當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Varien_Simplexml_Config::loadFile方法代碼示例

本文整理匯總了PHP中Varien_Simplexml_Config::loadFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Simplexml_Config::loadFile方法的具體用法?PHP Varien_Simplexml_Config::loadFile怎麽用?PHP Varien_Simplexml_Config::loadFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Varien_Simplexml_Config的用法示例。


在下文中一共展示了Varien_Simplexml_Config::loadFile方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * load theme xml
  */
 public function __construct()
 {
     parent::__construct();
     $this->settings = new Varien_Simplexml_Config();
     $this->settings->loadFile(Mage::getBaseDir() . $this->_file);
     if (!$this->settings) {
         throw new Exception('Can not read theme config file ' . Mage::getBaseDir() . $this->_file);
     }
 }
開發者ID:par-orillonsoft,項目名稱:wildfalcon,代碼行數:12,代碼來源:Settings.php

示例2: __construct

 /**
  * Assemble themes inheritance config
  *
  */
 public function __construct(array $params = array())
 {
     if (isset($params['designRoot'])) {
         if (!is_dir($params['designRoot'])) {
             throw new Mage_Core_Exception("Design root '{$params['designRoot']}' isn't a directory.");
         }
         $this->_designRoot = $params['designRoot'];
     } else {
         $this->_designRoot = Mage::getBaseDir('design');
     }
     $this->_cacheChecksum = null;
     $this->setCacheId('config_theme');
     $this->setCache(Mage::app()->getCache());
     if (!$this->loadCache()) {
         $this->loadString('<theme />');
         $path = str_replace('/', DS, $this->_designRoot . '/*/*/*/etc/theme.xml');
         $files = glob($path);
         foreach ($files as $file) {
             $config = new Varien_Simplexml_Config();
             $config->loadFile($file);
             list($area, $package, $theme) = $this->_getThemePathSegments($file);
             $this->setNode($area . '/' . $package . '/' . $theme, null);
             $this->getNode($area . '/' . $package . '/' . $theme)->extend($config->getNode());
         }
         $this->saveCache();
     }
 }
開發者ID:barneydesmond,項目名稱:propitious-octo-tribble,代碼行數:31,代碼來源:Config.php

示例3: restoreAction

 public function restoreAction()
 {
     $this->_stores = $this->getRequest()->getParam('stores', array(0));
     $this->_clear = $this->getRequest()->getParam('clear_scope', true);
     if ($this->_clear) {
         if (!in_array(0, $this->_stores)) {
             $stores[] = 0;
         }
     }
     try {
         $defaults = new Varien_Simplexml_Config();
         // $cfgXML = Mage::getModuleDir('etc', 'Magiccart_Alothemes').'/config.xml';
         $cfgXML = Mage::getBaseDir() . '/app/code/local/Magiccart/Alothemes/etc/config.xml';
         if (!file_exists($cfgXML)) {
             echo 'Not found file:' . $cfgXML;
             return;
         }
         $defaults->loadFile($cfgXML);
         $this->_restoreSettings($defaults->getNode('default/alothemes')->children(), 'alothemes');
         Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Default Settings for magicinstall Design Theme has been restored.'));
     } catch (Exception $e) {
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('An error occurred while restoring theme settings.'));
     }
     $this->getResponse()->setRedirect($this->getUrl("*/*/"));
 }
開發者ID:uibar,項目名稱:laviniailies2,代碼行數:25,代碼來源:RestoreController.php

