Example #1
0
/**
 * show a wiki page
 *
 * @author Andreas Gohr <*****@*****.**>
 */
function html_show($txt = null)
{
    global $ID;
    global $REV;
    global $HIGH;
    global $INFO;
    //disable section editing for old revisions or in preview
    if ($txt || $REV) {
        $secedit = false;
    } else {
        $secedit = true;
    }
    if (!is_null($txt)) {
        //PreviewHeader
        echo '<br id="scroll__here" />';
        echo p_locale_xhtml('preview');
        echo '<div class="preview">';
        $html = html_secedit(p_render('xhtml', p_get_instructions($txt), $info), $secedit);
        if ($INFO['prependTOC']) {
            $html = tpl_toc(true) . $html;
        }
        echo $html;
        echo '<div class="clearer"></div>';
        echo '</div>';
    } else {
        if ($REV) {
            print p_locale_xhtml('showrev');
        }
        $html = p_wiki_xhtml($ID, $REV, true);
        $html = html_secedit($html, $secedit);
        if ($INFO['prependTOC']) {
            $html = tpl_toc(true) . $html;
        }
        $html = html_hilight($html, $HIGH);
        echo $html;
    }
}
Example #2
0
/**
 * show a wiki page
 *
 * @author Andreas Gohr <*****@*****.**>
 */
function html_show($txt = '')
{
    global $ID;
    global $REV;
    global $HIGH;
    //disable section editing for old revisions or in preview
    if ($txt || $REV) {
        $secedit = false;
    } else {
        $secedit = true;
    }
    if ($txt) {
        //PreviewHeader
        print '<br id="scroll__here" />';
        print p_locale_xhtml('preview');
        print '<div class="preview">';
        print html_secedit(p_render('xhtml', p_get_instructions($txt), $info), $secedit);
        print '<div class="clearer"></div>';
        print '</div>';
    } else {
        if ($REV) {
            print p_locale_xhtml('showrev');
        }
        $html = p_wiki_xhtml($ID, $REV, true);
        $html = html_secedit($html, $secedit);
        print html_hilight($html, $HIGH);
    }
}
Example #3
0
/**
 * Show a wiki page
 *
 * @author Andreas Gohr <*****@*****.**>
 *
 * @param null|string $txt wiki text or null for showing $ID
 */
function html_show($txt = null)
{
    global $ID;
    global $REV;
    global $HIGH;
    global $INFO;
    global $DATE_AT;
    //disable section editing for old revisions or in preview
    if ($txt || $REV) {
        $secedit = false;
    } else {
        $secedit = true;
    }
    if (!is_null($txt)) {
        //PreviewHeader
        echo '<br id="scroll__here" />';
        echo p_locale_xhtml('preview');
        echo '<div class="preview"><div class="pad">';
        $html = html_secedit(p_render('xhtml', p_get_instructions($txt), $info), $secedit);
        if ($INFO['prependTOC']) {
            $html = tpl_toc(true) . $html;
        }
        echo $html;
        echo '<div class="clearer"></div>';
        echo '</div></div>';
    } else {
        if ($REV || $DATE_AT) {
            $data = array('rev' => &$REV, 'date_at' => &$DATE_AT);
            trigger_event('HTML_SHOWREV_OUTPUT', $data, 'html_showrev');
        }
        $html = p_wiki_xhtml($ID, $REV, true, $DATE_AT);
        $html = html_secedit($html, $secedit);
        if ($INFO['prependTOC']) {
            $html = tpl_toc(true) . $html;
        }
        $html = html_hilight($html, $HIGH);
        echo $html;
    }
}
Example #4
0
 /**
  * Print the whole entry, reformat it or cut it when needed
  *
  * @param bool   $included   - set true if you want content to be reformated
  * @param string $readmore   - where to cut the entry valid: 'syntax', FIXME
  * @param bool   $inc_level  - FIXME
  * @param bool   $skipheader - Remove the first header
  * @return bool false if a recursion was detected and the entry could not be printed, true otherwise
  */
 function tpl_entry($included = true, $readmore = 'syntax', $inc_level = true, $skipheader = false)
 {
     $content = $this->get_entrycontent($readmore, $inc_level, $skipheader);
     if ($included) {
         $content = $this->_convert_footnotes($content);
         $content .= $this->_edit_button();
     } else {
         $content = tpl_toc(true) . $content;
     }
     echo html_secedit($content, !$included);
     return true;
 }