示例#1
0
 /**
  * Main method controller.
  * @return unknown_type
  */
 public function build()
 {
     $this->setLayout('locales/index.tpl');
     $this->addModule('head', 'SharedHead');
     $this->addModule('footer', 'SharedFooter');
     $this->addModule('system_messages', 'SharedSystemMessages');
     $params = $this->getParams();
     $action = \Sifo\Router::getReversalRoute($params['path_parts'][0]);
     $params = $this->getParams();
     if ($params['params'] !== false && in_array('saved-true', $params["params"])) {
         \Sifo\FlashMessages::set('File Saved OK.', \Sifo\FlashMessages::MSG_OK);
     }
     if ($params['params'] !== false && in_array('created-true', $params["params"])) {
         \Sifo\FlashMessages::set('File Created OK.', \Sifo\FlashMessages::MSG_OK);
     }
     if ($this->getParsedParam('instance') !== false) {
         $this->assign('current_instance', $this->getParsedParam('instance'));
         $this->assign('languages', $this->getLanguagesInstance($this->getParsedParam('instance')));
         //var_dump($this->getLanguagesInstance($this->getParsedParam( 'instance' )));
     }
     if ($this->getParsedParam('language') !== false) {
         $this->assign('current_language', $this->getParsedParam('language'));
         $temp = explode("_", $this->getParsedParam('language'));
         if (is_array($temp)) {
             $this->assign('lang', $temp[1]);
         }
     }
     $instances = $this->getInstances();
     $this->assign('instances', $instances);
     // For url with params generation:
     $this->assign('params', $this->getParam('parsed_params'));
     $this->assign('params_definition', $this->getParamsDefinition());
 }
示例#2
0
 public function buildCommon()
 {
     $params = $this->getParams();
     $this->setLayout('static/common.tpl');
     $english_path = \Sifo\Router::getReversalRoute($params['path']);
     $template = 'static/' . $english_path . '_' . $this->language . '.tpl';
     if ($static = $this->fetch($template)) {
         $this->assign('static_content', $static);
     } else {
         throw new \Sifo\Exception_404('Page ' . $params['path'] . ' not found.');
     }
 }
示例#3
0
 /**
  * Main of controller.
  * @return unknown_type
  */
 public function build()
 {
     $this->setLayout('locales/index.tpl');
     $this->addModule('head', 'SharedHead');
     $this->addModule('footer', 'SharedFooter');
     $params = $this->getParams();
     $action = \Sifo\Router::getReversalRoute($params['path_parts'][0]);
     switch ($action) {
         case 'locales-save':
             $this->save();
             break;
         default:
             break;
     }
     $this->assign('params', $this->getParam('parsed_params'));
     $this->assign('params_definition', $this->getParamsDefinition());
 }