diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-11-28 11:54:47 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-11-28 11:54:47 +0400 |
commit | ce2d7d45d0ede5ca89f2021ba1c7d348664abdb0 (patch) | |
tree | 71203d621045240cdb3a5f720cc290415b0f1974 /core/View | |
parent | e7f256525eaf70540d959eb3dc20832518c56c12 (diff) |
Add hook in ReportsByDimension to let plugins modify the Reports listing
Diffstat (limited to 'core/View')
-rw-r--r-- | core/View/ReportsByDimension.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/core/View/ReportsByDimension.php b/core/View/ReportsByDimension.php index 2662f814d9..24f2110475 100644 --- a/core/View/ReportsByDimension.php +++ b/core/View/ReportsByDimension.php @@ -11,6 +11,7 @@ namespace Piwik\View; use Piwik\FrontController; +use Piwik\Piwik; use Piwik\Url; use Piwik\View; @@ -25,11 +26,14 @@ class ReportsByDimension extends View { /** * Constructor. + * + * @param string $id */ - public function __construct() + public function __construct($id) { parent::__construct('@CoreHome/ReportsByDimension/_reportsByDimension'); $this->dimensionCategories = array(); + $this->id = $id; } /** @@ -72,12 +76,27 @@ class ReportsByDimension extends View } /** + * @return string The ID specified in the constructor, usually the plugin name + */ + public function getId() + { + return $this->id; + } + + /** * Renders this view. * * @return string The rendered view. */ public function render() { + /** + * Use this hook to configure the "Report by dimension" UI controller. This controller is displayed for example + * in the Referrers>Overview and the Goals>Overview report. It displays a list of repotrs on the left, and when click + * loads the report on the right column. This hook can be used to filter this list of report. @see ReportsByDimension class for more info. + */ + Piwik::postEvent('View.ReportsByDimension.render', array($this)); + $this->firstReport = ""; // if there are reports & report categories added, render the first one so we can |