Пример #1
0
function admParam(&$session, $message)
{
    global $param_id, $param_theme, $param_pos, $param_name, $param_text, $textarea_width, $text_area_height;
    $session->trace(TC_Gui1, 'admParam');
    if (empty($param_theme)) {
        $param_theme = Theme_Standard;
    }
    getUserParam($session, U_TextAreaWidth, $textarea_width);
    getUserParam($session, U_TextAreaHeight, $textarea_height);
    guiHeader($session, 'Parameter');
    echo '<table border="1"><tr><td><b>Id</b></td><td><b>Beschreibung</b></td>';
    echo '<td><b>Wert</b></td></tr>' . "\n";
    $row = dbFirstRecord($session, 'select pos,name,text from ' . dbTable($session, T_Param) . ' where theme=' . $param_theme);
    while ($row) {
        echo "<tr><td>{$row['0']}</td><td>";
        echo htmlentities($row[1]);
        echo '</td><td>';
        echo htmlentities($row[2]);
        echo "</td></tr>\n";
        $row = dbNextRecord($session);
    }
    echo '</table>' . "\n";
    if (!empty($message)) {
        guiParagraph($session, $message, false);
    }
    guiStartForm($session, "param", P_Param);
    echo "<table border=\"0\">\n<tr><td>Id:</td><td>";
    echo $param_id;
    guiHiddenField("param_id", $param_id);
    echo "</td></tr>\n<tr><td>Theme/Pos:</td><td>";
    guiTextField("param_theme", $param_theme, 4, 4);
    echo ' / ';
    guiTextField("param_pos", $param_pos, 4, 4);
    guiButton('param_load', 'Datensatz laden');
    echo "</td></tr>\n<tr><td>Name:</td><td>";
    guiTextField("param_name", $param_name, 64, 64);
    echo "</td></tr>\n<tr><td>Text:</td><td>";
    guiTextArea("param_text", $param_text, $textarea_width, $textarea_height);
    echo "</td></tr>\n<tr><td></td><td>";
    echo " ";
    guiButton('param_insert', 'Eintragen');
    echo " ";
    guiButton('param_change', 'Ändern');
    echo "<br /><br />Eingabefeld: Breite: ";
    guiTextField("textarea_width", $textarea_width, 3, 3);
    echo " Höhe: ";
    guiTextField("textarea_height", $textarea_height, 3, 3);
    echo "</td></tr>\n</table>\n";
    guiFinishForm($session);
    guiFinishBody($session, null);
}
Пример #2
0
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&auml;ufig nur ein Suchbegriff m&ouml;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&uuml;r ein Datei';
    outStrong('format');
    echo '".', outParagraphEnd($session);
    guiStandardBodyEnd($session, Th_SearchBodyEnd);
}
Пример #3
0
function getTextareaSize(&$session, &$width, &$height)
{
    if (!isset($_POST[U_TextAreaWidth]) || empty($_POST[U_TextAreaWidth])) {
        $_POST[U_TextAreaWidth] = getUserParam($session, U_TextAreaWidth, $width);
    }
    $width = $_POST[U_TextAreaWidth];
    if ($width <= 0) {
        $width = $_POST[U_TextAreaWidth] = 70;
    }
    if (!isset($_POST[U_TextAreaHeight]) || empty($_POST[U_TextAreaHeight])) {
        $_POST[U_TextAreaHeight] = getUserParam($session, U_TextAreaHeight, $height);
    }
    $height = $_POST[U_TextAreaHeight];
    if ($height <= 0) {
        $height = $_POST[U_TextAreaHeight] = 10;
    }
}
Пример #4
0
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&ouml;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', '&Auml;ndern');
    }
    echo "</td></tr>\n</table>\n";
    guiFinishForm($session, $session);
    guiStandardBodyEnd($session, Th_AnswerBodyEnd);
}
Пример #5
0
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&auml;ufig nur ein Suchbegriff m&ouml;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);
}