Exemple #1
0
function render_ui($ui_page, $title = null)
{
    $page =& get_current_page();
    $renderer =& get_renderer();
    $layout_page = load_layout_page($ui_page);
    if ($layout_page !== null) {
        if (empty($title)) {
            $title = $page->title;
        }
        if (empty($title)) {
            $title = $page->name;
        }
        $vars = new_global_wiki_variables();
        $vars->set('title', $title);
        $info_text = get_info_text();
        if (count($info_text) > 0) {
            $vars->set('info_text', implode(' ', $info_text));
        }
        $redirected_page =& get_redirected_page();
        if ($redirected_page !== null) {
            $vars->set('redir_page', $redirected_page->name);
        }
        $layout_page->render($vars);
    }
}
Exemple #2
0
 /**
  * render Wiki markup to output
  * raw text is split into blocks (separated by empty lines) and then rendered,
  * text between <pre> and </pre> (must begin lines) is not Wiki-processed (regardless of blocks)
  * @param page MW_Page (may be null)
  * @param raw raw text (empty message is output if raw text is empty)
  * @param vars (optional): MW_Variables to be used as global variables
  * @param curpage (optional): MW_Page (may be null)
  */
 function render($page, $raw, $vars = null, $curpage = null)
 {
     if ($vars === null) {
         $vars = new_global_wiki_variables();
     }
     $state = new MW_CoreRendererState($this, $page, $raw, $vars, $curpage);
     $state->render();
 }