本文整理汇总了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);
}
}
示例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));
}
示例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;
}
示例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);
}
示例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;
}