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: * Product attribute add/edit form system tab
29: *
30: * @category Mage
31: * @package Mage_Adminhtml
32: * @author Magento Core Team <core@magentocommerce.com>
33: */
34:
35: class Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_System extends Mage_Adminhtml_Block_Widget_Form
36: {
37:
38: protected function _prepareForm()
39: {
40: $model = Mage::registry('entity_attribute');
41:
42: $form = new Varien_Data_Form();
43: $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('catalog')->__('System Properties')));
44:
45: if ($model->getAttributeId()) {
46: $fieldset->addField('attribute_id', 'hidden', array(
47: 'name' => 'attribute_id',
48: ));
49: }
50:
51: $yesno = array(
52: array(
53: 'value' => 0,
54: 'label' => Mage::helper('catalog')->__('No')
55: ),
56: array(
57: 'value' => 1,
58: 'label' => Mage::helper('catalog')->__('Yes')
59: ));
60:
61: /*$fieldset->addField('attribute_model', 'text', array(
62: 'name' => 'attribute_model',
63: 'label' => Mage::helper('catalog')->__('Attribute Model'),
64: 'title' => Mage::helper('catalog')->__('Attribute Model'),
65: ));
66:
67: $fieldset->addField('backend_model', 'text', array(
68: 'name' => 'backend_model',
69: 'label' => Mage::helper('catalog')->__('Backend Model'),
70: 'title' => Mage::helper('catalog')->__('Backend Model'),
71: ));*/
72:
73: $fieldset->addField('backend_type', 'select', array(
74: 'name' => 'backend_type',
75: 'label' => Mage::helper('catalog')->__('Data Type for Saving in Database'),
76: 'title' => Mage::helper('catalog')->__('Data Type for Saving in Database'),
77: 'options' => array(
78: 'text' => Mage::helper('catalog')->__('Text'),
79: 'varchar' => Mage::helper('catalog')->__('Varchar'),
80: 'static' => Mage::helper('catalog')->__('Static'),
81: 'datetime' => Mage::helper('catalog')->__('Datetime'),
82: 'decimal' => Mage::helper('catalog')->__('Decimal'),
83: 'int' => Mage::helper('catalog')->__('Integer'),
84: ),
85: ));
86:
87: /*$fieldset->addField('backend_table', 'text', array(
88: 'name' => 'backend_table',
89: 'label' => Mage::helper('catalog')->__('Backend Table'),
90: 'title' => Mage::helper('catalog')->__('Backend Table Title'),
91: ));
92:
93: $fieldset->addField('frontend_model', 'text', array(
94: 'name' => 'frontend_model',
95: 'label' => Mage::helper('catalog')->__('Frontend Model'),
96: 'title' => Mage::helper('catalog')->__('Frontend Model'),
97: ));*/
98:
99: /*$fieldset->addField('is_visible', 'select', array(
100: 'name' => 'is_visible',
101: 'label' => Mage::helper('catalog')->__('Visible'),
102: 'title' => Mage::helper('catalog')->__('Visible'),
103: 'values' => $yesno,
104: ));*/
105:
106: /*$fieldset->addField('source_model', 'text', array(
107: 'name' => 'source_model',
108: 'label' => Mage::helper('catalog')->__('Source Model'),
109: 'title' => Mage::helper('catalog')->__('Source Model'),
110: ));*/
111:
112: $fieldset->addField('is_global', 'select', array(
113: 'name' => 'is_global',
114: 'label' => Mage::helper('catalog')->__('Globally Editable'),
115: 'title' => Mage::helper('catalog')->__('Globally Editable'),
116: 'values'=> $yesno,
117: ));
118:
119: $form->setValues($model->getData());
120:
121: if ($model->getAttributeId()) {
122: $form->getElement('backend_type')->setDisabled(1);
123: if ($model->getIsGlobal()) {
124: #$form->getElement('is_global')->setDisabled(1);
125: }
126: } else {
127: }
128:
129: $this->setForm($form);
130:
131: return parent::_prepareForm();
132: }
133:
134: }
135: