Ejemplo n.º 1
0
function elggadmin_render_output($controller)
{
    $before_render = $controller[0] . '_before';
    run2($before_render, $controller);
    //before render
    templates_page_setup();
    //print_object($controller);
    //run func, must return page object
    $result = run2($controller[0], $controller[1]);
    //take only the output of controller
    $page = $result[$controller[0]];
    if (!isset($page->title) || !isset($page->body)) {
        trigger_error(__FUNCTION__ . ": returned page title or body not defined", E_USER_WARNING);
    }
    templates_page_output($page->title, $page->body);
}
Ejemplo n.º 2
0
<?php

require_once dirname(dirname(__FILE__)) . "/includes.php";
run("weblogs:init");
run("profile:init");
run("rss:init");
define('context', 'resources');
global $page_owner;
templates_page_setup();
$title = run("profile:display:name") . " :: " . gettext("Feeds");
run("rss:update:all", $page_owner);
$body = run("rss:view", $page_owner);
$body = templates_draw(array('context' => 'contentholder', 'title' => $title, 'body' => $body));
echo templates_page_draw(array($title, $body));
Ejemplo n.º 3
0
/**
* Build presentation data
**/
function returnHTML($purpose, $format, $results, $resultcount, $page, $username)
{
    $url = url;
    // PURPOSE
    if ($purpose == 'activity') {
        $pagetitle = 'Recent Activity';
    } elseif ($purpose == 'subscribe') {
        $pagetitle = 'Recent Changes';
    } else {
        error('Invalid purpose ' . $purpose . ' passed to feeds.php');
        die;
    }
    switch ($format) {
        case 'html':
            $body = folio_control_htmlfeed($results, $resultcount, $page, $username);
            // Transfer into template & write.
            templates_page_setup();
            if (isloggedin()) {
                $rsskey = folio_createhash($_SESSION['userid'] . '/');
            } else {
                $rsskey = '';
            }
            $types = str_replace(' ', '+', required_param('types'));
            $body = templates_draw(array('context' => 'contentholder', 'title' => "<a href='{$url}{$username}/{$purpose}/rss/{$types}/{$rsskey}'><img border=0 src='{$url}_templates/icons/rss.png' /></a> {$username} :: {$pagetitle} ", 'body' => $body));
            return templates_page_draw(array($pagetitle, $body));
            break;
        case 'rss':
            $body = folio_control_rssfeed($results, $resultcount, $username);
            header("Pragma: public");
            header("Cache-Control: public");
            header('Expires: ' . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
            $etag = md5($body);
            header('ETag: "' . $etag . '"');
            header("Content-Length: " . strlen($body));
            header("Content-type: text/xml; charset=utf-8");
            return $body;
            break;
        default:
            error('Invalid format passed to feeds.php');
            break;
    }
}
Ejemplo n.º 4
0
function templates_page_draw($param)
{
    // Draws the page, given a title and a main body (parameters[0] and [1]).
    $title = $param[0];
    $mainbody = $param[1];
    $run_result = '';
    global $messages;
    ////
    //// Prepare things for the module run
    //// populating $PAGE as required
    ////
    if (empty($PAGE->setupdone)) {
        templates_page_setup();
    }
    $messageshell = "";
    if (isset($messages) && sizeof($messages) > 0) {
        foreach ($messages as $message) {
            $messageshell .= templates_draw(array('context' => 'messages', 'message' => $message));
        }
        $messageshell = templates_draw(array('context' => 'messageshell', 'messages' => $messageshell));
    }
    // If $parameter[2] is set, we'll substitute it for the
    // sidebar
    if (isset($param[2])) {
        $sidebarhtml = $param[2];
    } else {
        $sidebarhtml = run("display:sidebar");
    }
    $run_result .= templates_draw(array('context' => 'pageshell', 'title' => htmlspecialchars($title, ENT_COMPAT, 'utf-8'), 'menu' => displaymenu(), 'submenu' => displaymenu_sub(), 'top' => displaymenu_top(), 'sidebar' => $sidebarhtml, 'mainbody' => $mainbody, 'messageshell' => $messageshell));
    return $run_result;
}