diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-05-13 21:58:54 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-05-13 21:58:54 +0400 |
commit | 85a7777b57bd109a3fd1d2f846799fac9557b31a (patch) | |
tree | 3b2170f61824f6773dac09406702d85b8a7c86bb /plugins/Actions | |
parent | f22bfd960f15c0d81fe2b891aebd50ab57e7b984 (diff) |
Downloads and Outlinks reports now use the 'Actions' table rendering style, which fixes #969 as search now works recursively (as it does when searching urls or page titles.
Diffstat (limited to 'plugins/Actions')
-rw-r--r-- | plugins/Actions/Controller.php | 78 |
1 files changed, 44 insertions, 34 deletions
diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php index 4216fc8eeb..783c903929 100644 --- a/plugins/Actions/Controller.php +++ b/plugins/Actions/Controller.php @@ -72,7 +72,6 @@ class Piwik_Actions_Controller extends Piwik_Controller 'getDownloadsSubDataTable' ); $this->configureViewDownloads($view); - $view->disableShowAllColumns(); return $this->renderView($view, $fetch); } @@ -84,7 +83,6 @@ class Piwik_Actions_Controller extends Piwik_Controller 'Actions.getDownloads', 'getDownloadsSubDataTable'); $this->configureViewDownloads($view); - $view->disableSearchBox(); return $this->renderView($view, $fetch); } @@ -96,8 +94,6 @@ class Piwik_Actions_Controller extends Piwik_Controller 'Actions.getOutlinks', 'getOutlinksSubDataTable' ); $this->configureViewOutlinks($view); - $view->disableExcludeLowPopulation(); - $view->disableShowAllColumns(); return $this->renderView($view, $fetch); } @@ -109,33 +105,18 @@ class Piwik_Actions_Controller extends Piwik_Controller 'Actions.getOutlinks', 'getOutlinksSubDataTable'); $this->configureViewOutlinks($view); - $view->disableSearchBox(); return $this->renderView($view, $fetch); } + /* + * Page titles & Page URLs reports + */ protected function configureViewActions($view) { - $view->setTemplate('CoreHome/templates/datatable_actions.tpl'); - - if(Piwik_Common::getRequestVar('idSubtable', -1) != -1) - { - $view->setTemplate('CoreHome/templates/datatable_actions_subdatable.tpl'); - } - $currentlySearching = $view->setSearchRecursive(); - - if($currentlySearching) - { - $view->setTemplate('CoreHome/templates/datatable_actions_recursive.tpl'); - } - $view->disableOffsetInformation(); - $view->disableShowAllViewsIcons(); - $view->disableShowAllColumns(); - - $view->setLimit( 100 ); $view->setColumnsToDisplay( array('label','nb_hits','nb_visits') ); $view->setColumnTranslation('nb_hits', Piwik_Translate('General_ColumnPageviews')); $view->setColumnTranslation('nb_visits', Piwik_Translate('General_ColumnUniquePageviews')); - + if(Piwik_Common::getRequestVar('enable_filter_excludelowpop', '0', 'string' ) != '0') { // computing minimum value to exclude @@ -149,18 +130,14 @@ class Piwik_Actions_Controller extends Piwik_Controller $view->setExcludeLowPopulation( 'nb_hits', $nbActionsLowPopulationThreshold ); } - - $view->main(); - - // we need to rewrite the phpArray so it contains all the recursive arrays - if($currentlySearching) - { - $phpArrayRecursive = $this->getArrayFromRecursiveDataTable($view->getDataTable()); - $view->getView()->arrayDataTable = $phpArrayRecursive; - } + + $this->configureGenericViewActions($view); return $view; } + /* + * Downloads report + */ protected function configureViewDownloads($view) { $view->setColumnsToDisplay( array('label','nb_visits','nb_hits') ); @@ -168,9 +145,12 @@ class Piwik_Actions_Controller extends Piwik_Controller $view->setColumnTranslation('nb_hits', Piwik_Translate('Actions_ColumnDownloads')); $view->setColumnTranslation('nb_visits', Piwik_Translate('Actions_ColumnUniqueDownloads')); $view->disableExcludeLowPopulation(); - $view->setLimit( 15 ); + $this->configureGenericViewActions($view); } + /* + * Outlinks report + */ protected function configureViewOutlinks($view) { $view->setColumnsToDisplay( array('label','nb_visits','nb_hits') ); @@ -178,9 +158,39 @@ class Piwik_Actions_Controller extends Piwik_Controller $view->setColumnTranslation('nb_hits', Piwik_Translate('Actions_ColumnClicks')); $view->setColumnTranslation('nb_visits', Piwik_Translate('Actions_ColumnUniqueClicks')); $view->disableExcludeLowPopulation(); - $view->setLimit( 15 ); + $this->configureGenericViewActions($view); } + /* + * Common to all Actions reports, how to use the custom Actions Datatable html + */ + protected function configureGenericViewActions($view) + { + $view->setTemplate('CoreHome/templates/datatable_actions.tpl'); + if(Piwik_Common::getRequestVar('idSubtable', -1) != -1) + { + $view->setTemplate('CoreHome/templates/datatable_actions_subdatable.tpl'); + } + $currentlySearching = $view->setSearchRecursive(); + if($currentlySearching) + { + $view->setTemplate('CoreHome/templates/datatable_actions_recursive.tpl'); + } + // disable Footer icons + $view->disableOffsetInformation(); + $view->disableShowAllViewsIcons(); + $view->disableShowAllColumns(); + + $view->setLimit( 100 ); + $view->main(); + // we need to rewrite the phpArray so it contains all the recursive arrays + if($currentlySearching) + { + $phpArrayRecursive = $this->getArrayFromRecursiveDataTable($view->getDataTable()); + $view->getView()->arrayDataTable = $phpArrayRecursive; + } + } + protected function getArrayFromRecursiveDataTable( $dataTable, $depth = 0 ) { $table = array(); |