function baseEditPage(&$session, $mode, $message = null, $message2 = null, $type = M_Undef, $name = null) { if ($mode == C_New) { $pageid = 0; $textid = 0; $pagename = $name == null ? "" : $name; $content = $name != null && strpos($pagename, 'ategorie') == 1 ? "<?plugin BackLinks?>\n----\nKategorieKategorie" : ""; $changedby = $session->fUserName; $changedat = ""; $mimetype = $type; $textidpred = 0; } elseif ($mode == C_Change) { $pagename = $session->fPageURL; list($pageid, $texttype) = dbGetRecordByClause($session, T_Page, 'id,type', 'name=' . dbSqlString($session, $pagename)); $mimetype = textTypeToMime($texttype); $textidpred = dbGetLastText($session, $pageid); list($content, $changedat, $changedby) = dbGetRecordById($session, T_Text, $textidpred, 'text,createdat,createdby'); $textid = null; } else { $pagename = $_POST['edit_pagename']; $pageid = $_POST['edit_pageid']; $textid = $_POST['edit_textid']; $content = textAreaToWiki($session, $_POST['edit_content']); $changedby = $_POST['edit_changedby']; $changedat = $_POST['edit_changedat']; $mimetype = $_POST['edit_mimetype']; $textidpred = $_POST['edit_textidpred']; } $session->setPageData(empty($pagename) ? 'Neue Seite' : $pagename, $changedat, $changedby); if ($pageid <= 0) { $mode = C_New; } if ($mode == C_New) { $header = empty($pagename) ? 'Neue Seite' : $pagename . ' (Neu)'; } else { $header = $pagename . ' (in Bearbeitung)'; } if ($mimetype == M_Wiki) { guiStandardHeader($session, $header, Th_EditHeaderWiki, Th_EditStartWiki); } else { guiStandardHeader($session, $header, Th_EditHeaderHTML, Th_EditStartHTML); } if (isset($_POST['edit_preview']) || isset($_POST['edit_previewandsave'])) { echo guiParam($session, Th_PreviewStart, '<h1>Vorschau von ' . $session->fPageURL . '</h1><p>Warnung: Der Text ist noch nicht gesichert!</p>'); guiFormatPage($session, $mimetype, $content); echo guiParam($session, Th_PreviewEnd, '<h1>Ende der Vorschau</h1>'); } echo '<form enctype="multipart/form-data" action="' . $session->fScriptURL . '" method="post">' . "\n"; outDivision($session); outHiddenField($session, 'edit_pageid', $pageid); outHiddenField($session, 'edit_textid', $textid); outHiddenField($session, 'edit_textidpred', $textidpred); outHiddenField($session, 'edit_changedat', $changedat); outHiddenField($session, 'edit_changedby', $changedby); outDivisionEnd($session); if (!empty($message)) { outParagraph($session); outStrong(htmlentities($message)); outParagraphEnd($session); } if (!empty($message2)) { outParagraph($session); outStrong(htmlentities($message2)); outParagraphEnd($session); } outDivision($session); if ($mode != C_New) { outHiddenField($session, 'edit_pagename', $pagename); } outTable(); outTableRecordAndDelim(); outTable(); if ($mode == C_New) { outTableRecord(); outTableTextField($session, 'Name:', 'edit_pagename', $pagename, 43, 64); outTableRecordEnd(); } outTableRecord(); if ($mode == C_New && $type == M_Undef) { outTableComboBox($session, 'Typ', 'edit_mimetype', array(M_Wiki, M_HTML), null, 0); } else { outTableDelim(); echo 'Typ:'; echo htmlentities($mimetype); outHiddenField($session, 'edit_mimetype', $mimetype); outTableDelimEnd(); } if ($mode == C_New) { $templates = dbColumnList($session, T_Page, 'name', 'name like ' . dbSqlString($session, 'Vorlage%')); if (count($templates) > 0) { outTableAndRecord(); outTableCell('Seitenvorlage:'); outTableDelim(); outComboBox($session, 'edit_template', $templates, null); echo ' '; outButton($session, 'edit_appendtemplate', 'Vorlage einkopieren'); outTableDelimAndRecordEnd(); } } outTableEnd(); outTableDelimAndRecordEnd(); outTableRecordAndDelim(); getTextareaSize($session, $width, $height); outTextArea($session, 'edit_content', $content, $width, $height); outTableDelimAndRecordEnd(); outTableRecordAndDelim(); outTable(0, '100%'); outTableRecord(); outTableButton($session, null, 'edit_save', 'Speichern (fertig)'); outTableDelim(AL_Justify); outButton($session, 'edit_previewandsave', 'Zwischenspeichern'); echo ' '; outButton($session, 'edit_preview', ' Vorschau'); outTableCellDelim(); outButton($session, 'edit_cancel', ' Verwerfen'); if (!$session->testFeature(FEATURE_UPLOAD_ALLOWED)) { echo ' Breite: '; outTextField($session, U_TextAreaWidth, null, 3, 3); echo ' Höhe: '; } else { outTableDelimEnd(); outTableTextField($session, 'Breite:', 'textarea_width', null, 3, 3); outTableRecordEnd(); outTableRecord(); outTableCell('Bild einfügen:'); outHiddenField($session, 'MAX_FILE_SIZE', MAX_UPLOAD_FILESIZE); outTableDelim(AL_Justify); outFileField($session, TEXTFIELD_UPLOAD); outTableDelimEnd(); outTableButton($session, null, 'edit_upload', 'Hochladen'); outTableCell('Höhe:'); outTableDelim(); } outTextField($session, U_TextAreaHeight, null, 3, 3); outTableAndRecordEnd(); outTableDelimEnd(); outTableAndRecordEnd(); outDivisionEnd($session); guiFinishForm($session, $session); outNewline(); guiStandardBodyEnd($session, $mimetype == M_Wiki ? Th_EditEndWiki : Th_EditEndHTML); }
function guiLogin(&$session, $message) { guiStandardHeader($session, "Anmeldung für den InfoBasar", Th_LoginHeader, Th_LoginBodyStart); guiStartForm($session); if (!empty($message)) { $message = preg_replace('/^\\+/', '+++ Fehler: ', $message); guiParagraph($session, $message, false); } outDivision($session); if (!isset($_POST['login_user'])) { $_POST['login_user'] = $session->fUserName; $_POST['login_email'] = ''; } outTableAndRecord(); outTableTextField($session, 'Benutzername:', 'login_user', null, 32, 32); outTableRecordDelim(); outTablePasswordField($session, 'Passwort:', 'login_code', '', 32, 32); outTableRecordDelim(); outTableButton($session, ' ', 'but_login', 'Anmelden'); outTableAndRecordEnd(); guiLine($session, 2); guiParagraph($session, 'Passwort vergessen?', false); outTableAndRecord(); outTableTextField($session, 'EMail-Adresse:', 'login_email', null, 32, 0); outTableRecordDelim(); outTableButton($session, ' ', 'but_forget', 'Passwort ändern'); outTableAndRecordEnd(); echo '(Das neue Passwort wird dann zugeschickt.)'; outNewline(); outStrong('Achtung:'); echo 'Benutzername muss ausgefüllt sein!'; outDivisionEnd($session); guiFinishForm($session, $session); guiStandardBodyEnd($session, Th_LoginBodyEnd); return 1; }
function admOptions(&$session, $message) { $session->trace(TC_Gui1, 'admOptions'); admStandardHeader($session, 'Allgemeine Einstellungen'); if (!empty($message)) { guiParagraph($session, $message, false); } guiHeadline($session, 2, 'Texte:'); if (empty($_POST['opt_basarname'])) { $_POST['opt_basarname'] = $session->getMacro(TM_BasarName); } if (empty($_POST['opt_webmaster'])) { $_POST['opt_webmaster'] = $session->getMacro(TM_Webmaster); } if (empty($_POST['opt_css'])) { $_POST['opt_css'] = dbGetText($session, Th_CSSFile); } guiStartForm($session); outDivision($session); outTableAndRecord(); outTableTextField($session, 'Basarname:', 'opt_basarname', null, 32, 128); outTableRecordDelim(); outTableTextField($session, 'Webmaster:', 'opt_webmaster', null, 32, 128); outTableRecordDelim(); outTableButton($session, ' ', 'opt_save', 'Ändern'); outTableAndRecordEnd(); outDivisionEnd($session); guiFinishForm($session); guiHeadline($session, 2, 'Dateien:'); guiUploadFile($session, 'Logo:', 'opt_upload', 50000); $dir_name = $session->fullPath('pic') . PATH_DELIM; admShowDir($session, $dir_name, null, '/logo/'); admFinishBody($session); }