From: moodler Date: Thu, 16 Mar 2006 07:22:58 +0000 (+0000) Subject: Simplified X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=aad6de92080faa018c36d2e4396378c862099091;p=moodle.git Simplified --- diff --git a/blog/set_session_vars.php b/blog/set_session_vars.php index ea104fdf70..680a40faec 100644 --- a/blog/set_session_vars.php +++ b/blog/set_session_vars.php @@ -2,49 +2,14 @@ /// inspired/taken from moodle calendar module's set.php file require_once('../config.php'); - require_once('lib.php'); - $referrer = required_param('referrer', PARAM_NOTAGS); - $var = required_param('var',PARAM_ALPHA); - $value = optional_param('value','', PARAM_NOTAGS); - $userid = optional_param('userid',0 , PARAM_INT); - $courseid = optional_param('courseid',0, PARAM_INT); - $d = optional_param('d', 0, PARAM_INT); - $m = optional_param('m', 0, PARAM_INT); - $y = optional_param('y', 0, PARAM_INT); - $id = optional_param('id', 0, PARAM_INT); + $referrer = required_param('referrer', PARAM_URL); - switch($var) { - case 'setcourse': - $id = intval($id); - if($id == 0) { - $SESSION->cal_courses_shown = array(); - calendar_set_referring_course(0); - } - else if($id == 1) { - $SESSION->cal_courses_shown = calendar_get_default_courses(true); - calendar_set_referring_course(0); - } - else { - // We don't check for membership anymore: if(isstudent($id, $USER->id) || isteacher($id, $USER->id)) { - if(get_record('course', 'id', $id) === false) { - // There is no such course - $SESSION->cal_courses_shown = array(); - calendar_set_referring_course(0); - } - else { - calendar_set_referring_course($id); - $SESSION->cal_courses_shown = $id; - } - } - break; - case 'setcategory': - break; - case 'setblog': - break; - case 'showediting': - $SESSION->blog_editing_enabled = !$SESSION->blog_editing_enabled; - break; + if (isset($SESSION->blog_editing_enabled)) { + $SESSION->blog_editing_enabled = !$SESSION->blog_editing_enabled; + } else { + $SESSION->blog_editing_enabled = true; } + redirect($referrer); ?>