-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings.php
80 lines (68 loc) · 3.3 KB
/
settings.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?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/>.
/**
* Url module admin settings and defaults
*
* File settings.php
* Encoding UTF-8
*
* @package mod_gwpayments
*
* @copyright 2021 Ing. R.J. van Dongen
* @author Ing. R.J. van Dongen <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
$currencies = \mod_gwpayments\local\helper::get_possible_currencies();
if (empty($currencies)) {
$notify = new \core\output\notification(
get_string('nocurrencysupported', 'core_payment'),
\core\output\notification::NOTIFY_WARNING
);
$settings->add(new admin_setting_heading('mod_gwpayments_nocurrency', '', $OUTPUT->render($notify)));
}
// Logo.
$image = '<a href="http://www.sebsoft.nl" target="_new"><img src="' .
$OUTPUT->image_url('logo', 'mod_gwpayments') . '" /></a> ';
$donate = '<a href="https://customerpanel.sebsoft.nl/sebsoft/donate/intro.php" target="_new">' .
'<img src="' . $OUTPUT->image_url('donate', 'block_coupon') . '" /></a>';
$header = '<div class="mod_gwpayments-logopromo">' . $image . $donate . '</div>';
$settings->add(new admin_setting_heading('mod_gwpayments_logopromo',
get_string('promo', 'mod_gwpayments'),
get_string('promodesc', 'mod_gwpayments', $header)));
require_once("$CFG->libdir/resourcelib.php");
// Modedit defaults.
$settings->add(new admin_setting_heading('urlmodeditdefaults',
get_string('modeditdefaults', 'admin'),
get_string('condifmodeditdefaults', 'admin')));
$settings->add(new admin_setting_configtext('gwpayments/cost',
get_string('cost', 'mod_gwpayments'),
'', 10.00, PARAM_FLOAT, 4));
$settings->add(new admin_setting_configtext('gwpayments/vat',
get_string('vat', 'mod_gwpayments'),
get_string('vat_help', 'mod_gwpayments'), 21, PARAM_INT, 4));
if (!empty($currencies)) {
$settings->add(new admin_setting_configselect('gwpayments/currency',
get_string('currency', 'mod_gwpayments'), '', 'EUR', $currencies));
}
$settings->add(new admin_setting_configcheckbox('gwpayments/studentdisplayonpayments',
get_string('studentdisplayonpayments', 'mod_gwpayments'),
get_string('studentdisplayonpayments_help', 'mod_gwpayments'), 0));
$settings->add(new admin_setting_configcheckbox('gwpayments/disablepaymentonmisconfig',
get_string('disablepaymentonmisconfig', 'mod_gwpayments'),
get_string('disablepaymentonmisconfig_help', 'mod_gwpayments'), 0));
}