Beispiel #1
0
 public function html_list($document)
 {
     Backend::add('Sub Title', $document->getMeta('name'));
     Backend::add('TabLinks', $this->getTabLinks(Controller::$action));
     Backend::add('Object', $document);
     Backend::addContent(Render::renderFile('document_list.tpl.php'));
 }
 public function html_display($content)
 {
     Backend::add('Sub Title', 'Revisions for ' . $content->array['name']);
     Backend::add('content', $content);
     Backend::add('revisions', $content->object->revisions);
     Backend::addContent(Render::renderFile('content_revision.display.tpl.php'));
     return true;
 }
Beispiel #3
0
 public function html_list($result)
 {
     Backend::add('Sub Title', $result->getMeta('name'));
     Backend::add('TabLinks', $this->getTabLinks(Controller::$action));
     Backend::addScript(SITE_LINK . '/js/jquery.js');
     Backend::addScript(SITE_LINK . '/js/image_list.js');
     Backend::addStyle(SITE_LINK . '/css/image_list.css');
     Backend::addContent(Render::renderFile('image.list.tpl.php', array('db_object' => $result)));
 }
 public function html_display($result)
 {
     $result = parent::html_display($result);
     if (Value::get(get_class($this) . '_commented', true) && Component::isActive('Comment')) {
         if ($result instanceof DBObject) {
             $comments = Comment::getComments($result->getMeta('table'), $result->getMeta('id'));
             Backend::addContent(Render::renderFile('comments.tpl.php', array('comment_list' => $comments)));
             if (Permission::check('create', 'comment')) {
                 $values = array('foreign_table' => $result->getMeta('table'), 'foreign_id' => $result->getMeta('id'));
                 Backend::addContent(Render::renderFile('comment.add.tpl.php', $values));
             }
         }
     }
     return $result;
 }
Beispiel #5
0
 function get_list($start, $count, array $options = array())
 {
     $Assignments = new AssignmentObj();
     if ($start === 'all') {
         $limit = 'all';
     } else {
         $limit = "{$start}, {$count}";
     }
     $conditions = array('`assignments`.`active` = 1');
     $joins = array(array('type' => 'LEFT', 'table' => '`roles`', 'conditions' => array('`roles`.`id` = `assignments`.`role_id`', '`roles`.`active` = 1')));
     $fields = array('`assignments`.*', '`roles`.`name` AS `role`');
     list($query, $params) = $Assignments->getSelectSQL(array('conditions' => $conditions, 'joins' => $joins, 'fields' => $fields, 'limit' => $limit));
     $Assignments->read(array('query' => $query, 'parameters' => $params));
     Backend::add('Assignments', $Assignments);
     Backend::addContent(Render::renderFile('assignment_list.tpl.php'));
 }
Beispiel #6
0
 public static function hook_output($to_print)
 {
     Backend::add('BackendErrors', Backend::getError());
     Backend::add('BackendSuccess', Backend::getSuccess());
     Backend::add('BackendNotices', Backend::getNotice());
     Backend::add('BackendInfo', Backend::getInfo());
     Backend::setError();
     Backend::setSuccess();
     Backend::setNotice();
     Backend::setInfo();
     $content = Backend::getContent();
     if (empty($content)) {
         ob_start();
         var_dump($to_print);
         $content = ob_get_clean();
         if (substr($content, 0, 4) != '<pre') {
             $content = '<pre>' . $content . '</pre>';
         }
         Backend::addContent($content);
     }
     $to_print = Render::renderFile('styles.area.tpl.php');
     $to_print .= Render::renderFile('maincontent.tpl.php');
     $to_print .= Render::renderFile('scripts.tpl.php');
     $to_print = HtmlView::addLastContent($to_print);
     $to_print = HtmlView::replace($to_print);
     $to_print = HtmlView::rewriteLinks($to_print);
     $to_print = HtmlView::addLinks($to_print);
     $to_print = HtmlView::formsAcceptCharset($to_print);
     if (Component::isActive('BackendFilter')) {
         $BEFilter = new BEFilterObj();
         $BEFilter->read();
         $filters = $BEFilter->list ? $BEFilter->list : array();
         foreach ($filters as $row) {
             if (class_exists($row['class'], true) && is_callable(array($row['class'], $row['function']))) {
                 $to_print = call_user_func(array($row['class'], $row['function']), $to_print);
             }
         }
     }
     return $to_print;
 }
 public function html_filter($resultArray)
 {
     //backend_error.filter.tpl.php
     Backend::addContent(Render::renderFile('backend_request.filter.tpl.php', array('data' => $resultArray['data'], 'params' => $resultArray['params'], 'pager' => $resultArray['pager'], 'sort' => $resultArray['sort'])));
 }
Beispiel #8
0
 public static function getExample()
 {
     return Render::renderFile('api.example.tpl.php');
 }
Beispiel #9
0
 public static function install_check()
 {
     if (!self::checkCacheFolder()) {
         if (function_exists('posix_getgrgid') && function_exists('posix_getegid')) {
             if ($group = posix_getgrgid(posix_getegid())) {
                 $group = $group['name'];
             }
         }
         $values = array('folder' => self::$cache_folder, 'group' => isset($group) ? $group : false);
         Backend::addContent(Render::renderFile('render.fix_cache_folder.tpl.php', $values));
         return false;
     }
     return true;
 }
Beispiel #10
0
 public function html_permissions($result)
 {
     if (is_post()) {
         if ($result === false) {
             Backend::addError('Could not update Permissions');
         } else {
             Backend::addSuccess($result . ' Permissions Updated');
         }
         Controller::redirect('previous');
     }
     //GET
     if (!empty(Controller::$parameters[0])) {
         Backend::add('Sub Title', class_name(Controller::$parameters[0]) . ' Permissions');
         Links::add('All Permissions', '?q=gate_manager/permissions', 'secondary');
     } else {
         Backend::add('Sub Title', ConfigValue::get('Title') . ' Permissions');
     }
     Backend::addContent(Render::renderFile('gate_manager.permissions.tpl.php', (array) $result));
 }
<?php

$list_start = !isset($list_start) ? Controller::$parameters[1] : $list_start;
$list_length = !isset($list_length) ? Controller::$parameters[2] : $list_length;
?>
{tpl:std_search.tpl.php}
<?php 
if (!empty($term)) {
    ?>
	<p class="large">Showing results for the search for <strong>#term#</strong></p>
	<?php 
    if (Render::checkTemplateFile($db_object->getArea() . '.list.tpl.php')) {
        ?>
		<?php 
        echo Render::renderFile($db_object->getArea() . '.list.tpl.php', array('list_start' => $list_start, 'list_length' => $list_length));
        ?>
	<?php 
    } else {
        ?>
		{tpl:std_list.tpl.php}
	<?php 
    }
}