本文整理汇总了PHP中Mage_Adminhtml_Block_Widget类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget类的具体用法?PHP Mage_Adminhtml_Block_Widget怎么用?PHP Mage_Adminhtml_Block_Widget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Adminhtml_Block_Widget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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');
}
示例2: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
if ($this->isCharity()) {
$this->getCharityDictionary();
}
}
示例3: _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);
// ---------------------------------------
}
示例4: _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();
}
示例5: _beforeToHtml
protected function _beforeToHtml()
{
if ($this->getParentBlock() && ($order = $this->getOrder())) {
$this->setEntity($order);
}
parent::_beforeToHtml();
}
示例6: _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();
}
示例7: _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();
}
示例8: _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();
}
示例9: _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();
}
示例10: _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();
}
示例11: _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();
}
示例12: _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();
}
示例13: _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();
}
示例14: _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();
}
示例15: _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();
}