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_Report_TagController extends Mage_Adminhtml_Controller_Action
00035 {
00036 public function _initAction()
00037 {
00038 $act = $this->getRequest()->getActionName();
00039 if(!$act)
00040 $act = 'default';
00041
00042 $this->loadLayout()
00043 ->_addBreadcrumb(Mage::helper('reports')->__('Reports'), Mage::helper('reports')->__('Reports'))
00044 ->_addBreadcrumb(Mage::helper('reports')->__('Tag'), Mage::helper('reports')->__('Tag'));
00045 return $this;
00046 }
00047
00048 public function customerAction()
00049 {
00050 $this->_initAction()
00051 ->_setActiveMenu('report/tag/customer')
00052 ->_addBreadcrumb(Mage::helper('reports')->__('Customers Report'), Mage::helper('reports')->__('Customers Report'))
00053 ->_addContent($this->getLayout()->createBlock('adminhtml/report_tag_customer'))
00054 ->renderLayout();
00055 }
00056
00057
00058
00059
00060 public function exportCustomerCsvAction()
00061 {
00062 $fileName = 'tag_customer.csv';
00063 $content = $this->getLayout()->createBlock('adminhtml/report_tag_customer_grid')
00064 ->getCsv();
00065
00066 $this->_prepareDownloadResponse($fileName, $content);
00067 }
00068
00069
00070
00071
00072 public function exportCustomerExcelAction()
00073 {
00074 $fileName = 'tag_customer.xml';
00075 $content = $this->getLayout()->createBlock('adminhtml/report_tag_customer_grid')
00076 ->getExcel($fileName);
00077
00078 $this->_prepareDownloadResponse($fileName, $content);
00079 }
00080
00081 public function productAction()
00082 {
00083 $this->_initAction()
00084 ->_setActiveMenu('report/tag/product')
00085 ->_addBreadcrumb(Mage::helper('reports')->__('Poducts Report'), Mage::helper('reports')->__('Products Report'))
00086 ->_addContent($this->getLayout()->createBlock('adminhtml/report_tag_product'))
00087 ->renderLayout();
00088 }
00089
00090
00091
00092
00093 public function exportProductCsvAction()
00094 {
00095 $fileName = 'tag_product.csv';
00096 $content = $this->getLayout()->createBlock('adminhtml/report_tag_product_grid')
00097 ->getCsv();
00098
00099 $this->_prepareDownloadResponse($fileName, $content);
00100 }
00101
00102
00103
00104
00105 public function exportProductExcelAction()
00106 {
00107 $fileName = 'tag_product.xml';
00108 $content = $this->getLayout()->createBlock('adminhtml/report_tag_product_grid')
00109 ->getExcel($fileName);
00110
00111 $this->_prepareDownloadResponse($fileName, $content);
00112 }
00113
00114
00115 public function popularAction()
00116 {
00117 $this->_initAction()
00118 ->_setActiveMenu('report/tag/popular')
00119 ->_addBreadcrumb(Mage::helper('reports')->__('Popular Tags'), Mage::helper('reports')->__('Popular Tags'))
00120 ->_addContent($this->getLayout()->createBlock('adminhtml/report_tag_popular'))
00121 ->renderLayout();
00122 }
00123
00124
00125
00126
00127 public function exportPopularCsvAction()
00128 {
00129 $fileName = 'tag_popular.csv';
00130 $content = $this->getLayout()->createBlock('adminhtml/report_tag_popular_grid')
00131 ->getCsv();
00132
00133 $this->_prepareDownloadResponse($fileName, $content);
00134 }
00135
00136
00137
00138
00139 public function exportPopularExcelAction()
00140 {
00141 $fileName = 'tag_popular.xml';
00142 $content = $this->getLayout()->createBlock('adminhtml/report_tag_popular_grid')
00143 ->getExcel($fileName);
00144
00145 $this->_prepareDownloadResponse($fileName, $content);
00146 }
00147
00148 public function customerDetailAction()
00149 {
00150 $this->_initAction()
00151 ->_setActiveMenu('report/tag/customerDetail')
00152 ->_addBreadcrumb(Mage::helper('reports')->__('Customers Report'), Mage::helper('reports')->__('Customers Report'))
00153 ->_addBreadcrumb(Mage::helper('reports')->__('Customer Tags'), Mage::helper('reports')->__('Customer Tags'))
00154 ->_addContent($this->getLayout()->createBlock('adminhtml/report_tag_customer_detail'))
00155 ->renderLayout();
00156 }
00157
00158
00159
00160
00161 public function exportCustomerDetailCsvAction()
00162 {
00163 $fileName = 'tag_customer_detail.csv';
00164 $content = $this->getLayout()->createBlock('adminhtml/report_tag_customer_detail_grid')
00165 ->getCsv();
00166
00167 $this->_prepareDownloadResponse($fileName, $content);
00168 }
00169
00170
00171
00172
00173 public function exportCustomerDetailExcelAction()
00174 {
00175 $fileName = 'tag_customer_detail.xml';
00176 $content = $this->getLayout()->createBlock('adminhtml/report_tag_customer_detail_grid')
00177 ->getExcel($fileName);
00178
00179 $this->_prepareDownloadResponse($fileName, $content);
00180 }
00181
00182 public function productDetailAction()
00183 {
00184 $this->_initAction()
00185 ->_setActiveMenu('report/tag/productDetail')
00186 ->_addBreadcrumb(Mage::helper('reports')->__('Products Report'), Mage::helper('reports')->__('Products Report'))
00187 ->_addBreadcrumb(Mage::helper('reports')->__('Product Tags'), Mage::helper('reports')->__('Product Tags'))
00188 ->_addContent($this->getLayout()->createBlock('adminhtml/report_tag_product_detail'))
00189 ->renderLayout();
00190 }
00191
00192
00193
00194
00195 public function exportProductDetailCsvAction()
00196 {
00197 $fileName = 'tag_product_detail.csv';
00198 $content = $this->getLayout()->createBlock('adminhtml/report_tag_product_detail_grid')
00199 ->getCsv();
00200
00201 $this->_prepareDownloadResponse($fileName, $content);
00202 }
00203
00204
00205
00206
00207 public function exportProductDetailExcelAction()
00208 {
00209 $fileName = 'tag_product_detail.xml';
00210 $content = $this->getLayout()->createBlock('adminhtml/report_tag_product_detail_grid')
00211 ->getExcel($fileName);
00212
00213 $this->_prepareDownloadResponse($fileName, $content);
00214 }
00215
00216 public function tagDetailAction()
00217 {
00218 $this->_initAction()
00219 ->_setActiveMenu('report/tag/tagDetail')
00220 ->_addBreadcrumb(Mage::helper('reports')->__('Popular Tags'), Mage::helper('reports')->__('Popular Tags'))
00221 ->_addBreadcrumb(Mage::helper('reports')->__('Tag Detail'), Mage::helper('reports')->__('Tag Detail'))
00222 ->_addContent($this->getLayout()->createBlock('adminhtml/report_tag_popular_detail'))
00223 ->renderLayout();
00224 }
00225
00226
00227
00228
00229 public function exportTagDetailCsvAction()
00230 {
00231 $fileName = 'tag_detail.csv';
00232 $content = $this->getLayout()->createBlock('adminhtml/report_tag_popular_detail_grid')
00233 ->getCsv();
00234
00235 $this->_prepareDownloadResponse($fileName, $content);
00236 }
00237
00238
00239
00240
00241 public function exportTagDetailExcelAction()
00242 {
00243 $fileName = 'tag_detail.xml';
00244 $content = $this->getLayout()->createBlock('adminhtml/report_tag_popular_detail_grid')
00245 ->getExcel($fileName);
00246
00247 $this->_prepareDownloadResponse($fileName, $content);
00248 }
00249
00250 protected function _isAllowed()
00251 {
00252 switch ($this->getRequest()->getActionName()) {
00253 case 'customer':
00254 return Mage::getSingleton('admin/session')->isAllowed('report/tags/customer');
00255 break;
00256 case 'product':
00257 return Mage::getSingleton('admin/session')->isAllowed('report/tags/product');
00258 break;
00259 case 'productAll':
00260 return Mage::getSingleton('admin/session')->isAllowed('report/tags/product');
00261 break;
00262 case 'popular':
00263 return Mage::getSingleton('admin/session')->isAllowed('report/tags/popular');
00264 break;
00265 default:
00266 return Mage::getSingleton('admin/session')->isAllowed('report/tags');
00267 break;
00268 }
00269 }
00270 }