public function getButtonsHtml($area = NULL) { $html = parent::getButtonsHtml($area); if ($area != 'footer') { return $html; } $cancelWord = Mage::helper('M2ePro')->__('Cancel'); // --------------------------------------- $callback = 'function(params) { EbayListingSettingsGridHandlerObj.saveSettings(params); }'; $data = array('class' => 'save', 'label' => Mage::helper('M2ePro')->__('Save'), 'onclick' => 'EbayListingTemplateSwitcherHandlerObj.saveSwitchers(' . $callback . ')'); $saveButtonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data); // --------------------------------------- // --------------------------------------- $html .= '<div style="height: 25px;"></div>'; // --------------------------------------- $html .= <<<HTML <div style="position: absolute; text-align: right; bottom: 0; padding: 10px 0 10px 0; background: #fff; width: 950px;"> <span style="padding-left: 10px;"> <a href="javascript:void(0);" onclick="Windows.getFocusedWindow().close();">{$cancelWord}</a> </span> <span style="padding-left: 10px;">{$saveButtonBlock->toHtml()}</span> </div> HTML; return $html; }
public function getButtonsHtml($area = null) { $out = parent::getButtonsHtml($area); $sliderId = Mage::registry('advancedslider_slide_data')->getSliderId(); $slideId = Mage::registry('advancedslider_slide_data')->getSlideId(); $collection = Mage::getModel('advancedslider/slides')->getCollection()->addFieldToFilter('slider_id', array('eq' => $sliderId))->addFieldToFilter('slide_id', array('neq' => $slideId))->setOrder('sort_order', 'asc'); $options = array(0 => $this->__('--Go to a Slide--')); foreach ($collection as $item) { $options[$item->getId()] = $item->getId() . ' / ' . $item->getTitle(); } if (count($options) == 1) { return $out; } $select = Mage::app()->getLayout()->createBlock('core/html_select')->setName('goToSlide')->setId('goToSlide')->setTitle($this->__('Go to a Slide'))->setValue(0)->setOptions($options)->setExtraParams('onchange="setLocation(\'' . Mage::helper('adminhtml')->getUrl('advancedslider/slides/edit', array('id' => '{{id}}')) . '\'.replace(\'{{id}}\', this.options[this.selectedIndex].value));"'); return $select->getHtml() . $out; }