本文整理汇总了PHP中Mage_Core_Model_Layout::getUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Layout::getUpdate方法的具体用法?PHP Mage_Core_Model_Layout::getUpdate怎么用?PHP Mage_Core_Model_Layout::getUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Layout
的用法示例。
在下文中一共展示了Mage_Core_Model_Layout::getUpdate方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
$this->_layout = Mage::getModel('Mage_Core_Model_Layout', array('area' => 'adminhtml'));
$this->_layout->getUpdate()->load('layout_test_grid_handle');
$this->_layout->generateXml();
$this->_layout->generateElements();
$this->_block = $this->_layout->getBlock('admin.test.grid.massaction');
}
示例2: setUp
protected function setUp()
{
/** @var $themeUtility Mage_Core_Utility_Theme */
$themeUtility = Mage::getModel('Mage_Core_Utility_Theme', array(dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'design', Mage::getDesign()));
$themeUtility->registerThemes()->setDesignTheme('test/default', 'frontend');
/* Disable loading and saving layout cache */
Mage::app()->getCacheInstance()->banUse('layout');
$this->_layout = Mage::getModel('Mage_Core_Model_Layout');
$this->_layout->getUpdate()->addHandle('layout_test_handle_main');
$this->_layout->getUpdate()->load('layout_test_handle_extra');
}
示例3: getBlock
/**
* Get block
*
* @param string $blockName
* @return Mage_Core_Block_Abstract
*/
public function getBlock($blockName)
{
/** @var $layout Mage_Core_Model_Layouts */
$this->_prepareLayout();
$this->_layout->getUpdate()->load($this->_getHandles());
$this->_layout->generateXml()->generateBlocks();
$block = $this->_layout->getBlock($blockName);
$this->unsetLayout();
return $block;
}
示例4: testLayoutObjectArgumentUpdatersDirective
public function testLayoutObjectArgumentUpdatersDirective()
{
$layout = new Mage_Core_Model_Layout();
$layout->getUpdate()->load(array('layout_test_handle_arguments_object_type_updaters'));
$layout->generateXml()->generateElements();
$expectedObjectData = array(0 => 'updater call', 1 => 'updater call', 2 => 'updater call');
$expectedSimpleData = 2;
$block = $layout->getBlock('block_with_object_updater_args')->getOne();
$this->assertInstanceOf('Mage_Core_Block_Text', $block);
$this->assertEquals($expectedObjectData, $block->getUpdaterCall());
$this->assertEquals($expectedSimpleData, $layout->getBlock('block_with_object_updater_args')->getTwo());
}
示例5: _generateBlockLayoutXML
protected function _generateBlockLayoutXML($blockName)
{
if (self::$_layoutXml == null) {
self::$_layoutXml = Mage::app()->getLayout()->getUpdate()->asSimplexml();
}
$sections = self::$_layoutXml->xpath("//block[@name='{$blockName}'] | //reference[@name='{$blockName}']");
$layoutXml = '';
foreach ($sections as $section) {
$layoutXml .= $this->_generateSubBlockLayoutXml($section);
}
$layout = new Mage_Core_Model_Layout();
$layout->getUpdate()->addUpdate($layoutXml);
$layout->generateXml();
$layoutXml = $layout->getXmlString();
return $layoutXml;
}
示例6: testGetUpdate
public function testGetUpdate()
{
$this->assertInstanceOf('Mage_Core_Model_Layout_Update', $this->_layout->getUpdate());
}
示例7: testGenerateElementsBroken
/**
* @expectedException Magento_Exception
*/
public function testGenerateElementsBroken()
{
$layout = new Mage_Core_Model_Layout();
$layout->getUpdate()->load('layout_test_handle_remove_broken');
$layout->generateXml()->generateElements();
}
示例8: setUp
protected function setUp()
{
$this->_layout = new Mage_Core_Model_Layout();
$this->_layout->getUpdate()->addHandle('layout_test_handle_main');
$this->_layout->getUpdate()->load('layout_test_handle_extra');
}
示例9: _hasBlockInXml
/**
* @param string $blockType
* @param Mage_Core_Model_Layout $layout
* @return bool
*/
protected function _hasBlockInXml($blockType, $layout)
{
/* @var $xml Mage_Core_Model_Layout_Element */
$xml = $layout->getUpdate()->asSimplexml();
return $blocks = $xml->xpath("//block[@type='{$blockType}']");
}
示例10: addAssets
public function addAssets(Mage_Core_Model_Layout $layout)
{
$head = $layout->getBlock('head');
$content = $layout->getBlock('content');
if ($head && $content) {
$head->addCss('webforms/form.css');
$head->addJs('prototype/window.js');
$head->addItem('js_css', 'prototype/windows/themes/default.css');
$head->addItem('js_css', 'prototype/windows/themes/alphacube.css');
// logic
$head->addJs('webforms/logic.js');
// stars
$head->addJs('webforms/stars.js');
$head->addCss('webforms/stars.css');
// tooltips
$head->addJs('webforms/HelpBalloon.js');
$head->addCss('webforms/helpballoon.css');
// wysiwyg
$head->addJs('tiny_mce/tiny_mce.js');
// calendar
$head->addJs('calendar/calendar.js');
$head->addJs('calendar/calendar-setup.js');
$head->addItem('js_css', 'calendar/calendar-blue.css');
// ajax file uploader
if (Mage::getStoreConfig('webforms/files/ajax')) {
if (Mage::getStoreConfig('webforms/files/load_jquery')) {
$head->addJs('webforms/jQuery/jquery-1.7.1.min.js');
$head->addJs('webforms/jQuery/no-conflict.js');
}
$head->addJs('webforms/blueimp/js/vendor/jquery.ui.widget.js');
$head->addJs('webforms/blueimp/js/jquery.iframe-transport.js');
$head->addJs('webforms/blueimp/js/jquery.fileupload.js');
$head->addCss('webforms/file-upload.css');
}
}
if (in_array('cms_page', $layout->getUpdate()->getHandles()) || in_array('webforms_index_index', $layout->getUpdate()->getHandles())) {
if (!$this->isProduction()) {
Mage::getSingleton('core/session')->addError($this->getNote());
}
}
// add custom assets
Mage::dispatchEvent('webforms_add_assets', array('layout' => $layout));
return $this;
}
示例11: updateLayoutHandles
public function updateLayoutHandles()
{
foreach ($this->layoutHandles as $layoutHandle) {
$this->layout->getUpdate()->addHandle($layoutHandle);
}
}
示例12: _addUpdate
/**
* Add a custom layout update.
*
* @param Mage_Core_Model_Layout $layout The current layout instance.
* @param string $xml The layout update XML.
*
* @return void
*/
protected function _addUpdate(Mage_Core_Model_Layout $layout, $xml)
{
$update = simplexml_load_string('<update_xml>' . $xml . '</update_xml>', $layout->getUpdate()->getElementClass());
$layout->getUpdate()->addUpdate($xml);
}