示例4: getRewritesList

 function getRewritesList()
 {
     $moduleFiles = glob(Mage::getBaseDir('etc') . DS . 'modules' . DS . '*.xml');
     if (!$moduleFiles) {
         return false;
     }
     // load file contents
     $unsortedConfig = new Varien_Simplexml_Config();
     $unsortedConfig->loadString('<config/>');
     $fileConfig = new Varien_Simplexml_Config();
     foreach ($moduleFiles as $filePath) {
         $fileConfig->loadFile($filePath);
         $unsortedConfig->extend($fileConfig);
     }
     // create sorted config [only active modules]
     $sortedConfig = new Varien_Simplexml_Config();
     $sortedConfig->loadString('<config><modules/></config>');
     foreach ($unsortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         if ('true' === (string) $moduleNode->active) {
             $sortedConfig->getNode('modules')->appendChild($moduleNode);
         }
     }
     $fileConfig = new Varien_Simplexml_Config();
     $_finalResult = array();
     foreach ($sortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         $codePool = (string) $moduleNode->codePool;
         $configPath = BP . DS . 'app' . DS . 'code' . DS . $codePool . DS . uc_words($moduleName, DS) . DS . 'etc' . DS . 'config.xml';
         $fileConfig->loadFile($configPath);
         $rewriteBlocks = array('blocks', 'models', 'helpers');
         foreach ($rewriteBlocks as $param) {
             if (!isset($_finalResult[$param])) {
                 $_finalResult[$param] = array();
             }
             if ($rewrites = $fileConfig->getXpath('global/' . $param . '/*/rewrite')) {
                 foreach ($rewrites as $rewrite) {
                     $parentElement = $rewrite->xpath('../..');
                     foreach ($parentElement[0] as $moduleKey => $moduleItems) {
                         $moduleItemsArray['rewrite'] = array();
                         $moduleItemsArray['codePool'] = array();
                         foreach ($moduleItems->rewrite as $rewriteLine) {
                             foreach ($rewriteLine as $key => $value) {
                                 $moduleItemsArray['rewrite'][$key] = (string) $value;
                                 $moduleItemsArray['codePool'][$key] = $codePool;
                             }
                         }
                         if ($moduleItems->rewrite) {
                             $_finalResult[$param] = array_merge_recursive($_finalResult[$param], array($moduleKey => $moduleItemsArray));
                         }
                     }
                 }
             }
         }
     }
     return $_finalResult;
 }
開發者ID:guohuadeng,項目名稱:stampApp,代碼行數:55,代碼來源:Data.php

示例5: _resetNode

 protected function _resetNode($xpath)
 {
     $store = $this->getRequest()->getParam('store', 0);
     $scope = $store ? 'stores' : 'default';
     $tpl_settings_def = new Varien_Simplexml_Config();
     $tpl_settings_def->loadFile(Mage::getBaseDir() . '/app/code/local/Etheme/Evoqueconfig/etc/config.xml');
     $sets = $tpl_settings_def->getNode('default/evoqueconfig/evoqueconfig_' . $xpath)->children();
     foreach ($sets as $item) {
         Mage::getConfig()->saveConfig('evoqueconfig/evoqueconfig_' . $xpath . '/' . $item->getName(), (string) $item, $scope, $store);
     }
 }
開發者ID:jacobfire,項目名稱:robotics,代碼行數:11,代碼來源:ResetcmsblocksController.php

示例6: __construct

 /**
  * Init License Config Information
  * XML Path: app/code/local/Magestore/license_certificates
  * 
  * @param type $sourceData
  */
 public function __construct($sourceData = null)
 {
     $certificateFolder = 'app/code/local/Magestore/license_certificates';
     $certificateFolder = str_replace('/', DS, $certificateFolder);
     $configFiles = glob(BP . DS . $certificateFolder . DS . '*.xml');
     $this->loadFile(current($configFiles));
     while ($file = next($configFiles)) {
         $merge = new Varien_Simplexml_Config();
         $merge->loadFile($file);
         $this->extend($merge);
     }
 }
開發者ID:santhosh400,項目名稱:ecart,代碼行數:18,代碼來源:Config.php

示例7: getFallbackConfig

 /**
  * Load widget XML config and merge with theme widget config
  *
  * @param array $defaults
  *
  * @return Varien_Simplexml_Element
  */
 protected function getFallbackConfig($defaults)
 {
     if ($this->_fallbackConfigXml === null) {
         $configFile = Mage::getSingleton('core/design_package')->getBaseDir(array('_area' => $defaults['_area'], '_package' => $defaults['_package'], '_theme' => $defaults['_theme'], '_type' => 'etc')) . DS . 'fallback.xml';
         if (is_readable($configFile)) {
             $themeFallbackConfig = new Varien_Simplexml_Config();
             $themeFallbackConfig->loadFile($configFile);
             if ($themeWidgetTypeConfig = $themeFallbackConfig->getNode('fallback')) {
                 $this->_fallbackConfigXml = $themeWidgetTypeConfig;
             }
         } else {
             $this->_fallbackConfigXml = false;
         }
     }
     return $this->_fallbackConfigXml;
 }
