Public Member Functions | |
getContinueUrl () | |
getBackUrl () | |
Protected Member Functions | |
_prepareLayout () | |
_getProduct () | |
_prepareForm () |
Definition at line 35 of file Settings.php.
_getProduct | ( | ) | [protected] |
Retrieve currently edited product object
Definition at line 69 of file Settings.php.
00070 { 00071 return Mage::registry('current_product'); 00072 }
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 79 of file Settings.php.
00080 { 00081 $form = new Varien_Data_Form(); 00082 $fieldset = $form->addFieldset('settings', array( 00083 'legend'=>Mage::helper('catalog')->__('Select Configurable Attributes ') 00084 )); 00085 00086 $product = $this->_getProduct(); 00087 $attributes = $product->getTypeInstance(true) 00088 ->getSetAttributes($product); 00089 00090 $fieldset->addField('req_text', 'note', array( 00091 'text' => '<ul class="messages"><li class="notice-msg"><ul><li>' 00092 . $this->__('Only attributes with scope "Global", input type "Dropdown" and Use To Create Configurable Product "Yes" are available.') 00093 . '</li></ul></li></ul>' 00094 )); 00095 00096 $hasAttributes = false; 00097 00098 foreach ($attributes as $attribute) { 00099 if ($product->getTypeInstance(true)->canUseAttribute($attribute, $product)) { 00100 $hasAttributes = true; 00101 $fieldset->addField('attribute_'.$attribute->getAttributeId(), 'checkbox', array( 00102 'label' => $attribute->getFrontend()->getLabel(), 00103 'title' => $attribute->getFrontend()->getLabel(), 00104 'name' => 'attribute', 00105 'class' => 'attribute-checkbox', 00106 'value' => $attribute->getAttributeId() 00107 )); 00108 } 00109 } 00110 00111 if ($hasAttributes) { 00112 $fieldset->addField('attributes', 'hidden', array( 00113 'name' => 'attribute_validate', 00114 'value' => '', 00115 'class' => 'validate-super-product-attributes' 00116 )); 00117 00118 $fieldset->addField('continue_button', 'note', array( 00119 'text' => $this->getChildHtml('continue_button'), 00120 )); 00121 } 00122 else { 00123 $fieldset->addField('note_text', 'note', array( 00124 'text' => $this->__('This attribute set don\'t have attributes which we can use for configurable product') 00125 )); 00126 $fieldset->addField('back_button', 'note', array( 00127 'text' => $this->getChildHtml('back_button'), 00128 )); 00129 } 00130 00131 00132 $this->setForm($form); 00133 00134 return parent::_prepareForm(); 00135 }
_prepareLayout | ( | ) | [protected] |
Prepare block children and data
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 41 of file Settings.php.
00042 { 00043 $onclick = "setSuperSettings('".$this->getContinueUrl()."','attribute-checkbox', 'attributes')"; 00044 $this->setChild('continue_button', 00045 $this->getLayout()->createBlock('adminhtml/widget_button') 00046 ->setData(array( 00047 'label' => Mage::helper('catalog')->__('Continue'), 00048 'onclick' => $onclick, 00049 'class' => 'save' 00050 )) 00051 ); 00052 00053 $backButton = $this->getLayout()->createBlock('adminhtml/widget_button') 00054 ->setData(array( 00055 'label' => Mage::helper('catalog')->__('Back'), 00056 'onclick' => "setLocation('".$this->getBackUrl()."')", 00057 'class' => 'back' 00058 )); 00059 00060 $this->setChild('back_button', $backButton); 00061 parent::_prepareLayout(); 00062 }
getBackUrl | ( | ) |
getContinueUrl | ( | ) |
Retrieve Continue URL
Definition at line 142 of file Settings.php.
00143 { 00144 return $this->getUrl('*/*/new', array( 00145 '_current' => true, 00146 'attributes' => '{{attributes}}' 00147 )); 00148 }