Пример #1
0
 /**
  * start - renders applicaiton and routes to correct template, writes content to output buffer
  *
  * @access public static
  * @return void
  */
 public function start()
 {
     $config = new config();
     $login = new login(session::getSID());
     $frontController = frontcontroller::getInstance(ROOT);
     if ($login->logged_in() === false) {
         if (isset($_GET['export']) === true) {
             ob_start();
             $frontController->run();
             $toRender = ob_get_clean();
         } else {
             ob_start();
             include 'includes/templates/' . TEMPLATE . '/login.php';
             $toRender = ob_get_clean();
         }
     } else {
         ob_start();
         include 'includes/templates/' . TEMPLATE . '/content.php';
         $toRender = ob_get_clean();
     }
     $this->render($toRender);
 }
Пример #2
0
 /**
  * display - display template from folder template
  *
  * @access public
  * @param $template
  * @return unknown_type
  */
 public function display($template)
 {
     $this->template = $template;
     //frontcontroller splits the name (actionname.modulename)
     $action = frontcontroller::getActionName($template);
     $module = frontcontroller::getModuleName($template);
     if (defined('MOBILE') === true) {
         $strTemplate = './includes/modules/' . $module . '/templates/mobile/' . $action . '.tpl.php';
     } else {
         $strTemplate = './includes/modules/' . $module . '/templates/' . $action . '.tpl.php';
     }
     if (!file_exists($strTemplate) || !is_readable($strTemplate)) {
         echo '<p>Template kann nicht gefunden werden</p>';
     } else {
         //get language-File for labels
         $language = new language();
         $language->setModule($module);
         $lang = $language->readIni();
         include $strTemplate;
     }
     return;
 }