Exemplo n.º 1
0
 /**
  * Get application options
  *
  * @return Zend_Config
  */
 private function _getAppOptions()
 {
     // Retrieve application options
     $appOptions = new ZLayer_Config_Directory(APPLICATION_PATH . 'configs/', APPLICATION_ENV, false);
     $options = $appOptions->process();
     return $options;
 }
Exemplo n.º 2
0
 /**
  * _getThemesOptions
  *
  * @param string $name
  * @throws ZLayer_Application_Resource_Exception When theme not found or was incorrectly created
  * @return array
  */
 private function _getThemesOptions($name)
 {
     //@todo GET SESSION/CACHE/LOAD Config
     $options = array();
     $matched = false;
     foreach ($this->_basePath as $key => $value) {
         $basePath = $value . $name . "/configs/";
         if (is_dir($basePath)) {
             //define('temp.TEST',"testando");
             $themeOptionsDir = new ZLayer_Config_Directory($basePath, APPLICATION_ENV, false);
             $themeOptions = $themeOptionsDir->process()->toArray();
             if (isset($themeOptions["resources"]["theme"]["parents"])) {
                 $parents = $themeOptions["resources"]["theme"]["parents"];
                 foreach ($parents as $parent) {
                     $themeOptions = array_merge_recursive($themeOptions, $this->_getThemesOptions($parent));
                 }
             }
             $options = array_merge_recursive($options, $themeOptions);
             $matched = true;
         }
     }
     if (!$matched) {
         throw new ZLayer_Application_Resource_Exception("The theme {$name} not found or was incorrectly created");
     }
     return $options;
 }