本文整理汇总了PHP中Mage_Adminhtml_Block_Widget::_beforeToHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget::_beforeToHtml方法的具体用法?PHP Mage_Adminhtml_Block_Widget::_beforeToHtml怎么用?PHP Mage_Adminhtml_Block_Widget::_beforeToHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Adminhtml_Block_Widget
的用法示例。
在下文中一共展示了Mage_Adminhtml_Block_Widget::_beforeToHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeToHtml
protected function _beforeToHtml()
{
if (Mage::helper('M2ePro')->getGlobalValue('temp_data') && Mage::helper('M2ePro')->getGlobalValue('temp_data')->getId()) {
/** @var $accountObj Ess_M2ePro_Model_Account */
$accountObj = Mage::helper('M2ePro')->getGlobalValue('temp_data');
$this->synchronizeProcessing = $accountObj->isLockedObject('server_synchronize');
if (!$this->synchronizeProcessing) {
$accountId = $accountObj->getId();
Mage::helper('M2ePro')->unsetGlobalValue('temp_data');
Mage::helper('M2ePro')->setGlobalValue('temp_data', Mage::helper('M2ePro/Component_Buy')->getModel('Account')->load($accountId));
}
} else {
$this->synchronizeProcessing = false;
}
$marketplaces = Mage::helper('M2ePro/Component_Buy')->getCollection('Marketplace')->addFieldToFilter('status', Ess_M2ePro_Model_Marketplace::STATUS_ENABLE);
$this->marketplace = true;
if ($marketplaces->getSize() <= 0) {
$this->marketplace = false;
}
//var_dump($this->marketplace); exit();
$onclickAction = 'BuyAccountHandlerObj.update_password(\'ftp\')';
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Update FTP Password'), 'onclick' => $onclickAction, 'class' => 'scalable'));
$this->setChild('buy_update_ftp_password', $buttonBlock);
$onclickAction = 'BuyAccountHandlerObj.update_password(\'web\')';
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Update Web Password'), 'onclick' => $onclickAction, 'class' => 'scalable'));
$this->setChild('buy_update_web_password', $buttonBlock);
return parent::_beforeToHtml();
}
示例2: _beforeToHtml
protected function _beforeToHtml()
{
$this->setChild('development_module_module', $this->getLayout()->createBlock('M2ePro/adminhtml_development_tabs_command_group', '', array('controller_name' => Ess_M2ePro_Helper_View_Development_Command::CONTROLLER_MODULE_MODULE)));
$this->setChild('development_module_synchronization', $this->getLayout()->createBlock('M2ePro/adminhtml_development_tabs_command_group', '', array('controller_name' => Ess_M2ePro_Helper_View_Development_Command::CONTROLLER_MODULE_SYNCHRONIZATION)));
$this->setChild('development_module_integration', $this->getLayout()->createBlock('M2ePro/adminhtml_development_tabs_command_group', '', array('controller_name' => Ess_M2ePro_Helper_View_Development_Command::CONTROLLER_MODULE_INTEGRATION)));
return parent::_beforeToHtml();
}
示例3: _beforeToHtml
protected function _beforeToHtml()
{
//------------------------------
$unsortedCountries = Mage::getModel('directory/country_api')->items();
$unsortedCountriesNames = array();
foreach ($unsortedCountries as $country) {
$unsortedCountriesNames[] = $country['name'];
}
sort($unsortedCountriesNames, SORT_STRING);
$sortedCountries = array();
foreach ($unsortedCountriesNames as $name) {
foreach ($unsortedCountries as $country) {
if ($country['name'] == $name) {
$sortedCountries[] = $country;
break;
}
}
}
$this->setData('countries', $sortedCountries);
//------------------------------
//------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Add Method'), 'onclick' => 'ShippingsHandlersObj.addRow(\'local\');', 'class' => 'add add_local_shipping_method_button'));
$this->setChild('add_local_shipping_method_button', $buttonBlock);
//------------------------------
//------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Add Method'), 'onclick' => 'ShippingsHandlersObj.addRow(\'international\');', 'class' => 'add add_international_shipping_method_button'));
$this->setChild('add_international_shipping_method_button', $buttonBlock);
//------------------------------
//------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Remove'), 'onclick' => 'ShippingsHandlersObj.removeRow(this, \'%type%\');', 'class' => 'delete icon-btn remove_shipping_method_button'));
$this->setChild('remove_shipping_method_button', $buttonBlock);
//------------------------------
return parent::_beforeToHtml();
}
示例4: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
if ($this->isCharity()) {
$this->getCharityDictionary();
}
}
示例5: _beforeToHtml
protected function _beforeToHtml()
{
$categoryData = Mage::helper('M2ePro/Data_Global')->getValue('chooser_data');
$specificBlocks = array();
$templates = array();
$uniqueIdCounter = 0;
if (!empty($categoryData['templates'])) {
foreach ($categoryData['templates'] as $template) {
$uniqueId = 'sb' . $uniqueIdCounter;
$specificBlocks[] = array('create_date' => $template['date'], 'template_id' => $template['id'], 'unique_id' => $uniqueId, 'block' => $this->createSpecificsBlock(array(), $uniqueId));
$uniqueIdCounter++;
}
} else {
$specificsSets = $this->getSpecificsSets();
uasort($specificsSets, array($this, 'specificsSetsSortCallback'));
foreach ($specificsSets as $templateId => $specificsSet) {
$uniqueId = 'sb' . $uniqueIdCounter;
$date = $specificsSet['create_date']->format('Y-m-d h:i');
$templates[] = array('id' => $templateId, 'date' => $date);
$specificBlocks[] = array('create_date' => $date, 'template_id' => $templateId, 'unique_id' => $uniqueId, 'block' => $this->createSpecificsBlock($specificsSet['specifics'], $uniqueId));
$uniqueIdCounter++;
}
}
$this->templates = $templates;
$this->specificsBlocks = $specificBlocks;
return parent::_beforeToHtml();
}
示例6: _beforeToHtml
protected function _beforeToHtml()
{
if ($tabsBlock = $this->getChild('custom_grid_tabs')) {
$tabsBlock->setActiveTab($this->getSelectedTabId());
}
return parent::_beforeToHtml();
}
示例7: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
//------------------------------
$this->setChild('confirm', $this->getLayout()->createBlock('M2ePro/adminhtml_widget_dialog_confirm'));
//------------------------------
}
示例8: _beforeToHtml
protected function _beforeToHtml()
{
$this->magentoInfo = Mage::helper('M2ePro')->__(ucwords(Mage::helper('M2ePro/Magento')->getEditionName())) . ' (' . Mage::helper('M2ePro/Magento')->getVersion() . ')';
// ---------------------------------------
$this->moduleVersion = Mage::helper('M2ePro/Module')->getVersion();
// ---------------------------------------
// ---------------------------------------
$this->phpVersion = Mage::helper('M2ePro/Client')->getPhpVersion();
$this->phpApi = Mage::helper('M2ePro/Client')->getPhpApiName();
// ---------------------------------------
// ---------------------------------------
$this->memoryLimit = Mage::helper('M2ePro/Client')->getMemoryLimit(true);
$this->maxExecutionTime = @ini_get('max_execution_time');
// ---------------------------------------
// ---------------------------------------
$this->mySqlVersion = Mage::helper('M2ePro/Client')->getMysqlVersion();
$this->mySqlDatabaseName = Mage::helper('M2ePro/Magento')->getDatabaseName();
// ---------------------------------------
// ---------------------------------------
$this->cronLastRunTime = 'N/A';
$this->cronIsNotWorking = false;
$this->cronCurrentRunner = ucfirst(Mage::helper('M2ePro/Module_Cron')->getRunner());
$cronLastRunTime = Mage::helper('M2ePro/Module_Cron')->getLastRun();
if (!is_null($cronLastRunTime)) {
$this->cronLastRunTime = $cronLastRunTime;
$this->cronIsNotWorking = Mage::helper('M2ePro/Module_Cron')->isLastRunMoreThan(12, true);
}
// ---------------------------------------
return parent::_beforeToHtml();
}
示例9: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
//------------------------------
$breadcrumb = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_breadcrumb')->setData('step', 'none');
$this->setChild('breadcrumb', $breadcrumb);
//------------------------------
//------------------------------
$tutorial = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_step_tutorial')->setData('is_allowed', !$this->isShownTutorial());
$this->setChild('tutorial', $tutorial);
//------------------------------
//------------------------------
$destination = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_step_destination')->setData('listing_id', $this->getData('listing_id'))->setData('products_ids', $this->getData('products_ids'))->setData('is_allowed', true);
$this->setChild('destination', $destination);
//------------------------------
//------------------------------
$policy = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_step_policy')->setData('is_allowed', false);
$this->setChild('policy', $policy);
//------------------------------
//------------------------------
$translation = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_step_translation')->setData('is_allowed', false);
$this->setChild('translation', $translation);
//------------------------------
//------------------------------
$categories = $this->getLayout()->createBlock('M2ePro/adminhtml_Ebay_Listing_Transferring_step_categories')->setData('is_allowed', true);
$this->setChild('categories', $categories);
//------------------------------
}
示例10: _beforeToHtml
protected function _beforeToHtml()
{
$this->isMagentoDevelopmentModeEnabled = Mage::helper('M2ePro/Magento')->isDeveloper();
$this->isDevelopmentModeEnabled = Mage::helper('M2ePro/Module')->isDevelopmentMode();
$this->isMaintenanceEnabled = Mage::helper('M2ePro/Module_Maintenance')->isEnabled();
$this->commands = Mage::helper('M2ePro/View_Development_Command')->parseDebugCommandsData(Ess_M2ePro_Helper_View_Development_Command::CONTROLLER_DEBUG);
//-------------------------------
$url = $this->getUrl('*/adminhtml_development/enableMaintenanceMode/');
$data = array('label' => Mage::helper('M2ePro')->__('Enable'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'enable_maintenance');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('enable_maintenance', $buttonBlock);
$url = $this->getUrl('*/adminhtml_development/disableMaintenanceMode/');
$data = array('label' => Mage::helper('M2ePro')->__('Disable'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'disable_maintenance');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('disable_maintenance', $buttonBlock);
//-------------------------------
//------------------------------
$url = $this->getUrl('*/adminhtml_development/enableDevelopmentMode/');
$data = array('label' => Mage::helper('M2ePro')->__('Enable'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'enable_development_mode');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('enable_development_mode', $buttonBlock);
$url = $this->getUrl('*/adminhtml_development/disableDevelopmentMode/');
$data = array('label' => Mage::helper('M2ePro')->__('Disable'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'disable_development_mode');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('disable_development_mode', $buttonBlock);
//-------------------------------
return parent::_beforeToHtml();
}
示例11: _beforeToHtml
protected function _beforeToHtml()
{
$account = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
$magentoOrdersSettings = $account->getData('magento_orders_settings');
$magentoOrdersSettings = !empty($magentoOrdersSettings) ? json_decode($magentoOrdersSettings, true) : array();
// ---------------------------------------
$temp = Mage::getModel('core/website')->getCollection()->setOrder('sort_order', 'ASC')->toArray();
$this->websites = $temp['items'];
// ---------------------------------------
// ---------------------------------------
$temp = Mage::getModel('customer/group')->getCollection()->toArray();
$this->groups = $temp['items'];
// ---------------------------------------
// ---------------------------------------
$selectedStore = !empty($magentoOrdersSettings['listing']['store_id']) ? $magentoOrdersSettings['listing']['store_id'] : '';
$blockStoreSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_storeSwitcher', '', array('id' => 'magento_orders_listings_store_id', 'name' => 'magento_orders_settings[listing][store_id]', 'selected' => $selectedStore));
$blockStoreSwitcher->hasDefaultOption(false);
$this->setChild('magento_orders_listings_store_id', $blockStoreSwitcher);
// ---------------------------------------
// ---------------------------------------
$selectedStore = !empty($magentoOrdersSettings['listing_other']['store_id']) ? $magentoOrdersSettings['listing_other']['store_id'] : '';
$blockStoreSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_storeSwitcher', '', array('id' => 'magento_orders_listings_other_store_id', 'name' => 'magento_orders_settings[listing_other][store_id]', 'selected' => $selectedStore));
$blockStoreSwitcher->hasDefaultOption(false);
$this->setChild('magento_orders_listings_other_store_id', $blockStoreSwitcher);
// ---------------------------------------
// ---------------------------------------
$productTaxClasses = Mage::getModel('tax/class')->getCollection()->addFieldToFilter('class_type', Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT)->toOptionArray();
$none = array('value' => Ess_M2ePro_Model_Magento_Product::TAX_CLASS_ID_NONE, 'label' => 'None');
array_unshift($productTaxClasses, $none);
$this->productTaxClasses = $productTaxClasses;
// ---------------------------------------
return parent::_beforeToHtml();
}
示例12: _beforeToHtml
protected function _beforeToHtml()
{
$this->setChild('actual_info', $this->getLayout()->createBlock('M2ePro/adminhtml_development_info_actual'));
$this->setChild('database_module', $this->getLayout()->createBlock('M2ePro/adminhtml_development_info_mysql_module'));
$this->setChild('database_integration', $this->getLayout()->createBlock('M2ePro/adminhtml_development_info_mysql_integration'));
return parent::_beforeToHtml();
}
示例13: _beforeToHtml
protected function _beforeToHtml()
{
$this->phpVersion = Mage::helper('M2ePro/Client')->getPhpVersion();
$this->phpApi = Mage::helper('M2ePro/Client')->getPhpApiName();
$this->phpSettings = Mage::helper('M2ePro/Client')->getPhpSettings();
return parent::_beforeToHtml();
}
示例14: _beforeToHtml
protected function _beforeToHtml()
{
//------------------------------
$data = array('label' => Mage::helper('M2ePro')->__('Insert'), 'onclick' => "AttributeSetHandlerObj.appendToText('select_attributes_for_title', 'title_template');", 'class' => 'select_attributes_for_title_button');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('select_attributes_for_title_button', $buttonBlock);
//------------------------------
//------------------------------
$data = array('label' => Mage::helper('M2ePro')->__('Insert'), 'onclick' => "AttributeSetHandlerObj.appendToText(" . "'select_attributes_for_mfg_name'," . " 'manufacturer_template'" . ");", 'class' => 'select_attributes_for_mfg_name_template_button');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('select_attributes_for_mfg_name_template_button', $buttonBlock);
//------------------------------
//------------------------------
$data = array('label' => Mage::helper('M2ePro')->__('Insert'), 'onclick' => "AttributeSetHandlerObj.appendToTextarea('#' + \$('select_attributes').value + '#');", 'class' => 'add_product_attribute_button');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('add_product_attribute_button', $buttonBlock);
//------------------------------
//------------------------------
for ($i = 0; $i < Ess_M2ePro_Model_Buy_Template_NewProduct_Core::FEATURES_COUNT; $i++) {
$data = array('label' => Mage::helper('M2ePro')->__('Insert'), 'onclick' => "AttributeSetHandlerObj.appendToText('select_attributes_for_features_{$i}'," . " 'features_{$i}');BuyTemplateNewProductHandlerObj.allowAddFeature(this);", 'class' => "select_attributes_for_features_{$i}_button");
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild("select_attributes_for_features_{$i}_button", $buttonBlock);
}
//------------------------------
return parent::_beforeToHtml();
}
示例15: _beforeToHtml
protected function _beforeToHtml()
{
$this->platformMode = Mage::helper('M2ePro')->__(ucwords(Mage::helper('M2ePro/Magento')->getEditionName()));
$this->platformVersion = Mage::helper('M2ePro/Magento')->getVersion();
$this->platformIsSecretKey = Mage::helper('M2ePro/Magento')->isSecretKeyToUrl();
return parent::_beforeToHtml();
}