/**
  * Add RP link to tab if we have all rates
  *
  * @return Enterprise_Reward_Block_Customer_Account
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
     if ($navigationBlock && Mage::helper('enterprise_reward')->isEnabledOnFront()) {
         $navigationBlock->addLink('enterprise_reward', 'enterprise_reward/customer/info/', Mage::helper('enterprise_reward')->__('Reward Points'));
     }
     return $this;
 }
Esempio n. 2
0
 protected function _prepareLayout()
 {
     $head = $this->getLayout()->getBlock('head');
     $head->addItem('js_css', 'sm/dynamicslideshow/rs-plugin/css/settings.css');
     $head->addLinkRel('stylesheet', $this->getUrl('dynamicslideshow/index/getCssCaptions'));
     if (Mage::app()->getRequest()->getActionName() == 'preview') {
         $head->addJs('sm/dynamicslideshow/js/jquery-1.11.1.min.js');
         $head->addJs('sm/dynamicslideshow/js/jquery-noconflict.js');
     }
     return parent::_prepareLayout();
 }
Esempio n. 3
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $parentBlock = $this->getParentBlock();
     if (!$parentBlock) {
         #Mage::Log("block is empty!");
         return;
     }
     $parentBlock->addLink($this->_('Approve Orders'), 'corporate/quote/approve', $this->_('Approve Orders'), true, array(), 50, null);
     //public function addLink($label, $url='', $title='', $prepare=false, $urlParams=array(),
     //$position=null, $liParams=null, $aParams=null, $beforeText='', $afterText='')
     // see Mage_Page_Block_Template_Links::addLink()
     return $this;
 }
Esempio n. 4
0
 protected function _prepareLayout()
 {
     $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Delete Option'), 'class' => 'delete delete-product-option ')));
     $path = 'global/catalog/product/options/custom/groups';
     foreach (Mage::getConfig()->getNode($path)->children() as $group) {
         $this->setChild($group->getName() . '_option_type', $this->getLayout()->createBlock((string) Mage::getConfig()->getNode($path . '/' . $group->getName() . '/render')));
         //            echo (string) Mage::getConfig()->getNode($path . '/' . $group->getName() . '/render').'<br>';
         //            echo (string) $group->getName() . '_option_type'.'<br>';
     }
     $scene7groups = Achang_Scene7_Model_System_Config_Source_Product_Options_Type::getScene7OptionGroups();
     foreach ($scene7groups as $k => $v) {
         $this->setChild($k . '_option_type', $this->getLayout()->createBlock($v['render']));
     }
     return Mage_Core_Block_Abstract::_prepareLayout();
 }
 protected function _prepareLayout()
 {
     $product = Mage::registry('product');
     if (!($setId = $product->getAttributeSetId())) {
         $setId = $this->getRequest()->getParam('set', null);
     }
     if ($setId) {
         /* @var $block Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs */
         $block = $this->getLayout()->getBlock('product_tabs');
         if (!$block) {
             // This case occurs for example during the first step of configurable product creation
             return parent::_prepareLayout();
         }
         $data = array('tabs' => $block, 'request' => $this->getRequest());
         Mage::dispatchEvent('ayaline_core_adminhtml_catalog_product_tabs_initializer', $data);
     }
     return parent::_prepareLayout();
 }
Esempio n. 6
0
 /**
  * Prepare global layout
  *
  * @return Mage_Cms_Block_Page
  */
 protected function _prepareLayout()
 {
     $page = $this->getPage();
     // show breadcrumbs
     if (Mage::getStoreConfig('web/default/show_cms_breadcrumbs') && ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) && $page->getIdentifier() !== Mage::getStoreConfig('web/default/cms_home_page') && $page->getIdentifier() !== Mage::getStoreConfig('web/default/cms_no_route')) {
         $breadcrumbs->addCrumb('home', array('label' => Mage::helper('cms')->__('Home'), 'title' => Mage::helper('cms')->__('Go to Home Page'), 'link' => Mage::getBaseUrl()));
         $breadcrumbs->addCrumb('cms_page', array('label' => $page->getTitle(), 'title' => $page->getTitle()));
     }
     $root = $this->getLayout()->getBlock('root');
     if ($root) {
         $root->addBodyClass('cms-' . $page->getIdentifier());
     }
     $head = $this->getLayout()->getBlock('head');
     if ($head) {
         $head->setTitle($page->getTitle());
         $head->setKeywords($page->getMetaKeywords());
         $head->setDescription($page->getMetaDescription());
     }
     return parent::_prepareLayout();
 }
 /**
  * Prepare Global Layout
  *
  * @return Enterprise_Cms_Block_Hieararchy_Head
  */
 protected function _prepareLayout()
 {
     /* @var $node Enterprise_Cms_Model_Hierarchy_Node */
     $node = Mage::registry('current_cms_hierarchy_node');
     /* @var $head Mage_Page_Block_Html_Head */
     $head = $this->getLayout()->getBlock('head');
     if (Mage::helper('enterprise_cms/hierarchy')->isMetadataEnabled() && $node && $head) {
         $treeMetaData = $node->getTreeMetaData();
         if (is_array($treeMetaData)) {
             /* @var $linkNode Enterprise_Cms_Model_Hierarchy_Node */
             if ($treeMetaData['meta_cs_enabled']) {
                 $linkNode = $node->getMetaNodeByType(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_CHAPTER);
                 if ($linkNode->getId()) {
                     $head->addLinkRel(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_CHAPTER, $linkNode->getUrl());
                 }
                 $linkNode = $node->getMetaNodeByType(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_SECTION);
                 if ($linkNode->getId()) {
                     $head->addLinkRel(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_SECTION, $linkNode->getUrl());
                 }
             }
             if ($treeMetaData['meta_next_previous']) {
                 $linkNode = $node->getMetaNodeByType(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_NEXT);
                 if ($linkNode->getId()) {
                     $head->addLinkRel(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_NEXT, $linkNode->getUrl());
                 }
                 $linkNode = $node->getMetaNodeByType(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_PREVIOUS);
                 if ($linkNode->getId()) {
                     $head->addLinkRel(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_PREVIOUS, $linkNode->getUrl());
                 }
             }
             if ($treeMetaData['meta_first_last']) {
                 $linkNode = $node->getMetaNodeByType(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_FIRST);
                 if ($linkNode->getId()) {
                     $head->addLinkRel(Enterprise_Cms_Model_Hierarchy_Node::META_NODE_TYPE_FIRST, $linkNode->getUrl());
                 }
             }
         }
     }
     return parent::_prepareLayout();
 }
