mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-26726 fix whitespace and a few debug and comment typos
This commit is contained in:
parent
56babbcb76
commit
3e7069e70b
1 changed files with 272 additions and 200 deletions
188
lib/adminlib.php
188
lib/adminlib.php
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
|
@ -631,6 +630,7 @@ function is_dataroot_insecure($fetchtest=false) {
|
|||
|
||||
/// CLASS DEFINITIONS /////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* Interface for anything appearing in the admin tree
|
||||
*
|
||||
|
@ -702,6 +702,7 @@ interface part_of_admin_tree {
|
|||
public function show_save();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Interface implemented by any part_of_admin_tree that has children.
|
||||
*
|
||||
|
@ -730,6 +731,7 @@ interface parentable_part_of_admin_tree extends part_of_admin_tree {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The object used to represent folders (a.k.a. categories) in the admin tree block.
|
||||
*
|
||||
|
@ -882,7 +884,7 @@ class admin_category implements parentable_part_of_admin_tree {
|
|||
$parent->children[] = $something;
|
||||
if (is_array($this->category_cache) and ($something instanceof admin_category)) {
|
||||
if (isset($this->category_cache[$something->name])) {
|
||||
debugging('Duplicate admin catefory name: '.$something->name);
|
||||
debugging('Duplicate admin category name: '.$something->name);
|
||||
} else {
|
||||
$this->category_cache[$something->name] = $something;
|
||||
$something->category_cache =& $this->category_cache;
|
||||
|
@ -890,7 +892,7 @@ class admin_category implements parentable_part_of_admin_tree {
|
|||
// just in case somebody already added subcategories
|
||||
if ($child instanceof admin_category) {
|
||||
if (isset($this->category_cache[$child->name])) {
|
||||
debugging('Duplicate admin catefory name: '.$child->name);
|
||||
debugging('Duplicate admin category name: '.$child->name);
|
||||
} else {
|
||||
$this->category_cache[$child->name] = $child;
|
||||
$child->category_cache =& $this->category_cache;
|
||||
|
@ -945,6 +947,7 @@ class admin_category implements parentable_part_of_admin_tree {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Root of admin settings tree, does not have any parent.
|
||||
*
|
||||
|
@ -1006,6 +1009,7 @@ class admin_root extends admin_category {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Links external PHP pages into the admin tree.
|
||||
*
|
||||
|
@ -1015,7 +1019,7 @@ class admin_root extends admin_category {
|
|||
*/
|
||||
class admin_externalpage implements part_of_admin_tree {
|
||||
|
||||
/** @var string An internal name for this external page. Must be unique amongst ALL part_of_admin_tree objects */
|
||||
/** @var string An internal name for this external page. Must be unique amongst ALL part_of_admin_tree objects */
|
||||
public $name;
|
||||
|
||||
/** @var string The displayed name for this external page. Usually obtained through get_string(). */
|
||||
|
@ -1035,6 +1039,8 @@ class admin_externalpage implements part_of_admin_tree {
|
|||
|
||||
/** @var mixed either string or array of string */
|
||||
public $path;
|
||||
|
||||
/** @var array list of visible names of page parents */
|
||||
public $visiblepath;
|
||||
|
||||
/**
|
||||
|
@ -1150,6 +1156,7 @@ class admin_externalpage implements part_of_admin_tree {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Used to group a number of admin_setting objects into a page and add them to the admin tree.
|
||||
*
|
||||
|
@ -1157,7 +1164,7 @@ class admin_externalpage implements part_of_admin_tree {
|
|||
*/
|
||||
class admin_settingpage implements part_of_admin_tree {
|
||||
|
||||
/** @var string An internal name for this external page. Must be unique amongst ALL part_of_admin_tree objects */
|
||||
/** @var string An internal name for this external page. Must be unique amongst ALL part_of_admin_tree objects */
|
||||
public $name;
|
||||
|
||||
/** @var string The displayed name for this external page. Usually obtained through get_string(). */
|
||||
|
@ -1177,6 +1184,8 @@ class admin_settingpage implements part_of_admin_tree {
|
|||
|
||||
/** @var mixed string of paths or array of strings of paths */
|
||||
public $path;
|
||||
|
||||
/** @var array list of visible names of page parents */
|
||||
public $visiblepath;
|
||||
|
||||
/**
|
||||
|
@ -1359,7 +1368,7 @@ class admin_settingpage implements part_of_admin_tree {
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
abstract class admin_setting {
|
||||
/** @var string unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. */
|
||||
/** @var string unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. */
|
||||
public $name;
|
||||
/** @var string localised name */
|
||||
public $visiblename;
|
||||
|
@ -1437,7 +1446,7 @@ abstract class admin_setting {
|
|||
/**
|
||||
* Returns the config if possible
|
||||
*
|
||||
* @return mixed returns config if successfull else null
|
||||
* @return mixed returns config if successful else null
|
||||
*/
|
||||
public function config_read($name) {
|
||||
global $CFG;
|
||||
|
@ -1540,6 +1549,7 @@ abstract class admin_setting {
|
|||
/**
|
||||
* Function called if setting updated - cleanup, cache reset, etc.
|
||||
* @param string $functionname Sets the function name
|
||||
* @return void
|
||||
*/
|
||||
public function set_updatedcallback($functionname) {
|
||||
$this->updatedcallback = $functionname;
|
||||
|
@ -1581,13 +1591,15 @@ abstract class admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* No setting - just heading and text.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_heading extends admin_setting {
|
||||
/**
|
||||
|
||||
/**
|
||||
* not a setting, just text
|
||||
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
|
||||
* @param string $heading heading
|
||||
|
@ -1640,6 +1652,7 @@ class admin_setting_heading extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The most flexibly setting, user is typing text
|
||||
*
|
||||
|
@ -1647,7 +1660,7 @@ class admin_setting_heading extends admin_setting {
|
|||
*/
|
||||
class admin_setting_configtext extends admin_setting {
|
||||
|
||||
/** @var mixed int means PARAM_XXX type, string is a allowed format in regex */
|
||||
/** @var mixed int means PARAM_XXX type, string is a allowed format in regex */
|
||||
public $paramtype;
|
||||
/** @var int default field size */
|
||||
public $size;
|
||||
|
@ -1734,6 +1747,7 @@ class admin_setting_configtext extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* General text area without html editor.
|
||||
*
|
||||
|
@ -1757,6 +1771,7 @@ class admin_setting_configtextarea extends admin_setting_configtext {
|
|||
$this->cols = $cols;
|
||||
parent::__construct($name, $visiblename, $description, $defaultsetting, $paramtype);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an XHTML string for the editor
|
||||
*
|
||||
|
@ -1778,6 +1793,7 @@ class admin_setting_configtextarea extends admin_setting_configtext {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* General text area with html editor.
|
||||
*/
|
||||
|
@ -1798,6 +1814,7 @@ class admin_setting_confightmleditor extends admin_setting_configtext {
|
|||
parent::__construct($name, $visiblename, $description, $defaultsetting, $paramtype);
|
||||
editors_head_setup();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an XHTML string for the editor
|
||||
*
|
||||
|
@ -1822,13 +1839,14 @@ class admin_setting_confightmleditor extends admin_setting_configtext {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Password field, allows unmasking of password
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configpasswordunmask extends admin_setting_configtext {
|
||||
/**
|
||||
/**
|
||||
* Constructor
|
||||
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
|
||||
* @param string $visiblename localised
|
||||
|
@ -1887,13 +1905,14 @@ if (is_ie) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Path to directory
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configfile extends admin_setting_configtext {
|
||||
/**
|
||||
/**
|
||||
* Constructor
|
||||
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
|
||||
* @param string $visiblename localised
|
||||
|
@ -1933,6 +1952,7 @@ class admin_setting_configfile extends admin_setting_configtext {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Path to executable file
|
||||
*
|
||||
|
@ -1940,7 +1960,7 @@ class admin_setting_configfile extends admin_setting_configtext {
|
|||
*/
|
||||
class admin_setting_configexecutable extends admin_setting_configfile {
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns an XHTML field
|
||||
*
|
||||
* @param string $data This is the value for the field
|
||||
|
@ -1966,6 +1986,7 @@ class admin_setting_configexecutable extends admin_setting_configfile {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Path to directory
|
||||
*
|
||||
|
@ -1973,7 +1994,7 @@ class admin_setting_configexecutable extends admin_setting_configfile {
|
|||
*/
|
||||
class admin_setting_configdirectory extends admin_setting_configfile {
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns an XHTML field
|
||||
*
|
||||
* @param string $data This is the value for the field
|
||||
|
@ -1999,13 +2020,14 @@ class admin_setting_configdirectory extends admin_setting_configfile {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checkbox
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configcheckbox extends admin_setting {
|
||||
/** @var string Value used when checked */
|
||||
/** @var string Value used when checked */
|
||||
public $yes;
|
||||
/** @var string Value used when not checked */
|
||||
public $no;
|
||||
|
@ -2085,13 +2107,14 @@ class admin_setting_configcheckbox extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple checkboxes, each represents different value, stored in csv format
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configmulticheckbox extends admin_setting {
|
||||
/** @var array Array of choices value=>label */
|
||||
/** @var array Array of choices value=>label */
|
||||
public $choices;
|
||||
|
||||
/**
|
||||
|
@ -2256,6 +2279,7 @@ class admin_setting_configmulticheckbox extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple checkboxes 2, value stored as string 00101011
|
||||
*
|
||||
|
@ -2263,7 +2287,7 @@ class admin_setting_configmulticheckbox extends admin_setting {
|
|||
*/
|
||||
class admin_setting_configmulticheckbox2 extends admin_setting_configmulticheckbox {
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns the setting if set
|
||||
*
|
||||
* @return mixed null if not set, else an array of set settings
|
||||
|
@ -2313,13 +2337,14 @@ class admin_setting_configmulticheckbox2 extends admin_setting_configmulticheckb
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Select one value from list
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configselect extends admin_setting {
|
||||
/** @var array Array of choices value=>label */
|
||||
/** @var array Array of choices value=>label */
|
||||
public $choices;
|
||||
|
||||
/**
|
||||
|
@ -2472,13 +2497,14 @@ class admin_setting_configselect extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Select multiple items from list
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configmultiselect extends admin_setting_configselect {
|
||||
/**
|
||||
/**
|
||||
* Constructor
|
||||
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
|
||||
* @param string $visiblename localised
|
||||
|
@ -2512,7 +2538,6 @@ class admin_setting_configmultiselect extends admin_setting_configselect {
|
|||
* Potential bug in the works should anyone call with this function
|
||||
* using a vartype that is not an array
|
||||
*
|
||||
* @todo Add vartype handling to ensure $data is an array
|
||||
* @param array $data
|
||||
*/
|
||||
public function write_setting($data) {
|
||||
|
@ -2619,7 +2644,7 @@ class admin_setting_configmultiselect extends admin_setting_configselect {
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configtime extends admin_setting {
|
||||
/** @var string Used for setting second select (minutes) */
|
||||
/** @var string Used for setting second select (minutes) */
|
||||
public $name2;
|
||||
|
||||
/**
|
||||
|
@ -2696,6 +2721,7 @@ class admin_setting_configtime extends admin_setting {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Used to validate a textarea used for ip addresses
|
||||
*
|
||||
|
@ -2703,7 +2729,7 @@ class admin_setting_configtime extends admin_setting {
|
|||
*/
|
||||
class admin_setting_configiplist extends admin_setting_configtextarea {
|
||||
|
||||
/**
|
||||
/**
|
||||
* Validate the contents of the textarea as IP addresses
|
||||
*
|
||||
* Used to validate a new line separated list of IP addresses collected from
|
||||
|
@ -2721,7 +2747,7 @@ class admin_setting_configiplist extends admin_setting_configtextarea {
|
|||
$result = true;
|
||||
foreach($ips as $ip) {
|
||||
$ip = trim($ip);
|
||||
if(preg_match('#^(\d{1,3})(\.\d{1,3}){0,3}$#', $ip, $match) ||
|
||||
if (preg_match('#^(\d{1,3})(\.\d{1,3}){0,3}$#', $ip, $match) ||
|
||||
preg_match('#^(\d{1,3})(\.\d{1,3}){0,3}(\/\d{1,2})$#', $ip, $match) ||
|
||||
preg_match('#^(\d{1,3})(\.\d{1,3}){3}(-\d{1,3})$#', $ip, $match)) {
|
||||
$result = true;
|
||||
|
@ -2738,6 +2764,7 @@ class admin_setting_configiplist extends admin_setting_configtextarea {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* An admin setting for selecting one or more users who have a capability
|
||||
* in the system context
|
||||
|
@ -2855,13 +2882,14 @@ class admin_setting_users_with_capability extends admin_setting_configmultiselec
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special checkbox for calendar - resets SESSION vars.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_adminseesall extends admin_setting_configcheckbox {
|
||||
/**
|
||||
/**
|
||||
* Calls the parent::__construct with default values
|
||||
*
|
||||
* name => calendar_adminseesall
|
||||
|
@ -2893,7 +2921,7 @@ class admin_setting_special_adminseesall extends admin_setting_configcheckbox {
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_selectsetup extends admin_setting_configselect {
|
||||
/**
|
||||
/**
|
||||
* Reads the setting directly from the database
|
||||
*
|
||||
* @return mixed
|
||||
|
@ -2919,13 +2947,14 @@ class admin_setting_special_selectsetup extends admin_setting_configselect {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special select for frontpage - stores data in course table
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_sitesetselect extends admin_setting_configselect {
|
||||
/**
|
||||
/**
|
||||
* Returns the site name for the selected site
|
||||
*
|
||||
* @see get_site()
|
||||
|
@ -2935,6 +2964,7 @@ class admin_setting_sitesetselect extends admin_setting_configselect {
|
|||
$site = get_site();
|
||||
return $site->{$this->name};
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the database and save the setting
|
||||
*
|
||||
|
@ -2957,6 +2987,7 @@ class admin_setting_sitesetselect extends admin_setting_configselect {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Select for blog's bloglevel setting: if set to 0, will set blog_menu
|
||||
* block to hidden.
|
||||
|
@ -2981,13 +3012,14 @@ class admin_setting_bloglevel extends admin_setting_configselect {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special select - lists on the frontpage - hacky
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_courselist_frontpage extends admin_setting {
|
||||
/** @var array Array of choices value=>label */
|
||||
/** @var array Array of choices value=>label */
|
||||
public $choices;
|
||||
|
||||
/**
|
||||
|
@ -3025,6 +3057,7 @@ class admin_setting_courselist_frontpage extends admin_setting {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the selected settings
|
||||
*
|
||||
|
@ -3098,13 +3131,14 @@ class admin_setting_courselist_frontpage extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special checkbox for frontpage - stores data in course table
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_sitesetcheckbox extends admin_setting_configcheckbox {
|
||||
/**
|
||||
/**
|
||||
* Returns the current sites name
|
||||
*
|
||||
* @return string
|
||||
|
@ -3139,7 +3173,7 @@ class admin_setting_sitesetcheckbox extends admin_setting_configcheckbox {
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_sitesettext extends admin_setting_configtext {
|
||||
/**
|
||||
/**
|
||||
* Return the current setting
|
||||
*
|
||||
* @return mixed string or null
|
||||
|
@ -3191,13 +3225,14 @@ class admin_setting_sitesettext extends admin_setting_configtext {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special text editor for site description.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_frontpagedesc extends admin_setting {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -3247,6 +3282,7 @@ class admin_setting_special_frontpagedesc extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Administration interface for emoticon_manager settings.
|
||||
*
|
||||
|
@ -3254,7 +3290,7 @@ class admin_setting_special_frontpagedesc extends admin_setting {
|
|||
*/
|
||||
class admin_setting_emoticons extends admin_setting {
|
||||
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific args
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -3465,13 +3501,14 @@ class admin_setting_emoticons extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special setting for limiting of the list of available languages.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_langlist extends admin_setting_configtext {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -3491,6 +3528,7 @@ class admin_setting_langlist extends admin_setting_configtext {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selection of one of the recognised countries using the list
|
||||
* returned by {@link get_list_of_countries()}.
|
||||
|
@ -3519,13 +3557,14 @@ class admin_settings_country_select extends admin_setting_configselect {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Course category selection
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_settings_coursecat_select extends admin_setting_configselect {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct($name, $visiblename, $description, $defaultsetting) {
|
||||
|
@ -3548,19 +3587,21 @@ class admin_settings_coursecat_select extends admin_setting_configselect {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special control for selecting days to backup
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_backupdays extends admin_setting_configmulticheckbox2 {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct('backup_auto_weekdays', get_string('automatedbackupschedule','backup'), get_string('automatedbackupschedulehelp','backup'), array(), NULL);
|
||||
$this->plugin = 'backup';
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the available choices for the select box
|
||||
*
|
||||
|
@ -3579,13 +3620,14 @@ class admin_setting_special_backupdays extends admin_setting_configmulticheckbox
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special debug setting
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_debug extends admin_setting_configselect {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -3610,13 +3652,14 @@ class admin_setting_special_debug extends admin_setting_configselect {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special admin control
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_calendar_weekend extends admin_setting {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -3626,6 +3669,7 @@ class admin_setting_special_calendar_weekend extends admin_setting {
|
|||
$default = array ('0', '6'); // Saturdays and Sundays
|
||||
parent::__construct($name, $visiblename, $description, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current settings as an array
|
||||
*
|
||||
|
@ -3699,7 +3743,7 @@ class admin_setting_special_calendar_weekend extends admin_setting {
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_pickroles extends admin_setting_configmulticheckbox {
|
||||
/** @var array Array of capabilities which identify roles */
|
||||
/** @var array Array of capabilities which identify roles */
|
||||
private $types;
|
||||
|
||||
/**
|
||||
|
@ -3737,6 +3781,7 @@ class admin_setting_pickroles extends admin_setting_configmulticheckbox {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the default setting for this control
|
||||
*
|
||||
|
@ -3760,13 +3805,14 @@ class admin_setting_pickroles extends admin_setting_configmulticheckbox {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Text field with an advanced checkbox, that controls a additional $name.'_adv' setting.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configtext_with_advanced extends admin_setting_configtext {
|
||||
/**
|
||||
/**
|
||||
* Constructor
|
||||
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
|
||||
* @param string $visiblename localised
|
||||
|
@ -3846,6 +3892,7 @@ class admin_setting_configtext_with_advanced extends admin_setting_configtext {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checkbox with an advanced checkbox that controls an additional $name.'_adv' config setting.
|
||||
*
|
||||
|
@ -3854,7 +3901,7 @@ class admin_setting_configtext_with_advanced extends admin_setting_configtext {
|
|||
*/
|
||||
class admin_setting_configcheckbox_with_advanced extends admin_setting_configcheckbox {
|
||||
|
||||
/**
|
||||
/**
|
||||
* Constructor
|
||||
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
|
||||
* @param string $visiblename localised
|
||||
|
@ -3950,6 +3997,7 @@ EOT;
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checkbox with an advanced checkbox that controls an additional $name.'_locked' config setting.
|
||||
*
|
||||
|
@ -4051,13 +4099,14 @@ class admin_setting_configcheckbox_with_lock extends admin_setting_configcheckbo
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Dropdown menu with an advanced checkbox, that controls a additional $name.'_adv' setting.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configselect_with_advanced extends admin_setting_configselect {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct($name, $visiblename, $description, $defaultsetting, $choices) {
|
||||
|
@ -4136,13 +4185,14 @@ class admin_setting_configselect_with_advanced extends admin_setting_configselec
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Graded roles in gradebook
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_gradebookroles extends admin_setting_pickroles {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -4152,12 +4202,13 @@ class admin_setting_special_gradebookroles extends admin_setting_pickroles {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_regradingcheckbox extends admin_setting_configcheckbox {
|
||||
/**
|
||||
/**
|
||||
* Saves the new settings passed in $data
|
||||
*
|
||||
* @param string $data
|
||||
|
@ -4179,13 +4230,14 @@ class admin_setting_regradingcheckbox extends admin_setting_configcheckbox {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Which roles to show on course description page
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_coursecontact extends admin_setting_pickroles {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -4195,12 +4247,13 @@ class admin_setting_special_coursecontact extends admin_setting_pickroles {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_gradelimiting extends admin_setting_configcheckbox {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
function admin_setting_special_gradelimiting() {
|
||||
|
@ -4240,13 +4293,14 @@ class admin_setting_special_gradelimiting extends admin_setting_configcheckbox {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Primary grade export plugin - has state tracking.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_gradeexport extends admin_setting_configmulticheckbox {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -4274,13 +4328,14 @@ class admin_setting_special_gradeexport extends admin_setting_configmulticheckbo
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Grade category settings
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_gradecat_combo extends admin_setting {
|
||||
/** @var array Array of choices */
|
||||
/** @var array Array of choices */
|
||||
public $choices;
|
||||
|
||||
/**
|
||||
|
@ -4413,7 +4468,7 @@ class admin_setting_gradecat_combo extends admin_setting {
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_grade_profilereport extends admin_setting_configselect {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -4447,13 +4502,14 @@ class admin_setting_grade_profilereport extends admin_setting_configselect {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for register auth selection
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_special_registerauth extends admin_setting_configselect {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -4504,13 +4560,14 @@ class admin_setting_special_registerauth extends admin_setting_configselect {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Module manage page
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_page_managemods extends admin_externalpage {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -4567,7 +4624,7 @@ class admin_page_managemods extends admin_externalpage {
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_manageenrols extends admin_setting {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -4763,7 +4820,7 @@ class admin_setting_manageenrols extends admin_setting {
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_page_manageblocks extends admin_externalpage {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -4812,13 +4869,14 @@ class admin_page_manageblocks extends admin_externalpage {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Question type manage page
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_page_manageqtypes extends admin_externalpage {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -4859,6 +4917,7 @@ class admin_page_manageqtypes extends admin_externalpage {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class admin_page_manageportfolios extends admin_externalpage {
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
|
@ -4910,6 +4969,7 @@ class admin_page_manageportfolios extends admin_externalpage {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class admin_page_managerepositories extends admin_externalpage {
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
|
@ -4961,13 +5021,14 @@ class admin_page_managerepositories extends admin_externalpage {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for authentication administration.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_manageauths extends admin_setting {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -5163,13 +5224,14 @@ class admin_setting_manageauths extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for authentication administration.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_manageeditors extends admin_setting {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -5329,6 +5391,7 @@ class admin_setting_manageeditors extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for license administration.
|
||||
*
|
||||
|
@ -5422,13 +5485,15 @@ class admin_setting_managelicenses extends admin_setting {
|
|||
return highlight($query, $return);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for filter administration.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_page_managefilters extends admin_externalpage {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -5474,6 +5539,7 @@ class admin_page_managefilters extends admin_externalpage {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialise admin page - this function does require login and permission
|
||||
* checks specified in page definition.
|
||||
|
@ -5487,7 +5553,7 @@ class admin_page_managefilters extends admin_externalpage {
|
|||
* @param array $extraurlparams an array paramname => paramvalue, or parameters that need to be
|
||||
* added to the turn blocks editing on/off form, so this page reloads correctly.
|
||||
* @param string $actualurl if the actual page being viewed is not the normal one for this
|
||||
* page (e.g. admin/roles/allowassin.php, instead of admin/roles/manage.php, you can pass the alternate URL here.
|
||||
* page (e.g. admin/roles/allow.php, instead of admin/roles/manage.php, you can pass the alternate URL here.
|
||||
* @param array $options Additional options that can be specified for page setup.
|
||||
* pagelayout - This option can be used to set a specific pagelyaout, admin is default.
|
||||
*/
|
||||
|
@ -5583,7 +5649,7 @@ function admin_externalpage_setup($section, $extrabutton = '', array $extraurlpa
|
|||
/**
|
||||
* Returns the reference to admin tree root
|
||||
*
|
||||
* @return object admin_roow object
|
||||
* @return object admin_root object
|
||||
*/
|
||||
function admin_get_root($reload=false, $requirefulltree=true) {
|
||||
global $CFG, $DB, $OUTPUT;
|
||||
|
@ -5958,7 +6024,6 @@ function any_new_admin_settings($node) {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Moved from admin/replace.php so that we can use this in cron
|
||||
*
|
||||
|
@ -6213,6 +6278,7 @@ function print_plugin_tables() {
|
|||
echo $html;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Manage repository settings
|
||||
*
|
||||
|
@ -6463,6 +6529,7 @@ class admin_setting_managerepository extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for management of external services
|
||||
*
|
||||
|
@ -6645,13 +6712,15 @@ class admin_setting_manageexternalservices extends admin_setting {
|
|||
return highlight($query, $return);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for plagiarism administration.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_manageplagiarism extends admin_setting {
|
||||
/**
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -6732,6 +6801,7 @@ class admin_setting_manageplagiarism extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for overview of external services
|
||||
*
|
||||
|
@ -7003,6 +7073,7 @@ class admin_setting_webservicesoverview extends admin_setting {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for web service protocol administration.
|
||||
*
|
||||
|
@ -7291,6 +7362,7 @@ class admin_setting_managewebservicetokens extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Colour picker
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue