Beispiel #1
0
 /**
  * Get path to the folder with current theme templates
  * @return string
  */
 public function getThemePath()
 {
     /*
      * Check for external themes
      */
     if ($this->_externalsExpert) {
         $themes = $this->_externalsExpert->getThemes();
         if (isset($themes[$this->theme])) {
             return $themes[$this->theme];
         }
     }
     return $this->_templatesPath . $this->theme . '/';
 }
Beispiel #2
0
 /**
  * Get themes list
  */
 public function themeslistAction()
 {
     $themes = File::scanFiles($this->_configMain->get('themes'), false, false, File::Dirs_Only);
     $result = array();
     if (!empty($themes)) {
         foreach ($themes as $name) {
             $code = basename($name);
             if ($code[0] != '.') {
                 $result[] = array('id' => $code, 'title' => $code);
             }
         }
     }
     if ($this->_configMain->get('allow_externals')) {
         $config = Config::factory(Config::File_Array, $this->_configMain->get('configs') . 'externals.php');
         $eExpert = new Externals_Expert($this->_configMain, $config);
         $themes = $eExpert->getThemes();
         if (!empty($themes)) {
             foreach ($themes as $k => $path) {
                 $result[] = array('id' => $k, 'title' => $k);
             }
         }
     }
     Response::jsonSuccess($result);
 }