開發者ID:ergontech,項目名稱:Aoe_DesignFallback,代碼行數:23,代碼來源:Package.php

示例8: restoreAction

 public function restoreAction()
 {
     $this->_stores = $this->getRequest()->getParam('stores', array(0));
     $this->_clear = $this->getRequest()->getParam('clear_scope', true);
     if ($this->_clear) {
         if (!in_array(0, $this->_stores)) {
             $stores[] = 0;
         }
     }
     try {
         $defaults = new Varien_Simplexml_Config();
         $defaults->loadFile(Mage::getBaseDir() . '/app/code/local/MagenThemes/MTGhost/etc/config.xml');
         $this->_restoreSettings($defaults->getNode('default/mtghost_design')->children(), 'mtghost_design');
         Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Default Settings for MTGhost Design Theme has been restored.'));
     } catch (Exception $e) {
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('An error occurred while restoring theme settings.'));
     }
     $this->getResponse()->setRedirect($this->getUrl("*/*/"));
 }
開發者ID:igorvasiliev4,項目名稱:magento_code,代碼行數:19,代碼來源:RestoreController.php

示例9: saveAction

 public function saveAction()
 {
     if ($data = $this->getRequest()->getPost()) {
         $stores = $this->getRequest()->getParam('stores', array(0));
         $setup_package = $this->getRequest()->getParam('setup_package', 0);
         $this->_clear = $this->getRequest()->getParam('clear_scope', false);
         $setup_pages = $this->getRequest()->getParam('setup_pages', 0);
         $setup_blocks = $this->getRequest()->getParam('setup_blocks', 0);
         if ($this->_clear) {
             if (!in_array(0, $this->_stores)) {
                 $stores[] = 0;
             }
         }
         try {
             foreach ($stores as $store) {
                 $scope = $store ? 'stores' : 'default';
                 Mage::getConfig()->saveConfig('design/header/logo_src', 'images/logo.gif', $scope, $store);
                 Mage::getConfig()->saveConfig('design/footer/copyright', '&copy; 2012 Magento Demo Store. All Rights Reserved.', $scope, $store);
                 if ($setup_package) {
                     Mage::getConfig()->saveConfig('design/package/name', 'default', $scope, $store);
                 }
             }
             $defaults = new Varien_Simplexml_Config();
             $defaults->loadFile(Mage::getBaseDir() . '/app/code/local/Meigee/ThemeOptionsBlacknwhite/etc/config.xml');
             $this->_restoreSettings($defaults->getNode('default/meigee_blacknwhite_general')->children(), 'meigee_blacknwhite_general');
             $this->_restoreSettings($defaults->getNode('default/meigee_blacknwhite_design')->children(), 'meigee_blacknwhite_design');
             $this->_restoreSettings($defaults->getNode('default/meigee_blacknwhite_productpage')->children(), 'meigee_blacknwhite_productpage');
             $this->_restoreSettings($defaults->getNode('default/meigee_blacknwhite_sidebar')->children(), 'meigee_blacknwhite_sidebar');
             $this->_restoreSettings($defaults->getNode('default/meigee_blacknwhite_headerslider')->children(), 'meigee_blacknwhite_headerslider');
             $this->_restoreSettings($defaults->getNode('default/meigee_blacknwhite_bgslider')->children(), 'meigee_blacknwhite_bgslider');
             if ($setup_pages) {
                 Mage::getModel('ThemeOptionsBlacknwhite/restore')->setupPages();
             }
             if ($setup_blocks) {
                 Mage::getModel('ThemeOptionsBlacknwhite/restore')->setupBlocks();
             }
             Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('ThemeOptionsBlacknwhite')->__('Default settings has been restored. Please clear all the cache (System > Cache management)'));
         } catch (Exception $e) {
             Mage::getSingleton('adminhtml/session')->addError(Mage::helper('ThemeOptionsBlacknwhite')->__('An error occurred while restoring theme. ' . $e->getMessage()));
         }
         $this->getResponse()->setRedirect($this->getUrl("*/*/"));
     }
 }
開發者ID:zaiats85,項目名稱:blacknwhite,代碼行數:43,代碼來源:RestoreController.php

