http://atutor.ca/atutor/mantis/view.php?id=4812
authorcindy li <cli@ocad.ca>
Fri, 12 Aug 2011 18:13:27 +0000 (18:13 -0000)
committercindy li <cli@ocad.ca>
Fri, 12 Aug 2011 18:13:27 +0000 (18:13 -0000)
Directed the user back to the originally selected tab after the form submission.

docs/mods/_core/users/default_preferences.php
docs/themes/default/users/preferences.tmpl.php
docs/users/preferences.php

index 51ef3f5..b76d4cc 100644 (file)
@@ -102,7 +102,7 @@ if (isset($_POST['submit']) || isset($_POST["set_default"])) {
        $result = mysql_query($sql, $db);
 
        $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
-       header('Location: '.$_SERVER['PHP_SELF']);
+       header('Location: '.$_SERVER['PHP_SELF'].'?current_tab='.$_POST['current_tab']);
        exit;
 }
 
index 9b98096..53ada3a 100644 (file)
@@ -16,8 +16,8 @@ for ($i=0; $i < $num_tabs; $i++)
        }
 }
 
-if (!$switch_tab && isset($_POST['current_tab'])) {
-       $current_tab = intval($_POST['current_tab']);
+if (!$switch_tab && isset($_REQUEST['current_tab'])) {
+       $current_tab = intval($_REQUEST['current_tab']);
 }
 
 if ($current_tab == 1)
index b1bb4e4..962b4a6 100644 (file)
@@ -29,6 +29,7 @@ if (!$_SESSION['valid_user']) {
 $is_auto_login = checkAutoLoginCookie();
 
 if (isset($_POST['submit']) || isset($_POST['set_default'])) {
+       $current_tab = $_POST['current_tab'];
        if (isset($_POST['submit']))
        {
            //copy posted variables to a temporary array
@@ -58,7 +59,7 @@ if (isset($_POST['submit']) || isset($_POST['set_default'])) {
     }
 
        $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
-       header('Location: preferences.php');
+       header('Location: preferences.php?current_tab='.$current_tab);
        exit;
 }