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_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface
00035 {
00036
00037
00038
00039
00040
00041
00042 protected $_product = null;
00043
00044 protected $_config = null;
00045
00046
00047
00048
00049
00050 public function __construct()
00051 {
00052 parent::__construct();
00053
00054 $this->setTemplate('downloadable/product/edit/downloadable.phtml');
00055 }
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 public function isReadonly()
00083 {
00084 return $this->getProduct()->getDownloadableReadonly();
00085 }
00086
00087
00088
00089
00090
00091
00092 public function getProduct()
00093 {
00094 return Mage::registry('current_product');
00095 }
00096
00097
00098
00099
00100
00101
00102 public function getTabLabel()
00103 {
00104 return Mage::helper('downloadable')->__('Downloadable Information');
00105 }
00106
00107
00108
00109
00110
00111
00112 public function getTabTitle()
00113 {
00114 return Mage::helper('downloadable')->__('Downloadable Information');
00115 }
00116
00117
00118
00119
00120
00121
00122 public function canShowTab()
00123 {
00124 return true;
00125 }
00126
00127
00128
00129
00130
00131
00132 public function isHidden()
00133 {
00134 return false;
00135 }
00136
00137
00138
00139
00140
00141
00142 protected function _toHtml()
00143 {
00144 $accordion = $this->getLayout()->createBlock('adminhtml/widget_accordion')
00145 ->setId('downloadableInfo');
00146
00147 $accordion->addItem('samples', array(
00148 'title' => Mage::helper('adminhtml')->__('Samples'),
00149 'content' => $this->getLayout()->createBlock('downloadable/adminhtml_catalog_product_edit_tab_downloadable_samples')->toHtml(),
00150 'open' => false,
00151 ));
00152
00153 $accordion->addItem('links', array(
00154 'title' => Mage::helper('adminhtml')->__('Links'),
00155 'content' => $this->getLayout()->createBlock('downloadable/adminhtml_catalog_product_edit_tab_downloadable_links')->toHtml(),
00156 'open' => true,
00157 ));
00158
00159 $this->setChild('accordion', $accordion);
00160
00161 return parent::_toHtml();
00162 }
00163
00164 }