import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -0,0 +1,50 @@
<?php
/*
* @copyright Copyright (C) 2005-2010 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/
class Stats_ReportsController extends CommunityID_Controller_Action
{
public function indexAction()
{
$statPlugin = $this->_getPlugin();
$statPlugin->setTemplateVars();
$pluginView = clone $this->view;
$pluginView->plugin = $statPlugin;
$pluginView->setScriptPath(APP_DIR . Stats_Model_Report::STATS_PLUGIN_DIR);
$this->view->reportTitle = $statPlugin->getTitle();
$this->view->content = $pluginView->render($statPlugin->getClassName().'.phtml');
}
public function graphAction()
{
$this->_helper->viewRenderer->setNeverRender(true);
$this->_helper->layout->disableLayout();
$statPlugin = $this->_getPlugin();
$statPlugin->renderGraph();
}
private function _getPlugin()
{
$reportName = $this->_getParam('report');
try {
$statPlugin = Stats_Model_Report::getReportInstance($reportName);
} catch (Monkeys_AccessDeniedException $ex) {
throw new Exception("Unable to open Stats plugin: $entry");
}
$statPlugin->setControllerAction($this);
$statPlugin->setView($this->view);
return $statPlugin;
}
}