示例10: restoreAction

 public function restoreAction()
 {
     $this->_stores = $this->getRequest()->getParam('stores', array(0));
     $this->_clear = $this->getRequest()->getParam('clear_scope', false);
     $setup_cms = $this->getRequest()->getParam('setup_cms', 0);
     if ($this->_clear) {
         if (!in_array(0, $this->_stores)) {
             $stores[] = 0;
         }
     }
     try {
         $defaults = new Varien_Simplexml_Config();
         $defaults->loadFile(Mage::getBaseDir() . '/app/code/local/Queldorei/ShopperSettings/etc/config.xml');
         $this->_restoreSettings($defaults->getNode('default/shoppersettings')->children(), 'shoppersettings');
         if ($setup_cms) {
             Mage::getModel('shoppersettings/settings')->setupCms();
         }
         Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('shoppersettings')->__('Default Settings for Shopper Theme has been restored. Please clear cache (System > Cache management) if you do not see changes in storefront'));
     } catch (Exception $e) {
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('shoppersettings')->__('An error occurred while restoring theme settings.'));
     }
     $this->getResponse()->setRedirect($this->getUrl("*/*/"));
 }
開發者ID:evinw,項目名稱:project_bloom_magento,代碼行數:23,代碼來源:RestoreController.php

示例11: __construct

 private function __construct()
 {
     $moduleFiles = glob(BP . '/app/etc/modules/*.xml');
     $unsortedConfig = new Varien_Simplexml_Config();
     $unsortedConfig->loadString('<config/>');
     $fileConfig = new Varien_Simplexml_Config();
     foreach ($moduleFiles as $filePath) {
         $fileConfig->loadFile($filePath);
         $unsortedConfig->extend($fileConfig);
     }
     // create sorted config [only active modules]
     #$sortedConfig = new Varien_Simplexml_Config();
     #$sortedConfig->loadString('<config><modules/></config>');
     $fileConfig = new Varien_Simplexml_Config();
     foreach ($unsortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         if ('true' === (string) $moduleNode->active) {
             $codePool = (string) $moduleNode->codePool;
             $configPath = BP . '/app/code/' . $codePool . '/' . uc_words($moduleName, '/') . '/etc/config.xml';
             $fileConfig->loadFile($configPath);
             $unsortedConfig->extend($fileConfig);
         }
     }
     $this->_config = $unsortedConfig;
 }
開發者ID:cabrerabywaters,項目名稱:magentoSunshine,代碼行數:24,代碼來源:MageConfig.php

示例12: loadFile

 public function loadFile($file)
 {
     if (in_array($file, $this->_loadedFiles)) {
         return false;
     }
     $res = parent::loadFile($file);
     if ($res) {
         $this->addLoadedFile($file);
     }
     return $this;
 }
開發者ID:cewolf2002,項目名稱:magento,代碼行數:11,代碼來源:Base.php

