<?php
-// This file is part of Moodle - http://moodle.org/
-//
+// 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
// 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/>.
/**
- * adminlib.php - Contains functions that only administrators will ever need to use
- *
- * Administration tree classes and functions
- * n.b. documentation is still in progress for this code
+ * Functions and classes used during installation, upgrades and for admin settings.
*
- * INTRODUCTION
+ * ADMIN SETTINGS TREE INTRODUCTION
*
* This file performs the following tasks:
* -it defines the necessary objects and interfaces to build the Moodle
* // functionality like processing form submissions goes here
* admin_externalpage_print_header();
* // your HTML goes here
- * admin_externalpage_print_footer();
+ * print_footer();
* </code>
*
* The admin_externalpage_setup() function call ensures the user is logged in,
* admin_tree) must be unique on the respective admin_settingpage where it is
* used.
*
- * Key Author: Vincenzo K. Marcovecchio
+ * Original author: Vincenzo K. Marcovecchio
+ * Maintainer: Petr Skoda
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
*/
/// Add libraries
-/**
- * Include the essential files
- */
require_once($CFG->libdir.'/ddllib.php');
require_once($CFG->libdir.'/xmlize.php');
require_once($CFG->libdir.'/messagelib.php'); // Messagelib functions
define('INSECURE_DATAROOT_WARNING', 1);
define('INSECURE_DATAROOT_ERROR', 2);
-
+
/**
* Delete all plugin tables
*
- * @global object
- * @global object
* @param string $name Name of plugin, used as table prefix
* @param string $file Path to install.xml file
* @param bool $feedback defaults to true
- * @return boolean Always returns true
+ * @return bool Always returns true
*/
function drop_plugin_tables($name, $file, $feedback=true) {
global $CFG, $DB;
/**
* Returns list of all directories where we expect install.xml files
- *
- * @global object
* @return array Array of paths
*/
function get_db_directories() {
/**
* Try to obtain or release the cron lock.
- *
- * @global object
* @param string $name name of lock
* @param int $until timestamp when this lock considered stale, null means remove lock unconditionaly
* @param bool $ignorecurrent ignore current lock state, usually entend previous lock, defaults to false
/**
* Test if and critical warnings are present
- *
- * @global object
* @return bool
*/
function admin_critical_warnings_present() {
* Try to verify that dataroot is not accessible from web.
* It is not 100% correct but might help to reduce number of vulnerable sites.
* Protection from httpd.conf and .htaccess is not detected properly.
- *
- * @global object
+ *
* @uses INSECURE_DATAROOT_WARNING
* @uses INSECURE_DATAROOT_ERROR
* @param bool $fetchtest try to test public access by fetching file, default false
* and methods for finding something in the admin tree.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
interface part_of_admin_tree {
* include an add method for adding other part_of_admin_tree objects as children.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
interface parentable_part_of_admin_tree extends part_of_admin_tree {
* Each admin_category object contains a number of part_of_admin_tree objects.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_category implements parentable_part_of_admin_tree {
- /**
- * @var mixed An array of part_of_admin_tree objects that are this object's children
- */
+ /** @var mixed An array of part_of_admin_tree objects that are this object's children */
public $children;
-
- /**
- * @var string An internal name for this category. Must be unique amongst ALL part_of_admin_tree objects
- */
+ /** @var string An internal name for this category. Must be unique amongst ALL part_of_admin_tree objects */
public $name;
-
- /**
- * @var string The displayed name for this category. Usually obtained through get_string()
- */
+ /** @var string The displayed name for this category. Usually obtained through get_string() */
public $visiblename;
-
- /**
- * @var bool Should this category be hidden in admin tree block?
- */
+ /** @var bool Should this category be hidden in admin tree block? */
public $hidden;
-
- /**
- * paths
- * @var mixed Either a string or an array or strings
- */
+ /** @var mixed Either a string or an array or strings */
public $path;
+ /** @var mixed Either a string or an array or strings */
public $visiblepath;
/**
*
* @param string $name The internal name of the object we want.
* @param bool $findpath initialize path and visiblepath arrays
- * @return mixed A reference to the object with internal name $name if found, otherwise a reference to NULL.
+ * @return mixed A reference to the object with internal name $name if found, otherwise a reference to NULL.
* defaults to false
*/
public function locate($name, $findpath=false) {
}
/**
- *
+ * Root of admin settings tree, does not have any parent.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_root extends admin_category {
- /**
- * @var array List of errors
- */
+ /** @var array List of errors */
public $errors;
-
- /**
- * @var string search query
- */
+ /** @var string search query */
public $search;
-
- /**
- * @var bool full tree flag - true means all settings required,
- * false onlypages required
- */
+ /** @var bool full tree flag - true means all settings required, false onlypages required */
public $fulltree;
-
- /**
- * @var bool flag indicating loaded tree
- */
+ /** @var bool flag indicating loaded tree */
public $loaded;
-
- /**
- * @var mixed site custom defaults overriding defaults in setings files
- */
+ /** @var mixed site custom defaults overriding defaults in setings files*/
public $custom_defaults;
/**
- * @global object
- * @param bool $fulltree true means all settings required,
+ * @param bool $fulltree true means all settings required,
* false only pages required
*/
public function __construct($fulltree) {
* See detailed usage example at the top of this document (adminlib.php)
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
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().
- */
+ /** @var string The displayed name for this external page. Usually obtained through get_string(). */
public $visiblename;
- /**
- * @var string The external URL that we should link to when someone requests this external page.
- */
+ /** @var string The external URL that we should link to when someone requests this external page. */
public $url;
- /**
- * @var string The role capability/permission a user must have to access this external page.
- */
+ /** @var string The role capability/permission a user must have to access this external page. */
public $req_capability;
- /**
- * @var object The context in which capability/permission should be checked, default is site context.
- */
+ /** @var object The context in which capability/permission should be checked, default is site context. */
public $context;
- /**
- * @var bool hidden in admin tree block.
- */
+ /** @var bool hidden in admin tree block. */
public $hidden;
- /**
- * @var mixed either string or array of string
- */
+ /** @var mixed either string or array of string */
public $path;
public $visiblepath;
/**
* Determines if the current user has access to this external page based on $this->req_capability.
*
- * @global object
* @return bool True if user has access, false otherwise.
*/
public function check_access() {
/**
* Is this external page hidden in admin tree block?
*
- * Returns the 'hidden' property
- *
* @return bool True if hidden
*/
public function is_hidden() {
* Used to group a number of admin_setting objects into a page and add them to the admin tree.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
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().
- */
+ /** @var string The displayed name for this external page. Usually obtained through get_string(). */
public $visiblename;
- /**
- * @var mixed An array of admin_setting objects that are part of this setting page.
- */
+
+ /** @var mixed An array of admin_setting objects that are part of this setting page. */
public $settings;
- /**
- * @var string The role capability/permission a user must have to access this external page.
- */
+ /** @var string The role capability/permission a user must have to access this external page. */
public $req_capability;
- /**
- * @var object The context in which capability/permission should be checked, default is site context.
- */
+ /** @var object The context in which capability/permission should be checked, default is site context. */
public $context;
- /**
- * @var bool hidden in admin tree block.
- */
+ /** @var bool hidden in admin tree block. */
public $hidden;
- /**
- * @var mixed string of paths or array of strings of paths
- */
+ /** @var mixed string of paths or array of strings of paths */
public $path;
public $visiblepath;
/**
* see admin_settingpage for details of this function
- *
+ *
* @param string $name The internal name for this external page. Must be unique amongst ALL part_of_admin_tree objects.
* @param string $visiblename The displayed name for this external page. Usually obtained through get_string().
* @param mixed $req_capability The role capability/permission a user must have to access this external page. Defaults to 'moodle/site:config'.
$this->context = $context;
}
- /**
+ /**
* see admin_category
*
* @param string $name
}
}
- /*
+ /**
+ * Search string in settings page.
+ *
* @param string $query
* @return array
*/
* Read & write happens at this level; no authentication.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
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
- */
+ /** @var string localised name */
public $visiblename;
- /**
- * @var string localised long description
- */
+ /** @var string localised long description */
public $description;
- /**
- * @var mixed Can be string or array of string
- */
+ /** @var mixed Can be string or array of string */
public $defaultsetting;
- /**
- * @var string
- */
+ /** @var string */
public $updatedcallback;
- /**
- * @var mixed can be String or Null. Null means main config table
- */
+ /** @var mixed can be String or Null. Null means main config table */
public $plugin; // null means main config table
/**
* Constructor
- * @param string $name unique ascii name, either 'mysetting' for settings that in config,
+ * @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 name
* @param string $description localised long description
/**
* Returns the config if possible
*
- * @global object
* @return mixed returns config if successfull else null
*/
public function config_read($name) {
/**
* Used to set a config pair and log change
*
- * @global object
- * @global object
- * @global object
* @param string $name
* @param mixed $value Gets converted to string if not null
* @return bool Write setting to confix table
// store change
set_config($name, $value, $this->plugin);
-
// log change
$log = new object();
$log->userid = during_initial_install() ? 0 :$USER->id; // 0 as user id during install
* No setting - just heading and text.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_heading extends admin_setting {
/**
// do not write any setting
return '';
}
-
+
/**
* Returns an HTML string
* @return string Returns an HTML string
* The most flexibly setting, user is typing text
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
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
- */
+ /** @var int default field size */
public $size;
/**
* General text area without html editor.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configtextarea extends admin_setting_configtext {
private $rows;
class admin_setting_confightmleditor extends admin_setting_configtext {
private $rows;
private $cols;
-
+
/**
* @param string $name
* @param string $visiblename
* Password field, allows unmasking of password
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configpasswordunmask extends admin_setting_configtext {
/**
public function __construct($name, $visiblename, $description, $defaultsetting) {
parent::__construct($name, $visiblename, $description, $defaultsetting, PARAM_RAW, 30);
}
-
+
/**
* Returns XHTML for the field
* Writes Javascript into the HTML below right before the last div
* Path to directory
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configfile extends admin_setting_configtext {
/**
/**
* Returns XHTML for the field
- *
+ *
* Returns XHTML for the field and also checks whether the file
* specified in $data exists using file_exists()
*
* Path to executable file
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configexecutable extends admin_setting_configfile {
* Path to directory
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configdirectory extends admin_setting_configfile {
* Checkbox
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
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
- */
+ /** @var string Value used when not checked */
public $no;
/**
* Multiple checkboxes, each represents different value, stored in csv format
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configmulticheckbox extends admin_setting {
- /**
- * @var array Array of choices value=>label
- */
+ /** @var array Array of choices value=>label */
public $choices;
/**
}
return $this->config_write($this->name, implode(',', $result)) ? '' : get_string('errorsetting', 'admin');
}
-
+
/**
* Returns XHTML field(s) as required by choices
*
* Multiple checkboxes 2, value stored as string 00101011
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configmulticheckbox2 extends admin_setting_configmulticheckbox {
* Select one value from list
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configselect extends admin_setting {
- /**
- * @var array
- */
+ /** @var array Array of choices value=>label */
public $choices;
/**
/**
* This function may be used in ancestors for lazy loading of choices
*
- * @todo Check if this function is still required content commented out only returns true
+ * Override this method if loading of choices is expensive, such
+ * as when it requires multiple db requests.
+ *
* @return bool true if loaded, false if error
*/
public function load_choices() {
/**
* Return the setting
- *
+ *
* @return mixed returns config if successfull else null
*/
public function get_setting() {
* Returns XHTML select field and wrapping div(s)
*
* @see output_select_html()
- *
+ *
* @param string $data the option to show as selected
* @param string $query
* @return string XHTML field and wrapping div
* Select multiple items from list
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configmultiselect extends admin_setting_configselect {
/**
* them as an array named after $name (so we only use $name2 internally for the setting)
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
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;
/**
/**
* Get the selected time
- *
+ *
* @return mixed An array containing 'h'=>xx, 'm'=>xx, or null if not set
*/
public function get_setting() {
/**
* Store the time (hours and minutes)
- *
+ *
* @param array $data Must be form 'h'=>xx, 'm'=>xx
* @return bool true if success, false if not
*/
* Used to validate a textarea used for ip addresses
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_configiplist extends admin_setting_configtextarea {
* get_users_from_config($CFG->mysetting, $capability); function in moodlelib.php.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_users_with_capability extends admin_setting_configmultiselect {
- /**
- * @var string The capabilities name
- * @access protected
- */
+ /** @var string The capabilities name */
protected $capability;
/**
* Special checkbox for calendar - resets SESSION vars.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_adminseesall extends admin_setting_configcheckbox {
/**
/**
* Stores the setting passed in $data
*
- * @global object
* @param mixed gets converted to string for comparison
* @return string empty string or error message
*/
* Special select for settings that are altered in setup.php and can not be altered on the fly
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_selectsetup extends admin_setting_configselect {
/**
/**
* Save the setting passed in $data
*
- * @global object
* @param string $data The setting to save
* @return string empty or error message
*/
* Special select for frontpage - stores data in course table
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_sitesetselect extends admin_setting_configselect {
/**
/**
* Updates the database and save the setting
*
- * @global object
- * @global object
* @param string data
* @return string empty or error message
*/
* Special select - lists on the frontpage - hacky
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_courselist_frontpage extends admin_setting {
- /**
- * @var array
- */
+ /** @var array Array of choices value=>label */
public $choices;
/**
* Construct override, requires one param
*
- * @global object
* @param bool $loggedin Is the user logged in
*/
public function __construct($loggedin) {
/**
* Loads the choices available
*
- * @global object
* @return bool always returns true
*/
public function load_choices() {
* Special checkbox for frontpage - stores data in course table
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_sitesetcheckbox extends admin_setting_configcheckbox {
/**
/**
* Save the selected setting
*
- * @global object
- * @global object
* @param string $data The selected site
* @return string empty string or error message
*/
* Empty string means not set here. Manual setting is required.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_sitesettext extends admin_setting_configtext {
/**
/**
* Save the selected setting
*
- * @global object
- * @global object
* @param string $data The selected value
* @return string emtpy or error message
*/
* Special text editor for site description.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_frontpagedesc extends admin_setting {
/**
/**
* Save the new setting
*
- * @global object
- * @global object
* @param string $data The new value to save
* @return string empty or error message
*/
/**
* Returns XHTML for the field plus wrapping div
*
- * @global object
- * @global object
* @param string $data The current value
* @param string $query
* @return string The XHTML output
* Special font selector for use in admin section
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_editorfontlist extends admin_setting {
/**
- * @var array
- * @todo Apparently unused var check if removable
- */
- public $items;
-
- /**
- * @global object
* Construct method, calls parent::__construct with specific args
*/
public function __construct() {
/**
* Return the current setting
- *
- * @global object
+ *
* @return array Array of the current setting(s)
*/
public function get_setting() {
* Special settings for emoticons
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_emoticons extends admin_setting {
/**
- * @var array
- * @todo Apparently unused var, check if removable
- */
- public $items;
-
- /**
- * @global object
* Calls parent::__construct with specific args
*/
public function __construct() {
'v27' => 'egg');
parent::__construct($name, $visiblename, $description, $defaults);
}
-
+
/**
* Return the current setting(s)
*
- * @global object
* @return array Current settings array
*/
public function get_setting() {
* Used to set editor options/settings
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_editorhidebuttons extends admin_setting {
- /**
- * @var array Array of possible options
- */
+ /** @var array Array of possible options */
public $items;
/**
/**
* Return XHTML for the field and wrapping div(s)
*
- * @global object
* @param array $data
* @param string $query
* @return string XHTML for output
* Special setting for limiting of the list of available languages.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_langlist extends admin_setting_configtext {
/**
* Course category selection
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_settings_coursecat_select extends admin_setting_configselect {
/**
/**
* Load the available choices for the select box
*
- * @global object
* @return bool
*/
public function load_choices() {
* Special control for selecting days to backup
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_backupdays extends admin_setting_configmulticheckbox2 {
/**
* Special debug setting
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
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
- * @package moodlecore
*/
class admin_setting_special_calendar_weekend extends admin_setting {
/**
* Admin setting that allows a user to pick appropriate roles for something.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
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;
/**
/**
* Load roles as choices
*
- * @global object
- * @global object
* @return bool true=>success, false=>error
*/
public function load_choices() {
/**
* Return the default setting for this control
*
- * @global object
* @return array Array of default settings
*/
public function get_defaultsetting() {
* Text field with an advanced checkbox, that controls a additional "fix_$name" setting.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_text_with_advanced extends admin_setting_configtext {
/**
* Dropdown menu with an advanced checkbox, that controls a additional "fix_$name" setting.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_combo_with_advanced extends admin_setting_configselect {
/**
public function __construct($name, $visiblename, $description, $defaultsetting, $choices) {
parent::__construct($name, $visiblename, $description, $defaultsetting, $choices);
}
-
+
/**
* Loads the current setting and returns array
*
* Specialisation of admin_setting_combo_with_advanced for easy yes/no choices.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_yesno_with_advanced extends admin_setting_combo_with_advanced {
/**
* Graded roles in gradebook
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_gradebookroles extends admin_setting_pickroles {
/**
/**
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_regradingcheckbox extends admin_setting_configcheckbox {
/**
* Saves the new settings passed in $data
*
- * @global object
- * @global object
* @param string $data
* @return mixed string or Array
*/
* Which roles to show on course decription page
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_coursemanager extends admin_setting_pickroles {
/**
/**
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_gradelimiting extends admin_setting_configcheckbox {
/**
}
/**
- * @global object
* Force site regrading
*/
function regrade_all() {
* Primary grade export plugin - has state tracking.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_gradeexport extends admin_setting_configmulticheckbox {
/**
* Grade category settings
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_gradecat_combo extends admin_setting {
- /**
- * @var array Array of choices
- */
+ /** @var array Array of choices */
public $choices;
/**
/**
* Return the current setting(s) array
- *
- * @global object
+ *
* @return array Array of value=>xx, forced=>xx, adv=>xx
*/
public function get_setting() {
* Save the new settings passed in $data
*
* @todo Add vartype handling to ensure $data is array
- * @global object
* @param array $data Associative array of value=>xx, forced=>xx, adv=>xx
* @return string empty or error message
*/
*
* @todo Add vartype handling to ensure $data is array
* @param array $data Associative array of value=>xx, forced=>xx, adv=>xx
- * @param string $query
+ * @param string $query
* @return string XHTML to display control
*/
public function output_html($data, $query='') {
* Selection of grade report in user profiles
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_grade_profilereport extends admin_setting_configselect {
/**
/**
* Loads an array of choices for the configselect control
*
- * @global object
* @return bool always return true
*/
public function load_choices() {
* Special class for register auth selection
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_special_registerauth extends admin_setting_configselect {
/**
/**
* Loads the possible choices for the array
*
- * @global object
* @return bool always returns true
*/
public function load_choices() {
* Module manage page
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_page_managemods extends admin_externalpage {
/**
* Calls parent::__construct with specific arguments
- *
- * @global object
*/
public function __construct() {
global $CFG;
/**
* Try to find the specified module
*
- * @global object
* @param string $query The module to search for
* @return array
*/
* Enrolment manage page
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_enrolment_page extends admin_externalpage {
/**
* Calls parent::__construct with specific arguments
- *
- * @global object
*/
public function __construct() {
global $CFG;
* Blocks manage page
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_page_manageblocks extends admin_externalpage {
/**
* Calls parent::__construct with specific arguments
- *
- * @global object
*/
public function __construct() {
global $CFG;
/**
* Search for a specific block
*
- * @global object
- * @global object
* @param string $query The string to search for
* @return array
*/
* Question type manage page
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_page_manageqtypes extends admin_externalpage {
/**
* Calls parent::__construct with specific arguments
- *
- * @global object
*/
public function __construct() {
global $CFG;
/**
* Search QTYPES for the specified string
*
- * @global object
- * @global array
* @param string $query The string to search for in QTYPES
* @return array
*/
* Special class for authentication administration.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_manageauths extends admin_setting {
/**
/**
* Return XHTML to display control
*
- * @global object
* @param mixed $data Unused
* @param string $query
* @return string highlight
* Special class for authentication administration.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_manageeditors extends admin_setting {
/**
}
/**
- * Always returns true, does nothing
+ * Always returns true, does nothing
*
* @return true
*/
}
/**
- * Always returns true, does nothing
+ * Always returns true, does nothing
*
* @return true
*/
/**
* Checks if $query is one of the available editors
- *
+ *
* @param string $query The string to search for
* @return bool Returns true if found, false if not
*/
/**
* Builds the XHTML to display the control
*
- * @global object
* @param string $data Unused
* @param string $query
* @return string
* Special class for filter administration.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_page_managefilters extends admin_externalpage {
/**
* Calls parent::__construct with specific arguments
- *
- * @global object
*/
public function __construct() {
global $CFG;
/**
* Searches all installed filters for specified filter
*
- * @global object
* @param string $query The filter(string) to search for
* @param string $query
*/
/**
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_manageportfolio extends admin_setting {
private $baseurl;
- /**
- * @global object
- */
+
public function __construct() {
global $CFG;
parent::__construct('manageportfolio', get_string('manageportfolio', 'portfolio'), '', '');
}
/**
- * Always returns true, does nothing
+ * Always returns true, does nothing
*
* @return true
*/
}
/**
- * Always returns true, does nothing
+ * Always returns true, does nothing
*
* @return true
*/
/**
* Builds XHTML to display the control
*
- * @global object
* @param string $data Unused
* @param string $query
* @return string XHTML to display the control
*
* This function must be called on each admin page before other code.
*
- * @global object
- * @global object
- * @global object
* @param string $section name of page
* @param string $extrabutton extra HTML that is added after the blocks editing on/off button.
* @param array $extraurlparams an array paramname => paramvalue, or parameters that need to be
/**
* Print header for admin page
*
- * @global object
- * @global object
- * @global object
- * @global object
* @param string $focus focus element
*/
function admin_externalpage_print_header($focus='') {
/**
* Returns the reference to admin tree root
*
- * @global object
- * @global object
* @return object admin_roow object
*/
function admin_get_root($reload=false, $requirefulltree=true) {
/**
* This function applies default settings.
*
- * @global object
* @param object $node, NULL means complete tree, null by default
* @param bool $uncoditional if true overrides all values with defaults, null buy default
*/
/**
* Store changed settings, this function updates the errors variable in $ADMIN
*
- * @global object
- * @global object
* @param object $formdata from form
* @return int number of changed settings
*/
/**
* Internal function - prints the search results
*
- * @global object
* @param string $query String to search for
* @return string empty or XHTML
*/
/**
* Format admin settings
*
- * @global object
* @param object $setting
* @param string $title label element
* @param string $form form fragment, html code - not highlighed automaticaly
/**
* Moved from admin/replace.php so that we can use this in cron
*
- * @global object
- * @global object
* @param string $search string to look for
* @param string $replace string to replace
* @return bool success or fail
* Prints tables of detected plugins, one table per plugin type,
* and prints whether they are part of the standard Moodle
* distribution or not.
- *
- * @global object
*/
function print_plugin_tables() {
global $DB;
* Manage repository settings
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_managerepository extends admin_setting {
- /**
- * @var string
- */
+ /** @var string */
private $baseurl;
+
/**
* calls parent::__construct with specific arguments
- *
- * @global object
*/
public function __construct() {
global $CFG;
/**
* Builds XHTML to display the control
*
- * @global object
- * @global object
* @param string $data Unused
- * @param string $query
+ * @param string $query
* @return string XHTML
*/
public function output_html($data, $query='') {
}
/**
- *
+ *
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_managewsprotocols extends admin_setting {
- /**
- * @var string
- */
+ /** @var string */
private $baseurl;
+
/**
* Calls parent::__construct with specific arguments
- *
- * @global object
*/
public function __construct() {
global $CFG;
/**
* Builds XHTML to display the control
*
- * @global object
* @param string $data
* @param string $query
* @return string XHTML
/**
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- * @package moodlecore
*/
class admin_setting_managewsusersettings extends admin_setting {
- /**
- * @var string
- */
+ /** @var string */
private $baseurl;
+
/**
* Calls parent::__construct with specific arguments
- *
- * @global object
*/
public function __construct() {
global $CFG;
/**
* Always returns true does nothing
- *
+ *
* @return true
*/
public function get_setting() {
/**
* Does nothing always returns ''
- *
+ *
* @return string Always returns ''
*/
public function write_setting($data) {
/**
* Build XHTML to display the control
*
- * @global object
* @param string $data Unused
* @param string $query
* @return string XHTML