本文整理汇总了PHP中Mage_Adminhtml_Block_Widget类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget类的具体用法?PHP Mage_Adminhtml_Block_Widget怎么用?PHP Mage_Adminhtml_Block_Widget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Adminhtml_Block_Widget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: processBlock
/**
* processes the grid block, checks gridcontrol configuration for updates on this block and calls column actions
*
* @param Mage_Adminhtml_Block_Widget $block
*/
public function processBlock($block)
{
$config = Mage::getSingleton('hackathon_gridcontrol/config')->getConfig();
$blockConfig = $config->getNode('grids/' . $block->getId());
// process columns
foreach ($blockConfig->children() as $column) {
// process column actions
foreach ($column->children() as $action) {
// create method name
$func = '_' . $action->getName() . 'Action';
$funcArr = array($this, $func);
if (!is_callable($funcArr)) {
continue;
}
// call function and give a reference to the actual block, column and action
call_user_func($funcArr, new Varien_Object(array('block' => $block, 'action' => $action, 'column' => $column)));
}
}
// resort columns
$block->sortColumnsByOrder();
// register current block, needed to extend the collection in Hackathon_GridControl_Model_Observer
Mage::register('hackathon_gridcontrol_current_block', $block);
// call _prepareCollection to reload the collection and apply column filters
$this->_callProtectedMethod($block, '_prepareCollection');
// remove current block to prevent race conditions in later collection loads
Mage::unregister('hackathon_gridcontrol_current_block');
}
开发者ID:maierb,项目名称:GridControl,代码行数:32,代码来源:Processor.php
示例2: _prepareLayout
protected function _prepareLayout()
{
$this->addChild('add_button', 'Mage_Adminhtml_Block_Widget_Button', array('label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add New Option'), 'class' => 'add', 'id' => 'add_new_defined_option'));
$this->addChild('options_box', 'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option');
$this->addChild('import_button', 'Mage_Adminhtml_Block_Widget_Button', array('label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Import Options'), 'class' => 'add', 'id' => 'import_new_defined_option'));
return parent::_prepareLayout();
}
开发者ID:natxetee,项目名称:magento2,代码行数:7,代码来源:Options.php
示例3: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
if ($this->isCharity()) {
$this->getCharityDictionary();
}
}
开发者ID:technomagegithub,项目名称:magento,代码行数:7,代码来源:Data.php
示例4: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
// ---------------------------------------
$groupGrid = $this->prepareGroupsGrid();
// ---------------------------------------
// ---------------------------------------
$data = array('id' => 'confirm_button', 'class' => 'confirm_button', 'label' => Mage::helper('M2ePro')->__('Save'), 'onclick' => 'ListingAutoActionHandlerObj.confirm();', 'style' => 'display: none;');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('confirm_button', $buttonBlock);
// ---------------------------------------
// ---------------------------------------
$data = array('id' => 'close_button', 'class' => 'close_button', 'label' => Mage::helper('M2ePro')->__('Close'), 'onclick' => 'Windows.getFocusedWindow().close();');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('close_button', $buttonBlock);
// ---------------------------------------
// ---------------------------------------
$data = array('id' => 'continue_button', 'class' => 'continue_button next', 'label' => Mage::helper('M2ePro')->__('Continue'), 'style' => 'display: none;', 'onclick' => '');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('continue_button', $buttonBlock);
// ---------------------------------------
// ---------------------------------------
$data = array('id' => 'add_button', 'class' => 'add_button add', 'label' => Mage::helper('M2ePro')->__('Add New Rule'), 'onclick' => 'ListingAutoActionHandlerObj.categoryStepOne();', 'style' => $groupGrid->getCollection()->getSize() == 0 ? 'display: none;' : '');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('add_button', $buttonBlock);
// ---------------------------------------
// ---------------------------------------
$data = array('id' => 'add_first_button', 'class' => 'add_first_button add', 'label' => Mage::helper('M2ePro')->__('Add New Rule'), 'onclick' => 'ListingAutoActionHandlerObj.categoryStepOne();');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('add_first_button', $buttonBlock);
// ---------------------------------------
}
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:32,代码来源:Category.php
示例5: _toHtml
/**
* Render block HTML
*
* @return string
*/
protected function _toHtml()
{
$accordion = $this->getLayout()->createBlock('adminhtml/widget_accordion')->setId('aitattachmentInfo');
$accordion->addItem('aitattachment', array('title' => Mage::helper('adminhtml')->__('Attachments'), 'content' => $this->getLayout()->createBlock('aitemails/email_template_edit_attachments')->toHtml(), 'open' => true));
$this->setChild('accordion', $accordion);
return parent::_toHtml();
}
开发者ID:kiutisuperking,项目名称:eatsmartboxdev,代码行数:12,代码来源:Downloadable.php
示例6: _beforeToHtml
protected function _beforeToHtml()
{
if ($this->getParentBlock() && ($order = $this->getOrder())) {
$this->setEntity($order);
}
parent::_beforeToHtml();
}
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:7,代码来源:Giftmessage.php
示例7: _prepareLayout
/**
* Prepare layout
*/
protected function _prepareLayout()
{
$this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/', array('store' => $this->getRequest()->getParam('store', 0))) . '\')', 'class' => 'back')));
$this->setChild('reset_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Reset'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/*', array('_current' => true)) . '\')')));
if ($this->getStaging()->canMerge()) {
$this->setChild('merge_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Merge...'), 'onclick' => 'setLocation(\'' . $this->getMergeUrl() . '\')', 'class' => 'add')));
} elseif ($this->getStaging()->getId()) {
$this->setChild('merge_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Merge'), 'class' => 'disabled')));
}
if ($this->getStaging()->canSave()) {
$this->setChild('save_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Save'), 'onclick' => $this->getEditFormJsObject() . '.submit()', 'class' => 'save')));
} else {
if ($this->getRequest()->getParam('type')) {
$this->setChild('create_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Create'), 'onclick' => $this->getEditFormJsObject() . '.runCreate()', 'class' => 'add')));
}
}
if ($this->getStaging()->canResetStatus()) {
$this->setChild('reset_status_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Reset Status'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/resetStatus', array('_current' => true)) . '\')', 'class' => 'reset')));
}
$stagingId = $this->getStagingId();
if ($stagingId && $this->getStaging()->isScheduled()) {
$this->setChild('unschedule_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Unschedule Merge'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/unschedule', array('id' => $stagingId)) . '\')', 'class' => 'reset')));
}
return parent::_prepareLayout();
}
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:28,代码来源:Edit.php
示例8: _beforeToHtml
protected function _beforeToHtml()
{
$tableName = $this->getData('table_name');
$actionIdsString = $this->getData('action_ids');
$countField = 'product_id';
if ($this->getData('type_log') == 'listing') {
$countField = 'product_id';
} else {
if ($this->getData('type_log') == 'listing_other') {
$countField = 'listing_other_id';
}
}
/** @var $connRead Varien_Db_Adapter_Pdo_Mysql */
$connRead = Mage::getSingleton('core/resource')->getConnection('core_read');
$fields = new Zend_Db_Expr('COUNT(`' . $countField . '`) as `count_products`, `description`');
$dbSelect = $connRead->select()->from($tableName, $fields)->where('`action_id` IN (' . $actionIdsString . ')')->where('`type` = ?', Ess_M2ePro_Model_Log_Abstract::TYPE_ERROR)->group('description')->order(array('count_products DESC'))->limit(100);
$newErrors = array();
$tempErrors = $connRead->fetchAll($dbSelect);
foreach ($tempErrors as $row) {
$row['description'] = Mage::helper('M2ePro/View')->getModifiedLogMessage($row['description']);
$newErrors[] = $row;
}
$this->errors = $newErrors;
return parent::_beforeToHtml();
}
开发者ID:ppkowalski,项目名称:M2E,代码行数:25,代码来源:ErrorsSummary.php
示例9: _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();
}
开发者ID:ppkowalski,项目名称:M2E,代码行数:28,代码来源:Debug.php
示例10: _prepareLayout
/**
* Preparing layout, adding buttons
*
* @return Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract
*/
protected function _prepareLayout()
{
$this->setChild('trainevent_form', $this->getLayout()->createBlock('wage_trainevent/adminhtml_trainevent_edit_tab_form'));
$this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('wage_trainevent')->__('Delete'), 'class' => 'delete delete-option')));
$this->setChild('add_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('wage_trainevent')->__('Add Schedules'), 'class' => 'add', 'id' => 'add_new_option_button')));
return parent::_prepareLayout();
}
开发者ID:brentwpeterson,项目名称:magento-training-event,代码行数:12,代码来源:Options.php
示例11: _prepareLayout
public function _prepareLayout()
{
$button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Add Price'), 'onclick' => 'return customerPriceControl.showCustomerGrid();', 'class' => 'add'));
$button->setName('add_customer_price_item_button');
$this->setChild('add_button', $button);
return parent::_prepareLayout();
}
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:7,代码来源:CustomerPrices.php
示例12: _prepareLayout
/**
* Preparing the layout
*
* @return Mage_Core_Block_Abstract
*/
protected function _prepareLayout()
{
$this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('adminhtml')->__('Back'), 'onclick' => "window.location.href = '" . $this->getUrl('*/*') . "'", 'class' => 'back')));
$this->setChild('select_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('adminhtml')->__('Continue To PDF Template Type'), 'onclick' => "getSelectedItem()", 'type' => 'button', 'class' => 'select')));
$this->setChild('form', $this->getLayout()->createBlock('pdfgenerator/adminhtml_template_pdf_edit_tabs'));
return parent::_prepareLayout();
}
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:12,代码来源:New.php
示例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();
}
开发者ID:technomagegithub,项目名称:magento,代码行数:7,代码来源:Php.php
示例14: _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();
}
开发者ID:technomagegithub,项目名称:magento,代码行数:7,代码来源:Summary.php
示例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();
}
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:7,代码来源:Magento.php
示例16: _prepareLayout
protected function _prepareLayout()
{
$this->setChild('browse_button', $this->getLayout()->createBlock('adminhtml/widget_button')->addData(array('id' => $this->_getButtonId('browse'), 'label' => Mage::helper('adminhtml')->__('Browse Files...'), 'type' => 'button', 'onclick' => $this->getJsObjectName() . '.browse()')));
$this->setChild('upload_button', $this->getLayout()->createBlock('adminhtml/widget_button')->addData(array('id' => $this->_getButtonId('upload'), 'label' => Mage::helper('adminhtml')->__('Upload Files'), 'type' => 'button', 'onclick' => $this->getJsObjectName() . '.upload()')));
$this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->addData(array('id' => '{{id}}-delete', 'class' => 'delete', 'type' => 'button', 'label' => Mage::helper('adminhtml')->__('Remove'), 'onclick' => $this->getJsObjectName() . '.removeFile(\'{{fileId}}\')')));
return parent::_prepareLayout();
}
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:7,代码来源:Uploader.php
示例17: _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();
}
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:7,代码来源:Module.php
示例18: _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();
}
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:27,代码来源:Specific.php
示例19: _beforeToHtml
protected function _beforeToHtml()
{
//-------------------------------
$this->attributes = Mage::helper('M2ePro/Magento_Attribute')->getGeneralFromAllAttributeSets();
//-------------------------------
//-------------------------------
$back = Mage::helper('M2ePro')->makeBackUrlParam('*/adminhtml_ebay_account/edit', array('id' => $this->getRequest()->getParam('id'), 'tab' => 'listingOther'));
$url = $this->getUrl('*/adminhtml_ebay_listing_other_synchronization/edit', array('back' => $back));
$data = array('label' => Mage::helper('M2ePro')->__('Synchronization Settings'), 'onclick' => 'window.open(\'' . $url . '\', \'_blank\')', 'class' => 'button_link');
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
$this->setChild('ebay_other_listings_synchronization_settings', $buttonBlock);
//-------------------------------
//-------------------------------
$account = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
$marketplacesData = $account->getData('marketplaces_data');
$marketplacesData = !empty($marketplacesData) ? json_decode($marketplacesData, true) : array();
$marketplaces = Mage::helper('M2ePro/Component_Ebay')->getCollection('Marketplace')->addFieldToFilter('status', Ess_M2ePro_Model_Marketplace::STATUS_ENABLE)->setOrder('sorder', 'ASC')->setOrder('title', 'ASC')->toArray();
$marketplaces = $marketplaces['items'];
foreach ($marketplaces as &$marketplace) {
$marketplaceId = $marketplace['id'];
$marketplace['related_store_id'] = isset($marketplacesData[$marketplaceId]['related_store_id']) ? $marketplacesData[$marketplaceId]['related_store_id'] : Mage_Core_Model_App::ADMIN_STORE_ID;
}
$this->marketplaces = $marketplaces;
//-------------------------------
return parent::_beforeToHtml();
}
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:26,代码来源:ListingOther.php
示例20: _prepareLayout
/**
* Prepare global layout
* Add "Add tier" button to layout
*
* @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier
*/
protected function _prepareLayout()
{
$button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Add Product SKU'), 'onclick' => 'return productSkuControl.addItem()', 'class' => 'add'));
$button->setName('add_product_sku_button');
$this->setChild('add_button', $button);
return parent::_prepareLayout();
}
开发者ID:beejhuff,项目名称:magento-kick-butt-search,代码行数:13,代码来源:Sku.php
注:本文中的Mage_Adminhtml_Block_Widget类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论