本文整理汇总了PHP中Mage_Adminhtml_Block_Widget_Form::_beforeToHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget_Form::_beforeToHtml方法的具体用法?PHP Mage_Adminhtml_Block_Widget_Form::_beforeToHtml怎么用?PHP Mage_Adminhtml_Block_Widget_Form::_beforeToHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Adminhtml_Block_Widget_Form
的用法示例。
在下文中一共展示了Mage_Adminhtml_Block_Widget_Form::_beforeToHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeToHtml
protected function _beforeToHtml()
{
// ---------------------------------------
/** @var Ess_M2ePro_Model_Marketplace[] $marketplaces */
$marketplaces = Mage::helper('M2ePro/Component_Amazon')->getCollection('Marketplace')->setOrder('group_title', 'ASC')->setOrder('sorder', 'ASC')->setOrder('title', 'ASC')->getItems();
$resultMarketplaces = array();
$storedStatuses = array();
$canadaMarketplace = NULL;
$canadaStoreStatus = NULL;
foreach ($marketplaces as $marketplace) {
if (is_null($marketplace->getData('developer_key'))) {
continue;
}
$isLocked = (bool) Mage::helper('M2ePro/Component_Amazon')->getCollection('Account')->addFieldToFilter('marketplace_id', $marketplace->getId())->getSize();
if ($marketplace->getId() == 24 && $marketplace->getCode() == 'CA') {
$canadaMarketplace = array('instance' => $marketplace, 'params' => array('locked' => $isLocked));
$canadaStoreStatus = array('marketplace_id' => $marketplace->getId(), 'status' => $marketplace->getStatus());
continue;
}
$storedStatuses[] = array('marketplace_id' => $marketplace->getId(), 'status' => $marketplace->getStatus());
$resultMarketplaces[] = array('instance' => $marketplace, 'params' => array('locked' => $isLocked));
}
if (!is_null($canadaMarketplace) && !is_null($canadaStoreStatus)) {
$storedStatuses[] = $canadaStoreStatus;
$resultMarketplaces[] = $canadaMarketplace;
}
$this->marketplaces = $resultMarketplaces;
$this->storedStatuses = $storedStatuses;
// ---------------------------------------
return parent::_beforeToHtml();
}
示例2: _beforeToHtml
protected function _beforeToHtml()
{
//----------------------------
$marketplaces = array();
$marketplaces[Ess_M2ePro_Helper_Component_Buy::NICK] = Mage::helper('M2ePro/Component_Buy')->getCollection('Marketplace')->getFirstItem();
$marketplaces[Ess_M2ePro_Helper_Component_Play::NICK] = Mage::helper('M2ePro/Component_Play')->getCollection('Marketplace')->getFirstItem();
$activeWizard = $this->getActiveWizard();
if (!is_null($activeWizard)) {
$marketplaces = array($marketplaces[$activeWizard]);
}
$groups = array();
$previewGroup = '';
$idGroup = 1;
foreach ($marketplaces as $marketplace) {
if ($marketplace->getGroupTitle() != $previewGroup) {
$previewGroup = $marketplace->getGroupTitle();
$groups[] = array('id' => $idGroup, 'title' => $previewGroup, 'marketplaces' => array());
$idGroup++;
}
$marketplace = array('instance' => $marketplace, 'params' => array('locked' => $marketplace->isLocked()));
$groups[count($groups) - 1]['marketplaces'][] = $marketplace;
}
$this->groups = $groups;
//----------------------------
//------------------------------
$data = array('label' => Mage::helper('M2ePro')->__('Update Now'), 'onclick' => 'MarketplaceHandlerObj.runSingleMarketplaceSynchronization(this)', 'class' => 'run_single_button');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('run_single_button', $buttonBlock);
//------------------------------
return parent::_beforeToHtml();
}
示例3: _beforeToHtml
protected function _beforeToHtml()
{
//------------------------------
$attributesSets = Mage::helper('M2ePro/Magento')->getAttributeSets();
$this->setData('attributes_sets', $attributesSets);
//------------------------------
//------------------------------
$this->attribute_set_locked = false;
if (Mage::helper('M2ePro')->getGlobalValue('temp_data') && Mage::helper('M2ePro')->getGlobalValue('temp_data')->getId()) {
$this->attribute_set_locked = Mage::helper('M2ePro')->getGlobalValue('temp_data')->isLocked();
}
$this->listing_type_locked = $this->attribute_set_locked;
//------------------------------
//------------------------------
$this->setData('currencies', Mage::helper('M2ePro/Module')->getConfig()->getAllGroupValues('/ebay/currency/', Ess_M2ePro_Model_Config_Abstract::SORT_VALUE_ASC));
//------------------------------
//------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_select_all_button', 'label' => Mage::helper('M2ePro')->__('Select All'), 'onclick' => 'AttributeSetHandlerObj.selectAllAttributeSets();', 'class' => 'attribute_sets_select_all_button'));
$this->setChild('attribute_sets_select_all_button', $buttonBlock);
//------------------------------
//------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_confirm_button', 'label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => 'EbayTemplateSellingFormatHandlerObj.attribute_sets_confirm();', 'class' => 'attribute_sets_confirm_button', 'style' => 'display: none'));
$this->setChild('attribute_sets_confirm_button', $buttonBlock);
//------------------------------
//------------------------------
$this->customerGroups = Mage::getModel('customer/group')->getCollection()->toOptionArray();
//------------------------------
return parent::_beforeToHtml();
}
示例4: _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);
//------------------------------
$buyerEmail = $this->order->getData('buyer_email');
stripos($buyerEmail, 'Invalid Request') !== false && ($buyerEmail = '');
$this->setData('buyer_email', $buyerEmail);
$this->setData('buyer_name', $this->order->getData('buyer_name'));
$this->setData('address', $this->order->getShippingAddress()->getData());
$this->setData('region_code', $this->order->getShippingAddress()->getRegionCode());
return parent::_beforeToHtml();
}
示例5: _beforeToHtml
protected function _beforeToHtml()
{
$ruleModel = Mage::helper('M2ePro/Data_Global')->getValue('rule_model');
$ruleBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_magento_product_rule')->setData(array('rule_model' => $ruleModel));
$this->setChild('rule_block', $ruleBlock);
return parent::_beforeToHtml();
}
示例6: _beforeToHtml
protected function _beforeToHtml()
{
// Set data for form
//----------------------------
$this->component_ebay_mode = Mage::helper('M2ePro/Component_Ebay')->isActive();
$this->component_amazon_mode = Mage::helper('M2ePro/Component_Amazon')->isActive();
$this->component_buy_mode = Mage::helper('M2ePro/Component_Buy')->isActive();
$this->component_ebay_allowed = Mage::helper('M2ePro/Component_Ebay')->isAllowed();
$this->component_amazon_allowed = Mage::helper('M2ePro/Component_Amazon')->isAllowed();
$this->component_buy_allowed = Mage::helper('M2ePro/Component_Buy')->isAllowed();
$this->component_group_rakuten_allowed = Mage::helper('M2ePro/Component')->isRakutenAllowed();
$this->components_allowed_count = count(Mage::helper('M2ePro/Component')->getAllowedComponents());
$this->component_default = Mage::helper('M2ePro/Component')->getDefaultComponent();
$this->products_show_thumbnails = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/products/settings/', 'show_thumbnails');
$this->block_notices_show = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/block_notices/settings/', 'show');
$this->feedbacks_notification_mode = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/feedbacks/notification/', 'mode');
$this->messages_notification_mode = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/messages/notification/', 'mode');
$this->cron_notification_mode = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/cron/notification/', 'mode');
//----------------------------
//-------------------------------
$url = $this->getUrl('*/*/restoreBlockNotices');
$confirm = Mage::helper('M2ePro')->__('Are you sure?');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('M2ePro')->__('Restore All Helps'), 'onclick' => 'confirmSetLocation(\'' . $confirm . '\', \'' . $url . '\')', 'class' => 'restore_block_notices'));
$this->setChild('restore_block_notices', $buttonBlock);
//-------------------------------
return parent::_beforeToHtml();
}
示例7: _beforeToHtml
protected function _beforeToHtml()
{
// Magento order data
// ---------------
$this->real_magento_order_id = NULL;
if (!is_null($magentoOrderId = $this->order->getData('magento_order_id'))) {
$magentoOrder = Mage::getModel('sales/order')->load($magentoOrderId);
if ($magentoOrder->getId()) {
$this->real_magento_order_id = $magentoOrder->getRealOrderId();
}
}
// ---------------
// Shipping data
// ---------------
$this->shipping_address = NULL;
$shippingAddress = $this->order->getShippingAddress(true);
if (count($shippingAddress)) {
if (isset($shippingAddress['country_id']) && $shippingAddress['country_id'] != '') {
$country = Mage::getModel('directory/country')->load($shippingAddress['country_id']);
!is_null($country->getId()) && ($shippingAddress['country_id'] = $country->getName());
}
$this->shipping_address = $shippingAddress;
}
// ---------------
$this->setChild('order_items', $this->getLayout()->createBlock('M2ePro/adminhtml_orders_view_items'));
$this->setChild('order_logs', $this->getLayout()->createBlock('M2ePro/adminhtml_orders_view_logs'));
$this->setChild('order_external_transactions', $this->getLayout()->createBlock('M2ePro/adminhtml_orders_view_external'));
return parent::_beforeToHtml();
}
示例8: _beforeToHtml
protected function _beforeToHtml()
{
//------------------------------
$attributesSets = Mage::helper('M2ePro/Magento_AttributeSet')->getAll();
$this->setData('attributes_sets', $attributesSets);
//------------------------------
//------------------------------
$this->attribute_set_locked = false;
if (Mage::helper('M2ePro/Data_Global')->getValue('temp_data') && Mage::helper('M2ePro/Data_Global')->getValue('temp_data')->getId()) {
$this->attribute_set_locked = Mage::helper('M2ePro/Data_Global')->getValue('temp_data')->isLocked();
}
//------------------------------
//------------------------------
$this->setData('currencies', Mage::helper('M2ePro/Component_Amazon')->getCurrencies());
//------------------------------
//------------------------------
$data = array('id' => 'attribute_sets_select_all_button', 'label' => Mage::helper('M2ePro')->__('Select All'), 'onclick' => 'AttributeSetHandlerObj.selectAllAttributeSets();', 'class' => 'attribute_sets_select_all_button');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('attribute_sets_select_all_button', $buttonBlock);
//------------------------------
//------------------------------
$data = array('id' => 'attribute_sets_confirm_button', 'label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => 'AmazonTemplateSellingFormatHandlerObj.attribute_sets_confirm();', 'class' => 'attribute_sets_confirm_button', 'style' => 'display: none');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('attribute_sets_confirm_button', $buttonBlock);
//------------------------------
//------------------------------
$this->customerGroups = Mage::getModel('customer/group')->getCollection()->toOptionArray();
//------------------------------
return parent::_beforeToHtml();
}
示例9: _beforeToHtml
protected function _beforeToHtml()
{
//------------------------------
$attributesSets = Mage::getModel('eav/entity_attribute_set')->getCollection()->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())->setOrder('attribute_set_name', 'ASC')->toArray();
$this->setData('attributes_sets', $attributesSets['items']);
//------------------------------
//------------------------------
$this->attribute_set_locked = false;
if (Mage::registry('M2ePro_data') && Mage::registry('M2ePro_data')->getId()) {
$this->attribute_set_locked = Mage::registry('M2ePro_data')->isLocked();
}
//------------------------------
//------------------------------
$this->setData('currencies', Mage::helper('M2ePro/Module')->getConfig()->getAllGroupValues('/ebay/currency/', Ess_M2ePro_Model_ConfigBase::SORT_VALUE_ASC));
//------------------------------
//------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_select_all_button', 'label' => Mage::helper('M2ePro')->__('Select All'), 'onclick' => 'AttributeSetsHandlersObj.selectAllAttributeSets();', 'class' => 'attribute_sets_select_all_button'));
$this->setChild('attribute_sets_select_all_button', $buttonBlock);
//------------------------------
//------------------------------
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'attribute_sets_confirm_button', 'label' => Mage::helper('M2ePro')->__('Confirm'), 'onclick' => 'SellingFormatTemplatesHandlersObj.attribute_sets_confirm();', 'class' => 'attribute_sets_confirm_button', 'style' => 'display: none'));
$this->setChild('attribute_sets_confirm_button', $buttonBlock);
//------------------------------
return parent::_beforeToHtml();
}
示例10: _beforeToHtml
protected function _beforeToHtml()
{
//-------------------------------
$this->isFromError = $this->getRequest()->getParam('error') === 'true';
//-------------------------------
//-------------------------------
$cronInfoBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_development_inspection_cron', '', array('is_support_mode' => true));
$this->setChild('cron_info', $cronInfoBlock);
//-------------------------------
//-------------------------------
$systemRequirementsBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_development_inspection_requirements', '', array('is_support_mode' => true));
$this->setChild('system_requirements', $systemRequirementsBlock);
//-------------------------------
//-------------------------------
$data = array('label' => Mage::helper('M2ePro')->__('Search'), 'onclick' => 'SupportHandlerObj.searchUserVoiceData();', 'id' => 'send_button');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('user_voice_search', $buttonBlock);
//-------------------------------
//-------------------------------
$data = array('label' => Mage::helper('M2ePro')->__('Contact Support'), 'onclick' => 'SupportHandlerObj.forceShowContactSupportForm();', 'id' => 'force_show_contact_support_button');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('force_show_contact_support_button', $buttonBlock);
//-------------------------------
//-------------------------------
$tabsBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_support_tabs', '', array('is_from_error' => $this->isFromError));
$this->setChild('tabs', $tabsBlock);
//-------------------------------
return parent::_beforeToHtml();
}
示例11: _beforeToHtml
protected function _beforeToHtml()
{
// ---------------------------------------
/** @var Ess_M2ePro_Model_Marketplace[] $marketplaces */
$marketplaces = array();
$marketplaces[Ess_M2ePro_Helper_Component_Buy::NICK] = Mage::helper('M2ePro/Component_Buy')->getCollection('Marketplace')->getFirstItem();
$groups = array();
$storedStatuses = array();
$previewGroup = '';
$idGroup = 1;
foreach ($marketplaces as $component => $marketplace) {
if ($marketplace->getGroupTitle() != $previewGroup) {
$previewGroup = $marketplace->getGroupTitle();
$groups[] = array('id' => $idGroup, 'title' => $previewGroup, 'marketplaces' => array());
$idGroup++;
}
$storedStatuses[] = array('marketplace_id' => $marketplace->getId(), 'status' => $marketplace->getStatus());
$isLocked = (bool) Mage::helper('M2ePro/Component_' . ucfirst($component))->getCollection('Account')->getSize();
$marketplace = array('instance' => $marketplace, 'params' => array('locked' => $isLocked));
$groups[count($groups) - 1]['marketplaces'][] = $marketplace;
}
$this->groups = $groups;
$this->storedStatuses = $storedStatuses;
// ---------------------------------------
// ---------------------------------------
$data = array('label' => Mage::helper('M2ePro')->__('Update Now'), 'onclick' => 'MarketplaceHandlerObj.runSingleSynchronization(this)', 'class' => 'run_single_button');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('run_single_button', $buttonBlock);
// ---------------------------------------
return parent::_beforeToHtml();
}
示例12: _beforeToHtml
protected function _beforeToHtml()
{
$configModel = Mage::helper('M2ePro/Module')->getConfig();
$this->view_ebay_mode = $configModel->getGroupValue('/view/ebay/', 'mode');
$this->view_ebay_feedbacks_notification_mode = (bool) (int) $configModel->getGroupValue('/view/ebay/feedbacks/notification/', 'mode');
$this->use_last_specifics_mode = (bool) (int) $configModel->getGroupValue('/view/ebay/template/category/', 'use_last_specifics');
$this->check_the_same_product_already_listed_mode = (bool) (int) $configModel->getGroupValue('/ebay/connector/listing/', 'check_the_same_product_already_listed');
/** @var Ess_M2ePro_Helper_Component_Ebay_Motor_Compatibility $compatibilityHelper */
$compatibilityHelper = Mage::helper('M2ePro/Component_Ebay_Motor_Compatibility');
// ------------------------
/** @var Ess_M2ePro_Model_Mysql4_Marketplace_Collection $specificsMarketplaceCollection */
$specificsMarketplaceCollection = Mage::getModel('M2ePro/Marketplace')->getCollection();
$specificsMarketplaceCollection->addFieldToFilter('id', array('in' => $compatibilityHelper->getSpecificSupportedMarketplaces()));
$specificsMarketplaceCollection->addFieldToFilter('status', Ess_M2ePro_Model_Marketplace::STATUS_ENABLE);
$this->is_motors_specifics_marketplace_enabled = (bool) $specificsMarketplaceCollection->getSize();
// ------------------------
// ------------------------
/** @var Ess_M2ePro_Model_Mysql4_Marketplace_Collection $ktypeMarketplaceCollection */
$ktypeMarketplaceCollection = Mage::getModel('M2ePro/Marketplace')->getCollection();
$ktypeMarketplaceCollection->addFieldToFilter('id', array('in' => $compatibilityHelper->getKtypeSupportedMarketplaces()));
$ktypeMarketplaceCollection->addFieldToFilter('status', Ess_M2ePro_Model_Marketplace::STATUS_ENABLE);
$this->is_motors_ktypes_marketplace_enabled = (bool) $ktypeMarketplaceCollection->getSize();
// ------------------------
$attributesForPartsCompatibility = Mage::getResourceModel('catalog/product_attribute_collection')->addVisibleFilter()->addFieldToFilter('backend_type', array('eq' => 'text'))->addFieldToFilter('frontend_input', array('eq' => 'textarea'))->toArray();
$this->attributes_for_parts_compatibility = $attributesForPartsCompatibility['items'];
$this->motors_specifics_attribute = $configModel->getGroupValue('/ebay/motor/', 'motors_specifics_attribute');
$this->motors_ktypes_attribute = $configModel->getGroupValue('/ebay/motor/', 'motors_ktypes_attribute');
return parent::_beforeToHtml();
}
示例13: _beforeToHtml
protected function _beforeToHtml()
{
// ---------------------------------------
$this->setData('source', $this->getRequest()->getParam('source', 'products'));
// ---------------------------------------
return parent::_beforeToHtml();
}
示例14: _beforeToHtml
protected function _beforeToHtml()
{
$chooserBlockData = Mage::helper('M2ePro/Data_Global')->getValue('chooser_data');
// ---------------------------------------------------
/** @var Ess_M2ePro_Block_Adminhtml_Ebay_Listing_Category_Chooser $chooserBlock */
$chooserBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_category_chooser');
$chooserBlock->setMarketplaceId($chooserBlockData['marketplace']);
if (in_array($chooserBlockData['type'], Mage::helper('M2ePro/Component_Ebay_Category')->getStoreCategoryTypes())) {
$chooserBlock->setAccountId($chooserBlockData['account']);
}
$chooserBlock->setSingleCategoryMode();
$chooserBlock->setSingleCategoryType($chooserBlockData['type']);
$chooserBlock->setSingleCategoryData(array('mode' => $chooserBlockData['mode'], 'value' => $chooserBlockData['value'], 'path' => $chooserBlockData['path']));
$this->setChild('chooser_block', $chooserBlock);
// ---------------------------------------------------
// ---------------------------------------------------
if (in_array($chooserBlockData['type'], Mage::helper('M2ePro/Component_Ebay_Category')->getEbayCategoryTypes())) {
$marketplaceTitle = Mage::helper('M2ePro/Component_Ebay')->getCachedObject('Marketplace', (int) $chooserBlockData['marketplace'])->getTitle();
$this->marketplaceData = array('title' => $marketplaceTitle);
} else {
$accountTitle = Mage::helper('M2ePro/Component_Ebay')->getCachedObject('Account', (int) $chooserBlockData['account'])->getTitle();
$this->accountData = array('id' => $chooserBlockData['account'], 'title' => $accountTitle);
}
// ---------------------------------------------------
//------------------------------
$this->setChild('confirm', $this->getLayout()->createBlock('M2ePro/adminhtml_widget_dialog_confirm'));
//------------------------------
return parent::_beforeToHtml();
}
示例15: _beforeToHtml
protected function _beforeToHtml()
{
//----------------------------
$this->inspectorMode = Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/synchronization/settings/defaults/inspector/', 'mode');
//----------------------------
return parent::_beforeToHtml();
}