1: <?php
2: /**
3: * Magento
4: *
5: * NOTICE OF LICENSE
6: *
7: * This source file is subject to the Open Software License (OSL 3.0)
8: * that is bundled with this package in the file LICENSE.txt.
9: * It is also available through the world-wide-web at this URL:
10: * http://opensource.org/licenses/osl-3.0.php
11: * If you did not receive a copy of the license and are unable to
12: * obtain it through the world-wide-web, please send an email
13: * to license@magentocommerce.com so we can send you a copy immediately.
14: *
15: * DISCLAIMER
16: *
17: * Do not edit or add to this file if you wish to upgrade Magento to newer
18: * versions in the future. If you wish to customize Magento for your
19: * needs please refer to http://www.magentocommerce.com for more information.
20: *
21: * @category Mage
22: * @package Mage_Adminhtml
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26:
27:
28: /**
29: * Adminhtml catalog product action attribute update
30: *
31: * @category Mage
32: * @package Mage_Adminhtml
33: * @author Magento Core Team <core@magentocommerce.com>
34: */
35: class Mage_Adminhtml_Block_Catalog_Product_Edit_Action_Attribute extends Mage_Adminhtml_Block_Widget
36: {
37:
38: protected function _prepareLayout()
39: {
40: $this->setChild('back_button',
41: $this->getLayout()->createBlock('adminhtml/widget_button')
42: ->setData(array(
43: 'label' => Mage::helper('catalog')->__('Back'),
44: 'onclick' => 'setLocation(\''.$this->getUrl('*/catalog_product/', array('store'=>$this->getRequest()->getParam('store', 0))).'\')',
45: 'class' => 'back'
46: ))
47: );
48:
49: $this->setChild('reset_button',
50: $this->getLayout()->createBlock('adminhtml/widget_button')
51: ->setData(array(
52: 'label' => Mage::helper('catalog')->__('Reset'),
53: 'onclick' => 'setLocation(\''.$this->getUrl('*/*/*', array('_current'=>true)).'\')'
54: ))
55: );
56:
57: $this->setChild('save_button',
58: $this->getLayout()->createBlock('adminhtml/widget_button')
59: ->setData(array(
60: 'label' => Mage::helper('catalog')->__('Save'),
61: 'onclick' => 'attributesForm.submit()',
62: 'class' => 'save'
63: ))
64: );
65: }
66:
67: /**
68: * Retrieve selected products for update
69: *
70: * @return unknown
71: */
72: public function getProducts()
73: {
74: return $this->_getHelper()->getProducts();
75: }
76:
77: /**
78: * Retrieve block attributes update helper
79: *
80: * @return Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute
81: */
82: protected function _getHelper()
83: {
84: return $this->helper('adminhtml/catalog_product_edit_action_attribute');
85: }
86:
87: /**
88: * Retrieve back button html code
89: *
90: * @return string
91: */
92: public function getBackButtonHtml()
93: {
94: return $this->getChildHtml('back_button');
95: }
96:
97: /**
98: * Retrieve cancel button html code
99: *
100: * @return string
101: */
102: public function getCancelButtonHtml()
103: {
104: return $this->getChildHtml('reset_button');
105: }
106:
107: /**
108: * Retrieve save button html code
109: *
110: * @return string
111: */
112: public function getSaveButtonHtml()
113: {
114: return $this->getChildHtml('save_button');
115: }
116:
117: /**
118: * Get save url
119: *
120: * @return string
121: */
122: public function getSaveUrl()
123: {
124: return $this->getUrl('*/*/save', array('store'=>Mage::helper('adminhtml/catalog_product_edit_action_attribute')->getSelectedStoreId()));
125: }
126:
127: /**
128: * Get validation url
129: *
130: * @return string
131: */
132: public function getValidationUrl()
133: {
134: return $this->getUrl('*/*/validate', array('_current'=>true));
135: }
136: }
137: