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 class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Settings extends Mage_Adminhtml_Block_Widget_Form
00035 {
00036 protected function _prepareLayout()
00037 {
00038 $this->setChild('continue_button',
00039 $this->getLayout()->createBlock('adminhtml/widget_button')
00040 ->setData(array(
00041 'label' => Mage::helper('catalog')->__('Continue'),
00042 'onclick' => "setSettings('".$this->getContinueUrl()."','attribute_set_id','product_type')",
00043 'class' => 'save'
00044 ))
00045 );
00046 return parent::_prepareLayout();
00047 }
00048
00049 protected function _prepareForm()
00050 {
00051 $form = new Varien_Data_Form();
00052 $fieldset = $form->addFieldset('settings', array('legend'=>Mage::helper('catalog')->__('Create Product Settings')));
00053
00054 $entityType = Mage::registry('product')->getResource()->getEntityType();
00055
00056 $fieldset->addField('attribute_set_id', 'select', array(
00057 'label' => Mage::helper('catalog')->__('Attribute Set'),
00058 'title' => Mage::helper('catalog')->__('Attribute Set'),
00059 'name' => 'set',
00060 'value' => $entityType->getDefaultAttributeSetId(),
00061 'values'=> Mage::getResourceModel('eav/entity_attribute_set_collection')
00062 ->setEntityTypeFilter($entityType->getId())
00063 ->load()
00064 ->toOptionArray()
00065 ));
00066
00067 $fieldset->addField('product_type', 'select', array(
00068 'label' => Mage::helper('catalog')->__('Product Type'),
00069 'title' => Mage::helper('catalog')->__('Product Type'),
00070 'name' => 'type',
00071 'value' => '',
00072 'values'=> Mage::getModel('catalog/product_type')->getOptionArray()
00073 ));
00074
00075 $fieldset->addField('continue_button', 'note', array(
00076 'text' => $this->getChildHtml('continue_button'),
00077 ));
00078
00079 $this->setForm($form);
00080 }
00081
00082 public function getContinueUrl()
00083 {
00084 return $this->getUrl('*/*/new', array(
00085 '_current' => true,
00086 'set' => '{{attribute_set}}',
00087 'type' => '{{type}}'
00088 ));
00089 }
00090 }