示例13: getConflictList

 /**
  * Retrive possible conflicts list
  *
  * @return array
  */
 public function getConflictList()
 {
     $moduleFiles = glob($this->_etcDir . 'modules' . DIRECTORY_SEPARATOR . '*.xml');
     if (!$moduleFiles) {
         return false;
     }
     // load file contents
     $unsortedConfig = new Varien_Simplexml_Config();
     $unsortedConfig->loadString('<config/>');
     $fileConfig = new Varien_Simplexml_Config();
     foreach ($moduleFiles as $filePath) {
         $fileConfig->loadFile($filePath);
         $unsortedConfig->extend($fileConfig);
     }
     // create sorted config [only active modules]
     $sortedConfig = new Varien_Simplexml_Config();
     $sortedConfig->loadString('<config><modules/></config>');
     foreach ($unsortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         if ('true' === (string) $moduleNode->active) {
             $sortedConfig->getNode('modules')->appendChild($moduleNode);
         }
     }
     $fileConfig = new Varien_Simplexml_Config();
     $_finalResult = array();
     foreach ($sortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         $codePool = (string) $moduleNode->codePool;
         $configPath = $this->_codeDir . $codePool . DIRECTORY_SEPARATOR . uc_words($moduleName, DS) . DIRECTORY_SEPARATOR . 'etc' . DS . 'config.xml';
         $fileConfig->loadFile($configPath);
         $rewriteBlocks = array('blocks', 'models', 'helpers');
         foreach ($rewriteBlocks as $param) {
             if (!isset($_finalResult[$param])) {
                 $_finalResult[$param] = array();
             }
             if ($rewrites = $fileConfig->getXpath('global/' . $param . '/*/rewrite')) {
                 foreach ($rewrites as $rewrite) {
                     $parentElement = $rewrite->xpath('../..');
                     foreach ($parentElement[0] as $moduleKey => $moduleItems) {
                         $moduleItemsArray['rewrite'] = array();
                         foreach ($moduleItems->rewrite as $rewriteLine) {
                             foreach ($rewriteLine as $key => $value) {
                                 $moduleItemsArray['rewrite'][$key] = (string) $value;
                             }
                             #echo "<pre>".print_r($moduleItemsArray['rewrite'],1)."</pre>";
                         }
                         if ($moduleItems->rewrite) {
                             $_finalResult[$param] = array_merge_recursive($_finalResult[$param], array($moduleKey => $moduleItemsArray));
                         }
                     }
                 }
             }
         }
     }
     $_finalResult = $this->_fillAllClassesToRewrite($_finalResult);
     $_finalResult = $this->_clearEmptyRows($_finalResult);
     $_finalResult = $this->_recoverDeletedClassRewrites($_finalResult);
     // filter aitoc modules
     foreach ($_finalResult as $type => $data) {
         foreach ($data as $module => $data) {
             foreach ($data['rewrite'] as $model => $classes) {
                 $remove = true;
                 foreach ($classes as $class) {
                     if (strstr($class, 'Aitoc') || strstr($class, 'AdjustWare')) {
                         $remove = false;
                         break;
                     }
                 }
                 if ($remove) {
                     unset($_finalResult[$type][$module]['rewrite'][$model]);
                 }
             }
             if (!$_finalResult[$type][$module]['rewrite']) {
                 unset($_finalResult[$type][$module]);
             }
         }
     }
     return $_finalResult;
 }
開發者ID:cabrerabywaters,項目名稱:magentoSunshine,代碼行數:82,代碼來源:Conflict.php

