当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Model_Layout::findTranslationModuleName方法代码示例

本文整理汇总了PHP中Mage_Core_Model_Layout::findTranslationModuleName方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Layout::findTranslationModuleName方法的具体用法?PHP Mage_Core_Model_Layout::findTranslationModuleName怎么用?PHP Mage_Core_Model_Layout::findTranslationModuleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Model_Layout的用法示例。


在下文中一共展示了Mage_Core_Model_Layout::findTranslationModuleName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _collectLayoutHandles

 /**
  * Filter and collect layout handles into array
  *
  * @param Mage_Core_Model_Layout_Element $layoutHandles
  */
 protected function _collectLayoutHandles($layoutHandles)
 {
     if ($layoutHandlesArr = $layoutHandles->xpath('/*/*/label/..')) {
         foreach ($layoutHandlesArr as $node) {
             if ($this->_filterLayoutHandle($node->getName())) {
                 $helper = Mage::helper(Mage_Core_Model_Layout::findTranslationModuleName($node));
                 $this->_layoutHandles[$node->getName()] = $helper->__((string) $node->label);
             }
         }
         asort($this->_layoutHandles, SORT_STRING);
     }
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:17,代码来源:Layout.php

示例2: testFindTranslationModuleNameDefaults

 /**
  * @dataProvider findTranslationModuleNameDefaultsDataProvider
  */
 public function testFindTranslationModuleNameDefaults($node, $moduleName)
 {
     $this->markTestIncomplete('Method it self not finished as has commented out logic.');
     $this->assertEquals($moduleName, Mage_Core_Model_Layout::findTranslationModuleName($node));
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:8,代码来源:Layout.php

示例3: getContainers

 /**
  * Retrieve containers from the update handles that have been already loaded
  *
  * Result format:
  * array(
  *     'container_name' => 'Container Label',
  *     // ...
  * )
  *
  * @return array
  */
 public function getContainers()
 {
     $result = array();
     $containerNodes = $this->asSimplexml()->xpath('//container');
     /** @var $oneContainerNode Mage_Core_Model_Layout_Element */
     foreach ($containerNodes as $oneContainerNode) {
         $helper = Mage::helper(Mage_Core_Model_Layout::findTranslationModuleName($oneContainerNode));
         $result[$oneContainerNode->getAttribute('name')] = $helper->__($oneContainerNode->getAttribute('label'));
     }
     return $result;
 }
开发者ID:nemphys,项目名称:magento2,代码行数:22,代码来源:Update.php

示例4: _collectBlocks

 /**
  * Filter and collect blocks into array
  */
 protected function _collectBlocks()
 {
     if ($blocks = $this->_layoutHandleUpdatesXml->xpath('//block/label/..')) {
         /* @var $block Mage_Core_Model_Layout_Element */
         foreach ($blocks as $block) {
             if ((string) $block->getAttribute('name') && $this->_filterBlock($block)) {
                 $helper = Mage::helper(Mage_Core_Model_Layout::findTranslationModuleName($block));
                 $this->_blocks[(string) $block->getAttribute('name')] = $helper->__((string) $block->label);
             }
         }
     }
     asort($this->_blocks, SORT_STRING);
 }
开发者ID:monkviper,项目名称:magento-lite,代码行数:16,代码来源:Block.php

示例5: _getPageTypeLabelMap

 /**
  * Return the array of page labels from layout indexed by handle names.
  *
  * @return array
  */
 protected function _getPageTypeLabelMap()
 {
     $labelByIdentifier = array();
     $cacheKey = self::PAGE_LABELS_BY_IDENTIFER_MAP_CACHE_ID . '_' . Mage::app()->getStore()->getId();
     $cache = Mage::app()->loadCache($cacheKey);
     if ($cache === false) {
         // Retrieve informations from design
         $design = Mage::getDesign();
         $area = $design->getArea();
         $package = $design->getPackageName();
         $theme = $design->getTheme('layout');
         // Retrieve Layout Informations
         $layoutHandles = $this->getLayout()->getUpdate()->getFileLayoutUpdatesXml($area, $package, $theme);
         $layoutHandlesArr = $layoutHandles->xpath('/*/*/label/..');
         if ($layoutHandlesArr) {
             foreach ($layoutHandlesArr as $node) {
                 $identifier = $node->getName();
                 $helper = Mage::helper(Mage_Core_Model_Layout::findTranslationModuleName($node));
                 $labelByIdentifier[$identifier] = $this->helper('core')->jsQuoteEscape($helper->__((string) $node->label));
             }
         }
         $cacheTags = array(Mage_Core_Model_Layout_Update::LAYOUT_GENERAL_CACHE_TAG);
         Mage::app()->saveCache(serialize($labelByIdentifier), $cacheKey, $cacheTags, 7200);
     } else {
         $labelByIdentifier = unserialize($cache);
     }
     return $labelByIdentifier;
 }
开发者ID:diglin,项目名称:smile-magento-elasticsearch,代码行数:33,代码来源:Base.php


注:本文中的Mage_Core_Model_Layout::findTranslationModuleName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。