Exemplo n.º 1
0
function guiFormatPage(&$session, $mime, $content)
{
    $session->trace(TC_Gui2, 'guiFormatPage');
    switch ($mime) {
        case TT_Wiki:
        case M_Wiki:
            wikiToHtml($session, $content);
            break;
        case TT_HTML:
        case M_HTML:
            echo $content;
            break;
        case TT_Text:
        case M_Text:
            echo TAG_PRE;
            textToHtml($session, $content);
            echo TAG_PRE_END;
        default:
            wikiToHtml($session, $content);
            break;
    }
}
Exemplo n.º 2
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);
}
Exemplo n.º 3
0
function baseTestAll(&$session)
{
    guiStandardHeader($session, 'Test', Th_StandardHeader, Th_StandardBodyStart);
    echo wikiToHtml($session, "!!! 3-erÜberschrift\n" . "!! 2-erÜberschrift\n" . "! 1-erÜberschrift\n" . "Normaler Text\n" . "Dies ist ein !WikiWort (WikiWort)\n" . "[\"WikiWort\" wikiwort mal anderst]\n" . "http://www.heise.de Heise\n" . "[http://www.heise.de Heise]\n" . "\n" . "''kursiv'' '''fett''' ''''kursiv und fett'''' normal __unterstrichen__\n" . "'''fett'''\n" . "<?plugin BackLinks?>\n" . "* Punkt1\n* Punkt2\n## Punkt 21\n## Punkt 22\n" . "# Punkt1\n# Punkt2\n** Punkt 21\n** Punkt 22\n\n" . "|1|2|3\n|1|2|3\n" . "\n");
    guiStandardBodyEnd($session, Th_StandardBodyEnd);
}
Exemplo n.º 4
0
function admTest(&$session)
{
    $wiki = "" . "[StartSeite] und [StartSeite Fängt so an!]\n\n" . "''fett''[Newline]und '''Zitat''' [small]klein[/small] und [_]_ kein Unterstrich!\n\n" . "[http:pic/logo.png Logo] und [http:pic/logo.png] und [ftp://abc/def.de Meine Adresse]!\n\n";
    admStandardHeader($session, 'Test');
    guiHeadline($session, 1, 'Orginal als Quelltext');
    echo TAG_PRE;
    echo htmlentities($wiki);
    echo TAG_PRE_END;
    $wiki = wiki06To07($wiki);
    guiHeadline($session, 1, 'Konvertiert als Quelltext');
    echo TAG_PRE;
    echo htmlentities($wiki);
    echo TAG_PRE_END;
    guiHeadline($session, 1, 'Als Wiki');
    echo wikiToHtml($session, $wiki);
    admFinishBody($session);
}