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_Customer_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('customer_info_tabs');
00041 $this->setDestElementId('edit_form');
00042 $this->setTitle(Mage::helper('customer')->__('Customer Information'));
00043 }
00044
00045 protected function _beforeToHtml()
00046 {
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 $this->addTab('account', array(
00057 'label' => Mage::helper('customer')->__('Account Information'),
00058 'content' => $this->getLayout()->createBlock('adminhtml/customer_edit_tab_account')->initForm()->toHtml(),
00059 'active' => Mage::registry('current_customer')->getId() ? false : true
00060 ));
00061
00062 $this->addTab('addresses', array(
00063 'label' => Mage::helper('customer')->__('Addresses'),
00064 'content' => $this->getLayout()->createBlock('adminhtml/customer_edit_tab_addresses')->initForm()->toHtml(),
00065 ));
00066
00067
00068
00069
00070 if (Mage::registry('current_customer')->getId()) {
00071 $this->addTab('orders', array(
00072 'label' => Mage::helper('customer')->__('Orders'),
00073 'class' => 'ajax',
00074 'url' => $this->getUrl('*/*/orders', array('_current' => true)),
00075 ));
00076
00077 $this->addTab('cart', array(
00078 'label' => Mage::helper('customer')->__('Shopping Cart'),
00079 'class' => 'ajax',
00080 'url' => $this->getUrl('*/*/carts', array('_current' => true)),
00081 ));
00082
00083 $this->addTab('wishlist', array(
00084 'label' => Mage::helper('customer')->__('Wishlist'),
00085 'class' => 'ajax',
00086 'url' => $this->getUrl('*/*/wishlist', array('_current' => true)),
00087 ));
00088
00089 $this->addTab('newsletter', array(
00090 'label' => Mage::helper('customer')->__('Newsletter'),
00091 'content' => $this->getLayout()->createBlock('adminhtml/customer_edit_tab_newsletter')->initForm()->toHtml()
00092 ));
00093
00094 $this->addTab('reviews', array(
00095 'label' => Mage::helper('customer')->__('Product Reviews'),
00096 'class' => 'ajax',
00097 'url' => $this->getUrl('*/*/productReviews', array('_current' => true)),
00098 ));
00099
00100 $this->addTab('tags', array(
00101 'label' => Mage::helper('customer')->__('Product Tags'),
00102 'class' => 'ajax',
00103 'url' => $this->getUrl('*/*/productTags', array('_current' => true)),
00104 ));
00105 }
00106
00107 $this->_updateActiveTab();
00108 Varien_Profiler::stop('customer/tabs');
00109 return parent::_beforeToHtml();
00110 }
00111
00112 protected function _updateActiveTab()
00113 {
00114 $tabId = $this->getRequest()->getParam('tab');
00115 if( $tabId ) {
00116 $tabId = preg_replace("#{$this->getId()}_#", '', $tabId);
00117 if($tabId) {
00118 $this->setActiveTab($tabId);
00119 }
00120 }
00121 }
00122 }