diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2011-01-16 01:21:15 +0300 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2011-01-16 01:21:15 +0300 |
commit | 6600d5ad1827b9a419d1714530caf543386286e0 (patch) | |
tree | 4b05370beb2c695ab5e68b7182a72e6005a8c166 /plugins | |
parent | 55be7a8ad6cdb7b31125e115933cb27db8c81a65 (diff) |
Fixes #2022
* Introducing 'priority filters' that can be queued from the Controllers directly, and can remove rows from the DataTable returned from the API.
This is for example useful for several Controller views that use a same data source, but are interested in a different subset of this dataset. For example, Exit pages, Entry Pages and Page URLs all use the same DataTable, but Exit pages will only display the rows that have Exits / Exit rate. Therefore they must delete other rows in a filter that is applied before the 'Generic filters' that are Sort, Limit, etc.
git-svn-id: http://dev.piwik.org/svn/trunk@3748 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Actions/Controller.php | 4 | ||||
-rw-r--r-- | plugins/VisitorGenerator/Generator.php | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php index 65e0ef4a72..ec5defa454 100644 --- a/plugins/Actions/Controller.php +++ b/plugins/Actions/Controller.php @@ -74,7 +74,7 @@ class Piwik_Actions_Controller extends Piwik_Controller $view->setColumnTranslation('entry_bounce_count', Piwik_Translate('General_ColumnBounces'), Piwik_Translate('General_BouncesDefinition')); $view->setColumnTranslation('entry_nb_visits', Piwik_Translate('General_ColumnEntrances'), Piwik_Translate('General_EntrancesDefinition')); // remove pages that are not entry pages - $view->queueFilter('ColumnCallbackDeleteRow', array('entry_nb_visits', 'strlen')); + $view->queueFilter('ColumnCallbackDeleteRow', array('entry_nb_visits', 'strlen'), $priorityFilter = true); } public function getExitPageUrls($fetch = false) @@ -99,7 +99,7 @@ class Piwik_Actions_Controller extends Piwik_Controller $view->setColumnsToDisplay( array('label', 'exit_nb_visits', 'nb_visits', 'exit_rate') ); $view->setColumnTranslation('exit_nb_visits', Piwik_Translate('General_ColumnExits'), Piwik_Translate('General_ExitsDefinition')); // remove pages that are not exit pages - $view->queueFilter('ColumnCallbackDeleteRow', array('exit_nb_visits', 'strlen')); + $view->queueFilter('ColumnCallbackDeleteRow', array('exit_nb_visits', 'strlen'), $priorityFilter = true); } public function getPageTitles($fetch = false) diff --git a/plugins/VisitorGenerator/Generator.php b/plugins/VisitorGenerator/Generator.php index 65ecb911da..f507787e9b 100644 --- a/plugins/VisitorGenerator/Generator.php +++ b/plugins/VisitorGenerator/Generator.php @@ -471,7 +471,7 @@ class Piwik_VisitorGenerator_Generator $deep = mt_rand(0,$this->maximumUrlDepth); for($i=0;$i<$deep;$i++) { - $name = $this->getRandomString(1,1,'alnum'); + $name = $this->getRandomString(5-$deep,7-$deep,'alnum'); $url .= '/'.$name; } |