Permalink
Browse files

Fix navlinks when browsing results from a Report

Navlinks hadn't report related parameters set. So when clicking on
expend/collapse or refresh, the link just ignores we where browsing a
report result set. In consequence, the trail and navlinks in the printed
page where broken.
  • Loading branch information...
1 parent 62edc5f commit c428e67f1c7ad2f5080e1ec15aa88932dc5f922c @ioguix ioguix committed Mar 5, 2013
Showing with 26 additions and 2 deletions.
  1. +26 −2 plugins/Report/plugin.php
View
@@ -76,7 +76,7 @@ function get_hooks() {
$hooks = array(
'tabs' => array('add_plugin_tabs'),
'trail' => array('add_plugin_trail'),
- 'navlinks' => array('add_plugin_navlinks')
+ 'navlinks' => array('plugin_navlinks')
);
return $hooks;
}
@@ -214,7 +214,7 @@ function add_plugin_trail(&$plugin_functions_parameters) {
* Add plugin in the navlinks
* @param $plugin_functions_parameters
*/
- function add_plugin_navlinks(&$params) {
+ function plugin_navlinks(&$params) {
global $misc, $lang;
if (
@@ -290,6 +290,30 @@ function add_plugin_navlinks(&$params) {
),
'content' => $this->lang['streditreport']
);
+
+ /* edit collapse link to add report related vars */
+ $params['navlinks']['collapse']['attr']['href']['urlvars']
+ ['plugin'] = $this->name;
+ $params['navlinks']['collapse']['attr']['href']['urlvars']
+ ['report_id'] = $_REQUEST['report_id'];
+ $params['navlinks']['collapse']['attr']['href']['urlvars']
+ ['report'] = $_REQUEST['report'];
+
+ /* edit refresh link to add report related vars */
+ $params['navlinks']['refresh']['attr']['href']['urlvars']
+ ['plugin'] = $this->name;
+ $params['navlinks']['refresh']['attr']['href']['urlvars']
+ ['report_id'] = $_REQUEST['report_id'];
+ $params['navlinks']['refresh']['attr']['href']['urlvars']
+ ['report'] = $_REQUEST['report'];
+
+ if (isset($_REQUEST['action'])) {
+ $params['navlinks']['collapse']['attr']['href']['urlvars']
+ ['action'] = $_REQUEST['action'];
+
+ $params['navlinks']['refresh']['attr']['href']['urlvars']
+ ['action'] = $_REQUEST['action'];
+ }
}
if (isset($_REQUEST['schema']))

0 comments on commit c428e67

Please sign in to comment.