2009-09-29 02:51:00 +00:00
|
|
|
<?php
|
2004-03-29 15:28:15 +00:00
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// //
|
|
|
|
// NOTICE OF COPYRIGHT //
|
|
|
|
// //
|
|
|
|
// Moodle - Calendar extension //
|
|
|
|
// //
|
|
|
|
// Copyright (C) 2003-2004 Greek School Network www.sch.gr //
|
|
|
|
// //
|
|
|
|
// Designed by: //
|
2007-02-27 13:49:43 +00:00
|
|
|
// Avgoustos Tsinakos (tsinakos@teikav.edu.gr) //
|
|
|
|
// Jon Papaioannou (pj@moodle.org) //
|
2004-03-29 15:28:15 +00:00
|
|
|
// //
|
|
|
|
// Programming and development: //
|
2007-02-27 13:49:43 +00:00
|
|
|
// Jon Papaioannou (pj@moodle.org) //
|
2004-03-29 15:28:15 +00:00
|
|
|
// //
|
|
|
|
// For bugs, suggestions, etc contact: //
|
2007-02-27 13:49:43 +00:00
|
|
|
// Jon Papaioannou (pj@moodle.org) //
|
2004-03-29 15:28:15 +00:00
|
|
|
// //
|
|
|
|
// The current module was developed at the University of Macedonia //
|
|
|
|
// (www.uom.gr) under the funding of the Greek School Network (www.sch.gr) //
|
|
|
|
// The aim of this project is to provide additional and improved //
|
|
|
|
// functionality to the Asynchronous Distance Education service that the //
|
|
|
|
// Greek School Network deploys. //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License for more details: //
|
|
|
|
// //
|
|
|
|
// http://www.gnu.org/copyleft/gpl.html //
|
|
|
|
// //
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2009-09-29 02:51:00 +00:00
|
|
|
require_once('../config.php');
|
|
|
|
require_once($CFG->dirroot.'/calendar/lib.php');
|
2004-03-29 15:28:15 +00:00
|
|
|
|
2011-10-28 19:35:04 +02:00
|
|
|
require_sesskey();
|
|
|
|
|
2009-09-29 02:51:00 +00:00
|
|
|
$var = required_param('var', PARAM_ALPHA);
|
2014-07-03 14:30:36 +01:00
|
|
|
$return = clean_param(base64_decode(required_param('return', PARAM_RAW)), PARAM_LOCALURL);
|
2012-04-23 14:58:39 +08:00
|
|
|
$courseid = optional_param('id', -1, PARAM_INT);
|
|
|
|
if ($courseid != -1) {
|
|
|
|
$return = new moodle_url($return, array('course' => $courseid));
|
|
|
|
} else {
|
|
|
|
$return = new moodle_url($return);
|
|
|
|
}
|
2014-07-03 14:30:36 +01:00
|
|
|
$url = new moodle_url('/calendar/set.php', array('return'=>base64_encode($return->out_as_local_url(false)), 'course' => $courseid, 'var'=>$var, 'sesskey'=>sesskey()));
|
2009-09-29 02:51:00 +00:00
|
|
|
$PAGE->set_url($url);
|
2012-07-23 16:22:36 +08:00
|
|
|
$PAGE->set_context(context_system::instance());
|
2007-05-06 04:28:11 +00:00
|
|
|
|
2009-09-29 02:51:00 +00:00
|
|
|
switch($var) {
|
|
|
|
case 'showgroups':
|
2011-06-29 14:50:38 +08:00
|
|
|
calendar_set_event_type_display(CALENDAR_EVENT_GROUP);
|
|
|
|
break;
|
2009-09-29 02:51:00 +00:00
|
|
|
case 'showcourses':
|
2011-06-29 14:50:38 +08:00
|
|
|
calendar_set_event_type_display(CALENDAR_EVENT_COURSE);
|
|
|
|
break;
|
2009-09-29 02:51:00 +00:00
|
|
|
case 'showglobal':
|
2011-06-29 14:50:38 +08:00
|
|
|
calendar_set_event_type_display(CALENDAR_EVENT_GLOBAL);
|
|
|
|
break;
|
2009-09-29 02:51:00 +00:00
|
|
|
case 'showuser':
|
2011-06-29 14:50:38 +08:00
|
|
|
calendar_set_event_type_display(CALENDAR_EVENT_USER);
|
|
|
|
break;
|
2009-09-29 02:51:00 +00:00
|
|
|
}
|
2004-03-29 15:28:15 +00:00
|
|
|
|
2011-11-01 17:50:01 +13:00
|
|
|
redirect($return);
|