-
Notifications
You must be signed in to change notification settings - Fork 18
/
slotsviewoptions.php
executable file
·58 lines (49 loc) · 1.84 KB
/
slotsviewoptions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
// This file is part of mod_organizer for Moodle - http://moodle.org/
//
// It 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 3 of the License, or
// (at your option) any later version.
//
// It 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.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* slotsviewoptions.php
*
* Saves user changes of the filter options in slots view. Called by ajax.
*
* @package mod_organizer
* @author Thomas Niedermaier ([email protected])
* @copyright 2022 Academic Moodle Cooperation {@link http://www.academic-moodle-cooperation.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('AJAX_SCRIPT', true);
require_once(__DIR__ . '/../../config.php');
// Check access.
if (!confirm_sesskey()) {
throw new moodle_exception('invalidsesskey', 'error');
}
// Get the params.
$slotsviewoptions = required_param('slotsviewoptions', PARAM_ALPHANUM); // Present slots view options.
$userid = required_param('userid', PARAM_INT); // The ID of the user.
// Update database entry.
/*
* Legend of slotsviewoptions string
*
* Values: 0 for not active, 1 for active
*
* Position 0: show_my_slots_only
* Position 1: show_free_slots_only
* Position 2: show_hidden_slots
* Position 3: show_past_slots
* Position 4: show_registrations_only
* Position 5: show_all_participants
*/
set_user_preference('mod_organizer_slotsviewoptions', $slotsviewoptions, $userid);
echo "1";