MDL-30021 qtype numerical better showunits default when coming from 1.9
[moodle.git] / calendar / set.php
blob2633369d3544d85508aa7d2ab27685a69192c357
1 <?php
3 /////////////////////////////////////////////////////////////////////////////
4 // //
5 // NOTICE OF COPYRIGHT //
6 // //
7 // Moodle - Calendar extension //
8 // //
9 // Copyright (C) 2003-2004 Greek School Network www.sch.gr //
10 // //
11 // Designed by: //
12 // Avgoustos Tsinakos (tsinakos@teikav.edu.gr) //
13 // Jon Papaioannou (pj@moodle.org) //
14 // //
15 // Programming and development: //
16 // Jon Papaioannou (pj@moodle.org) //
17 // //
18 // For bugs, suggestions, etc contact: //
19 // Jon Papaioannou (pj@moodle.org) //
20 // //
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. //
26 // //
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. //
31 // //
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: //
36 // //
37 // http://www.gnu.org/copyleft/gpl.html //
38 // //
39 /////////////////////////////////////////////////////////////////////////////
41 require_once('../config.php');
42 require_once($CFG->dirroot.'/calendar/lib.php');
44 require_sesskey();
46 $var = required_param('var', PARAM_ALPHA);
47 $return = clean_param(base64_decode(required_param('return', PARAM_RAW)), PARAM_URL);
49 $url = new moodle_url('/calendar/set.php', array('return'=>base64_encode($return),'var'=>$var, 'sesskey'=>sesskey()));
50 $PAGE->set_url($url);
51 $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
53 switch($var) {
54 case 'showgroups':
55 calendar_set_event_type_display(CALENDAR_EVENT_GROUP);
56 break;
57 case 'showcourses':
58 calendar_set_event_type_display(CALENDAR_EVENT_COURSE);
59 break;
60 case 'showglobal':
61 calendar_set_event_type_display(CALENDAR_EVENT_GLOBAL);
62 break;
63 case 'showuser':
64 calendar_set_event_type_display(CALENDAR_EVENT_USER);
65 break;
68 redirect($return);