function admRename(&$session, $message) { global $rename_oldname, $rename_newname, $rename_backlinks; $session->trace(TC_Gui1, 'admRename'); guiHeader($session, 'Umbenennen einer Seite'); guiHeadline($session, 1, 'Umbenennen einer Seite'); if (!empty($message)) { guiParagraph($session, $message, false); } guiStartForm($session, 'Form', P_Rename); echo '<table border="0">'; echo '<tr><td>Bisheriger Name:</td><td>'; guiTextField('rename_oldname', $rename_oldname, 64, 64); echo '<tr><td>Neuer Name:</td><td>'; guiTextField('rename_newname', $rename_newname, 64, 64); echo '</td></tr>' . "\n"; echo '<tr><td></td><td>'; guiButton('rename_info', 'Info'); if (!empty($rename_oldname) && !empty($rename_newname)) { echo ' | '; } guiButton('rename_rename', 'Umbenennen'); echo '<br>'; guiCheckBox('rename_backlinks', 'Alle Verweise umbenennen', !isset($rename_backlinks) || $rename_backlinks == C_CHECKBOX_TRUE); echo '</td></tr></table>' . "\n"; guiFinishForm($session); if (!empty($rename_oldname) && dbPageId($session, $rename_oldname) > 0) { $row = dbFirstRecord($session, 'select page,text,createdby,createdat from ' . dbTable($session, T_Text) . ' where replacedby is null and text like ' . dbSqlString($session, "%{$rename_oldname}%")); if (!$row) { guiParagraph($session, '+++ keine Verweise gefunden', false); } else { echo '<table border="1"><tr><td>Seite:</td><td>Typ:</td>' . '<td>von</td><td>Letzte Änderung</td><td>Fundstelle</td></tr>'; while ($row) { $pagerecord = dbGetRecordById($session, T_Page, $row[0], 'name,type'); $text = findTextInLine($row[1], $rename_oldname, 10, true); if (!empty($text)) { echo "\n<tr><td>"; guiInternLink($session, encodeWikiName($session, $pagerecord[0]), $pagerecord[0], M_Base); echo '</td><td>'; echo $pagerecord[1]; echo '</td><td>'; echo $row[2]; echo '</td><td>'; echo htmlentities($row[3]); echo '</td><td>'; echo $text; echo "</td><tr>\n"; } $row = dbNextRecord($session); } echo "\n</table>\n"; } } guiFinishBody($session, null); }
function instStandardEnd(&$session) { guiLine($session, 2); echo '<p>'; guiButton('inst_last', 'zurück'); echo ' | '; guiButton('inst_next', 'weiter'); echo '</p>'; guiFinishForm($session); guiFinishBody($session); }
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 baseSearch(&$session, $message) { $session->trace(TC_Gui1, 'baseSearch'); if (!isset($_POST['search_bodytext']) && isset($_POST['search_titletext'])) { $_POST['search_bodytext'] = $_POST['search_titletext']; } getUserParam($session, U_MaxHits, $_POST['search_maxhits']); guiStandardHeader($session, 'Suchen auf den Wiki-Seiten', Th_SearchHeader, Th_SearchBodyStart); if (isset($_POST['search_title']) || isset($_POST['search_body'])) { baseSearchResults($session); } guiStartForm($session); outTableAndRecord(); outTableCell('Titel:'); outTableDelim(); outTextField($session, 'search_titletext', null, 32, 64); echo " "; outButton($session, 'search_title', "Suchen"); outTableDelimAndRecordEnd(); outTableRecord(); outTableCell('Beitrag:'); outTableDelim(); outTextField($session, 'search_bodytext', null, 32, 64); echo " "; outButton($session, 'search_body', 'Suchen'); outTableDelimAndRecordEnd(); outTableTextField($session, 'Maximale Trefferzahl:', 'search_maxhits', null, 10, 10); outTableAndRecordEnd(); guiFinishForm($session, $session); outParagraph($session); outStrong('Hinweis:'); outNewline(); echo 'Vorläufig nur ein Suchbegriff möglich.'; outNewline(); echo 'Joker (Wildcards) sind % (beliebig) und _ (1 Zeichen).'; outNewline(); outStrong('Bsp:'); outNewline(); outQuotation('a_t '); echo ' findet "Kin'; outStrong('ast'); echo '" und "'; outStrong('Amt'); echo 'sperson", aber nicht "h'; outStrong('a'); echo 's'; outStrong('st'); echo '"'; outNewline(); outQuotation('Hilfe%format'); echo ' findet '; outStrong('Hilfe'); echo 'Bei'; outStrong('Format'); echo 'ierung und "'; outStrong('Hilfe'); echo ' für ein Datei'; outStrong('format'); echo '".', outParagraphEnd($session); guiStandardBodyEnd($session, Th_SearchBodyEnd); }
function guiUploadFile(&$session, $prefix, $lastpage = null, $custom_field = null, $custom_value = null, $caption = 'Hochladen', $button = 'upload_go', $file = 'upload_file', $max_file_size = 100000) { echo '<form enctype="multipart/form-data" action="' . $session->fScriptURL . '" method="post">' . "\n"; guiHiddenField('last_pagename', $lastpage ? $lastpage : $last_pagename); if ($custom_field) { guiHiddenField($custom_field, $custom_value); } guiHiddenField('MAX_FILE_SIZE', $max_file_size); if (!empty($prefix)) { echo $prefix . ' '; } echo '<input name="' . $file . '" type="file">' . "\n"; echo ' '; guiButton($button, $caption); guiFinishForm($session); }
function basePosting(&$session, $message, $mode) { global $forum_id, $thread_id, $reference_id, $posting_id, $posting_subject, $posting_text, $posting_preview, $textarea_width, $textarea_height, $last_pagename; $session->trace(TC_Gui1, 'basePosting: ' . $mode); if (!isset($last_pagename)) { $last_pagename = $session->fPageName; } $headline = $mode == C_New ? empty($reference_id) ? 'Neues Thema' : 'Antworten' : (empty($reference_id) ? 'Thema ändern' : 'Antwort ändern'); guiStandardHeader($session, $headline, Th_AnswerHeader, Th_AnswerBodyStart); if (!empty($reference_id) && ($posting = dbGetRecordById($session, T_Posting, $reference_id, 'author,subject,text,forum'))) { guiHeadline($session, 1, 'Beitrag: ' . $posting[1]); guiParagraph($session, 'Autor: ' . $posting[0], true); wikiToHTML($session, $posting[2]); guiLine(2); if ($mode == C_New) { $pos = strpos($posting[1], 'Re: '); $posting_subject = (is_int($pos) ? '' : 'Re: ') . $posting[1]; } $forum_id = $posting[3]; } else { str_replace($posting_text, "\\'", "'"); } if (isset($posting_preview)) { guiHeadline($session, 1, 'Vorschau'); wikiToHtml($session, $posting_text); guiLine(2); } guiHeadline($session, 1, $headline); if (!empty($message)) { guiParagraph($session, $message, true); } if ($mode == C_Change && !isset($posting_text)) { $posting = dbGetRecordById($session, T_Posting, $posting_id, 'subject,text,forum'); $forum_id = $posting[2]; $posting_text = $posting[1]; $posting_subject = $posting[0]; } getUserParam($session, U_TextAreaWidth, $textarea_width); getUserParam($session, U_TextAreaHeight, $textarea_height); guiStartForm($session, 'thread'); guiHiddenField('std_answer', 'j'); guiHiddenField('last_pagename', $last_pagename); guiHiddenField('forum_id', $forum_id); guiHiddenField('thread_id', $thread_id); guiHiddenField('posting_id', $posting_id); guiHiddenField('reference_id', $reference_id); echo "<table border=\"0\">\n<tr><td>Thema:</td><td>"; guiTextField('posting_subject', $posting_subject, $textarea_width, 64); echo "</td></tr>\n<tr><td>Text</td><td>"; guiTextArea('posting_text', $posting_text, $textarea_width, $textarea_height); echo '</td></tr><tr><td></td><td style="text-align: right;">Eingabefeld: Breite: '; guiTextField('textarea_width', $textarea_width, 3, 3); echo " Höhe: "; guiTextField('textarea_height', $textarea_height, 3, 3); echo "</td></tr>\n<tr><td></td><td>"; guiButton('posting_preview', 'Vorschau'); echo ' | '; if ($mode == C_New) { guiButton('posting_insert', 'Eintragen'); } else { guiButton('posting_change', 'Ändern'); } echo "</td></tr>\n</table>\n"; guiFinishForm($session, $session); guiStandardBodyEnd($session, Th_AnswerBodyEnd); }
echo '</td><td>'; switch ($db_status) { case NO_SERVER: guiButton('db_retry', 'Erneut anmelden'); break; case NO_DB: guiButton('db_createdb', 'Datenbank erzeugen'); break; case DB_EXISTS: guiButton('db_populate', 'Startwerte eintragen'); break; default: break; } echo "</td></tr></table>\n"; guiFinishForm($session); } echo guiFinishBody($session, null); function checkDB(&$session) { global $db_server, $db_user, $db_passw, $db_name; $result = NO_SERVER; if (!($dbc = mySql_pconnect($db_server, $db_user, $db_passw))) { echo "<p>Kann mich mit mySQL-Server nicht verbinden. Stimmen User/Passw?</p>"; echo '<p>MySql meldet: ' . htmlentities(mySql_error()) . "</p>\n"; } elseif (!mySql_select_db($db_name, $dbc)) { $session->setDbConnectionInfo($dbc, $dbc); echo "<p>DB {$db_name} nicht gefunden<br/>\n"; echo 'MySql meldet: ' . htmlentities(mySql_error()) . "</p>\n"; $result = NO_DB; } else {
function addressShowCards(&$session, $message = null) { $session->trace(TC_Gui1, 'addressShowBook:'); guiStandardHeader($session, 'Anzeigen von Adressen', Th_AddressHeader, Th_AddressBodyStart); if ($message != null) { guiParagraph($session, $message, false); } guiStartForm($session); guiHeadline($session, 2, 'Suchkriterien:'); $books = dbColumnList($session, Tab_Book, 'name', '1'); if (!isset($_POST['show_book'])) { $_POST['show_book'] = $books[0]; } echo 'Adressbuch: '; guiComboBox('show_book', $books, null, null); $fields = array('Name', 'Vorname', 'Spitzname', 'EMail', 'PLZ', 'Ort', 'Funktion', 'Notiz'); echo ' Auswahlkriterium: '; guiComboBox('show_choice', $fields, null, null); echo ' Suchmuster: '; outTextField($session, 'show_pattern', null, 16); echo ' '; outButton($session, 'show_search', 'Suchen'); guiHeadline($session, 2, 'Ausgabefelder:'); outCheckBox($session, 'show_withname', 'Name'); echo ' '; outCheckBox($session, 'show_withprivate', 'Privat'); echo ' '; outCheckBox($session, 'show_withoffice', 'Geschäftlich'); echo ' '; outCheckBox($session, 'show_withphone', 'Telefon'); echo ' '; outCheckBox($session, 'show_withemail', 'EMail'); echo ' '; outCheckBox($session, 'show_withaddress', 'Postadresse'); echo ' '; outCheckBox($session, 'show_withfunction', 'Funktion'); echo ' '; outCheckBox($session, 'show_withnote', 'Notiz'); echo ' '; outCheckBox($session, 'show_withdate', 'Datum'); guiFinishForm($session, $session); if (isset($_POST['show_pattern'])) { $pattern = $_POST['show_pattern']; if (empty($pattern)) { $condidtion = '1'; } else { $pattern = '%' . $pattern . '%'; switch ($_POST['show_choice']) { case 'Name': $condition = 'lastname like ' . dbSqlString($session, $pattern); break; case 'Vorname': $condition = 'firstname like ' . dbSqlString($session, $pattern); break; case 'Spitzname': $condition = 'nickname like ' . dbSqlString($session, $pattern); break; case 'EMail': $condition = 'emailprivate like ' . dbSqlString($session, $pattern) . ' or emailprivate2 like ' . dbSqlString($session, $pattern) . ' or emailoffice like ' . dbSqlString($session, $pattern) . ' or emailoffice2 like ' . dbSqlString($session, $pattern); break; case 'PLZ': $condition = 'zip like ' . dbSqlString($session, $pattern); break; case 'Ort': $condition = 'city like ' . dbSqlString($session, $pattern); break; case 'Funktion': $condition = 'function like ' . dbSqlString($session, $pattern); break; case 'Notiz': $condition = 'note like ' . dbSqlString($session, $pattern); break; default: $condition = '1'; break; } $what = 'lastname,firstname,country,zip,city,street,' . 'emailprivate,emailprivate2,phoneprivate,phoneprivate2,mobileprivate,faxprivate,' . 'emailoffice,emailoffice2,phoneoffice,phoneoffice2,mobileoffice,faxoffice,' . 'functions,notes,nickname,id,changedat,createdat'; addressPrintTable($session, "select {$what} from " . dbTable($session, Tab_Card) . " where {$condition}", 30); } } guiStandardBodyEnd($session, Th_AddressBodyEnd); }
function instFinish(&$session, $message = null) { global $inst_populate; $session->trace(TC_Init, 'instFinish'); guiHeader($session, 'Schritt 3'); guiHeadline($session, 2, 'Installation beenden'); guiParagraph($session, empty($message) ? $message : 'Der InfoBasar ist jetzt installiert.', false); guiStartForm($session, 'Form'); guiHiddenField('inst_step', 3); echo 'Passwort für den Benutzer admin: '; guiTextField('inst_passw', '', 32, 0); guiCheckbox('inst_setpassw', 'Passwort setzen', true); echo '<br />'; guiCheckbox('inst_delete', 'Installationsdateien entfernen', true); guiLine($session, 2); guiButton('inst_last', 'zurück'); echo ' | '; guiButton('inst_next', 'weiter'); guiFinishForm($session); guiFinishBody($session); }
function admShowDir(&$session, $path, $headline = null, $pattern = null, $button_text = null, $button_prefix = null, $file_prefix = null, $with_form = true) { $session->trace(TC_Init, 'admShowDir'); $dir = opendir($path); if ($headline != '') { guiHeadline($session, 2, $headline == null ? "Verzeichnis {$path} auf dem Server" : $headline); } if ($button_text != null && $with_form) { guiStartForm($session); } outTableAndRecord(1); outTableCellStrong('Name'); outTableCellStrong('Größe'); outTableCellStrong('Geändert am'); if ($button_text != null) { outTableCellStrong('Aktion'); } outTableRecordEnd(); $no = 0; while ($file = readdir($dir)) { if ($file != '.' && $file != '..' && ($pattern == null || preg_match($pattern, $file))) { $name = $path . $file; outTableRecord(); outTableCell(htmlentities($file)); outTableCell(is_dir($name) ? 'Verzeichnis' : filesize($name), AL_Right); outTableCell(date("Y.m.d H:i:s", filemtime($name))); if ($button_text != null) { $no++; outTableDelim(); outHiddenField($session, $file_prefix . $no, $path . $file); outButton($session, $button_prefix . $no, $button_text); outTableDelimEnd(); } outTableRecordEnd(); } } outTableEnd(); closedir($dir); if ($button_text != null && $with_form) { guiFinishForm($session); } }
function admBackup(&$session, $with_header, $message) { global $backup_table, $backup_compressed, $backup_save; $session->trace(TC_Gui1, 'admBackup'); if ($with_header) { guiHeader($session, 'Datenbank-Backup'); } if (!empty($message)) { guiParagraph($session, $message, false); } guiHeadLine($session, 1, 'Backup'); guiStartForm($session, "backup"); // guiHiddenField ('forum_id', $forum_id); echo "<table border=\"0\">\n<tr>"; echo "<td>Tabelle:</td><td>"; guiTextField('backup_table', $backup_table, 64, 64); echo "</td></tr>\n<tr><td></td></td>"; guiCheckBox('backup_compressed', 'komprimiert', $backup_compressed); echo "</td></tr>\n<tr><td>"; guiButton('backup_save', 'Sichern'); echo "</td></tr>"; echo "\n</table>\n"; guiFinishForm($session); guiFinishBody($session, null); }
function baseSearch(&$session, $message) { global $search_titletext, $search_maxhits, $search_bodytext, $last_pagename, $search_title, $search_body; $session->trace(TC_Gui1, 'baseSearch'); if (!isset($last_pagename)) { $last_pagename = $session->fPageName; } getUserParam($session, U_MaxHits, $search_maxhits); guiStandardHeader($session, 'Suchen auf den Wiki-Seiten', Th_SearchHeader, Th_SearchBodyStart); if (isset($search_title) || isset($search_body)) { baseSearchResults($session); } guiParagraph($session, 'Hinweis: vorläufig nur ein Suchbegriff möglich', false); guiStartForm($session, 'search', P_Search); guiHiddenField('last_pagename', $last_pagename); echo "<table border=\"0\">\n<tr><td>Titel:</td><td>"; guiTextField('search_titletext', $search_titletext, 32, 64); echo " "; guiButton('search_title', "Suchen"); echo "</td></tr>\n<tr><td>Beitrag:</td><td>"; guiTextField('search_bodytext', $search_bodytext, 32, 64); echo " "; guiButton('search_body', "Suchen"); echo "</td></tr>\n<tr><td>Maximale Trefferzahl:</td><td>"; guiTextField("search_maxhits", $search_maxhits, 10, 10); echo "</td></tr>\n</table>\n"; guiFinishForm($session, $session); guiStandardBodyEnd($session, Th_SearchBodyEnd); }