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_CurrencySymbol
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: * Manage currency symbols block
29: *
30: * @category Mage
31: * @package Mage_CurrencySymbol
32: * @author Magento Core Team <core@magentocommerce.com>
33: */
34: class Mage_Currencysymbol_Block_Adminhtml_System_Currencysymbol extends Mage_Adminhtml_Block_Widget_Form
35: {
36: /**
37: * Constructor. Initialization required variables for class instance.
38: */
39: public function __construct()
40: {
41: $this->_blockGroup = 'currencysymbol_system';
42: $this->_controller = 'adminhtml_system_currencysymbol';
43: parent::__construct();
44: }
45:
46: /**
47: * Custom currency symbol properties
48: *
49: * @var array
50: */
51: protected $_symbolsData = array();
52:
53: /**
54: * Prepares layout
55: *
56: * @return Mage_Core_Block_Abstract
57: */
58: protected function _prepareLayout()
59: {
60: return parent::_prepareLayout();
61: }
62:
63: /**
64: * Returns page header
65: *
66: * @return bool|string
67: */
68: public function getHeader()
69: {
70: return Mage::helper('adminhtml')->__('Manage Currency Symbols');
71: }
72:
73: /**
74: * Returns 'Save Currency Symbol' button's HTML code
75: *
76: * @return string
77: */
78: public function getSaveButtonHtml()
79: {
80: /** @var $block Mage_Core_Block_Abstract */
81: $block = $this->getLayout()->createBlock('adminhtml/widget_button');
82: $block->setData(array(
83: 'label' => Mage::helper('currencysymbol')->__('Save Currency Symbols'),
84: 'onclick' => 'currencySymbolsForm.submit();',
85: 'class' => 'save'
86: ));
87:
88: return $block->toHtml();
89: }
90:
91: /**
92: * Returns URL for save action
93: *
94: * @return string
95: */
96: public function getFormActionUrl()
97: {
98: return $this->getUrl('*/*/save');
99: }
100:
101: /**
102: * Returns website id
103: *
104: * @return int
105: */
106: public function getWebsiteId()
107: {
108: return $this->getRequest()->getParam('website');
109: }
110:
111: /**
112: * Returns store id
113: *
114: * @return int
115: */
116: public function getStoreId()
117: {
118: return $this->getRequest()->getParam('store');
119: }
120:
121: /**
122: * Returns Custom currency symbol properties
123: *
124: * @return array
125: */
126: public function getCurrencySymbolsData()
127: {
128: if(!$this->_symbolsData) {
129: $this->_symbolsData = Mage::getModel('currencysymbol/system_currencysymbol')
130: ->getCurrencySymbolsData();
131: }
132: return $this->_symbolsData;
133: }
134:
135: /**
136: * Returns inheritance text
137: *
138: * @return string
139: */
140: public function getInheritText()
141: {
142: return Mage::helper('currencysymbol')->__('Use Standard');
143: }
144: }
145: