public function __construct() { parent::__construct(); // Initialization block //------------------------------ $this->setId('license'); $this->_blockGroup = 'M2ePro'; $this->_controller = 'adminhtml'; $this->_mode = 'license'; //------------------------------ // Set header text //------------------------------ $this->_headerText = Mage::helper('M2ePro')->__('License'); //------------------------------ // Set buttons actions //------------------------------ $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); if (Mage::getModel('M2ePro/Wizard')->isActive() && Mage::getModel('M2ePro/Wizard')->getStatus() == Ess_M2ePro_Model_Wizard::STATUS_LICENSE) { $this->_addButton('reset', array('label' => Mage::helper('M2ePro')->__('Refresh'), 'onclick' => 'CommonHandlersObj.reset_click()', 'class' => 'reset')); $this->_addButton('close', array('label' => Mage::helper('M2ePro')->__('Complete This Step'), 'onclick' => 'LicenseHandlersObj.completeStep();', 'class' => 'close')); } else { $this->_addButton('goto_about', array('label' => Mage::helper('M2ePro')->__('About'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/adminhtml_about/index') . '\')', 'class' => 'button_link')); $this->_addButton('goto_support', array('label' => Mage::helper('M2ePro')->__('Support'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/adminhtml_support/index') . '\')', 'class' => 'button_link')); $docsLink = Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/documentation/', 'baseurl'); $this->_addButton('goto_docs', array('label' => Mage::helper('M2ePro')->__('Documentation'), 'onclick' => 'window.open(\'' . $docsLink . '\', \'M2ePro Documentation \' + \'' . $docsLink . '\'); return false;', 'class' => 'button_link')); $this->_addButton('reset', array('label' => Mage::helper('M2ePro')->__('Refresh'), 'onclick' => 'LicenseHandlersObj.reset_click()', 'class' => 'reset')); } //------------------------------ }
public function __construct() { parent::__construct(); // Initialization block //------------------------------ $this->setId('listingsAddStepOne'); $this->_blockGroup = 'M2ePro'; $this->_controller = 'adminhtml_listings'; $this->_mode = 'edit'; //------------------------------ // Set header text //------------------------------ $this->_headerText = Mage::helper('M2ePro')->__('Add Listing [Settings]'); //------------------------------ // Set buttons actions //------------------------------ $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); $this->_addButton('back', array('label' => Mage::helper('M2ePro')->__('Back'), 'onclick' => 'ListingEditHandlersObj.back_click(\'' . $this->getUrl('*/*/index') . '\')', 'class' => 'back')); $this->_addButton('reset', array('label' => Mage::helper('M2ePro')->__('Refresh'), 'onclick' => 'ListingEditHandlersObj.reset_click()', 'class' => 'reset')); $this->_addButton('save_and_next', array('label' => Mage::helper('M2ePro')->__('Next'), 'onclick' => 'ListingEditHandlersObj.save_click(\'' . $this->getUrl('*/*/add', array('step' => '1')) . '\')', 'class' => 'next')); //------------------------------ }
public function __construct() { parent::__construct(); $this->_objectId = 'id'; $this->_blockGroup = 'massimporterpro'; $this->_controller = 'adminhtml_priceupdater'; $this->removeButton('back'); $helper = Mage::helper('massimporterpro'); $isValid = $helper->isValid(); $isActive = $helper->isActive(); $message = ''; if (!$isActive) { $message = base64_decode('RXh0ZW5zaW9uIGhhcyBiZWVuIGRpc2FibGVkLiBQbGVhc2UgZW5hYmxlIGl0IGZyb20gTWFzcyBJbXBvcnRlciBQcm8gJnJhcXVvOyBNYW5hZ2UgU2V0dGluZ3M='); } else { if ($isActive && !$isValid) { $message = base64_decode('UGxlYXNlIGVudGVyIGEgdmFsaWQgbGljZW5zZSBrZXkgaW4gb3JkZXIgdG8gcnVuIHRoZSBleHRlbnNpb24='); } } if (!$isActive || $isActive && !$isValid) { $this->removeButton('save'); $this->_addButton('dsave', array('label' => Mage::helper('massimporterpro')->__('Run Import'), 'onclick' => 'alert(\'' . $message . '.\')', 'class' => 'disabled'), -100); } else { $this->_updateButton('save', 'label', Mage::helper('massimporterpro')->__('Run Import')); } $this->_formScripts[] = "\n function addUploadFile(){\n\t\t\t\tvar importFile = \$('import_file_upload').value;\n\t\t\t\tif(importFile == ''){\n\t\t\t\t\talert('Please select some import file.');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar ext = importFile.substring(importFile.lastIndexOf('.') + 1);\n\t\t\t\tif(ext.toLowerCase() != 'csv'){\n\t\t\t\t\talert('Please select valid import file (CSV).');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//tweak for required feilds: import file section, delimiter, enclosed\n\t\t\t\t\$('import_file').removeClassName('required-entry');\n\t\t\t\t\$('delimiter').removeClassName('required-entry');\n\t\t\t\t\$('enclosure').removeClassName('required-entry');\n editForm.submit('" . Mage::helper('adminhtml')->getUrl('massimporterpro/adminhtml_priceupdater/uploadCsv') . "');\n }\n "; }
public function __construct() { $this->_objectId = 'invoice_id'; $this->_controller = 'sales_order_invoice'; $this->_mode = 'view'; $this->_session = Mage::getSingleton('admin/session'); parent::__construct(); $this->_removeButton('save'); $this->_removeButton('reset'); $this->_removeButton('delete'); if ($this->_isAllowedAction('cancel') && $this->getInvoice()->canCancel()) { $this->_addButton('cancel', array('label' => Mage::helper('sales')->__('Cancel'), 'class' => 'delete', 'onclick' => 'setLocation(\'' . $this->getCancelUrl() . '\')')); } if ($this->_isAllowedAction('emails')) { $this->addButton('send_notification', array('label' => Mage::helper('sales')->__('Send Email'), 'onclick' => 'confirmSetLocation(\'' . Mage::helper('sales')->__('Are you sure you want to send Invoice email to customer?') . '\', \'' . $this->getEmailUrl() . '\')')); } $orderPayment = $this->getInvoice()->getOrder()->getPayment(); if ($this->_isAllowedAction('creditmemo') && $this->getInvoice()->getOrder()->canCreditmemo()) { if ($orderPayment->canRefundPartialPerInvoice() && $this->getInvoice()->canRefund() && $orderPayment->getAmountPaid() > $orderPayment->getAmountRefunded() || $orderPayment->canRefund() && !$this->getInvoice()->getIsUsedForRefund()) { $this->_addButton('capture', array('label' => Mage::helper('sales')->__('Credit Memo'), 'class' => 'go', 'onclick' => 'setLocation(\'' . $this->getCreditMemoUrl() . '\')')); } } if ($this->_isAllowedAction('capture') && $this->getInvoice()->canCapture()) { $this->_addButton('capture', array('label' => Mage::helper('sales')->__('Capture'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getCaptureUrl() . '\')')); } if ($this->getInvoice()->canVoid()) { $this->_addButton('void', array('label' => Mage::helper('sales')->__('Void'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getVoidUrl() . '\')')); } if ($this->getInvoice()->getId()) { $this->_addButton('print', array('label' => Mage::helper('sales')->__('Print'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getPrintUrl() . '\')')); } }
/** * Init class * */ public function __construct() { switch (Mage::registry('store_type')) { case 'website': $this->_objectId = 'website_id'; $saveLabel = Mage::helper('core')->__('Save Website'); $deleteLabel = Mage::helper('core')->__('Delete Website'); $deleteUrl = $this->getUrl('*/*/deleteWebsite', array('item_id' => Mage::registry('store_data')->getId())); break; case 'group': $this->_objectId = 'group_id'; $saveLabel = Mage::helper('core')->__('Save Store'); $deleteLabel = Mage::helper('core')->__('Delete Store'); $deleteUrl = $this->getUrl('*/*/deleteGroup', array('item_id' => Mage::registry('store_data')->getId())); break; case 'store': $this->_objectId = 'store_id'; $saveLabel = Mage::helper('core')->__('Save Store View'); $deleteLabel = Mage::helper('core')->__('Delete Store View'); $deleteUrl = $this->getUrl('*/*/deleteStore', array('item_id' => Mage::registry('store_data')->getId())); break; } $this->_controller = 'system_store'; parent::__construct(); $this->_updateButton('save', 'label', $saveLabel); $this->_updateButton('delete', 'label', $deleteLabel); $this->_updateButton('delete', 'onclick', 'setLocation(\'' . $deleteUrl . '\');'); if (!Mage::registry('store_data')->isCanDelete()) { $this->_removeButton('delete'); } if (Mage::registry('store_data')->isReadOnly()) { $this->_removeButton('save')->_removeButton('reset'); } }
public function __construct() { $this->_blockGroup = 'sagepayreporting'; $this->_controller = 'adminhtml_sagepayreporting_whitelistip'; parent::__construct(); $this->_updateButton('save', 'label', Mage::helper('sagepayreporting')->__('Add')); }
public function __construct() { parent::__construct(); $this->_objectId = 'id'; $this->_blockGroup = 'produp1'; $this->_controller = 'adminhtml_produp1'; $this->_updateButton('save', 'label', Mage::helper('produp1')->__('Save Item')); $this->_updateButton('delete', 'label', Mage::helper('produp1')->__('Delete Item')); $this->_addButton('saveandcontinue', array( 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'), 'onclick' => 'saveAndContinueEdit()', 'class' => 'save', ), -100); $this->_formScripts[] = " function toggleEditor() { if (tinyMCE.getInstanceById('produp1_content') == null) { tinyMCE.execCommand('mceAddControl', false, 'produp1_content'); } else { tinyMCE.execCommand('mceRemoveControl', false, 'produp1_content'); } } function saveAndContinueEdit(){ editForm.submit($('edit_form').action+'back/edit/'); } "; }
public function __construct() { parent::__construct(); $this->_objectId = 'id'; $this->_blockGroup = 'amfeed'; $this->_controller = 'adminhtml_field'; }
protected function _prepareLayout() { if ($this->_blockGroup && $this->_controller && $this->_mode) { $this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup . '/' . $this->_controller . '_' . $this->_mode . '_form')); } return parent::_prepareLayout(); }
/** * Internal constructor */ protected function _construct() { parent::_construct(); $this->_objectId = 'rate_id'; $this->_blockGroup = 'enterprise_reward'; $this->_controller = 'adminhtml_reward_rate'; }
public function __construct() { parent::__construct(); $source = $this->getRequest()->getParam('id'); $this->_objectId = 'id'; $this->_blockGroup = 'inventoryplus'; $this->_controller = 'adminhtml_stock'; $showcustomer_url = Mage::helper('adminhtml')->getUrl('inventoryplusadmin/adminhtml_stock/showcustomer'); $admin = Mage::getSingleton('admin/session')->getUser(); $this->_removeButton('delete'); $this->_removeButton('reset'); $this->_removeButton('back'); $stockActions = array(); $stockActions['adjuststock'] = array('params' => array('label' => Mage::helper('inventoryplus')->__('Adjust Stock'), 'onclick' => 'location.href=\'' . $this->getUrl('*/adminhtml_adjuststock/new') . '\'', 'class' => 'save'), 'position' => 10); /* Quick adjust stock button */ $this->_updateButton('save', 'label', Mage::helper('inventoryplus')->__('Update Stock In-grid')); $this->_updateButton('save', 'onclick', 'IMmassUpdateStock()'); $this->_updateButton('save', 'area', 'after_header'); /* End of Qucik adjust stock button */ $stockActionsObject = new Varien_Object(array('actions' => $stockActions)); Mage::dispatchEvent('inventoryplus_inventory_stock_action_buttons', array('stock_actions_object' => $stockActionsObject)); $this->_generateStockActionButtons($stockActionsObject); $this->setTemplate('inventoryplus/stock/content-header.phtml'); $this->_formScripts[] = " \n function IMmassUpdateStock(){\n if(\$('select_warehouse') && \$('select_warehouse').getValue() == '0'){\n alert('" . $this->__('Please select a warehouse to view stock & perform in-grid update.') . "');\n \$('select_warehouse').addClassName('highlight');\n window.scrollTo(0, 0);\n return;\n }\n var r=confirm('" . Mage::helper('inventoryplus')->__('Are you sure you want to update Qty. of products?') . "'); \n if (r==true){\n editForm.submit(\$('edit_form').action);\n }\n } \n \n function IMselectWarehouse() {\n \$('select_warehouse').removeClassName('highlight');\n }\n \n function toggleEditor() {\n if (tinyMCE.getInstanceById('inventory_content') == null)\n tinyMCE.execCommand('mceAddControl', false, 'inventory_content');\n else\n tinyMCE.execCommand('mceRemoveControl', false, 'inventory_content');\n } \n \n "; }
/** * Initialize form * Add standard buttons * Add "Save and Continue" button */ protected function _construct() { $this->_objectId = 'id'; $this->_controller = 'promo_quote'; parent::_construct(); $this->_addButton('save_and_continue_edit', array('class' => 'save', 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Save and Continue Edit'), 'data_attribute' => array('mage-init' => array('button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form')))), 10); }
protected function _prepareLayout() { if (!Mage::registry('current_customer')->isReadonly()) { $this->_addButton('save_and_continue', array('label' => Mage::helper('customer')->__('Save and Continue Edit'), 'onclick' => 'saveAndContinueEdit(\'' . $this->_getSaveAndContinueUrl() . '\')', 'class' => 'save'), 10); } return parent::_prepareLayout(); }
public function getFormHtml() { if ($this->getChild('form')) { return parent::getFormHtml(); } return ''; }
public function __construct() { $this->_objectId = 'id'; $this->_blockGroup = 'advancednewsletter'; $this->_controller = 'adminhtml_subscriber'; parent::__construct(); }
public function __construct() { parent::__construct(); // Initialization block //------------------------------ $this->setId('settings'); $this->_blockGroup = 'M2ePro'; $this->_controller = 'adminhtml'; $this->_mode = 'configuration_components'; //------------------------------ // Set header text //------------------------------ $this->_headerText = Mage::helper('M2ePro')->__('Settings'); //------------------------------ // Set buttons actions //------------------------------ $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); $this->_addButton('reset', array('label' => Mage::helper('M2ePro')->__('Refresh'), 'onclick' => 'ComponentsHandlerObj.reset_click()', 'class' => 'reset')); $this->_addButton('close', array('label' => Mage::helper('M2ePro')->__('Save And Complete This Step'), 'onclick' => 'ComponentsHandlerObj.completeStep();', 'class' => 'close')); //------------------------------ }
public function __construct() { parent::__construct(); $this->_objectId = 'id'; $this->_blockGroup = 'inventorybarcode'; $this->_controller = 'adminhtml_barcode'; // $this->_updateButton('save', 'label', Mage::helper('inventorybarcode')->__('Save Item')); $this->_removeButton('delete'); /* Add by Kai - print barcode */ if ($this->getRequest()->getParam('print') == 'true') { $this->_removeButton('save'); $this->_removeButton('reset'); $this->_addButton('printbarcode1', array('label' => Mage::helper('adminhtml')->__('PRINT'), 'onclick' => 'printbarcode1()', 'class' => 'printbarcode1'), -100); } else { /* End add by Kai - print barcode */ if ($this->getRequest()->getParam('id')) { $this->_removeButton('save'); $this->_removeButton('reset'); $this->_addButton('print_barcode', array('label' => Mage::helper('inventorybarcode')->__('Print Barcodes'), 'onclick' => 'createBarcode()', 'class' => 'add'), 0); if (Mage::registry('barcode_data')->getBarcodeStatus() == 1) { $this->_addButton('disable_barcode', array('label' => Mage::helper('inventorybarcode')->__('Disable'), 'onclick' => 'disableBarcode()', 'class' => 'disable'), 0); } else { $this->_addButton('disable_barcode', array('label' => Mage::helper('inventorybarcode')->__('Enable'), 'onclick' => 'enableBarcode()', 'class' => 'disable'), 0); } } else { $this->_updateButton('save', 'label', Mage::helper('inventorybarcode')->__('Save Barcode')); } } $classBarcode = Mage::helper('inventorybarcode')->getValidateBarcode(); $this->_formScripts[] = "\r\n function createBarcode(){\r\n var url = '" . $this->getUrl('adminhtml/inb_printbarcode/selecttemplate', array('barcode' => $this->getRequest()->getParam('id'))) . "';\r\n window.open(url,'_blank', 'scrollbars=yes, resizable=yes, width=750, height=500, left=80, menubar=yes'); \r\n }\r\n \r\n function toggleEditor() {\r\n if (tinyMCE.getInstanceById('inventorybarcode_content') == null)\r\n tinyMCE.execCommand('mceAddControl', false, 'inventorybarcode_content');\r\n else\r\n tinyMCE.execCommand('mceRemoveControl', false, 'inventorybarcode_content');\r\n }\r\n \r\n function printbarcode1()\r\n { \r\n var productInput = \$\$('input[name=\"purchase_products\"]');\r\n if(productInput[0].value == ''){\r\n alert('" . $this->__('Please choose barcodes before printing.') . "');\r\n return false;\r\n }\r\n \r\n \$('edit_form').target='_blank';\r\n editForm.submit('" . $this->getUrl('*/*/massprint') . "');\r\n }\r\n\r\n\r\n function saveAndContinueEdit(){\r\n editForm.submit(\$('edit_form').action+'back/edit/');\r\n }\r\n \r\n function disableBarcode(){\r\n editForm.submit(\$('edit_form').action+'barcode_status/2/');\r\n }\r\n \r\n function enableBarcode(){\r\n editForm.submit(\$('edit_form').action+'barcode_status/1/');\r\n }\r\n \r\n function setBarcodeAuto (element, id){\r\n if(element.checked){\r\n \$(id).value = '';\r\n \$(id).readOnly = true;\r\n \$(id).removeClassName('" . $classBarcode . "') \r\n }else{\r\n \$(id).readOnly = false;\r\n \$(id).addClassName('" . $classBarcode . "') \r\n }\r\n }\r\n \r\n function fileSelected() {\r\n var file = document.getElementById('fileToUpload').files[0];\r\n if (file) {\r\n var fileSize = 0;\r\n if (file.size > 1024 * 1024)\r\n fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + 'MB';\r\n else\r\n fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + 'KB';\r\n document.getElementById('fileName').innerHTML = 'Name: ' + file.name;\r\n document.getElementById('fileSize').innerHTML = 'Size: ' + fileSize;\r\n document.getElementById('fileType').innerHTML = 'Type: ' + file.type;\r\n }\r\n }\r\n\t\t\t\r\n function uploadFile() {\r\n if(!\$('fileToUpload') || !\$('fileToUpload').value){\r\n alert('Please choose CSV file to import!');return false;\r\n }\r\n if(\$('loading-mask')){\r\n \$('loading-mask').style.display = 'block';\r\n \$('loading-mask').style.height = '900px'; \r\n \$('loading-mask').style.width = '1500px'; \r\n \$('loading-mask').style.top = '0'; \r\n \$('loading-mask').style.left = '-2'; \r\n }\r\n var fd = new FormData();\r\n fd.append('fileToUpload', document.getElementById('fileToUpload').files[0]);\r\n fd.append('form_key', document.getElementById('form_key').value);\r\n var xhr = new XMLHttpRequest();\r\n xhr.upload.addEventListener('progress', uploadProgress, false);\r\n xhr.addEventListener('load', uploadComplete, false);\r\n xhr.addEventListener('error', uploadFailed, false);\r\n xhr.addEventListener('abort', uploadCanceled, false);\r\n xhr.open('POST', '" . $this->getUrl('adminhtml/inb_barcode/getImportCsv') . "');\r\n xhr.send(fd);\r\n }\r\n\r\n function uploadProgress(evt) {\r\n if (evt.lengthComputable) {\r\n var percentComplete = Math.round(evt.loaded * 100 / evt.total);\r\n //document.getElementById('progressNumber').innerHTML = percentComplete.toString() + '%';\r\n // document.getElementById('prog').value = percentComplete;\r\n }\r\n else {\r\n // document.getElementById('progressNumber').innerHTML = 'unable to compute';\r\n }\r\n }\r\n \r\n function uploadComplete(evt) {\r\n var import_data = '" . Mage::getModel('admin/session')->getData('null_barcode_product_import') . "'; \r\n \r\n if(import_data == '1'){\r\n alert('No product was added');\r\n }\r\n \r\n \$('barcode_tabs_products_section').addClassName('notloaded');\r\n barcode_tabsJsTabs.showTabContent(\$('barcode_tabs_products_section'));\r\n //varienGlobalEvents.attachEventHandler('showTab',function(){ sendstockproductGridJsObject.doFilter(); });\r\n }\r\n\r\n function uploadFailed(evt) {\r\n alert('There was an error attempting to upload the file.');\r\n }\r\n\r\n function uploadCanceled(evt) {\r\n alert('The upload has been canceled by the user or the browser dropped the connection.');\r\n } \r\n "; }
/** * Initialize form * Add standard buttons * Add "Save and Continue" button */ public function __construct() { $this->_objectId = 'id'; $this->_controller = 'promo_quote'; parent::__construct(); $this->_addButton('save_and_continue_edit', array('class' => 'save', 'label' => Mage::helper('salesrule')->__('Save and Continue Edit'), 'onclick' => 'editForm.submit($(\'edit_form\').action + \'back/edit/\')'), 10); }
/** * Internal constructor * */ protected function _construct() { parent::_construct(); $this->_objectId = 'job_code'; $this->_blockGroup = 'aoe_scheduler'; $this->_controller = 'adminhtml_job'; }
protected function _prepareLayout() { if (Mage::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true) && Mage::helper('googleoptimizer')->isOptimizerActive(Mage::app()->getStore()->getStoreId())) { $this->setChild('googleoptimizer_js', $this->getLayout()->createBlock('googleoptimizer/js')->setTemplate('googleoptimizer/js.phtml')); } return parent::_prepareLayout(); }
/** * Add & remove control buttons * */ public function __construct() { $this->_objectId = 'creditmemo_id'; $this->_controller = 'sales_order_creditmemo'; $this->_mode = 'view'; parent::__construct(); $this->_removeButton('save'); $this->_removeButton('reset'); $this->_removeButton('delete'); if ($this->getCreditmemo()->canCancel()) { $this->_addButton('cancel', array('label' => Mage::helper('sales')->__('Cancel'), 'class' => 'delete', 'onclick' => 'setLocation(\'' . $this->getCancelUrl() . '\')')); } if ($this->_isAllowedAction('emails')) { $this->addButton('send_notification', array('label' => Mage::helper('sales')->__('Send Email'), 'onclick' => 'confirmSetLocation(\'' . Mage::helper('sales')->__('Are you sure you want to send Creditmemo email to customer?') . '\', \'' . $this->getEmailUrl() . '\')')); } if ($this->getCreditmemo()->canRefund()) { $this->_addButton('refund', array('label' => Mage::helper('sales')->__('Refund'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getRefundUrl() . '\')')); } if ($this->getCreditmemo()->canVoid()) { $this->_addButton('void', array('label' => Mage::helper('sales')->__('Void'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getVoidUrl() . '\')')); } if ($this->getCreditmemo()->getId()) { $this->_addButton('print', array('label' => Mage::helper('sales')->__('Print'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getPrintUrl() . '\')')); } }
protected function _toHtml() { $listing = Mage::helper('M2ePro/Component')->getCachedUnknownObject('Listing', $this->getRequest()->getParam('id')); $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => $listing)); $this->setChild('view_header', $viewHeaderBlock); return parent::_toHtml(); }
/** * Init container */ public function __construct() { $this->_objectId = 'sitemap_id'; $this->_controller = 'sitemap'; parent::__construct(); $this->_addButton('generate', array('label' => AO::helper('adminhtml')->__('Save & Generate'), 'onclick' => "\$('generate').value=1; editForm.submit();", 'class' => 'add')); }
public function __construct() { $this->_objectId = 'attribute_id'; $this->_controller = 'index'; $this->_blockGroup = 'attributemanager'; parent::__construct(); //$this->_removeButton('back'); $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/index/customer') . '\')'); if ($this->getRequest()->getParam('popup')) { $this->_removeButton('back'); $this->_addButton('close', array('label' => Mage::helper('catalog')->__('Close Window'), 'class' => 'cancel', 'onclick' => 'window.close()', 'level' => -1)); } $this->_updateButton('save', 'label', Mage::helper('catalog')->__('Save Attribute')); /*$this->_addButton( 'save_and_edit_button', array( 'label' => Mage::helper('catalog')->__('Save And Continue Edit'), 'onclick' => 'saveAndContinueEdit()', 'class' => 'save' ), 100 );*/ if (!Mage::registry('attributemanager_data')->getIsUserDefined()) { $this->_removeButton('delete'); } else { $this->_updateButton('delete', 'label', Mage::helper('catalog')->__('Delete Attribute')); $this->_updateButton('delete', 'onclick', "deleteConfirm(\r\n \t\t'" . Mage::helper('adminhtml')->__('Are you sure you want to do this?') . "',\r\n \t\t'" . $this->getUrl('*/*/delete/type/' . $this->getRequest()->getParam('type') . '/attribute_id/' . $this->getRequest()->getParam('attribute_id')) . "')"); } }
public function __construct() { parent::__construct(); $this->_objectId = 'id'; $this->_blockGroup = 'amshopby'; $this->_controller = 'adminhtml_range'; }
public function __construct() { parent::__construct(); // Initialization block //------------------------------ $this->setId('listingsEdit'); $this->_blockGroup = 'M2ePro'; $this->_controller = 'adminhtml_listings'; $this->_mode = 'edit'; //------------------------------ // Set header text //------------------------------ $listingData = Mage::registry('M2ePro_data'); $headerText = Mage::helper('M2ePro')->__('Edit "%title%" Listing [Settings]'); $this->_headerText = str_replace('%title%', $this->htmlEscape($listingData['title']), $headerText); //------------------------------ // Set buttons actions //------------------------------ $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); if (!is_null($this->getRequest()->getParam('back'))) { $this->_addButton('back', array('label' => Mage::helper('M2ePro')->__('Back'), 'onclick' => 'ListingEditHandlersObj.back_click(\'' . Mage::helper('M2ePro')->getBackUrl('*/adminhtml_listings/index') . '\')', 'class' => 'back')); } $this->_addButton('reset', array('label' => Mage::helper('M2ePro')->__('Refresh'), 'onclick' => 'ListingEditHandlersObj.reset_click()', 'class' => 'reset')); $this->_addButton('save', array('label' => Mage::helper('M2ePro')->__('Save'), 'onclick' => 'ListingEditHandlersObj.save_click(\'' . $this->getUrl('*/*/edit', array('id' => $listingData['id'], 'back' => Mage::helper('M2ePro')->getBackUrlParam('list'))) . '\')', 'class' => 'save')); $this->_addButton('save_and_continue', array('label' => Mage::helper('M2ePro')->__('Save And Continue Edit'), 'onclick' => 'ListingEditHandlersObj.save_and_edit_click()', 'class' => 'save')); //------------------------------ }
/** * Internal constructor * * @return void */ protected function _construct() { parent::_construct(); $this->_objectId = 'export_id'; $this->_blockGroup = 'importexport'; $this->_controller = 'adminhtml_export'; }
public function __construct() { parent::__construct(); $this->_objectId = 'id'; $this->_blockGroup = 'blog'; $this->_controller = 'adminhtml_post'; $id = Mage::app()->getFrontController()->getRequest()->getParam('id', 0); $this->setValidationUrl(Mage::helper('adminhtml')->getUrl('blog/adminhtml_post/validate', array('id' => $id))); //echo $this->getJsUrl('tiny_mce/tiny_mce.js');exit; $this->_updateButton('save', 'label', Mage::helper('blog')->__('Save Post')); $this->_updateButton('delete', 'label', Mage::helper('blog')->__('Delete Post')); //$this->getTagList(); $this->_addButton('saveandcontinue', array('label' => Mage::helper('adminhtml')->__('Save And Continue Edit'), 'onclick' => 'saveAndContinueEdit()', 'class' => 'save'), -100); $tagList = $this->getTagList(); $urlTagList = Mage::helper('adminhtml')->getUrl('blog/adminhtml_post/autotag'); $this->_formScripts[] = "\n function toggleEditor() {\n if (tinyMCE.getInstanceById('post_content') == null) {\n tinyMCE.execCommand('mceAddControl', false, 'post_content');\n } else {\n tinyMCE.execCommand('mceRemoveControl', false, 'post_content');\n }\n }\n\n editForm._processValidationResult = function(transport) {\n var response = transport.responseText.evalJSON();\n if (response.error){\n if (response.attribute && \$(response.attribute)) {\n \$(response.attribute).setHasError(true, editForm);\n Validation.ajaxError(\$(response.attribute), response.message);\n if (!Prototype.Browser.IE){\n \$(response.attribute).focus();\n }\n }\n else if (\$('messages')) {\n if(!\$('advice-validate-ajax-sku'))\n {\n var div = new Element('div', { 'class': 'validation-advice', id: 'advice-validate-ajax-sku' }).update(response.message);\n \$('post_identifier').value = response.identifier;\n \$('post_identifier').up().insert(div);\n }\n \n }\n }\n else{\n editForm._submit();\n }\n };\n\n function saveAndContinueEdit(){\n editForm.submit(\$('edit_form').action+'back/edit/');\n }\n \n new Ajax.Autocompleter(\n 'tag',\n 'tag-indicator',\n '{$urlTagList}',\n {\n paramName:'q',\n minChars:3,\n indicator:'tag_auto_indicator',\n updateElement:getSelectionTag,\n evalJSON:'force',\n }\n );\n function getSelectionTag(li)\n {\n var tagid = li.getAttribute('value');\n var tagname = li.getAttribute('tag');\n addTag(tagname,tagid);\n //alert('abc');\n }\n \n function addTag(tagname,tagid)\n {\n var curtags = \$('taglist').innerHTML;\n var curtagsvalue = \$('tag-value').innerHTML;\n var curtagsname = \$('tag-name').innerHTML;\n if(!curtags)\n {\n \$('taglist').innerHTML = curtags + '<li style=\"cursor:pointer\" id=\"0\" onclick=\"removeTag(0);\">' + tagname + '</li>';\n \$('tag-value').innerHTML = curtagsvalue + '<input type=\"hidden\" id=\"0value\" name=\"tags[]\" value=\"' + tagid + '\"/>';\n \$('tag-name').innerHTML = curtagsname + '<input type=\"hidden\" id=\"0name\" name=\"tags_name[]\" value=\"' + tagname + '\"/>';\n }\n \n else\n {\n var list = \$('taglist').getElementsByTagName('li');\n var i;\n for(i=0;i<list.length;i++)\n {\n if(list[i].innerHTML == tagname)\n return;\n }\n \$('taglist').innerHTML = curtags + '<li style=\"cursor:pointer\" id=\"' + i + '\" onclick=\"removeTag(' + i + ');\">' + tagname + '</li>';\n \$('tag-value').innerHTML = curtagsvalue + '<input id=\"' + i + 'value\" type=\"hidden\" name=\"tags[]\" value=\"' + tagid + '\"/>';\n \$('tag-name').innerHTML = curtagsname + '<input id=\"' + i + 'name\" type=\"hidden\" name=\"tags_name[]\" value=\"' + tagname + '\"/>';\n }\n \$('tag').setValue('');\n }\n \n function removeTag(id)\n {\n //alert(\$(id));\n var tag = document.getElementById(id);\n var tagValue = document.getElementById(id + 'value');\n var tagName = document.getElementById(id + 'name');\n tag.parentNode.removeChild(tag);\n tagValue.parentNode.removeChild(tagValue);\n tagName.parentNode.removeChild(tagName);\n //alert('abc');\n \n }\n\n function updateTag()\n {\n var new_tag = \$('tag').value;\n if(new_tag == '')\n alert('not value');\n else\n addTag(new_tag,0);\n }\n \n "; /* window.addEvent('domready', function() { new Autocompleter.Request.JSON('tag', '$urlTagList', { 'postVar': 'tag' }); });*/ //$this->getChildHtml('js'); }
protected function _prepareLayout() { parent::_prepareLayout(); if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } }
/** * Prepare layout * * @return Mage_Core_Block_Abstract */ protected function _prepareLayout() { if ($head = $this->getLayout()->getBlock('head')) { $head->setCanLoadExtJs(true); } return parent::_prepareLayout(); }