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:
34: class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Settings extends Mage_Adminhtml_Block_Widget_Form
35: {
36: protected function _prepareLayout()
37: {
38: $this->setChild('continue_button',
39: $this->getLayout()->createBlock('adminhtml/widget_button')
40: ->setData(array(
41: 'label' => Mage::helper('catalog')->__('Continue'),
42: 'onclick' => "setSettings('".$this->getContinueUrl()."','attribute_set_id','product_type')",
43: 'class' => 'save'
44: ))
45: );
46: return parent::_prepareLayout();
47: }
48:
49: protected function _prepareForm()
50: {
51: $form = new Varien_Data_Form();
52: $fieldset = $form->addFieldset('settings', array('legend'=>Mage::helper('catalog')->__('Create Product Settings')));
53:
54: $entityType = Mage::registry('product')->getResource()->getEntityType();
55:
56: $fieldset->addField('attribute_set_id', 'select', array(
57: 'label' => Mage::helper('catalog')->__('Attribute Set'),
58: 'title' => Mage::helper('catalog')->__('Attribute Set'),
59: 'name' => 'set',
60: 'value' => $entityType->getDefaultAttributeSetId(),
61: 'values'=> Mage::getResourceModel('eav/entity_attribute_set_collection')
62: ->setEntityTypeFilter($entityType->getId())
63: ->load()
64: ->toOptionArray()
65: ));
66:
67: $fieldset->addField('product_type', 'select', array(
68: 'label' => Mage::helper('catalog')->__('Product Type'),
69: 'title' => Mage::helper('catalog')->__('Product Type'),
70: 'name' => 'type',
71: 'value' => '',
72: 'values'=> Mage::getModel('catalog/product_type')->getOptionArray()
73: ));
74:
75: $fieldset->addField('continue_button', 'note', array(
76: 'text' => $this->getChildHtml('continue_button'),
77: ));
78:
79: $this->setForm($form);
80: }
81:
82: public function getContinueUrl()
83: {
84: return $this->getUrl('*/*/new', array(
85: '_current' => true,
86: 'set' => '{{attribute_set}}',
87: 'type' => '{{type}}'
88: ));
89: }
90: }
91: