Beispiel #1
0
 public function __construct(\Silex\Application $App = null)
 {
     parent::__construct($App);
     $Module = new \System\Libraries\Modules($App);
     $Module->bindTextDomainForModule('agnifw');
     // load functions
     $this->Loader->loadFunctions('language');
 }
 /**
  * index action
  * 
  * @return string
  */
 public function indexAction()
 {
     $Module = new \System\Libraries\Modules($this->Silexapp);
     $Module->bindTextDomainForModule('cms');
     // load functions
     $this->Loader->loadFunctions('language');
     // list languages for language selector.
     $LanguagesDb = new \System\Core\Models\LanguagesDb($this->Silexapp['Db']);
     $language_file = $LanguagesDb->getConfigFile();
     if (is_file($language_file)) {
         $languages_config = (include $language_file);
     }
     unset($LanguagesDb, $language_file);
     if (isset($languages_config) && is_array($languages_config) && array_key_exists('languages', $languages_config)) {
         $data['languages'] = $languages_config['languages'];
     } else {
         $data['languages'] = [];
     }
     unset($languages_config);
     $data['Uri'] = new \System\Libraries\Uri();
     $data['framework_name'] = _t('Agni Framework', 'cms');
     $data['page_content'] = $this->Theme->render('front/templates/index/index_v', $data);
     return $this->Theme->render('front/templates/body_v', $data);
 }