示例#1
0
 /**
  * Overriding the render method gives us a single point to check that this page
  * is authorised.
  */
 public function _render()
 {
     if (!$this->page_authorised()) {
         $this->access_denied('page');
     }
     parent::_render();
 }
示例#2
0
 /**
  * This will do all the actions required before rendering the template. 
  * Setting up the notifications and navigatiosn, working out what to return
  * based on what type of request it is etc. 
  */
 public function _render()
 {
     if (request::is_ajax()) {
         // if the view has been set, then only ever return the view html
         // if this view is set please make sure there are no redirect under it.
         if (isset($this->ajax['view'])) {
             header('content-type: text/html');
             echo $this->ajax['view'];
         } else {
             if ($this->notification->count()) {
                 $this->ajax['notifications'] = $this->notification->get();
             }
             header('content-type: application/json');
             echo json_encode($this->ajax);
         }
     } else {
         if ($this->notification->count()) {
             $this->template->notifications = View::factory('templates/notification', array('notifications' => $this->notification->get()));
         }
         $this->template->breadcrumbs = $this->breadcrumbs->get();
         $this->template->navigation = $this->navigation->display();
         $this->template->css_classes = $this->css_classes;
         parent::_render();
     }
 }
 public function _render()
 {
     if ($this->auto_render) {
         // Add styles
         $this->template->styles = array('userguide/media/css/print.css' => 'print', 'userguide/media/css/screen.css' => 'screen', 'userguide/media/css/kodoc.css' => 'screen', 'userguide/media/css/topline.css' => 'screen', 'userguide/media/css/shCore.css' => 'screen', 'userguide/media/css/shThemeDefault.css' => 'screen');
         // Add scripts
         $this->template->scripts = array('userguide/media/js/jquery-1.3.2.min.js', 'userguide/media/js/jquery.coda-slider-2.0.js', 'userguide/media/js/jquery.easing.1.3.js', 'userguide/media/js/kodoc.js', 'userguide/media/js/shCore.js', 'userguide/media/js/shBrushPhp.js');
     }
     return parent::_render();
 }