00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Adminhtml_Block_Catalog_Product_Edit_Action_Attribute_Tab_Attributes
00036 extends Mage_Adminhtml_Block_Catalog_Form
00037 implements Mage_Adminhtml_Block_Widget_Tab_Interface
00038 {
00039 protected function _construct()
00040 {
00041 parent::_construct();
00042 $this->setShowGlobalIcon(true);
00043 }
00044
00045 protected function _prepareForm()
00046 {
00047 $this->setFormExcludedFieldList(array('tier_price','gallery', 'media_gallery'));
00048 Mage::dispatchEvent('adminhtml_catalog_product_form_prepare_excluded_field_list', array('object'=>$this));
00049
00050 $form = new Varien_Data_Form();
00051 $fieldset = $form->addFieldset('fields', array('legend'=>Mage::helper('catalog')->__('Attributes')));
00052 $attributes = $this->getAttributes();
00053
00054
00055
00056
00057 $form->setDataObject(Mage::getModel('catalog/product'));
00058 $this->_setFieldset($attributes, $fieldset, $this->getFormExcludedFieldList());
00059 $form->setFieldNameSuffix('attributes');
00060 $this->setForm($form);
00061 }
00062
00063
00064
00065
00066
00067
00068 public function getAttributes()
00069 {
00070 return $this->helper('adminhtml/catalog_product_edit_action_attribute')->getAttributes()->getItems();
00071 }
00072
00073
00074
00075
00076
00077
00078 protected function _getAdditionalElementTypes()
00079 {
00080 return array(
00081 'price' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_price'),
00082 'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_image'),
00083 'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_boolean')
00084 );
00085 }
00086
00087
00088
00089
00090
00091
00092
00093 protected function _getAdditionalElementHtml($element)
00094 {
00095 return '<span class="attribute-change-checkbox"><input type="checkbox" id="' . $element->getId()
00096 . '-checkbox" onclick="toogleFieldEditMode(this, \'' . $element->getId()
00097 . '\')" /><label for="' . $element->getId() . '-checkbox">' . Mage::helper('catalog')->__('Change')
00098 . '</label></span>
00099 <script type="text/javascript">initDisableFields(\''.$element->getId().'\')</script>';
00100 }
00101
00102
00103
00104
00105 public function getTabLabel()
00106 {
00107 return Mage::helper('catalog')->__('Attributes');
00108 }
00109
00110 public function getTabTitle()
00111 {
00112 return Mage::helper('catalog')->__('Attributes');
00113 }
00114
00115 public function canShowTab()
00116 {
00117 return true;
00118 }
00119
00120 public function isHidden()
00121 {
00122 return false;
00123 }
00124 }