NAVIGATION MDL-25468 remove optional_param from navigationlib.php, use override_activ...
authorDongsheng Cai <dongsheng@moodle.com>
Mon, 7 Feb 2011 08:25:58 +0000 (16:25 +0800)
committerDongsheng Cai <dongsheng@moodle.com>
Mon, 7 Feb 2011 08:25:58 +0000 (16:25 +0800)
lib/navigationlib.php
user/portfolio.php
user/portfoliologs.php

index 1a9f007..447428b 100644 (file)
@@ -3398,26 +3398,10 @@ class settings_navigation extends navigation_node {
             if (portfolio_instances(true, false)) {
                 $portfolio = $usersetting->add(get_string('portfolios', 'portfolio'), null, self::TYPE_SETTING);
 
-                $config  = optional_param('config', 0, PARAM_INT);
-                $hide    = optional_param('hide', 0, PARAM_INT);
                 $url = new moodle_url('/user/portfolio.php', array('courseid'=>$course->id));
-                if ($hide !== 0) {
-                    $url->param('hide', $hide);
-                }
-                if ($config !== 0) {
-                    $url->param('config', $config);
-                }
                 $portfolio->add(get_string('configure', 'portfolio'), $url, self::TYPE_SETTING);
 
-                $page = optional_param('page', 0, PARAM_INT);
-                $perpage = optional_param('perpage', 10, PARAM_INT);
                 $url = new moodle_url('/user/portfoliologs.php', array('courseid'=>$course->id));
-                if ($page !== 0) {
-                    $url->param('page', $page);
-                }
-                if ($perpage !== 0) {
-                    $url->param('perpage', $perpage);
-                }
                 $portfolio->add(get_string('logs', 'portfolio'), $url, self::TYPE_SETTING);
             }
         }
index e5a083a..c91e04e 100644 (file)
@@ -37,9 +37,7 @@ $hide     = optional_param('hide', 0, PARAM_INT);
 $courseid = optional_param('courseid', SITEID, PARAM_INT);
 
 $url = new moodle_url('/user/portfolio.php', array('courseid'=>$courseid));
-if ($hide !== 0) {
-    $url->param('hide', $hide);
-}
+
 if ($config !== 0) {
     $url->param('config', $config);
 }
@@ -69,6 +67,7 @@ echo $OUTPUT->header();
 $showroles = 1;
 
 if (!empty($config)) {
+    navigation_node::override_active_url(new moodle_url('/user/portfolio.php', array('courseid'=>$courseid)));
     $instance = portfolio_instance($config);
     $mform = new portfolio_user_form('', array('instance' => $instance, 'userid' => $user->id));
     if ($mform->is_cancelled()){
index 3993261..1690b1f 100644 (file)
@@ -48,6 +48,8 @@ $strportfolios = get_string('portfolios', 'portfolio');
 
 $url = new moodle_url('/user/portfoliologs.php', array('courseid'=>$courseid));
 
+navigation_node::override_active_url(new moodle_url('/user/portfoliologs.php', array('courseid'=>$courseid)));
+
 if ($page !== 0) {
     $url->param('page', $page);
 }