Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Settings Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Settings:

Mage_Adminhtml_Block_Widget_Form Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getContinueUrl ()
 getBackUrl ()

Protected Member Functions

 _prepareLayout ()
 _getProduct ()
 _prepareForm ()


Detailed Description

Definition at line 35 of file Settings.php.


Member Function Documentation

_getProduct (  )  [protected]

Retrieve currently edited product object

Returns:
Mage_Catalog_Model_Product

Definition at line 69 of file Settings.php.

00070     {
00071         return Mage::registry('current_product');
00072     }

_prepareForm (  )  [protected]

Prepare form before rendering HTML

Returns:
Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Settings

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 (  ) 

Retrieve Back URL

Returns:
string

Definition at line 155 of file Settings.php.

00156     {
00157         return $this->getUrl('*/*/new', array('set'=>null, 'type'=>null));
00158     }

getContinueUrl (  ) 

Retrieve Continue URL

Returns:
string

Definition at line 142 of file Settings.php.

00143     {
00144         return $this->getUrl('*/*/new', array(
00145             '_current'   => true,
00146             'attributes' => '{{attributes}}'
00147         ));
00148     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:46 2009 for Magento by  doxygen 1.5.8