Public Member Functions | |
__construct () | |
getProduct () | |
getAttributeTabBlock () | |
setAttributeTabBlock ($attributeTabBlock) | |
Protected Member Functions | |
_prepareLayout () | |
Protected Attributes | |
$_attributeTabBlock = 'adminhtml/catalog_product_edit_tab_attributes' |
Definition at line 34 of file Tabs.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 38 of file Tabs.php.
00039 { 00040 parent::__construct(); 00041 $this->setId('product_info_tabs'); 00042 $this->setDestElementId('product_edit_form'); 00043 $this->setTitle(Mage::helper('catalog')->__('Product Information')); 00044 }
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
Don't display website tab for single mode
Do not change this tab id
Reimplemented from Mage_Core_Block_Abstract.
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs_Configurable, Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs_Grouped, and Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tabs.
Definition at line 46 of file Tabs.php.
00047 { 00048 $product = $this->getProduct(); 00049 00050 if (!($setId = $product->getAttributeSetId())) { 00051 $setId = $this->getRequest()->getParam('set', null); 00052 } 00053 00054 if ($setId) { 00055 $groupCollection = Mage::getResourceModel('eav/entity_attribute_group_collection') 00056 ->setAttributeSetFilter($setId) 00057 ->load(); 00058 00059 foreach ($groupCollection as $group) { 00060 $attributes = $product->getAttributes($group->getId(), true); 00061 // do not add grops without attributes 00062 00063 foreach ($attributes as $key => $attribute) { 00064 if( !$attribute->getIsVisible() ) { 00065 unset($attributes[$key]); 00066 } 00067 } 00068 00069 if (count($attributes)==0) { 00070 continue; 00071 } 00072 00073 $this->addTab('group_'.$group->getId(), array( 00074 'label' => Mage::helper('catalog')->__($group->getAttributeGroupName()), 00075 'content' => $this->getLayout()->createBlock($this->getAttributeTabBlock()) 00076 ->setGroup($group) 00077 ->setGroupAttributes($attributes) 00078 ->toHtml(), 00079 )); 00080 } 00081 00082 $this->addTab('inventory', array( 00083 'label' => Mage::helper('catalog')->__('Inventory'), 00084 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_inventory')->toHtml(), 00085 )); 00086 00087 00088 /** 00089 * Don't display website tab for single mode 00090 */ 00091 if (!Mage::app()->isSingleStoreMode()) { 00092 $this->addTab('websites', array( 00093 'label' => Mage::helper('catalog')->__('Websites'), 00094 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_websites')->toHtml(), 00095 )); 00096 } 00097 00098 $this->addTab('categories', array( 00099 'label' => Mage::helper('catalog')->__('Categories'), 00100 'url' => $this->getUrl('*/*/categories', array('_current' => true)), 00101 'class' => 'ajax', 00102 )); 00103 00104 $this->addTab('related', array( 00105 'label' => Mage::helper('catalog')->__('Related Products'), 00106 'url' => $this->getUrl('*/*/related', array('_current' => true)), 00107 'class' => 'ajax', 00108 )); 00109 00110 $this->addTab('upsell', array( 00111 'label' => Mage::helper('catalog')->__('Up-sells'), 00112 'url' => $this->getUrl('*/*/upsell', array('_current' => true)), 00113 'class' => 'ajax', 00114 )); 00115 00116 $this->addTab('crosssell', array( 00117 'label' => Mage::helper('catalog')->__('Cross-sells'), 00118 'url' => $this->getUrl('*/*/crosssell', array('_current' => true)), 00119 'class' => 'ajax', 00120 )); 00121 00122 $storeId = 0; 00123 if ($this->getRequest()->getParam('store')) { 00124 $storeId = Mage::app()->getStore($this->getRequest()->getParam('store'))->getId(); 00125 } 00126 00127 $alertPriceAllow = Mage::getStoreConfig('catalog/productalert/allow_price'); 00128 $alertStockAllow = Mage::getStoreConfig('catalog/productalert/allow_stock'); 00129 00130 if ($alertPriceAllow || $alertStockAllow) { 00131 $this->addTab('productalert', array( 00132 'label' => Mage::helper('catalog')->__('Product Alerts'), 00133 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_alerts', 'admin.alerts.products')->toHtml() 00134 )); 00135 } 00136 00137 if( $this->getRequest()->getParam('id', false) ) { 00138 $this->addTab('reviews', array( 00139 'label' => Mage::helper('catalog')->__('Product Reviews'), 00140 'url' => $this->getUrl('*/*/reviews', array('_current' => true)), 00141 'class' => 'ajax', 00142 )); 00143 00144 $this->addTab('tags', array( 00145 'label' => Mage::helper('catalog')->__('Product Tags'), 00146 'url' => $this->getUrl('*/*/tagGrid', array('_current' => true)), 00147 'class' => 'ajax', 00148 )); 00149 00150 $this->addTab('customers_tags', array( 00151 'label' => Mage::helper('catalog')->__('Customers Tagged Product'), 00152 'url' => $this->getUrl('*/*/tagCustomerGrid', array('_current' => true)), 00153 'class' => 'ajax', 00154 )); 00155 } 00156 00157 /** 00158 * Do not change this tab id 00159 * @see Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs_Configurable 00160 * @see Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tabs 00161 */ 00162 if ($this->getProduct()->getTypeId() != Mage_Catalog_Model_Product_Type::TYPE_GROUPED) { 00163 $this->addTab('customer_options', array( 00164 'label' => Mage::helper('catalog')->__('Custom Options'), 00165 'url' => $this->getUrl('*/*/options', array('_current' => true)), 00166 'class' => 'ajax', 00167 )); 00168 } 00169 00170 } 00171 else { 00172 $this->addTab('set', array( 00173 'label' => Mage::helper('catalog')->__('Settings'), 00174 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_settings')->toHtml(), 00175 'active' => true 00176 )); 00177 } 00178 return parent::_prepareLayout(); 00179 }
getAttributeTabBlock | ( | ) |
Getting attribute block name for tabs
Definition at line 199 of file Tabs.php.
00200 { 00201 if (is_null(Mage::helper('adminhtml/catalog')->getAttributeTabBlock())) { 00202 return $this->_attributeTabBlock; 00203 } 00204 return Mage::helper('adminhtml/catalog')->getAttributeTabBlock(); 00205 }
getProduct | ( | ) |
Retrive product object from object if not from registry
Definition at line 186 of file Tabs.php.
00187 { 00188 if (!($this->getData('product') instanceof Mage_Catalog_Model_Product)) { 00189 $this->setData('product', Mage::registry('product')); 00190 } 00191 return $this->getData('product'); 00192 }
setAttributeTabBlock | ( | $ | attributeTabBlock | ) |
$_attributeTabBlock = 'adminhtml/catalog_product_edit_tab_attributes' [protected] |
Reimplemented in Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tabs.