Exemplo n.º 1
0
function page_header($page_title, $page_id = false, $options = array())
{
    $options['title'] = $page_title;
    if ($page_id) {
        $options['id'] = $page_id;
    }
    PageRenderer::header($options);
}
Exemplo n.º 2
0
 public function render($arguments)
 {
     PageRenderer::addTemplatesLocation(__DIR__ . "/../templates");
     Permissions::need("exceptions");
     PageRenderer::header(array("title" => t("Exception list"), "id" => "page_exception_list"));
     $limit = isset($arguments['limit']) ? $arguments['limit'] : 10;
     $class = isset($arguments['limit']) ? $arguments['limit'] : null;
     $important = isset($arguments['important']) ? $arguments['important'] : null;
     $ignored = isset($arguments['ignored']) ? $arguments['ignored'] : null;
     $q = db()->prepare("SELECT * FROM uncaught_exceptions ORDER BY id desc LIMIT " . (int) $limit);
     $q->execute();
     $exceptions = $q->fetchAll();
     PageRenderer::requireTemplate("exception_list", array("exceptions" => $exceptions, "url" => url_for($this->getPath(), array("limit" => $limit, "class" => $class, "important" => $important, "ignored" => $ignored))));
     PageRenderer::footer();
 }
Exemplo n.º 3
0
 function generateFile($template, $object, $args = array())
 {
     $filename = $object->getFilename();
     $title = $object->getTitle($this->options);
     $_file = $this->output . $filename;
     $this->logger->info("Generating '{$_file}'...");
     ob_start();
     $args['options'] = $this->options;
     $args['database'] = $this->database;
     $args['logger'] = $this->logger;
     $args['generator'] = $this;
     PageRenderer::header(array("title" => $title));
     PageRenderer::requireTemplate($template, $args);
     PageRenderer::footer();
     $contents = ob_get_contents();
     ob_end_clean();
     file_put_contents($_file, $contents);
 }
Exemplo n.º 4
0
<?php

use Pages\PageRenderer;
PageRenderer::header(array("title" => t("Contact"), "id" => "page_contact"));
PageRenderer::requireTemplate("contact");
PageRenderer::footer();
Exemplo n.º 5
0
<?php

/**
 * A simple calculator to calculate the value of one currency in another currency.
 */
use Pages\PageRenderer;
define('__TEMPLATE_DIR__', __DIR__);
PageRenderer::header(array("title" => t("Cryptocurrency Calculator"), "id" => "page_calculator", "js" => "calculator"));
PageRenderer::requireTemplate("calculator");
PageRenderer::footer();
Exemplo n.º 6
0
function page_header($title, $id = "", $arguments = array())
{
    $arguments['title'] = $title;
    $arguments['id'] = $id;
    \Pages\PageRenderer::header($arguments);
}