/**
 * Outputs html page
 * @param string $title   The title of the page
 * @param string $body    The body of the content    
 * @param string $context Optional template context
 * @param string $sidebar Optional sidebar content 
 */
function templates_page_output($title, $body, $context = null, $sidebar = null)
{
    // hook pre-output page
    // @rho i think no needed because there is already
    //      _init and _pagesetup
    if (!isset($context)) {
        $context = 'contentholder';
    }
    if ($context !== false) {
        // allow title with html tags or specialchars
        $body = templates_draw(array('context' => $context, 'title' => $title, 'body' => $body));
    }
    // clean title for <title> tag
    $title = htmlspecialchars_decode(strip_tags($title), ENT_COMPAT);
    // print output!
    echo templates_page_draw(array($title, $body, $sidebar));
    // hook post-output
    action('end');
    // end execution
    exit;
}
Example #2
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;
    }
}
Example #3
0
<?php

//    ELGG manage community members page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("friends:init");
define("context", "network");
templates_page_setup();
// Whose friends are we looking at?
global $page_owner;
// You must be logged on to view this!
//    protect(1);
$title = run("profile:display:name") . " :: " . gettext("Members");
echo templates_page_draw(array($title, templates_draw(array('context' => 'contentholder', 'title' => $title, 'body' => run("communities:members", array($page_owner))))));
Example #4
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
templates_page_setup();
// Draw page
echo templates_page_draw(array(sprintf(gettext("About %s"), sitename), templates_draw(array('body' => run("content:about"), 'name' => sprintf(gettext("About %s"), sitename), 'context' => 'contentholder'))));
Example #5
0
<?php

//    ELGG manage friends and groups page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("friends:init");
define("context", "network");
// Whose friends are we looking at?
global $page_owner;
// You must be logged on to view this!
//    protect(1);
templates_page_setup();
$title = run("profile:display:name") . " :: " . gettext("Friends who have linked to you");
echo templates_page_draw(array($title, run("friends:of:editpage")));
Example #6
0
                $body .= <<<END
        <td width="100" align="center">
            <p>
            <a href="{$CFG->wwwroot}{$info->username}/weblog">
            <img src="{$CFG->wwwroot}{$info->username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />
            <span class="userdetails">
                {$friends_name}
            </span>
            </p>
        </td>
END;
                if ($i % 5 == 0) {
                    $body .= "</tr><tr>";
                }
                $i++;
                if ($i > 5) {
                    break;
                }
            }
        }
    }
    $body .= <<<END
    </tr>
    </table>
    </div>
END;
    $body .= sprintf(gettext("<a href=\"%s\">Find others</a> with similar interests and goals."), url . "search/tags.php") . "<br /><br />";
    $body .= "<p align=\"center\"><a href=\"_weblog/everyone.php\"><img src=\"_templates/default_images/view_blog.gif\" border=\"0\"></a></p>";
}
echo templates_page_draw(array(sitename, templates_draw(array('body' => $body, 'title' => gettext("Main Index"), 'context' => 'contentholder'))));
<?php

//    ELGG generate-a-new-password page
// Run includes
define("context", "login");
require_once dirname(dirname(__FILE__)) . "/includes.php";
run("profile:init");
run("invite:init");
templates_page_setup();
$title = gettext("Generate a New Password");
$body = run("invite:password:request");
$body = templates_draw(array('context' => 'contentholder', 'title' => $title, 'body' => $body));
echo templates_page_draw(array($title, $body, '&nbsp;'));
Example #8
0
<?php

//    ELGG main admin panel page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("admin:init");
define("context", "admin");
templates_page_setup();
// You must be logged on to view this!
echo templates_page_draw(array(gettext("Administration"), templates_draw(array('context' => 'contentholder', 'title' => gettext("Administration"), 'body' => run("admin:main")))));
Example #9
0
<?php

//    ELGG manage community memberships page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("friends:init");
define("context", "network");
templates_page_setup();
// Whose friends are we looking at?
global $page_owner;
// You must be logged on to view this!
//    protect(1);
$title = run("profile:display:name") . " :: " . gettext("Communities");
echo templates_page_draw(array($title, run("communities:editpage")));
Example #10
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
define("context", "weblog");
templates_page_setup();
// Draw page
echo templates_page_draw(array("Blog help", templates_draw(array('body' => run("help:blogs"), 'title' => gettext("'Your blog' help"), 'context' => 'contentholder'))));
Example #11
0
<?php

//	ELGG manage owned users page
global $CFG;
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("friends:init");
run("ownedusers:init");
define("context", "network");
templates_page_setup();
// Whose owned users are we looking at?
global $page_owner;
$profile_id = optional_param('profile_id');
// You must be logged on to view this!
protect(1);
$title = run("profile:display:name") . " :: " . gettext($CFG->owned_users_caption);
echo templates_page_draw(array($title, templates_draw(array('context' => 'contentholder', 'title' => $title, 'body' => run("ownedusers:move", array($page_owner, $profile_id))))));
Example #12
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
templates_page_setup();
// Draw page
echo templates_page_draw(array(sprintf(gettext("%s Privacy Policy"), sitename), templates_draw(array('body' => run("content:privacy"), 'name' => sprintf(gettext("%s Privacy Policy"), sitename), 'context' => 'contentholder'))));
Example #13
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
templates_page_setup();
// Draw page
echo templates_page_draw(array(sprintf(gettext("%s FAQ"), sitename), templates_draw(array('body' => run("content:faq"), 'name' => sprintf(gettext("%s FAQ"), sitename), 'context' => 'contentholder'))));
Example #14
0
<?php

