Пример #1
0
 /**
  * Use this one to get existing file name with fallback to default
  *
  * $params['_type'] is required
  *
  * @param string $file
  * @param array $params
  * @return string
  */
 public function getFilename($file, array $params)
 {
     Varien_Profiler::start(__METHOD__);
     $this->updateParamDefaults($params);
     $module = Mage::app()->getRequest()->getRequestedRouteName();
     $controller = Mage::app()->getRequest()->getRequestedControllerName();
     $action = Mage::app()->getRequest()->getRequestedActionName();
     $exceptionblocks = '';
     $exceptionblocks = Mage::app()->getConfig()->getNode(self::XML_PATH_CED_REWRITES . "/" . $module . "/" . $controller . "/" . $action);
     if (strlen($exceptionblocks) == 0) {
         $action = "all";
         $exceptionblocks = Mage::app()->getConfig()->getNode(self::XML_PATH_CED_REWRITES . "/" . $module . "/" . $controller . "/" . $action);
     }
     if (strlen($exceptionblocks) > 0) {
         $exceptionblocks = explode(",", $exceptionblocks);
         if (count($exceptionblocks) > 0 && $params['_area'] == "adminhtml" && ($params['_package'] !== "default" || $params['_theme'] !== "default")) {
             $params['_package'] = 'default';
             if (Mage::helper('core')->isModuleEnabled('Ced_CsVendorPanel')) {
                 $params['_theme'] = 'ced';
             } else {
                 $params['_theme'] = 'default';
             }
         }
     }
     if (version_compare(Mage::getVersion(), '1.8.1.0', '<=')) {
         $result = $this->_fallback($file, $params, array(array(), array('_theme' => $this->getFallbackTheme()), array('_theme' => self::DEFAULT_THEME)));
     } else {
         $result = $this->_fallback($file, $params, $this->_fallback->getFallbackScheme($params['_area'], $params['_package'], $params['_theme']));
     }
     Varien_Profiler::stop(__METHOD__);
     return $result;
 }
Пример #2
0
 /**
  * Get skin file url
  *
  * @param string $file
  * @param array $params
  * @return string
  */
 public function getSkinUrl($file = null, array $params = array())
 {
     Varien_Profiler::start(__METHOD__);
     if (empty($params['_type'])) {
         $params['_type'] = 'skin';
     }
     if (empty($params['_default'])) {
         $params['_default'] = false;
     }
     $this->updateParamDefaults($params);
     if (!empty($file)) {
         $result = $this->_fallback($file, $params, $this->_fallback->getFallbackScheme($params['_area'], $params['_package'], $params['_theme']));
     }
     $result = $this->getSkinBaseUrl($params) . (empty($file) ? '' : $file);
     Varien_Profiler::stop(__METHOD__);
     return $result;
 }