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 $var = required_param('var', PARAM_ALPHA
);
45 $return = clean_param(base64_decode(required_param('return', PARAM_RAW
)), PARAM_LOCALURL
);
46 $courseid = optional_param('id', -1, PARAM_INT
);
47 if ($courseid != -1) {
48 $return = new moodle_url($return, array('course' => $courseid));
50 $return = new moodle_url($return);
53 if (!confirm_sesskey()) {
54 // Do not call require_sesskey() since this page may be accessed without session (for example by bots).
58 $url = new moodle_url('/calendar/set.php', array('return'=>base64_encode($return->out_as_local_url(false)), 'course' => $courseid, 'var'=>$var, 'sesskey'=>sesskey()));
60 $PAGE->set_context(context_system
::instance());
64 calendar_set_event_type_display(CALENDAR_EVENT_GROUP
);
67 calendar_set_event_type_display(CALENDAR_EVENT_COURSE
);
70 calendar_set_event_type_display(CALENDAR_EVENT_GLOBAL
);
73 calendar_set_event_type_display(CALENDAR_EVENT_USER
);