Esempio n. 8
0
 protected function _prepareLayout()
 {
     if (!Mage::helper('firecheckout')->canUseCaptchaModule()) {
         return parent::_prepareLayout();
     }
     /**
      * @var Mage_Core_Model_Layout
      */
     $layout = $this->getLayout();
     $login = $layout->getBlock('customer.login');
     if ($login) {
         $list = $layout->createBlock('core/text_list', 'form.additional.info');
         $captcha = $layout->createBlock('captcha/captcha', 'captcha.login.checkout');
         $captcha->setFormId('user_login')->setImgWidth(230)->setImgHeight(50);
         $list->append($captcha);
         $login->append($list);
     }
     $forgot = $layout->getBlock('customer.forgot');
     if ($forgot) {
         $list = $layout->createBlock('core/text_list', 'form.additional.info');
         $captcha = $layout->createBlock('captcha/captcha', 'captcha.forgot.checkout');
         $captcha->setFormId('user_forgotpassword')->setImgWidth(230)->setImgHeight(50);
         $list->append($captcha);
         $forgot->append($list);
     }
     $billing = $layout->getBlock('checkout.onepage.billing');
     if ($billing) {
         $list = $layout->createBlock('core/text_list', 'form.additional.info');
         $captcha = $layout->createBlock('captcha/captcha', 'captcha.guest.checkout');
         $captcha->setFormId('guest_checkout')->setImgWidth(230)->setImgHeight(50);
         $list->append($captcha);
         $captcha = $layout->createBlock('captcha/captcha', 'captcha.register.during.checkout');
         $captcha->setFormId('register_during_checkout')->setImgWidth(230)->setImgHeight(50);
         $list->append($captcha);
         $billing->append($list);
     }
     return parent::_prepareLayout();
 }
Esempio n. 9
0
	protected function _prepareLayout() {

		/*
		 * Doesn't work on inline widgets because layout isn't loaded until
		 * after the head has been written to the page. Fix.
		 *
		if($this->getLayout()->getBlock('janrain_engage_styles')==false) {
			$block = $this->getLayout()
				->createBlock('core/template', 'janrain_engage_styles')
				->setTemplate('janrain/engage/styles.phtml');
			$this->getLayout()->getBlock('head')->insert($block);
		}
		*/

		if($this->getLayout()->getBlock('janrain_engage_scripts')==false) {
			$block = $this->getLayout()
				->createBlock('core/template', 'janrain_engage_scripts')
				->setTemplate('janrain/engage/scripts.phtml');
			$this->getLayout()->getBlock('before_body_end')->insert($block);
		}

		parent::_prepareLayout();
	}
Esempio n. 10
0
 protected function _prepareLayout()
 {
     // Notifies Magento Booster that the Layered Navigation is loaded
     Mage::register('adjustware_layered_navigation_view', true, true);
     //remove Enterprise_PageCache data
     Mage::app()->getCache()->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(Enterprise_PageCache_Model_Processor::CACHE_TAG));
     // get current category ID
     $category = Mage::registry('current_category');
     if ($category) {
         $iCurrentCatId = $category->getId();
     } else {
         $iCurrentCatId = null;
     }
     // get last cat ID
     $sessionObject = Mage::getSingleton('catalog/session');
     $request = Mage::app()->getRequest();
     if ($sessionObject && ($iLastCatId = $sessionObject->getAdjnavLastCategoryId())) {
         if ($iCurrentCatId != $iLastCatId && !$request->isXmlHttpRequest()) {
             Mage::register('adjnav_new_category', true);
         }
     }
     $sessionObject->setAdjnavLastCategoryId($iCurrentCatId);
     //preload setting
     $this->setIsRemoveLinks(Mage::getStoreConfig('design/adjnav/remove_links'));
     //blocks
     $this->createCategoriesBlock();
     $filterableAttributes = $this->_getFilterableAttributes();
     // we rewrite this piece of code
     // to make sure price filter is applied last
     $blocks = array();
     foreach ($filterableAttributes as $attribute) {
         #print_r($attribute);
         $blockType = 'adjnav/catalog_layer_filter_attribute';
         if ($attribute->getFrontendInput() == 'price') {
             $blockType = 'adjnav/catalog_layer_filter_price';
         }
         $name = $attribute->getAttributeCode() . '_filter';
         $blocks[$name] = $this->getLayout()->createBlock($blockType)->setLayer($this->getLayer())->setAttributeModel($attribute);
         $this->setChild($name, $blocks[$name]);
     }
     foreach ($blocks as $name => $block) {
         #echo "<br>" . $name . "<br>";
         $block->init();
         if (Mage::helper('adjnav')->isSolrEnabled()) {
             $block->addFacetCondition();
         }
     }
     $this->getLayer()->apply();
     return Mage_Core_Block_Abstract::_prepareLayout();
 }
Esempio n. 11
0
 protected function _prepareLayout()
 {
     return Mage_Core_Block_Abstract::_prepareLayout();
 }