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 class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formset extends Mage_Adminhtml_Block_Widget_Form
00034 {
00035 public function __construct()
00036 {
00037 parent::__construct();
00038 }
00039
00040 protected function _prepareForm()
00041 {
00042 $data = Mage::getModel('eav/entity_attribute_set')
00043 ->load($this->getRequest()->getParam('id'));
00044
00045 $form = new Varien_Data_Form();
00046 $fieldset = $form->addFieldset('set_name', array('legend'=>__('Edit Set Name')));
00047 $fieldset->addField('attribute_set_name', 'text',
00048 array(
00049 'label' => Mage::helper('catalog')->__('Name<br/>(For internal use)'),
00050 'name' => 'attribute_set_name',
00051 'required' => true,
00052 'class' => 'required-entry',
00053 'value' => $data->getAttributeSetName()
00054 ));
00055
00056 if( !$this->getRequest()->getParam('id', false) ) {
00057 $fieldset->addField('gotoEdit', 'hidden',
00058 array(
00059 'name' => 'gotoEdit',
00060 'value' => '1'
00061 ));
00062
00063 $sets = Mage::getModel('eav/entity_attribute_set')
00064 ->getResourceCollection()
00065 ->setEntityTypeFilter(Mage::registry('entityType'))
00066 ->load()
00067 ->toOptionArray();
00068
00069 $fieldset->addField('skeleton_set', 'select',
00070 array(
00071 'label' => Mage::helper('catalog')->__('Based On'),
00072 'name' => 'skeleton_set',
00073 'required' => true,
00074 'class' => 'required-entry',
00075 'values' => $sets,
00076 ));
00077 }
00078
00079 $form->setMethod('post');
00080 $form->setUseContainer(true);
00081 $form->setId('set_prop_form');
00082 $form->setAction($this->getUrl('*/*/save'));
00083 $form->setOnsubmit('return false;');
00084 $this->setForm($form);
00085 }
00086 }