moodle-local_adonis/settings.php
2022-11-28 07:33:03 +00:00

104 lines
No EOL
3.3 KiB
PHP

<?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/>.
/**
* Plugin settings for the local_adonis plugin.
*
* @package local_adonis
* @copyright 2022, Kumi Systems e.U. <office@kumi.systems>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Ensure the configurations for this site are set
if ($hassiteconfig) {
// Create the new settings page
// - in a local plugin this is not defined as standard, so normal $settings->methods will throw an error as
// $settings will be null
$settings = new admin_settingpage('local_adonis', 'Adonis Connection');
// Create
$ADMIN->add('localplugins', $settings);
// Add a setting field to the settings for this page
$settings->add(new admin_setting_configtext(
// This is the reference you will use to your configuration
'local_adonis/api_url',
// This is the friendly title for the config, which will be displayed
'Adonis Base URL',
// This is helper text for this config field
'Base URL (scheme://IP_or_domain) of Adonis',
// This is the default value
'https://adonis',
// This is the type of Parameter this config is
PARAM_TEXT
));
$settings->add(new admin_setting_configtext(
// This is the reference you will use to your configuration
'local_adonis/username',
// This is the friendly title for the config, which will be displayed
'Adonis Username',
// This is helper text for this config field
'Username to use for Adonis authentication',
// This is the default value
'adonis',
// This is the type of Parameter this config is
PARAM_TEXT
));
$settings->add(new admin_setting_configpasswordunmask(
// This is the reference you will use to your configuration
'local_adonis/password',
// This is the friendly title for the config, which will be displayed
'Adonis Password',
// This is helper text for this config field
'Password to use for Adonis authentication',
// This is the default value
'secret',
// This is the type of Parameter this config is
PARAM_TEXT
));
$settings->add(new admin_setting_configtext(
// This is the reference you will use to your configuration
'local_adonis/requirements_view',
// This is the friendly title for the config, which will be displayed
'Requirements View',
// This is helper text for this config field
'ID of the view containing crew requirements',
// This is the default value
'ABC123',
// This is the type of Parameter this config is
PARAM_TEXT
));
}