private function passBlocks()
 {
     $tpl = new Template($this->parent);
     $tpl->addBlocks($this->blocks);
     $tpl->run();
     return $tpl->getHTML();
 }
Example #2
0
function template($file, $parameters, $parent = NULL)
{
    if (is_null($parent)) {
        $tpl = new Template($file, $parameters);
        $tpl->load();
        echo $tpl->getHTML();
    } else {
        $tpl = new Template($file, $parameters);
        $tpl->load();
        $child = $tpl->getHTML();
        $parameters["__CHILD__"] = $child;
        $tpl = new Template($parent, $parameters);
        $tpl->load();
        echo $tpl->getHTML();
    }
}
Example #3
0
<?php

error_reporting(E_ALL);
require dirname(__FILE__) . './../include/config.php';
$payload = array('config' => $config);
$repository = new Repository();
// parse the url
$payload['request'] = get_request();
if (isset($payload['request']['p'])) {
    $project = $repository->getProject($payload['request']['p']);
    switch ($payload['request']['a']) {
        case 'shortlog':
            $payload['history'] = $project->getHistory();
            $payload['project'] = $project;
            $template = new Template('shortlog', $payload['request']['p'], $payload);
            break;
        default:
            $payload['history'] = $project->getHistory();
            $payload['project'] = $project;
            $template = new Template('summary', $payload['request']['p'], $payload);
    }
} else {
    $payload['projects'] = $repository->getProjectList();
    $template = new Template('repository', 'repository', $payload);
}
echo $template->getHTML();
Example #4
0
 private function processNotifications()
 {
     $this->trigger("BeforeProcessNotifications", $this);
     if (!is_object($this->notifyStorage)) {
         $this->notifyStorage = Storage::createWithSession('ControllerNotify');
     }
     $notes = $this->notifyStorage['notify'];
     if (!is_array($notes) || empty($notes)) {
         return '';
     }
     $this->addScript("jquery.jgrowl.js");
     $this->addCSS("jquery.jgrowl.css");
     $tpl = new Template(Config::get('ROOT_DIR') . '/includes/widgets/templates', 'notify.tpl');
     $tpl->setParamsArray(array('list' => $notes));
     unset($this->notifyStorage['notify']);
     return $tpl->getHTML();
 }