welcomeGraphicFunctions printWelcomeHeader ($color, $title, $bgcolor="TBD", $width=590, $padding=0) Deprecata. Usare SKIN SKIN_printWelcomeHeader printWelcomeFooter () Deprecata. Usare SKIN SKIN_printWelcomeFooter printPostit ($title, $message, $width, $height, $color) Stampa il codice HTML di un postit Parametri: $title: stringa $message: stringa $width: intero (n° di pixel) $height: intero (n° di pixel) $color: {“green”,”red”,”yellow”,”blue”} initPaperConsole () Inizializza le variabili di sessione per la console di ricerca degli articoli printPaperConsole ($formName, $color, $status, $pendingPapers=0) Stampa il codice HTML della console di ricerca per gli articoli Parametri: $formName: stringa. Nome del form che verrà sottomesso $color: {“green”,”red”,”yellow”,”blue”} $status: intero (0No print quality, 1Print quality, 2camera ready) $pendingPapers:intero, 1 se si vuole avere il checkbox “Pending papers only” nella console dell’assegnazione dei revisori printFrameHeader ($title, $color, $width=590) Deprecata. Usare SKIN SKIN_printFrameHeader printFrameFooter ($title, $width) Deprecata. Usare SKIN SKIN_printFrameFooter accorcia ($s, $len=30) Tronca una stringa a $len caratteri. Se la stringa è troncata, vengono aggiunti tre puntini al fondo printTip ($title, $icons, $messages) Deprecata. Usare SKIN SKIN_printTip welcomeToday printWTStatistics () Stampa una pagina riassuntiva e statistica sugli articoli ricevuti Parametri: global $mydb, $savedrights, $saveduserid Sql composeSelectString ($fields) Compone una stringa di campi separati da virgola. I campi sono presi dal vettore passato come parametro. Es: v={a b c} return: “a,b,c” Parametri: $fields array, i campi che entrano nella stringa /** * Compose a string of comma-separated fields. Each field is selected from the array passed as parameter * * @author Giorgio Di Natale * @param array $fields List of fields used to compose the string * @return string List of fields * @access public * @see Database.php */ function composeInsertString($fieldNames, $CONTEXT) { $retval=array(); $Fields=""; $Values=""; $firstTime=1; $write=0; for ($i=0; $i<count($fieldNames);$i++) { if (isset($GLOBALS['saved'.$CONTEXT.$fieldNames[$i]])) { if (trim($GLOBALS['saved'.$CONTEXT.$fieldNames[$i]])!=NULL) { $Fields.=$fieldNames[$i].', '; $Values.="'".addslashes(trim($GLOBALS['saved'.$CONTEXT.$fieldNames[$i]]))."', "; } } } $retval[0]=$Fields; $retval[1]=$Values; for ($i=0;$i<2;$i++) { if ($retval[$i]{strlen($retval[$i])-2}==',') $retval[$i]{strlen($retval[$i])-2}=' '; } return $retval; } function composeGeneralInsertString($fieldNames, $fieldValues) { $retval=array(); $Fields=""; $Values=""; $firstTime=1; $write=0; foreach ($fieldNames as $fn) { if (isset($fieldValues[$fn])) { if (trim($fieldValues[$fn])!="") { $Fields.=$fn.', '; $Values.="'".addslashes(trim($fieldValues[$fn]))."', "; } } } $retval[0]=$Fields; $retval[1]=$Values; for ($i=0;$i<2;$i++) { if ($retval[$i]{strlen($retval[$i])-2}==',') $retval[$i]{strlen($retval[$i])-2}=' '; } return $retval; } /** * Compose a string of comma-separated fields. Each field is selected from the array passed as parameter * * @author Giorgio Di Natale * @param array $fields List of fields used to compose the string * @return string List of fields * @access public * @see Database.php */ function composeInsertStringFromRow($fieldNames, $row) { $retval=array(); $Fields=""; $Values=""; $firstTime=1; $write=0; for ($i=0; $i<count($fieldNames);$i++) { if (isset($row[$fieldNames[$i]])) { if ($row[$fieldNames[$i]]!=NULL) { $Fields.=$fieldNames[$i].', '; $Values.="'".$row[$fieldNames[$i]]."', "; } } } $retval[0]=$Fields; $retval[1]=$Values; for ($i=0;$i<2;$i++) { if ($retval[$i]{strlen($retval[$i])-2}==',') $retval[$i]{strlen($retval[$i])-2}=' '; } return $retval; } /** * Compose a string of field=value, ... list. Each field is selected from the array passed as parameter * * @author Giorgio Di Natale * @param array $fields List of fields used to compose the string * @return string List of fields * @access public * @see Database.php */ function composeUpdateString($fieldNames, $CONTEXT) { $Fields=""; for ($i=0; $i<count($fieldNames);$i++) { if (isset($GLOBALS['saved'.$CONTEXT.$fieldNames[$i]])) { if (trim($GLOBALS['saved'.$CONTEXT.$fieldNames[$i]])!=NULL) { if ($fieldNames[$i]!='Password' && $fieldNames[$i]!='Username') { $Fields.=$fieldNames[$i].'=\''.trim(addslashes($GLOBALS['saved'.$CONTEXT.$fieldName s[$i]])).'\', '; } } } } if ($Fields{strlen($Fields)-2}==',') { $Fields{strlen($Fields)-2}=' '; } return $Fields; } /** * LD=local database * ED=external database * @param array $fields Associazione tra nomi dell'XML e campi del DB: v[ED_fieldName]=>LD_fieldName * Esempio: v['USERID']='UserId'; * v['EMAIL']='Email'; * @param array $values Valori da inserire: $values[ED_Fieldname]=value * Es: v['FIRSTNAME']="Giorgio" * */ function ED_composeUpdateStringFromArray($fields, $values) { $finalString=""; foreach ($values as $ED_field => $LD_value) { if (strlen(trim($LD_value))>0) { $finalString.=$fields[$ED_field].'=\''.trim(addslashes($LD_value)).'\', '; } } if ($finalString{strlen($finalString)-2}==',') { $finalString{strlen($finalString)-2}=' '; } return $finalString; } /** * LD=local database * ED=external database * @param array $fields v[ED_fieldName]=>LD_fieldName Associazione tra nomi dell'XML e campi del DB: * Esempio: v['USERID']='UserId'; * v['EMAIL']='Email'; * @param array $values Valori da inserire: $values[ED_Fieldname]=value * Es: v['FIRSTNAME']="Giorgio" * */ function ED_composeInsertStringFromArray($fields, $values) { $insertFields=""; $insertValues=""; foreach ($values as $ED_field => $LD_value) { if (strlen(trim($LD_value))>0 && strlen(trim($fields[$ED_field]))>0) { $insertFields.=$fields[$ED_field].", "; $insertValues.="'".trim(addslashes($LD_value))."', "; } } if ($insertValues{strlen($insertValues)-2}==',') { $insertValues{strlen($insertValues)-2}=' '; } if ($insertFields{strlen($insertFields)-2}==',') { $insertFields{strlen($insertFields)-2}=' '; } return "(".$insertFields.") VALUES (".$insertValues.")"; } ?>