Пример #1
0
 /**
  * Loads standard Exambuff template, either using title, and bodyid or a complete TemplateData object passed as the second arg.
  * @param $view Name of view required
  * @param $title String || $templateData TemplateData - either title string or complete TemplateData object
  * @param $bodyID String
  * @param $viewData array
  */
 function _template($view, $title = null, $bodyID = null, $viewData = null)
 {
     if (get_class(func_get_arg(1)) === 'TemplateData') {
         $templateData = $title;
     } else {
         $this->load->library('templatedata');
         $templateData = new TemplateData();
         $templateData->setHead($title);
         $templateData->setPage($bodyID);
         $templateData->setView($viewData);
     }
     if ($templateData->page) {
         $templateData->setPage(array_merge($templateData->page, array('userAuth' => @$this->session->userdata('email'), 'markerAuth' => @$this->session->userdata('markerEmail'))));
     } else {
         $templateData->setPage(array('userAuth' => @$this->session->userdata('email'), 'markerAuth' => @$this->session->userdata('markerEmail')));
     }
     $templateData->setFooter($templateData->footer + $this->_fbToken());
     $this->load->view('html_head.php', $templateData->head);
     $this->load->view('page_head.php', $templateData->page);
     $this->load->view($view, $templateData->view);
     $this->load->view('footer', $templateData->footer);
 }