Beispiel #1
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);
}
Beispiel #2
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);
}
Beispiel #3
0
function baseAlterPage(&$session, $mode, $message, $message2, $type = M_Undef)
{
    global $alterpage_name, $alterpage_content, $textarea_width, $textarea_height, $alterpage_content, $alterpage_mime, $alterpage_lastmode, $alterpage_preview;
    $session->trace(TC_Gui1, 'baseAlterPage');
    if ($type != M_Undef) {
        $alterpage_mime = $type;
    }
    if ($alterpage_mime == M_Wiki) {
        guiStandardHeader($session, $mode != C_Change ? 'Neue Seite eintragen' : 'Seite ändern', Th_EditHeaderWiki, Th_EditStartWiki);
    } else {
        guiStandardHeader($session, $mode != C_Change ? 'Neue Seite eintragen' : 'Seite ändern', Th_EditHeaderHTML, Th_EditStartHTML);
    }
    getUserParam($session, U_TextAreaWidth, $textarea_width);
    getUserParam($session, U_TextAreaHeight, $textarea_height);
    if (!empty($message)) {
        guiParagraph($session, $message, true);
    }
    if (!empty($message2)) {
        guiParagraph($session, $message2, true);
    }
    if (isset($alterpage_preview)) {
        guiHeadline($session, 1, 'Vorschau');
        guiFormatPage($session, $alterpage_mime, $alterpage_content);
        guiLine(1);
    }
    guiStartForm($session, 'alterpage');
    guiHiddenField('alterpage_lastmode', $mode);
    echo "<table border=\"0\">\n<tr><td>Name:</td><td>";
    guiTextField('alterpage_name', $alterpage_name, 64, 64);
    if ($mode == C_Change) {
        guiButton('alterpage_changepage', 'Seite laden');
    }
    if ($type == M_Wiki) {
    }
    echo "</td></tr>\n<tr><td>Typ:</td><td>";
    if ($mode == C_New && $type == M_Undef) {
        guiComboBox('alterpage_mime', array(M_Wiki, M_HTML), null);
    } else {
        echo $alterpage_mime;
        guiHiddenField($session, 'alterpage_mime', $alterpage_mime);
    }
    echo "</td></tr>\n<tr><td>Inhalt:</td><td>";
    guiTextArea("alterpage_content", $alterpage_content, $textarea_width, $textarea_height);
    echo "</td></tr>\n<tr><td></td><td>";
    if ($mode != C_Change) {
        guiButton('alterpage_insert', 'Eintragen');
    } else {
        guiButton('alterpage_changecontent', 'Ändern');
    }
    echo " ";
    guiButton('alterpage_preview', 'Vorschau');
    echo " ";
    guiButton('alterpage_cancel', 'Abbrechen');
    echo "<br /><br />Eingabefeld: Breite: ";
    guiTextField("alterpage_width", $textarea_width, 3, 3);
    echo " Höhe: ";
    guiTextField("alterpage_height", $textarea_height, 3, 3);
    echo "</td></tr>\n</table>\n";
    guiFinishForm($session, $session);
    guiStandardBodyEnd($session, Th_StandardBodyEnd);
}