//    ELGG manage friendship requests page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("friends:init");
define("context", "network");
templates_page_setup();
// Whose friends are we looking at?
global $page_owner;
// You must be logged on to view this!
//    protect(1);
$title = run("profile:display:name") . " :: " . gettext("Friendship requests");
echo templates_page_draw(array($title, run("friends:requests:view")));
Example #15
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
define("context", "files");
templates_page_setup();
// Draw page
echo templates_page_draw(array(sprintf(gettext("Help for %s"), sitename), templates_draw(array('body' => run("help:files"), 'title' => gettext("'Your Files' help"), 'context' => 'contentholder'))));
Example #16
0
<?php

//    ELGG content flagging admin panel page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("admin:init");
define("context", "admin");
templates_page_setup();
// You must be logged on to view this!
echo templates_page_draw(array(gettext("Content flags"), templates_draw(array('context' => 'contentholder', 'title' => gettext("Content flags"), 'body' => run("admin:contentflags")))));
Example #17
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
templates_page_setup();
// Draw page
echo templates_page_draw(array(sprintf(gettext("%s Usage Guidelines"), sitename), templates_draw(array('body' => run("content:guidelines"), 'name' => sprintf(gettext("%s Usage Guidelines"), sitename), 'context' => 'contentholder'))));
Example #18
0
<?php

//    ELGG manage groups page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("friends:init");
run("groups:init");
define("context", "network");
templates_page_setup();
// Whose friends are we looking at?
global $page_owner;
// You must be logged on to view this!
protect(1);
$title = run("profile:display:name") . " :: " . gettext("Access Controls");
echo templates_page_draw(array($title, templates_draw(array('context' => 'contentholder', 'title' => $title, 'body' => run("groups:editpage")))));
Example #19
0
<?php

//	ELGG manage owned users page
global $CFG;
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("friends:init");
run("ownedusers:init");
define("context", "network");
templates_page_setup();
// Whose owned users are we looking at?
global $page_owner;
// You must be logged on to view this!
//	protect(1);
$title = run("profile:display:name") . " :: " . gettext($CFG->owned_users_caption);
echo templates_page_draw(array($title, templates_draw(array('context' => 'contentholder', 'title' => $title, 'body' => run("ownedusers:owned", array($page_owner))))));
Example #20
0
<?php

//    ELGG manage community membership requests page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("friends:init");
run("communities:init");
define("context", "network");
templates_page_setup();
// Whose friends are we looking at?
global $page_owner;
// You must be logged on to view this!
//    protect(1);
$title = run("profile:display:name") . " :: " . gettext("Membership requests");
echo templates_page_draw(array($title, run("communities:requests:view")));
Example #21
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
templates_page_setup();
// Draw page
echo templates_page_draw(array(sprintf(gettext("%s Terms &amp; Conditions"), sitename), templates_draw(array('body' => run("content:terms"), 'name' => sprintf(gettext("%s Terms &amp; Conditions"), sitename), 'context' => 'contentholder'))));
Example #22
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
templates_page_setup();
// Draw page
echo templates_page_draw(array(sprintf(gettext("Running Your Own %s"), sitename), templates_draw(array('body' => run("content:run_your_own"), 'name' => sprintf(gettext("Running Your Own %s"), sitename), 'context' => 'contentholder'))));
Example #23
0
<?php

//    ELGG content flagging admin panel page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("admin:init");
define("context", "admin");
templates_page_setup();
// You must be logged on to view this!
echo templates_page_draw(array(gettext("Manage users"), templates_draw(array('context' => 'contentholder', 'title' => gettext("Manage users"), 'body' => run("admin:users")))));
Example #24
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
define("context", "calendar");
// Draw page
echo templates_page_draw(array(gettext("Calendar help"), templates_draw(array('body' => run("help:calendar"), 'title' => gettext("'Your calendar' help"), 'context' => 'contentholder'))));
Example #25
0
<?php

//    ELGG manage files page
// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("files:init");
define("context", "files");
templates_page_setup();
// Whose files are we looking at?
global $page_owner;
$title = run("profile:display:name") . " :: " . gettext("Edit File");
$body = run("content:files:edit");
$body .= run("files:edit");
echo templates_page_draw(array($title, templates_draw(array('context' => 'contentholder', 'title' => $title, 'body' => $body))));
Example #26
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
define("context", "profile");
templates_page_setup();
// Draw page
echo templates_page_draw(array("Profile help", templates_draw(array('body' => run("help:profile"), 'title' => gettext("'Your Profile' help"), 'context' => 'contentholder'))));
Example #27
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));
Example #28
0
<?php

// Run includes
require_once dirname(dirname(__FILE__)) . "/includes.php";
define("context", "network");
templates_page_setup();
// Draw page
echo templates_page_draw(array("Network help ", templates_draw(array('body' => run("help:network"), 'title' => gettext("'Your Network' help"), 'context' => 'contentholder'))));