示例14: getConflictList

 /**
  * Retrive possible conflicts list
  *
  * @return array
  */
 public function getConflictList()
 {
     $moduleFiles = glob($this->_etcDir . 'modules' . DIRECTORY_SEPARATOR . '*.xml');
     if (!$moduleFiles) {
         return false;
     }
     // load file contents
     $unsortedConfig = new Varien_Simplexml_Config();
     $unsortedConfig->loadString('<config/>');
     $fileConfig = new Varien_Simplexml_Config();
     foreach ($moduleFiles as $filePath) {
         $fileConfig->loadFile($filePath);
         $unsortedConfig->extend($fileConfig);
     }
     // create sorted config [only active modules]
     $sortedConfig = new Varien_Simplexml_Config();
     $sortedConfig->loadString('<config><modules/></config>');
     foreach ($unsortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         if ('true' === (string) $moduleNode->active) {
             $sortedConfig->getNode('modules')->appendChild($moduleNode);
         }
     }
     $fileConfig = new Varien_Simplexml_Config();
     $_finalResult = array();
     $_finalResultAbstract = array();
     foreach ($sortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         $codePool = (string) $moduleNode->codePool;
         $configPath = $this->_codeDir . $codePool . DIRECTORY_SEPARATOR . uc_words($moduleName, DS) . DIRECTORY_SEPARATOR . 'etc' . DS . 'config.xml';
         $fileConfig->loadFile($configPath);
         $rewriteBlocks = array('blocks', 'models', 'helpers');
         foreach ($rewriteBlocks as $param) {
             if (!isset($_finalResult[$param])) {
                 $_finalResult[$param] = array();
             }
             if ($rewrites = $fileConfig->getXpath('global/' . $param . '/*/rewrite')) {
                 foreach ($rewrites as $rewrite) {
                     $parentElement = $rewrite->xpath('../..');
                     foreach ($parentElement[0] as $moduleKey => $moduleItems) {
                         $moduleItemsArray['rewrite'] = array();
                         foreach ($moduleItems->rewrite as $rewriteLine) {
                             foreach ($rewriteLine as $key => $value) {
                                 $moduleItemsArray['rewrite'][$key] = (string) $value;
                             }
                             #$moduleItemsArray['rewrite'] += $rewriteLine->asArray();
                             #echo "<pre>".print_r($moduleItemsArray['rewrite'],1)."</pre>";
                         }
                         if ($moduleItems->rewrite) {
                             //                                $_finalResult[$param] = array_merge_recursive($_finalResult[$param], array($moduleKey => $moduleItems->asArray()));
                             $_finalResult[$param] = array_merge_recursive($_finalResult[$param], array($moduleKey => $moduleItemsArray));
                         }
                     }
                 }
             }
             #echo "<pre>".print_r($_finalResult,1)."</pre>";
             if ($rewrites = $fileConfig->getXpath('global/' . $param . '/*/rewriteabstract')) {
                 foreach ($rewrites as $rewrite) {
                     $parentElement = $rewrite->xpath('../..');
                     foreach ($parentElement[0] as $moduleKey => $moduleItems) {
                         if ($moduleItems->rewriteabstract) {
                             //                                $_finalResultAbstract[$param] = array_merge_recursive($_finalResultAbstract[$param], array($moduleKey => $moduleItems->asArray()));
                             $list = array();
                             foreach ($moduleItems->rewriteabstract->children() as $key => $value) {
                                 $list[$key] = (string) $value;
                             }
                             #echo "<pre>--".print_r($list,1)."</pre>";
                             #echo "<pre>++".print_r($moduleItems->asArray(),1)."</pre>";
                             $_finalResultAbstract[$param] = array($moduleKey => array('rewriteabstract' => $list));
                         }
                     }
                 }
             }
         }
     }
     foreach (array_keys($_finalResult) as $groupType) {
         foreach (array_keys($_finalResult[$groupType]) as $key) {
             // remove some repeating elements after merging all parents
             foreach ($_finalResult[$groupType][$key]['rewrite'] as $key1 => $value) {
                 if (is_array($value)) {
                     $_finalResult[$groupType][$key]['rewrite'][$key1] = array_unique($value);
                 }
                 // if rewrites count < 2 - no conflicts - remove
                 if (gettype($_finalResult[$groupType][$key]['rewrite'][$key1]) == 'array' && count($_finalResult[$groupType][$key]['rewrite'][$key1]) < 2 || gettype($_finalResult[$groupType][$key]['rewrite'][$key1]) == 'string') {
                     unset($_finalResult[$groupType][$key]['rewrite'][$key1]);
                 }
             }
             // clear empty elements
             if (count($_finalResult[$groupType][$key]['rewrite']) < 1) {
                 unset($_finalResult[$groupType][$key]);
             }
         }
         // clear empty elements
         if (count($_finalResult[$groupType]) < 1) {
             unset($_finalResult[$groupType]);
         }
     }
//.........這裏部分代碼省略.........
開發者ID:CherylMuniz,項目名稱:fashion,代碼行數:101,代碼來源:Conflict.php

示例15: getWidgetConfig

 /**
  * Load widget XML config and merge with theme widget config
  *
  * @return Varien_Simplexml_Element|null
  */
 public function getWidgetConfig()
 {
     if ($this->_widgetConfigXml === null) {
         $this->_widgetConfigXml = Mage::getSingleton('Mage_Widget_Model_Widget')->getXmlElementByType($this->getType());
         if ($this->_widgetConfigXml) {
             $configFile = Mage::getDesign()->getFilename('widget.xml', array('_area' => $this->getArea(), '_package' => $this->getPackage(), '_theme' => $this->getTheme(), '_module' => Mage::getConfig()->determineOmittedNamespace(preg_replace('/^(.+?)\\/.+$/', '\\1', $this->getType()), true)));
             if (is_readable($configFile)) {
                 $themeWidgetsConfig = new Varien_Simplexml_Config();
                 $themeWidgetsConfig->loadFile($configFile);
                 if ($themeWidgetTypeConfig = $themeWidgetsConfig->getNode($this->_widgetConfigXml->getName())) {
                     $this->_widgetConfigXml->extend($themeWidgetTypeConfig);
                 }
             }
         }
     }
     return $this->_widgetConfigXml;
 }
開發者ID:relue,項目名稱:magento2,代碼行數:22,代碼來源:Instance.php


注:本文中的Varien_Simplexml_Config::loadFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。