public function _prepareLayout() { parent::_prepareLayout(); $head = $this->getLayout()->getBlock('head'); $sliders = Mage::registry('sliders'); $slides = Mage::registry('slides'); $backUrl = $this->getUrl('*/*/edit', array('id' => $sliders->getId(), 'activeTab' => 'slides_section')); $deleteUrl = $this->getUrl('*/*/deleteSlide', array('id' => $slides->getId(), 'sid' => $sliders->getId())); $this->updateButton('delete', 'onclick', "setLocation('{$deleteUrl}');"); $this->updateButton('save', 'onclick', 'DnmSl.save();'); $this->updateButton('back', 'onclick', 'setLocation(\'' . $backUrl . '\');'); $this->_addButton('sac', array('label' => Mage::helper('dynamicslideshow')->__('Save and Continue Edit'), 'class' => 'save', 'onclick' => "DnmSl.save(true);")); if ($sliders->getId()) { if ($sliders->getData('load_googlefont') == 'yes') { $fonts = $sliders->getData('google_font'); if (is_array($fonts)) { foreach ($fonts as $font) { $href = Mage::helper('dynamicslideshow')->getCssHref($font); $head->addLinkRel('stylesheet', $href); } } } } return $this; }
protected function _prepareLayout() { parent::_prepareLayout(); if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } }
protected function _prepareLayout() { if ($this->_blockGroup && $this->_controller && $this->_mode) { $this->setChild('form', $this->getLayout()->createBlock('pws_faq/adminhtml_faq_articles_edit_form')); } return parent::_prepareLayout(); }
/** * Prepare layout * * @return mixed */ protected function _prepareLayout() { $this->setChild('form', $this->getLayout()->createBlock('magemonitoring/tab_form')); $tabList = $this->getLayout()->createBlock('magemonitoring/tab_list', 'magemonitoring_tabs'); $this->getLayout()->getBlock('left')->append($tabList); return parent::_prepareLayout(); }
/** * @return Mage_Core_Block_Abstract */ protected function _prepareLayout() { /* @var Open_Gallery_Model_Item $item */ $item = Mage::registry('item'); $this->_formScripts = $item->getHelper()->prepareEditFormScripts($item, $this->_formScripts); return parent::_prepareLayout(); }
public function _prepareLayout() { parent::_prepareLayout(); $head = $this->getLayout()->getBlock('head'); $slider = Mage::registry('revslider'); $slide = Mage::registry('revslide'); $backUrl = $this->getUrl('*/*/edit', array('id' => $slider->getId(), 'activeTab' => 'slide_section')); $deleteUrl = $this->getUrl('*/*/deleteSlide', array('id' => $slide->getId(), 'sid' => $slider->getId())); $this->updateButton('delete', 'onclick', "setLocation('{$deleteUrl}');"); $this->updateButton('save', 'onclick', 'revLayer.save();'); $this->updateButton('back', 'onclick', 'setLocation(\'' . $backUrl . '\');'); $this->_addButton('sac', array('label' => Mage::helper('revslider')->__('Save and Continue Edit'), 'class' => 'save', 'onclick' => "revLayer.save(true);")); if (version_compare(Mage::getVersion(), '1.7.0.0') < 0) { $head->addJs('am/extensions/prototype/dragdrop.js'); } if ($slider->getId()) { if ($slider->getData('load_googlefont') == 'true') { $fonts = $slider->getData('google_font'); if (is_array($fonts)) { foreach ($fonts as $font) { $href = Mage::helper('revslider')->getCssHref($font); $head->addLinkRel('stylesheet', $href); } } } } return $this; }
protected function _prepareLayout() { if (Mage::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true) && Mage::helper('googleoptimizer')->isOptimizerActive(Mage::app()->getStore()->getStoreId())) { $this->setChild('googleoptimizer_js', $this->getLayout()->createBlock('googleoptimizer/js')->setTemplate('googleoptimizer/js.phtml')); } return parent::_prepareLayout(); }
protected function _prepareLayout() { if (!Mage::registry('current_customer')->isReadonly()) { $this->_addButton('save_and_continue', array('label' => Mage::helper('customer')->__('Save and Continue Edit'), 'onclick' => 'saveAndContinueEdit(\'' . $this->_getSaveAndContinueUrl() . '\')', 'class' => 'save'), 10); } return parent::_prepareLayout(); }
protected function _prepareLayout() { if ($this->_blockGroup && $this->_controller && $this->_mode) { $this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup . '/' . $this->_controller . '_' . $this->_mode . '_form')); } return parent::_prepareLayout(); }
/** * Set the custom form block * * @return $this */ protected function _prepareLayout() { // Allows a custom child form block $this->_mode = false; $this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup . '/' . $this->_controller . '_form')); return parent::_prepareLayout(); }
/** * Prepare catalog event form or category selector * * @return Enterprise_CatalogEvent_Block_Adminhtml_Event_Edit */ protected function _prepareLayout() { if (!$this->getEvent()->getId() && !$this->getEvent()->getCategoryId()) { $this->_removeButton('save'); $this->_removeButton('reset'); } else { $this->_addButton('save_and_continue', array('label' => $this->helper('enterprise_catalogevent')->__('Save and Continue Edit'), 'class' => 'save', 'onclick' => 'saveAndContinue()'), 1); $this->_formScripts[] = ' function saveAndContinue() { if (editForm.validator.validate()) { $(editForm.formId).insert({bottom: \'<\' + \'input type="hidden" name="_continue" value="1" /\' + \'>\' }); editForm.submit(); } } '; } parent::_prepareLayout(); if (!$this->getEvent()->getId() && !$this->getEvent()->getCategoryId()) { $this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup . '/' . $this->_controller . '_' . $this->_mode . '_category')); } if ($this->getRequest()->getParam('category')) { $this->_updateButton('back', 'label', $this->helper('enterprise_catalogevent')->__('Back to Category')); } if ($this->getEvent()->isReadonly() && $this->getEvent()->getImageReadonly()) { $this->_removeButton('save'); $this->_removeButton('reset'); $this->_removeButton('save_and_continue'); } if (!$this->getEvent()->isDeleteable()) { $this->_removeButton('delete'); } return $this; }
protected function _prepareLayout() { if ($this->_getStatus()->status_key) { $this->_removeButton("delete"); } parent::_prepareLayout(); }
protected function _prepareLayout() { // return false; $this->_addButton('save_and_continue', array('label' => $this->__('Save And Continue Edit'), 'onclick' => 'editForm.submit(\'' . $this->_getSaveAndContinueUrl() . '\')', 'class' => 'save'), 10); $this->_addButton('parse', array('label' => $this->__('Parse'), 'onclick' => "setLocation('{$this->getUrl('*/*/parse', array('_current' => true))}')"), 10); return parent::_prepareLayout(); }
protected function _prepareLayout() { parent::_prepareLayout(); // add scripts $js = $this->getLayout()->createBlock('core/template', 'webforms_js', array('template' => 'webforms/js.phtml', 'tabs_block' => 'webforms_fields_tabs')); $this->getLayout()->getBlock('content')->append($js); }
protected function _prepareLayout() { $this->setChild('form', $this->getLayout()->createBlock('cores/Adminhtml_Cadastro_Form')); Mage::app()->getLayout()->getBlock('head')->addJs('cores/spectrum.js'); Mage::app()->getLayout()->getBlock('head')->addItem('skin_css', 'images/cores/spectrum.css'); return parent::_prepareLayout(); }
/** * file location: * your_magento_location/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php */ protected function _prepareLayout() { $this->addButton('preview', array('label' => $this->__('Preview & Save Data'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/preview') . '\')', 'class' => 'save')); $this->_removeButton('save'); //$this->setChild('grid', $this->getLayout()->createBlock('adminhtml/catalog_product_grid', 'product.grid')); return parent::_prepareLayout(); }
protected function _prepareLayout() { if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } $deal = Mage::registry('collpur_deal'); if ($deal->isOpen()) { $this->_removeButton('delete'); if (!$deal->getData('is_success')) { $closeFailedJs = 'deleteConfirm(\'' . Mage::helper('collpur')->__('Are you sure? All purchases, connected to this deal, will be refunded') . '\', \'' . $this->getUrl('collpur_admin/adminhtml_deal/closeAsFailed', array('id' => $deal->getId())) . '\');'; $this->_addButton('close_as_failed', array('label' => $this->__('Close as Failed'), 'onclick' => $closeFailedJs)); } if ($deal->getData('is_success')) { $closeSuccessJs = 'deleteConfirm(\'' . Mage::helper('collpur')->__('Are you sure?') . '\', \'' . $this->getUrl('collpur_admin/adminhtml_deal/closeAsSuccess', array('id' => $deal->getId())) . '\');'; $this->_addButton('close_as_success', array('label' => $this->__('Close as Success'), 'onclick' => $closeSuccessJs)); } } if ($deal->isOpen() || !$deal->getId()) { $this->_addButton('save_and_continue', array('label' => Mage::helper('customer')->__('Save and Continue Edit'), 'onclick' => 'saveAndContinueEdit(\'' . $this->_getSaveAndContinueUrl() . '\')', 'class' => 'save'), 10); } if ($deal->isClosed()) { $archiveJs = 'deleteConfirm(\'' . Mage::helper('collpur')->__('Are you sure?') . '\', \'' . $this->getUrl('collpur_admin/adminhtml_deal/archive', array('id' => $deal->getId())) . '\');'; $this->_addButton('archive', array('label' => $this->__('Archive'), 'onclick' => $archiveJs)); $reopenJs = 'deleteConfirm(\'' . Mage::helper('collpur')->__('Are you sure?') . '\', \'' . $this->getUrl('collpur_admin/adminhtml_deal/reopen', array('id' => $deal->getId())) . '\');'; $this->_addButton('reopen', array('label' => $this->__('Reopen'), 'onclick' => $reopenJs)); } if ($deal->isClosed() || $deal->isArchived()) { $this->_removeButton('save'); $this->_removeButton('save_and_edit_button'); } return parent::_prepareLayout(); }
protected function _prepareLayout(){ parent::_prepareLayout(); if((float)substr(Mage::getVersion(),0,3) > 1.3 && substr(Mage::getVersion(),0,5)!= '1.4.0') if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } }
/** * Prepare layout * * @return Mage_Core_Block_Abstract */ protected function _prepareLayout() { if ($head = $this->getLayout()->getBlock('head')) { $head->setCanLoadExtJs(true); } return parent::_prepareLayout(); }
protected function _prepareLayout() { parent::_prepareLayout(); $form = $this->getChild('form'); if ($form) { $form->addData($this->getFormData() ? $this->getFormData() : array())->setContainer($this); } }
protected function _prepareLayout() { $this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('storelocator')->__('Back'), 'onclick' => "window.location.href = '" . $this->getUrl('*/*') . "'", 'class' => 'back'))); $this->setChild('reset_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('storelocator')->__('Reset'), 'onclick' => 'window.location.href = window.location.href'))); $this->setChild('save_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('storelocator')->__('Save'), 'onclick' => 'storelocatorControl.save();', 'class' => 'save'))); $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('storelocator')->__('Delete'), 'onclick' => 'storelocatorControl._delete();', 'class' => 'delete'))); return parent::_prepareLayout(); }
protected function _prepareLayout() { // Load Wysiwyg on demand and Prepare layout if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled() && ($block = $this->getLayout()->getBlock('head'))) { $block->setCanLoadTinyMce(true); } parent::_prepareLayout(); }
/** * Prepare layout. * Adding save_and_continue button * * @return Mage_Adminhtml_Block_System_Variable_Edit */ protected function _preparelayout() { $this->_addButton('save_and_edit', array('label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form')))), 100); if (!$this->getVariable()->getId()) { $this->removeButton('delete'); } return parent::_prepareLayout(); }
protected function _prepareLayout() { $category = AO::registry('current_category'); if (AO::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true) && AO::helper('googleoptimizer')->isOptimizerActive($category->getStoreId())) { $this->setChild('googleoptimizer_js', $this->getLayout()->createBlock('googleoptimizer/js')->setTemplate('googleoptimizer/js.phtml')); } return parent::_prepareLayout(); }
public function _prepareLayout() { if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled() && ($block = $this->getLayout()->getBlock('head'))) { $block->setCanLoadTinyMce(true); //$block->setCanLoadExtJs(true); } return parent::_prepareLayout(); }
protected function _prepareLayout() { parent::_prepareLayout(); $this->_updateButton('save', 'label', $this->__('Save Queue Item')); $this->_addButton('save_and_continue', array('label' => $this->__('Save and Continue Edit'), 'onclick' => 'saveAndContinueEdit()', 'class' => 'save'), 100); $this->_formScripts[] = "\n function saveAndContinueEdit () {\n editForm.submit(\$('edit_form').action ='back/edit';\n }\n "; return $this; }
/** * Prepare layout. * Adding save_and_continue button * * @return Mage_Adminhtml_Block_System_Variable_Edit */ protected function _preparelayout() { $this->_addButton('save_and_edit', array('label' => Mage::helper('adminhtml')->__('Save and Continue Edit'), 'class' => 'save', 'onclick' => 'editForm.submit(\'' . $this->getSaveAndContinueUrl() . '\');'), 100); if (!$this->getVariable()->getId()) { $this->removeButton('delete'); } return parent::_prepareLayout(); }
/** * Prepare layout. * Adding save_and_continue button * * @return Mage_Widget_Block_Adminhtml_Widget_Instance_Edit */ protected function _preparelayout() { if ($this->getWidgetInstance()->isCompleteToCreate()) { $this->_addButton('save_and_edit_button', array('label' => Mage::helper('Mage_Widget_Helper_Data')->__('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form')))), 100); } else { $this->removeButton('save'); } return parent::_prepareLayout(); }
/** * Prepare layout. * Adding save_and_continue button * * @return Mage_Widget_Block_Adminhtml_Widget_Instance_Edit */ protected function _preparelayout() { if ($this->getWidgetInstance()->isCompleteToCreate()) { $this->_addButton('save_and_edit_button', array('label' => Mage::helper('widget')->__('Save and Continue Edit'), 'class' => 'save', 'onclick' => 'saveAndContinueEdit()'), 100); } else { $this->removeButton('save'); } return parent::_prepareLayout(); }
protected function _prepareLayout() { parent::_prepareLayout(); if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { /** @var Mage_Adminhtml_Block_Page_Head $head */ $head = $this->getLayout()->getBlock('head'); $head->setCanLoadTinyMce(true); } }