3 /////////////////////////////////////////////////////////////////////////////
5 // NOTICE OF COPYRIGHT //
7 // Moodle - Calendar extension //
9 // Copyright (C) 2003-2004 Greek School Network www.sch.gr //
12 // Avgoustos Tsinakos (tsinakos@teikav.edu.gr) //
13 // Jon Papaioannou (pj@moodle.org) //
15 // Programming and development: //
16 // Jon Papaioannou (pj@moodle.org) //
18 // For bugs, suggestions, etc contact: //
19 // Jon Papaioannou (pj@moodle.org) //
21 // The current module was developed at the University of Macedonia //
22 // (www.uom.gr) under the funding of the Greek School Network (www.sch.gr) //
23 // The aim of this project is to provide additional and improved //
24 // functionality to the Asynchronous Distance Education service that the //
25 // Greek School Network deploys. //
27 // This program is free software; you can redistribute it and/or modify //
28 // it under the terms of the GNU General Public License as published by //
29 // the Free Software Foundation; either version 2 of the License, or //
30 // (at your option) any later version. //
32 // This program is distributed in the hope that it will be useful, //
33 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
34 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
35 // GNU General Public License for more details: //
37 // http://www.gnu.org/copyleft/gpl.html //
39 /////////////////////////////////////////////////////////////////////////////
41 require_once('../config.php');
42 require_once($CFG->dirroot
.'/calendar/lib.php');
44 $from = required_param('from');
45 $var = required_param('var');
46 $value = optional_param('value');
47 $id = optional_param('id');
48 $cal_d = optional_param('cal_d');
49 $cal_m = optional_param('cal_m');
50 $cal_y = optional_param('cal_y');
54 // Not implemented yet (or possibly at all)
59 $SESSION->cal_courses_shown
= array();
60 calendar_set_referring_course(0);
63 $SESSION->cal_courses_shown
= calendar_get_default_courses(true);
64 calendar_set_referring_course(0);
67 if(get_record('course', 'id', $id) === false) {
68 // There is no such course
69 $SESSION->cal_courses_shown
= array();
70 calendar_set_referring_course(0);
73 calendar_set_referring_course($id);
74 $SESSION->cal_courses_shown
= $id;
79 $SESSION->cal_show_groups
= !$SESSION->cal_show_groups
;
80 set_user_preference('calendar_savedflt', calendar_get_filters_status());
83 $SESSION->cal_show_course
= !$SESSION->cal_show_course
;
84 set_user_preference('calendar_savedflt', calendar_get_filters_status());
87 $SESSION->cal_show_global
= !$SESSION->cal_show_global
;
88 set_user_preference('calendar_savedflt', calendar_get_filters_status());
91 $SESSION->cal_show_user
= !$SESSION->cal_show_user
;
92 set_user_preference('calendar_savedflt', calendar_get_filters_status());
98 redirect(CALENDAR_URL
.'event.php?action='.$action.'&type='.$type.'&id='.intval($id));
101 redirect(CALENDAR_URL
.'view.php?view=month&cal_d='.$cal_d.'&cal_m='.$cal_m.'&cal_y='.$cal_y);
104 redirect(CALENDAR_URL
.'view.php?view=upcoming');
107 redirect(CALENDAR_URL
.'view.php?view=day&cal_d='.$cal_d.'&cal_m='.$cal_m.'&cal_y='.$cal_y);
110 redirect($CFG->wwwroot
.'/course/view.php?id='.intval($id));