コード例 #1
0
 /**
  * (non-PHPdoc)
  * @see magento-src/app/code/core/Mage/Adminhtml/controllers/Mage_Adminhtml_DashboardController#tunnelAction()
  */
 public function tunnelAction()
 {
     // check if google chart API should be used or internal chart library
     if (Mage::getStoreConfig('piwik/piwik_chart/google')) {
         // initialize the original DashboardController
         $dashboardController = new Mage_Adminhtml_DashboardController($this->_request, $this->_response);
         // call the original method
         $dashboardController->tunnelAction();
     } else {
         $gaData = $this->getRequest()->getParam('ga');
         $gaHash = $this->getRequest()->getParam('h');
         if ($gaData && $gaHash) {
             $newHash = Mage::helper('piwik')->getChartDataHash($gaData);
             if ($newHash == $gaHash) {
                 if ($params = unserialize(base64_decode(urldecode($gaData)))) {
                     // render the chart and add the image to the response
                     $this->getResponse()->setHeader('Content-type', 'image/png')->setBody($this->_render($params));
                 }
             }
         }
     }
 }
コード例 #2
0
 /**
  * (non-PHPdoc)
  * @see magento-src/app/code/core/Mage/Adminhtml/controllers/Mage_Adminhtml_DashboardController#ajaxBlockAction()
  */
 public function ajaxBlockAction()
 {
     $output = '';
     $blockTab = $this->getRequest()->getParam('block');
     if (in_array($blockTab, array('tab_tracking'))) {
         $output = $this->getLayout()->createBlock('piwik/adminhtml_dashboard_' . $blockTab)->toHtml();
         $this->getResponse()->setBody($output);
     } else {
         parent::ajaxBlockAction();
     }
     return;
 }