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
00035
00036 class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts extends Mage_Adminhtml_Block_Template
00037 {
00038 public function __construct()
00039 {
00040 parent::__construct();
00041 $this->setTemplate('catalog/product/tab/alert.phtml');
00042 }
00043
00044 protected function _prepareLayout()
00045 {
00046 $accordion = $this->getLayout()->createBlock('adminhtml/widget_accordion')
00047 ->setId('productAlerts');
00048
00049
00050 $alertPriceAllow = Mage::getStoreConfig('catalog/productalert/allow_price');
00051 $alertStockAllow = Mage::getStoreConfig('catalog/productalert/allow_stock');
00052
00053 if ($alertPriceAllow) {
00054 $accordion->addItem('price', array(
00055 'title' => Mage::helper('adminhtml')->__('Price alert subscription was saved successfully'),
00056 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_alerts_price')->toHtml() . '<br />',
00057 'open' => true
00058 ));
00059 }
00060 if ($alertStockAllow) {
00061 $accordion->addItem('stock', array(
00062 'title' => Mage::helper('adminhtml')->__('Stock notification was saved successfully'),
00063 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_alerts_stock'),
00064 'open' => true
00065 ));
00066 }
00067
00068 $this->setChild('accordion', $accordion);
00069
00070 return parent::_prepareLayout();
00071 }
00072
00073 public function getAccordionHtml()
00074 {
00075 return $this->getChildHtml('accordion');
00076 }
00077 }