function admOptions(&$session, $message) { global $opt_basarname, $opt_save, $upload_go, $upload_file; $session->trace(TC_Gui1, 'admOptions'); guiHeader($session, 'Einstellungen'); guiHeadline($session, 1, 'Allgemeine Einstellungen'); if (isset($upload_go)) { $message = guiUploadFileAnswer($session, PATH_DELIM . 'pic' . PATH_DELIM, 'logo.png'); } if (!empty($message)) { guiParagraph($session, $message, false); } guiHeadline($session, 2, 'Texte:'); if (empty($opt_basarname)) { $opt_basarname = $session->fMacroBasarName; } if (empty($opt_css)) { $opt_css = dbGetText($session, Th_CSSFile); } guiStartForm($session, 'Form', P_Options); echo '<table border="0">'; echo '<tr><td>Basarname:</td><td>'; guiTextField('opt_basarname', $opt_basarname, 32, 128); echo '</td></tr>' . "\n"; echo '<tr><td></td><td>'; guiButton('opt_save', 'Ändern'); echo '</td></tr></table>' . "\n"; guiFinishForm($session); guiHeadline($session, 2, 'Dateien:'); guiUploadFile($session, 'Logo:', P_Options); guiFinishBody($session, null); }
function admOptionsAnswer(&$session) { $session->trace(TC_Gui1, 'admOptionsAnswer'); $message = null; if (isset($_POST['opt_save'])) { if ($_POST['opt_basarname'] == $session->getMacro(TM_BasarName)) { $message = 'Basarname wurde nicht gespeichert, da gleich.' . tagNewline(); } else { $id = dbSingleValue($session, 'select id from ' . dbTable($session, T_Macro) . ' where theme=' . Theme_All . ' and name=' . dbSqlString($session, TM_BasarName)); dbUpdateRaw($session, T_Macro, $id, 'value=' . dbSqlString($session, $_POST['opt_basarname'])); $message = 'Basarname wurde geändert.' . tagNewline(); } if ($_POST['opt_webmaster'] == $session->getMacro(TM_Webmaster)) { $message .= 'Webmaster wurde nicht gespeichert, da gleich.' . tagNewline(); } else { $id = dbSingleValue($session, 'select id from ' . dbTable($session, T_Macro) . ' where theme=' . Theme_All . ' and name=' . dbSqlString($session, TM_Webmaster)); dbUpdateRaw($session, T_Macro, $id, 'value=' . dbSqlString($session, $_POST['opt_webmaster'])); $message .= 'Webmaster wurde geändert.' . tagNewline(); } } elseif (isset($_POST['opt_upload'])) { $message = guiUploadFileAnswer($session, 'opt_upload', PATH_DELIM . 'pic' . PATH_DELIM, 'logo.png'); } admOptions($session, $message); }