1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31:
32:
33: class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formset extends Mage_Adminhtml_Block_Widget_Form
34: {
35: public function __construct()
36: {
37: parent::__construct();
38: }
39:
40: 41: 42: 43:
44: protected function _prepareForm()
45: {
46: $data = Mage::getModel('eav/entity_attribute_set')
47: ->load($this->getRequest()->getParam('id'));
48:
49: $form = new Varien_Data_Form();
50: $fieldset = $form->addFieldset('set_name', array('legend'=> Mage::helper('catalog')->__('Edit Set Name')));
51: $fieldset->addField('attribute_set_name', 'text', array(
52: 'label' => Mage::helper('catalog')->__('Name'),
53: 'note' => Mage::helper('catalog')->__('For internal use.'),
54: 'name' => 'attribute_set_name',
55: 'required' => true,
56: 'class' => 'required-entry validate-no-html-tags',
57: 'value' => $data->getAttributeSetName()
58: ));
59:
60: if( !$this->getRequest()->getParam('id', false) ) {
61: $fieldset->addField('gotoEdit', 'hidden', array(
62: 'name' => 'gotoEdit',
63: 'value' => '1'
64: ));
65:
66: $sets = Mage::getModel('eav/entity_attribute_set')
67: ->getResourceCollection()
68: ->setEntityTypeFilter(Mage::registry('entityType'))
69: ->load()
70: ->toOptionArray();
71:
72: $fieldset->addField('skeleton_set', 'select', array(
73: 'label' => Mage::helper('catalog')->__('Based On'),
74: 'name' => 'skeleton_set',
75: 'required' => true,
76: 'class' => 'required-entry',
77: 'values' => $sets,
78: ));
79: }
80:
81: $form->setMethod('post');
82: $form->setUseContainer(true);
83: $form->setId('set_prop_form');
84: $form->setAction($this->getUrl('*/*/save'));
85: $form->setOnsubmit('return false;');
86: $this->setForm($form);
87: }
88: }
89: