2013-09-09 08:50:48 +00:00
|
|
|
<?php
|
|
|
|
// This file is part of the Certificate module for 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/>.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a link to the upload form on the settings page.
|
|
|
|
*
|
2021-11-24 07:29:43 +00:00
|
|
|
* @package mod_htmlcert
|
|
|
|
* @copyright 2013 Mark Nelson <markn@moodle.com>, 2021 Klaus-Uwe Mitterer <kumitterer@kumi.systems>
|
2013-09-09 08:50:48 +00:00
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
|
|
|
|
defined('MOODLE_INTERNAL') || die;
|
|
|
|
|
2021-11-24 07:29:43 +00:00
|
|
|
$url = $CFG->wwwroot . '/mod/htmlcert/verify_certificate.php';
|
2018-07-17 06:49:26 +00:00
|
|
|
|
2021-11-24 07:29:43 +00:00
|
|
|
$ADMIN->add('modsettings', new admin_category('htmlcert', get_string('pluginname', 'mod_htmlcert')));
|
|
|
|
$settings = new admin_settingpage('modsettinghtmlcert', new lang_string('htmlcertsettings', 'mod_htmlcert'));
|
2018-07-17 06:49:26 +00:00
|
|
|
|
2021-11-24 07:29:43 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('htmlcert/verifyallcertificates',
|
|
|
|
get_string('verifyallcertificates', 'htmlcert'),
|
|
|
|
get_string('verifyallcertificates_desc', 'htmlcert', $url),
|
2017-11-12 04:55:10 +00:00
|
|
|
0));
|
|
|
|
|
2021-11-24 07:29:43 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('htmlcert/showposxy',
|
|
|
|
get_string('showposxy', 'htmlcert'),
|
|
|
|
get_string('showposxy_desc', 'htmlcert'),
|
2016-10-21 13:33:59 +00:00
|
|
|
0));
|
|
|
|
|
2021-11-24 07:29:43 +00:00
|
|
|
$settings->add(new \mod_htmlcert\admin_setting_link('htmlcert/verifycertificate',
|
|
|
|
get_string('verifycertificate', 'htmlcert'), get_string('verifycertificatedesc', 'htmlcert'),
|
|
|
|
get_string('verifycertificate', 'htmlcert'), new moodle_url('/mod/htmlcert/verify_certificate.php'), ''));
|
2018-06-26 10:50:21 +00:00
|
|
|
|
2021-11-24 07:29:43 +00:00
|
|
|
$settings->add(new \mod_htmlcert\admin_setting_link('htmlcert/managetemplates',
|
|
|
|
get_string('managetemplates', 'htmlcert'), get_string('managetemplatesdesc', 'htmlcert'),
|
|
|
|
get_string('managetemplates', 'htmlcert'), new moodle_url('/mod/htmlcert/manage_templates.php'), ''));
|
2013-09-09 08:50:48 +00:00
|
|
|
|
2021-11-24 07:29:43 +00:00
|
|
|
$settings->add(new \mod_htmlcert\admin_setting_link('htmlcert/uploadimage',
|
|
|
|
get_string('uploadimage', 'htmlcert'), get_string('uploadimagedesc', 'htmlcert'),
|
|
|
|
get_string('uploadimage', 'htmlcert'), new moodle_url('/mod/htmlcert/upload_image.php'), ''));
|
2018-07-23 06:17:30 +00:00
|
|
|
|
|
|
|
$settings->add(new admin_setting_heading('defaults',
|
|
|
|
get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
|
|
|
|
|
|
|
|
$yesnooptions = [
|
|
|
|
0 => get_string('no'),
|
|
|
|
1 => get_string('yes'),
|
|
|
|
];
|
|
|
|
|
2021-11-24 07:29:43 +00:00
|
|
|
$settings->add(new admin_setting_configselect('htmlcert/emailstudents',
|
|
|
|
get_string('emailstudents', 'htmlcert'), get_string('emailstudents_help', 'htmlcert'), 0, $yesnooptions));
|
|
|
|
$settings->add(new admin_setting_configselect('htmlcert/emailteachers',
|
|
|
|
get_string('emailteachers', 'htmlcert'), get_string('emailteachers_help', 'htmlcert'), 0, $yesnooptions));
|
|
|
|
$settings->add(new admin_setting_configtext('htmlcert/emailothers',
|
|
|
|
get_string('emailothers', 'htmlcert'), get_string('emailothers_help', 'htmlcert'), '', PARAM_TEXT));
|
|
|
|
$settings->add(new admin_setting_configselect('htmlcert/verifyany',
|
|
|
|
get_string('verifycertificateanyone', 'htmlcert'), get_string('verifycertificateanyone_help', 'htmlcert'),
|
2018-07-23 06:17:30 +00:00
|
|
|
0, $yesnooptions));
|
2021-11-24 07:29:43 +00:00
|
|
|
$settings->add(new admin_setting_configtext('htmlcert/requiredtime',
|
|
|
|
get_string('coursetimereq', 'htmlcert'), get_string('coursetimereq_help', 'htmlcert'), 0, PARAM_INT));
|
|
|
|
$settings->add(new admin_setting_configcheckbox('htmlcert/protection_print',
|
|
|
|
get_string('preventprint', 'htmlcert'),
|
|
|
|
get_string('preventprint_desc', 'htmlcert'),
|
2018-07-23 06:17:30 +00:00
|
|
|
0));
|
2021-11-24 07:29:43 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('htmlcert/protection_modify',
|
|
|
|
get_string('preventmodify', 'htmlcert'),
|
|
|
|
get_string('preventmodify_desc', 'htmlcert'),
|
2018-07-23 06:17:30 +00:00
|
|
|
0));
|
2021-11-24 07:29:43 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('htmlcert/protection_copy',
|
|
|
|
get_string('preventcopy', 'htmlcert'),
|
|
|
|
get_string('preventcopy_desc', 'htmlcert'),
|
2018-07-23 06:17:30 +00:00
|
|
|
0));
|
|
|
|
|
2021-11-24 07:29:43 +00:00
|
|
|
$ADMIN->add('htmlcert', $settings);
|
2018-07-17 06:49:26 +00:00
|
|
|
|
|
|
|
// Element plugin settings.
|
2021-11-24 07:29:43 +00:00
|
|
|
$ADMIN->add('htmlcert', new admin_category('htmlcertelements', get_string('elementplugins', 'htmlcert')));
|
|
|
|
$plugins = \core_plugin_manager::instance()->get_plugins_of_type('htmlcertelement');
|
2018-07-17 06:49:26 +00:00
|
|
|
foreach ($plugins as $plugin) {
|
2021-11-24 07:29:43 +00:00
|
|
|
$plugin->load_settings($ADMIN, 'htmlcertelements', $hassiteconfig);
|
2018-07-17 06:49:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Tell core we already added the settings structure.
|
|
|
|
$settings = null;
|