forked from bozoh/moodle-mod_simplecertificate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
100 lines (78 loc) · 5.55 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?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/>.
/**
* Provides some custom settings for the certificate module
*
* @package mod
* @subpackage simplecertificate
* @copyright Carlos Alexandre S. da Fonseca <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
require_once("$CFG->dirroot/mod/simplecertificate/lib.php");
// General settings.
$settings->add(new admin_setting_configtext('simplecertificate/width', get_string('defaultwidth', 'simplecertificate'),
get_string('size_help', 'simplecertificate'), 297, PARAM_INT));
$settings->add(new admin_setting_configtext('simplecertificate/height', get_string('defaultheight', 'simplecertificate'),
get_string('size_help', 'simplecertificate'), 210, PARAM_INT));
$settings->add(new admin_setting_configtext('simplecertificate/certificatetextx',
get_string('defaultcertificatetextx', 'simplecertificate'),
get_string('textposition_help', 'simplecertificate'), 50, PARAM_INT));
$settings->add(new admin_setting_configtext('simplecertificate/certificatetexty',
get_string('defaultcertificatetexty', 'simplecertificate'),
get_string('textposition_help', 'simplecertificate'), 50, PARAM_INT));
$settings->add(new admin_setting_configselect('simplecertificate/certdate', get_string('printdate', 'simplecertificate'),
get_string('printdate_help', 'simplecertificate'), -2, simplecertificate_get_date_options()));
$settings->add(new admin_setting_configtext('simplecertificate/certlifetime', get_string('certlifetime', 'simplecertificate'),
get_string('certlifetime_help', 'simplecertificate'), 60, PARAM_INT));
// QR CODE.
$settings->add(new admin_setting_configcheckbox('simplecertificate/printqrcode',
get_string('printqrcode', 'simplecertificate'), get_string('printqrcode_help', 'simplecertificate'), 1));
$settings->add(new admin_setting_configtext('simplecertificate/codex', get_string('defaultcodex', 'simplecertificate'),
get_string('qrcodeposition_help', 'simplecertificate'), 10, PARAM_INT));
$settings->add(new admin_setting_configtext('simplecertificate/codey', get_string('defaultcodey', 'simplecertificate'),
get_string('qrcodeposition_help', 'simplecertificate'), 10, PARAM_INT));
$settings->add(new admin_setting_configcheckbox('simplecertificate/qrcodefirstpage',
get_string('qrcodefirstpage', 'simplecertificate'), get_string('qrcodefirstpage_help', 'simplecertificate'), 0));
// Certificate back page.
$settings->add(new admin_setting_configcheckbox('simplecertificate/enablesecondpage',
get_string('enablesecondpage', 'simplecertificate'), get_string('enablesecondpage_help', 'simplecertificate'), 0));
// Pagination.
$settings->add(new admin_setting_configtext('simplecertificate/perpage', get_string('defaultperpage', 'simplecertificate'),
get_string('defaultperpage_help', 'simplecertificate'), 30, PARAM_INT));
// Secure sign.
$settings->add(new admin_setting_heading('simplecertificate/signhead', null,
format_text(get_string('signhead', 'simplecertificate'))));
$settings->add(new admin_setting_configtext('simplecertificate/signname', get_string('signname', 'simplecertificate'),
get_string('signame_help', 'simplecertificate'), ''));
$settings->add(new admin_setting_configfile('simplecertificate/certificatepath',
get_string('certificatepath', 'simplecertificate'),
get_string('certificatepath_help', 'simplecertificate'), ''));
$settings->add(new admin_setting_configtext('simplecertificate/signposx', get_string('signposx', 'simplecertificate'),
get_string('signposx_help', 'simplecertificate'), 0, PARAM_INT));
$settings->add(new admin_setting_configtext('simplecertificate/signposy', get_string('signposy', 'simplecertificate'),
get_string('signposy_help', 'simplecertificate'), 0, PARAM_INT));
$settings->add(new admin_setting_configtext('simplecertificate/signwidth', get_string('signwidth', 'simplecertificate'),
get_string('signwidth_help', 'simplecertificate'), 0, PARAM_INT));
$settings->add(new admin_setting_configtext('simplecertificate/signheight', get_string('signheight', 'simplecertificate'),
get_string('signheight_help', 'simplecertificate'), 0, PARAM_INT));
$opts = ['accepted_types' => ['.png', '.jpg']];
$settings->add(new admin_setting_configstoredfile('simplecertificate/signimage', get_string('signimage', 'simplecertificate'),
get_string('signimage_help', 'simplecertificate'), 'signimage', 0, $opts));
$settings->add(new admin_setting_configtextarea('simplecertificate/signinfo', get_string('signinfo', 'simplecertificate'),
get_string('signinfo_help', 'simplecertificate'), "Name=\nLocation=\nReason=\nContactInfo="));
}