本文整理汇总了PHP中Mage_Adminhtml_Block_Template::_beforeToHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Template::_beforeToHtml方法的具体用法?PHP Mage_Adminhtml_Block_Template::_beforeToHtml怎么用?PHP Mage_Adminhtml_Block_Template::_beforeToHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Adminhtml_Block_Template
的用法示例。
在下文中一共展示了Mage_Adminhtml_Block_Template::_beforeToHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
$data = array('class' => 'close-btn', 'label' => Mage::helper('M2ePro')->__('Close'), 'onclick' => 'Windows.getFocusedWindow().close()');
$this->setChild('close_btn', $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data));
return $this;
}
示例2: _beforeToHtml
public function _beforeToHtml()
{
$this->_currency = Mage::getModel('directory/currency')->load(Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE));
$this->_collection = Mage::getResourceModel('sales/sale_collection')->setCustomerFilter(Mage::registry('current_customer'))->setOrderStateFilter(Mage_Sales_Model_Order::STATE_CANCELED, true)->load();
$this->_groupedCollection = array();
foreach ($this->_collection as $sale) {
if (!is_null($sale->getStoreId())) {
$store = Mage::app()->getStore($sale->getStoreId());
$websiteId = $store->getWebsiteId();
$groupId = $store->getGroupId();
$storeId = $store->getId();
$sale->setWebsiteId($store->getWebsiteId());
$sale->setWebsiteName($store->getWebsite()->getName());
$sale->setGroupId($store->getGroupId());
$sale->setGroupName($store->getGroup()->getName());
} else {
$websiteId = 0;
$groupId = 0;
$storeId = 0;
$sale->setStoreName(Mage::helper('customer')->__('Deleted Stores'));
}
$this->_groupedCollection[$websiteId][$groupId][$storeId] = $sale;
$this->_websiteCounts[$websiteId] = isset($this->_websiteCounts[$websiteId]) ? $this->_websiteCounts[$websiteId] + 1 : 1;
}
return parent::_beforeToHtml();
}
示例3: _beforeToHtml
protected function _beforeToHtml()
{
//-------------------------------
$defaultStoreId = Mage::helper('M2ePro/Magento_Store')->getDefaultStoreId();
$countries = Mage::getModel('Adminhtml/System_Config_Source_Country')->toOptionArray();
$countries[0] = array('value' => '', 'label' => '');
$this->setData('countries', $countries);
$this->setData('country', Mage::getStoreConfig('general/country/default', $defaultStoreId));
//-------------------------------
$userId = Mage::getSingleton('admin/session')->getUser()->getId();
$user = Mage::getModel('admin/user')->load($userId)->getData();
$tempPath = defined('Mage_Shipping_Model_Config::XML_PATH_ORIGIN_CITY') ? Mage_Shipping_Model_Config::XML_PATH_ORIGIN_CITY : 'shipping/origin/city';
$user['city'] = Mage::getStoreConfig($tempPath, $defaultStoreId);
$tempPath = defined('Mage_Shipping_Model_Config::XML_PATH_ORIGIN_POSTCODE') ? Mage_Shipping_Model_Config::XML_PATH_ORIGIN_POSTCODE : 'shipping/origin/postcode';
$user['postal_code'] = Mage::getStoreConfig($tempPath, $defaultStoreId);
$this->addData($user);
//-------------------------------
//-------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => '', 'id' => 'license_popup_confirm_button'));
$this->setChild('license_popup_confirm_button', $buttonBlock);
//-------------------------------
//-------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Sign into eBay'), 'onclick' => '', 'id' => 'sign_into_ebay_button'));
$this->setChild('sign_into_ebay_button', $buttonBlock);
//-------------------------------
//-------------------------------
$url = 'https://scgi.ebay.com/ws/eBayISAPI.dll?RegisterEnterInfo&bizflow=2';
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Register for eBay'), 'onclick' => 'window.open(\'' . $url . '\',\'_blank\')', 'id' => 'register_on_ebay_button'));
$this->setChild('register_on_ebay_button', $buttonBlock);
//-------------------------------
return parent::_beforeToHtml();
}
示例4: _beforeToHtml
protected function _beforeToHtml()
{
$this->assign('form', $this->_form);
$this->assign('element', $this->_element);
$this->assign('formBlock', $this->_formBlock);
return parent::_beforeToHtml();
}
示例5: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
$data = array('class' => 'save-btn', 'label' => Mage::helper('M2ePro')->__('Save'));
$this->setChild('save_btn', $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data));
return $this;
}
示例6: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
$data = array('class' => 'next', 'label' => Mage::helper('M2ePro')->__('Continue'), 'onclick' => "setLocation(M2ePro.url.get('adminhtml_ebay_listing_categorySettings'));");
$this->setChild('continue_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data));
return $this;
}
示例7: _beforeToHtml
protected function _beforeToHtml()
{
if ($this->_getData('select_id') == '') {
$this->setData('select_id', $this->getHtmlId() . '-select');
}
return parent::_beforeToHtml();
}
示例8: _beforeToHtml
protected function _beforeToHtml()
{
if ($this->isAllowedEdit()) {
$this->setChild('rename_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Rename'), 'onclick' => 'window.location.href=\'' . Mage::helper('mzeis_documentation/page')->getRenameUrl($this->getPage()->getName()) . '\'', 'class' => 'edit')));
$this->setChild('edit_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Edit'), 'onclick' => 'window.location.href=\'' . Mage::helper('mzeis_documentation/page')->getEditUrl($this->getPage()->getName()) . '\'', 'class' => 'edit')));
}
return parent::_beforeToHtml();
}
示例9: _beforeToHtml
protected function _beforeToHtml()
{
$this->setTemplate('newsletter/queue/edit.phtml');
$this->setChild('form', $this->getLayout()->createBlock('adminhtml/newsletter_queue_edit_form', 'form'));
$queue = AO::getSingleton('newsletter/queue');
$queue->addTemplateData($queue);
return parent::_beforeToHtml();
}
示例10: _beforeToHtml
protected function _beforeToHtml()
{
// ---------------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Continue'), 'onclick' => '', 'id' => 'continue_button'));
$this->setChild('continue_button', $buttonBlock);
// ---------------------------------------
return parent::_beforeToHtml();
}
示例11: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
$url = $this->getUrl('*/*/index', array('_current' => true, 'step' => 3));
$data = array('class' => 'next', 'label' => Mage::helper('M2ePro')->__('Continue'), 'onclick' => 'setLocation(\'' . $url . '\')');
$this->setChild('continue_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data));
return $this;
}
示例12: _beforeToHtml
/**
* Retrieve required options from parent
*/
protected function _beforeToHtml()
{
if (!$this->getParentBlock()) {
Mage::throwException(Mage::helper('adminhtml')->__('Invalid parrent block for this block'));
}
$this->setPayment($this->getParentBlock()->getOrder()->getPayment());
parent::_beforeToHtml();
}
示例13: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
$this->_oldStoreId = Mage::app()->getStore()->getId();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Mage::helper('udropship/catalog')->setDesignStore(0, 'adminhtml');
return $this;
}
示例14: _beforeToHtml
/**
* Retrieve required options from parent
*/
protected function _beforeToHtml()
{
if (!$this->getParentBlock()) {
Mage::throwException(Mage::helper('adminhtml')->__('Invalid parent block for this block.'));
}
$this->setEntity($this->getParentBlock()->getSource());
parent::_beforeToHtml();
}
示例15: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
$data = array('class' => 'switch-to-parent-btn', 'label' => Mage::helper('M2ePro')->__('Yes'));
$this->setChild('yes_btn', $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data));
$data = array('class' => 'switch-to-parent-popup-close', 'label' => Mage::helper('M2ePro')->__('No'));
$this->setChild('no_btn', $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data));
return $this;
}