-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
58 lines (47 loc) · 1.87 KB
/
index.php
File metadata and controls
58 lines (47 loc) · 1.87 KB
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 Moodle - http://moodle.org/
//
// Moodle 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.
//
// Moodle 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/>.
/**
* Batch overview.
*
* @package local_bbcomailing
* @copyright 2026 David Herney @ BambuCo
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use core\url as moodle_url;
use core\context\system as context_system;
require_once('../../config.php');
require_login();
$context = context_system::instance();
require_capability('local/bbcomailing:manage', $context);
$PAGE->set_context($context);
$PAGE->set_url(new moodle_url('/local/bbcomailing/index.php'));
$PAGE->set_title(get_string('pluginname', 'local_bbcomailing'));
$PAGE->set_heading(get_string('pluginname', 'local_bbcomailing'));
$PAGE->set_pagelayout('admin');
// Handle batch cancellation.
$cancel = optional_param('cancel', '', PARAM_ALPHANUMEXT);
if ($cancel && confirm_sesskey()) {
\local_bbcomailing\manager::cancel_batch($cancel);
redirect($PAGE->url, get_string('batchcancelled', 'local_bbcomailing'));
}
echo $OUTPUT->header();
// Navigation tabs.
echo \local_bbcomailing\manager::render_tabs('manage');
// Batches table.
echo $OUTPUT->heading(get_string('batches', 'local_bbcomailing'), 3);
$table = new \local_bbcomailing\table\batches_table($PAGE->url);
$table->out(20, true);
echo $OUTPUT->footer();