';
@@ -2551,11 +3212,24 @@ class admin_setting_special_editorfontlist extends admin_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() {
global $CFG;
$name = 'emoticons';
@@ -2619,7 +3293,13 @@ class admin_setting_emoticons extends admin_setting {
'v27' => 'egg');
parent::__construct($name, $visiblename, $description, $defaults);
}
-
+
+ /**
+ * Return the current setting(s)
+ *
+ * @global object
+ * @return array Current settings array
+ */
public function get_setting() {
global $CFG;
$result = $this->config_read($this->name);
@@ -2638,6 +3318,12 @@ class admin_setting_emoticons extends admin_setting {
return $currentsetting;
}
+ /**
+ * Save selected settings
+ *
+ * @param array $data Array of settings to save
+ * @return bool
+ */
public function write_setting($data) {
// there miiight be an easier way to do this :)
@@ -2665,6 +3351,12 @@ class admin_setting_emoticons extends admin_setting {
return ($this->config_write($this->name, implode('{;}', $result)) ? '' : get_string('errorsetting', 'admin').$this->visiblename.'
');
}
+ /**
+ * Return XHTML field(s) for options
+ *
+ * @param array $data Array of options to set in HTML
+ * @return string XHTML string for the fields and wrapping div(s)
+ */
public function output_html($data, $query='') {
$fullname = $this->get_full_name();
$return = '
';
@@ -2685,10 +3377,22 @@ class admin_setting_emoticons extends admin_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
+ */
public $items;
+ /**
+ * Calls parent::__construct with specific options
+ */
public function __construct() {
parent::__construct('editorhidebuttons', get_string('editorhidebuttons', 'admin'),
get_string('confeditorhidebuttons', 'admin'), array());
@@ -2734,6 +3438,11 @@ class admin_setting_special_editorhidebuttons extends admin_setting {
'search_replace' => 'ed_replace.gif');
}
+ /**
+ * Get an array of current settings
+ *
+ * @return array Array of current settings
+ */
public function get_setting() {
$result = $this->config_read($this->name);
if (is_null($result)) {
@@ -2745,6 +3454,12 @@ class admin_setting_special_editorhidebuttons extends admin_setting {
return explode(' ', $result);
}
+ /**
+ * Save the selected settings
+ *
+ * @param array $data Array of settings to save
+ * @return mixed empty string, error string, or bool true=>success, false=>error
+ */
public function write_setting($data) {
if (!is_array($data)) {
return ''; // ignore it
@@ -2763,6 +3478,14 @@ class admin_setting_special_editorhidebuttons extends admin_setting {
return ($this->config_write($this->name, implode(' ', $result)) ? '' : get_string('errorsetting', 'admin'));
}
+ /**
+ * Return XHTML for the field and wrapping div(s)
+ *
+ * @global object
+ * @param array $data
+ * @param string $query
+ * @return string XHTML for output
+ */
public function output_html($data, $query='') {
global $CFG;
@@ -2801,12 +3524,24 @@ class admin_setting_special_editorhidebuttons 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
+ * @package moodlecore
*/
class admin_setting_langlist extends admin_setting_configtext {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct() {
parent::__construct('langlist', get_string('langlist', 'admin'), get_string('configlanglist', 'admin'), '', PARAM_NOTAGS);
}
+ /**
+ * Save the new setting
+ *
+ * @param string $data The new setting
+ * @return bool
+ */
public function write_setting($data) {
$return = parent::write_setting($data);
get_list_of_languages(true);//refresh the list
@@ -2816,12 +3551,24 @@ 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 {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct($name, $visiblename, $description, $defaultsetting) {
parent::__construct($name, $visiblename, $description, $defaultsetting, NULL);
}
+ /**
+ * Load the available choices for the select box
+ *
+ * @global object
+ * @return bool
+ */
public function load_choices() {
global $CFG;
require_once($CFG->dirroot.'/course/lib.php');
@@ -2833,12 +3580,25 @@ 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
+ * @package moodlecore
+ */
class admin_setting_special_backupdays extends admin_setting_configmulticheckbox2 {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct() {
parent::__construct('backup_sche_weekdays', get_string('schedule'), get_string('backupschedulehelp'), array(), NULL);
$this->plugin = 'backup';
}
-
+ /**
+ * Load the available choices for the select box
+ *
+ * @return bool Always returns true
+ */
public function load_choices() {
if (is_array($this->choices)) {
return true;
@@ -2854,12 +3614,23 @@ 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
+ * @package moodlecore
*/
class admin_setting_special_debug extends admin_setting_configselect {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct() {
parent::__construct('debug', get_string('debug', 'admin'), get_string('configdebug', 'admin'), DEBUG_NONE, NULL);
}
+ /**
+ * Load the available choices for the select box
+ *
+ * @return bool
+ */
public function load_choices() {
if (is_array($this->choices)) {
return true;
@@ -2873,8 +3644,16 @@ 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 {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct() {
$name = 'calendar_weekend';
$visiblename = get_string('calendar_weekend', 'admin');
@@ -2882,7 +3661,11 @@ 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 settins as an array
+ *
+ * @return mixed Null if none, else array of settings
+ */
public function get_setting() {
$result = $this->config_read($this->name);
if (is_null($result)) {
@@ -2900,6 +3683,12 @@ class admin_setting_special_calendar_weekend extends admin_setting {
return $settings;
}
+ /**
+ * Save the new settings
+ *
+ * @param array $data Array of new settings
+ * @return bool
+ */
public function write_setting($data) {
if (!is_array($data)) {
return '';
@@ -2912,6 +3701,13 @@ class admin_setting_special_calendar_weekend extends admin_setting {
return ($this->config_write($this->name, $result) ? '' : get_string('errorsetting', 'admin'));
}
+ /**
+ * Return XHTML to display the control
+ *
+ * @param array $data array of selected days
+ * @param string $query
+ * @return string XHTML for display (field + wrapping div(s)
+ */
public function output_html($data, $query='') {
// The order matters very much because of the implied numeric keys
$days = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');
@@ -2934,8 +3730,14 @@ 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
+ */
private $types;
/**
@@ -2951,6 +3753,13 @@ class admin_setting_pickroles extends admin_setting_configmulticheckbox {
$this->types = $types;
}
+ /**
+ * Load roles as choices
+ *
+ * @global object
+ * @global object
+ * @return bool true=>success, false=>error
+ */
public function load_choices() {
global $CFG, $DB;
if (empty($CFG->rolesactive)) {
@@ -2969,7 +3778,12 @@ class admin_setting_pickroles extends admin_setting_configmulticheckbox {
return false;
}
}
-
+ /**
+ * Return the default setting for this control
+ *
+ * @global object
+ * @return array Array of default settings
+ */
public function get_defaultsetting() {
global $CFG;
@@ -2990,13 +3804,24 @@ class admin_setting_pickroles extends admin_setting_configmulticheckbox {
/**
* 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 {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct($name, $visiblename, $description, $defaultsetting, $paramtype) {
parent::__construct($name, $visiblename, $description,
$defaultsetting, $paramtype);
}
+ /**
+ * Loads the current setting and returns array
+ *
+ * @return array Returns array value=>xx, fix=>xx
+ */
public function get_setting() {
$value = parent::get_setting();
$fix = $this->config_read('fix_' . $this->name);
@@ -3006,6 +3831,13 @@ class admin_setting_text_with_advanced extends admin_setting_configtext {
return array('value' => $value, 'fix' => $fix);
}
+ /**
+ * Saves the new settings passed in $data
+ *
+ * @todo Add vartype handling to ensure $data is an array
+ * @param array $data
+ * @return mixed string or Array
+ */
public function write_setting($data) {
$error = parent::write_setting($data['value']);
if (!$error) {
@@ -3021,6 +3853,13 @@ class admin_setting_text_with_advanced extends admin_setting_configtext {
return $error;
}
+ /**
+ * Return XHTML for the control
+ *
+ * @param array $data Default data array
+ * @param string $query
+ * @return string XHTML to display control
+ */
public function output_html($data, $query='') {
$default = $this->get_defaultsetting();
$defaultinfo = array();
@@ -3053,12 +3892,23 @@ 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 {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct($name, $visiblename, $description, $defaultsetting, $choices) {
parent::__construct($name, $visiblename, $description, $defaultsetting, $choices);
}
-
+
+ /**
+ * Loads the current setting and returns array
+ *
+ * @return array Returns array value=>xx, fix=>xx
+ */
public function get_setting() {
$value = parent::get_setting();
$fix = $this->config_read('fix_' . $this->name);
@@ -3068,6 +3918,13 @@ class admin_setting_combo_with_advanced extends admin_setting_configselect {
return array('value' => $value, 'fix' => $fix);
}
+ /**
+ * Saves the new settings passed in $data
+ *
+ * @todo Add vartype handling to ensure $data is an array
+ * @param array $data
+ * @return mixed string or Array
+ */
public function write_setting($data) {
$error = parent::write_setting($data['value']);
if (!$error) {
@@ -3083,6 +3940,13 @@ class admin_setting_combo_with_advanced extends admin_setting_configselect {
return $error;
}
+ /**
+ * Return XHTML for the control
+ *
+ * @param array $data Default data array
+ * @param string $query
+ * @return string XHTML to display control
+ */
public function output_html($data, $query='') {
$default = $this->get_defaultsetting();
$current = $this->get_setting();
@@ -3120,8 +3984,14 @@ class admin_setting_combo_with_advanced extends admin_setting_configselect {
/**
* 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 {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct($name, $visiblename, $description, $defaultsetting) {
parent::__construct($name, $visiblename, $description,
$defaultsetting, array(get_string('no'), get_string('yes')));
@@ -3130,8 +4000,14 @@ class admin_setting_yesno_with_advanced extends admin_setting_combo_with_advance
/**
* 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 {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct() {
parent::__construct('gradebookroles', get_string('gradebookroles', 'admin'),
get_string('configgradebookroles', 'admin'),
@@ -3139,8 +4015,20 @@ 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
+ */
public function write_setting($data) {
global $CFG, $DB;
@@ -3159,8 +4047,14 @@ class admin_setting_regradingcheckbox extends admin_setting_configcheckbox {
/**
* 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 {
+ /**
+ * Calls parent::__consturct with specific arguments
+ */
public function __construct() {
parent::__construct('coursemanager', get_string('coursemanager', 'admin'),
get_string('configcoursemanager', 'admin'),
@@ -3168,18 +4062,36 @@ 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 {
+ /**
+ * Calls parent::__construct with specific arguments
+ */
function admin_setting_special_gradelimiting() {
parent::__construct('unlimitedgrades', get_string('unlimitedgrades', 'grades'),
get_string('configunlimitedgrades', 'grades'), '0', '1', '0');
}
+ /**
+ * @global object
+ * Force site regrading
+ */
function regrade_all() {
global $CFG;
require_once("$CFG->libdir/gradelib.php");
grade_force_site_regrading();
}
+ /**
+ * Saves the new settings
+ *
+ * @param mixed $data
+ * @return string empty string or error message
+ */
function write_setting($data) {
$previous = $this->get_setting();
@@ -3199,13 +4111,24 @@ 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
+ * @package moodlecore
*/
class admin_setting_special_gradeexport extends admin_setting_configmulticheckbox {
+ /**
+ * Calls parent::__construct with specific arguments
+ */
public function __construct() {
parent::__construct('gradeexport', get_string('gradeexport', 'admin'),
get_string('configgradeexport', 'admin'), array(), NULL);
}
+ /**
+ * Load the available choices for the multicheckbox
+ *
+ * @return bool always returns true
+ */
public function load_choices() {
if (is_array($this->choices)) {
return true;
@@ -3223,16 +4146,35 @@ 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
+ * @package moodlecore
*/
class admin_setting_gradecat_combo extends admin_setting {
-
+ /**
+ * @var array Array of choices
+ */
public $choices;
+ /**
+ * Sets choices and calls parent::__construct with passed arguments
+ * @param string $name
+ * @param string $visiblename
+ * @param string $description
+ * @param mixed $defaultsetting string or array depending on implementation
+ * @param array $choices An array of choices for the control
+ */
public function __construct($name, $visiblename, $description, $defaultsetting, $choices) {
$this->choices = $choices;
parent::__construct($name, $visiblename, $description, $defaultsetting);
}
+ /**
+ * Return the current setting(s) array
+ *
+ * @global object
+ * @return array Array of value=>xx, forced=>xx, adv=>xx
+ */
public function get_setting() {
global $CFG;
@@ -3250,6 +4192,14 @@ class admin_setting_gradecat_combo extends admin_setting {
return array('value' => $value, 'forced' => $forced, 'adv' => $adv);
}
+ /**
+ * 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
+ */
public function write_setting($data) {
global $CFG;
@@ -3282,6 +4232,14 @@ class admin_setting_gradecat_combo extends admin_setting {
}
}
+ /**
+ * Return XHTML to display the field and wrapping div
+ *
+ * @todo Add vartype handling to ensure $data is array
+ * @param array $data Associative array of value=>xx, forced=>xx, adv=>xx
+ * @param string $query
+ * @return string XHTML to display control
+ */
public function output_html($data, $query='') {
$value = $data['value'];
$forced = !empty($data['forced']);
@@ -3326,12 +4284,24 @@ class admin_setting_gradecat_combo extends admin_setting {
/**
* 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 {
+ /**
+ * Calls parent::__construct with specific arguments
+ */
public function __construct() {
parent::__construct('grade_profilereport', get_string('profilereport', 'grades'), get_string('configprofilereport', 'grades'), 'user', null);
}
+ /**
+ * Loads an array of choices for the configselect control
+ *
+ * @global object
+ * @return bool always return true
+ */
public function load_choices() {
if (is_array($this->choices)) {
return true;
@@ -3356,12 +4326,23 @@ 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
+ * @package moodlecore
*/
class admin_setting_special_registerauth extends admin_setting_configselect {
+ /**
+ * Calls parent::__construct with specific arguments
+ */
public function __construct() {
parent::__construct('registerauth', get_string('selfregistration', 'auth'), get_string('selfregistration_help', 'auth'), '', null);
}
+ /**
+ * Returns the default option
+ *
+ * @return string emtpy or default option
+ */
public function get_defaultsetting() {
$this->load_choices();
$defaultsetting = parent::get_defaultsetting();
@@ -3372,6 +4353,12 @@ 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() {
global $CFG;
@@ -3398,13 +4385,28 @@ 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
+ * @package moodlecore
*/
class admin_page_managemods extends admin_externalpage {
+ /**
+ * Calls parent::__construct with specific arguments
+ *
+ * @global object
+ */
public function __construct() {
global $CFG;
parent::__construct('managemodules', get_string('modsettings', 'admin'), "$CFG->wwwroot/$CFG->admin/modules.php");
}
+ /**
+ * Try to find the specified module
+ *
+ * @global object
+ * @param string $query The module to search for
+ * @return array
+ */
public function search($query) {
global $DB;
if ($result = parent::search($query)) {
@@ -3439,13 +4441,25 @@ class admin_page_managemods extends admin_externalpage {
/**
* 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;
parent::__construct('enrolment', get_string('enrolments'), $CFG->wwwroot . '/'.$CFG->admin.'/enrol.php');
}
+ /**
+ * @param string The string to search for
+ * @return array
+ */
public function search($query) {
if ($result = parent::search($query)) {
return $result;
@@ -3490,13 +4504,29 @@ class admin_enrolment_page extends admin_externalpage {
/**
* 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;
parent::__construct('manageblocks', get_string('blocksettings', 'admin'), "$CFG->wwwroot/$CFG->admin/blocks.php");
}
+ /**
+ * Search for a specific block
+ *
+ * @global object
+ * @global object
+ * @param string $query The string to search for
+ * @return array
+ */
public function search($query) {
global $CFG, $DB;
if ($result = parent::search($query)) {
@@ -3531,13 +4561,29 @@ class admin_page_manageblocks extends admin_externalpage {
/**
* 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;
parent::__construct('manageqtypes', get_string('manageqtypes', 'admin'), "$CFG->wwwroot/$CFG->admin/qtypes.php");
}
+ /**
+ * Search QTYPES for the specified string
+ *
+ * @global object
+ * @global array
+ * @param string $query The string to search for in QTYPES
+ * @return array
+ */
public function search($query) {
global $CFG;
if ($result = parent::search($query)) {
@@ -3567,25 +4613,52 @@ class admin_page_manageqtypes extends admin_externalpage {
/**
* 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 {
+ /**
+ * Calls parent::__construct with specific arguments
+ */
public function __construct() {
parent::__construct('authsui', get_string('authsettings', 'admin'), '', '');
}
+ /**
+ * Always returns true
+ *
+ * @return true
+ */
public function get_setting() {
return true;
}
+ /**
+ * Always returns true
+ *
+ * @return true
+ */
public function get_defaultsetting() {
return true;
}
+ /**
+ * Always returns '' and doesn't write anything
+ *
+ * @return string Always returns ''
+ */
public function write_setting($data) {
// do not write any setting
return '';
}
+ /**
+ * Search to find if Query is related to auth plugin
+ *
+ * @param string $query The string to search for
+ * @return bool true for related false for not
+ */
public function is_related($query) {
if (parent::is_related($query)) {
return true;
@@ -3606,6 +4679,14 @@ class admin_setting_manageauths extends admin_setting {
return false;
}
+ /**
+ * Return XHTML to display control
+ *
+ * @global object
+ * @param mixed $data Unused
+ * @param string $query
+ * @return string highlight
+ */
public function output_html($data, $query='') {
global $CFG;
@@ -3735,25 +4816,52 @@ 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
+ * @package moodlecore
*/
class admin_setting_manageeditors extends admin_setting {
+ /**
+ * Calls parent::__construct with specific arguments
+ */
public function __construct() {
parent::__construct('editorsui', get_string('editorsettings', 'editor'), '', '');
}
+ /**
+ * Always returns true, does nothing
+ *
+ * @return true
+ */
public function get_setting() {
return true;
}
+ /**
+ * Always returns true, does nothing
+ *
+ * @return true
+ */
public function get_defaultsetting() {
return true;
}
+ /**
+ * Always returns '', does not write anything
+ *
+ * @return string Always returns ''
+ */
public function write_setting($data) {
// do not write any setting
return '';
}
+ /**
+ * 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
+ */
public function is_related($query) {
if (parent::is_related($query)) {
return true;
@@ -3772,6 +4880,14 @@ class admin_setting_manageeditors extends admin_setting {
return false;
}
+ /**
+ * Builds the XHTML to display the control
+ *
+ * @global object
+ * @param string $data Unused
+ * @param string $query
+ * @return string
+ */
public function output_html($data, $query='') {
global $CFG;
@@ -3866,13 +4982,28 @@ class admin_setting_manageeditors extends admin_setting {
/**
* 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;
parent::__construct('managefilters', get_string('filtersettings', 'admin'), "$CFG->wwwroot/$CFG->admin/filters.php");
}
+ /**
+ * Searches all installed filters for specified filter
+ *
+ * @global object
+ * @param string $query The filter(string) to search for
+ * @param string $query
+ */
public function search($query) {
global $CFG;
if ($result = parent::search($query)) {
@@ -3905,26 +5036,55 @@ class admin_page_managefilters extends admin_externalpage {
}
}
+/**
+ *
+ * @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'), '', '');
$this->baseurl = $CFG->wwwroot . '/' . $CFG->admin . '/portfolio.php?sesskey=' . sesskey();
}
+ /**
+ * Always returns true, does nothing
+ *
+ * @return true
+ */
public function get_setting() {
return true;
}
+ /**
+ * Always returns true, does nothing
+ *
+ * @return true
+ */
public function get_defaultsetting() {
return true;
}
+ /**
+ * Always returns '', does not write anything
+ *
+ * @return string Always returns ''
+ */
public function write_setting($data) {
return '';
}
+ /**
+ * Searches the portfolio types for the specified type(string)
+ *
+ * @param string $query The string to search for
+ * @return bool true for found or related, false for not
+ */
public function is_related($query) {
if (parent::is_related($query)) {
return true;
@@ -3946,6 +5106,14 @@ class admin_setting_manageportfolio extends admin_setting {
return false;
}
+ /**
+ * Builds XHTML to display the control
+ *
+ * @global object
+ * @param string $data Unused
+ * @param string $query
+ * @return string XHTML to display the control
+ */
public function output_html($data, $query='') {
global $CFG;
@@ -4016,10 +5184,15 @@ class admin_setting_manageportfolio extends admin_setting {
/**
* Initialise admin page - this function does require login and permission
* checks specified in page definition.
+ *
* 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 string $extraurlparams an array paramname => paramvalue, or parameters that need to be
+ * @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.
@@ -4069,6 +5242,11 @@ function admin_externalpage_setup($section, $extrabutton = '',
/**
* Print header for admin page
+ *
+ * @global object
+ * @global object
+ * @global object
+ * @global object
* @param string $focus focus element
*/
function admin_externalpage_print_header($focus='') {
@@ -4214,7 +5392,10 @@ function admin_externalpage_print_footer() {
/**
* Returns the reference to admin tree root
- * @return reference
+ *
+ * @global object
+ * @global object
+ * @return object admin_roow object
*/
function admin_get_root($reload=false, $requirefulltree=true) {
global $CFG, $DB;
@@ -4261,9 +5442,10 @@ function admin_get_root($reload=false, $requirefulltree=true) {
/**
* This function applies default settings.
- * @param object $node, NULL means complete tree
- * @param bool $uncoditional if true overrides all values with defaults
- * @return void
+ *
+ * @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
*/
function admin_apply_default_settings($node=NULL, $unconditional=true) {
global $CFG;
@@ -4296,6 +5478,9 @@ function admin_apply_default_settings($node=NULL, $unconditional=true) {
/**
* 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
*/
@@ -4350,6 +5535,10 @@ function admin_write_settings($formdata) {
/**
* Internal recursive function - finds all settings from submitted form
+ *
+ * @param object $node Instance of admin_category, or admin_settingpage
+ * @param array $data
+ * @return array
*/
function admin_find_write_settings($node, $data) {
$return = array();
@@ -4379,6 +5568,10 @@ function admin_find_write_settings($node, $data) {
/**
* Internal function - prints the search results
+ *
+ * @global object
+ * @param string $query String to search for
+ * @return string empty or XHTML
*/
function admin_search_settings_html($query) {
global $CFG;
@@ -4435,6 +5628,9 @@ function admin_search_settings_html($query) {
/**
* Internal function - returns arrays of html pages with uninitialised settings
+ *
+ * @param object $node Instance of admin_category or admin_settingpage
+ * @return array
*/
function admin_output_new_settings_by_page($node) {
$return = array();
@@ -4479,14 +5675,17 @@ function admin_output_new_settings_by_page($node) {
/**
* Format admin settings
- * @param string $object setting
+ *
+ * @global object
+ * @param object $setting
* @param string $title label element
* @param string $form form fragment, html code - not highlighed automaticaly
* @param string $description
- * @param bool $label link label to id
+ * @param bool $label link label to id, true by default
* @param string $warning warning text
- * @param sting $defaultinfo defaults info, null means nothing, '' is converted to "Empty" string
+ * @param sting $defaultinfo defaults info, null means nothing, '' is converted to "Empty" string, defaults to null
* @param string $query search query to be highlighted
+ * @return string XHTML
*/
function format_admin_setting($setting, $title='', $form='', $description='', $label=true, $warning='', $defaultinfo=NULL, $query='') {
global $CFG;
@@ -4545,7 +5744,7 @@ function format_admin_setting($setting, $title='', $form='', $description='', $l
* Based on find_new_settings{@link ()} in upgradesettings.php
* Looks to find any admin settings that have not been initialized. Returns 1 if it finds any.
*
- * @param string $node The node at which to start searching.
+ * @param object $node Instance of admin_category, or admin_settingpage
* @return boolen true if any settings haven't been initialised, false if they all have
*/
function any_new_admin_settings($node) {
@@ -4572,9 +5771,12 @@ function any_new_admin_settings($node) {
/**
* Moved from admin/replace.php so that we can use this in cron
- * @param string $search - string to look for
- * @param string $replace - string to replace
- * @return bool - success or fail
+ *
+ * @global object
+ * @global object
+ * @param string $search string to look for
+ * @param string $replace string to replace
+ * @return bool success or fail
*/
function db_replace($search, $replace) {
@@ -4612,6 +5814,8 @@ function db_replace($search, $replace) {
* 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;
@@ -4780,27 +5984,58 @@ function print_plugin_tables() {
echo $html;
}
-
+/**
+ * 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
+ */
private $baseurl;
+ /**
+ * calls parent::__construct with specific arguments
+ *
+ * @global object
+ */
public function __construct() {
global $CFG;
parent::__construct('managerepository', get_string('managerepository', 'repository'), '', '');
$this->baseurl = $CFG->wwwroot . '/' . $CFG->admin . '/repository.php?sesskey=' . sesskey();
}
+ /**
+ * Always returns true, does nothing
+ *
+ * @return true
+ */
public function get_setting() {
return true;
}
+ /**
+ * Always returns true does nothing
+ *
+ * @return true
+ */
public function get_defaultsetting() {
return true;
}
+ /**
+ * Always returns s_managerepository
+ *
+ * @return string Always return 's_managerepository'
+ */
public function get_full_name() {
return 's_managerepository';
}
+ /**
+ * Always returns '' doesn't do anything
+ */
public function write_setting($data) {
$url = $this->baseurl . '&new=' . $data;
return '';
@@ -4811,6 +6046,12 @@ class admin_setting_managerepository extends admin_setting {
// exit;
}
+ /**
+ * Searches repository plugins for one that matches $query
+ *
+ * @param string $query The string to search for
+ * @return bool true if found, false if not
+ */
public function is_related($query) {
if (parent::is_related($query)) {
return true;
@@ -4832,6 +6073,15 @@ class admin_setting_managerepository extends admin_setting {
return false;
}
+ /**
+ * Builds XHTML to display the control
+ *
+ * @global object
+ * @global object
+ * @param string $data Unused
+ * @param string $query
+ * @return string XHTML
+ */
public function output_html($data, $query='') {
global $CFG, $USER;
$output = print_box_start('generalbox','',true);
@@ -4941,23 +6191,54 @@ class admin_setting_managerepository extends admin_setting {
}
}
+/**
+ *
+ *
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package moodlecore
+ */
class admin_setting_managewsprotocols extends admin_setting {
+ /**
+ * @var string
+ */
private $baseurl;
+ /**
+ * Calls parent::__construct with specific arguments
+ *
+ * @global object
+ */
public function __construct() {
global $CFG;
parent::__construct('managewsprotocols', get_string('managewsprotocols', 'admin'), '', '');
$this->baseurl = $CFG->wwwroot . '/' . $CFG->admin . '/wsprotocols.php?sesskey=' . sesskey();
}
+ /**
+ * Always returns true, does nothing
+ * @return true
+ */
public function get_setting() {
return true;
}
+ /**
+ * Doesnt nothing, always returns ''
+ *
+ * @return string Always returns ''
+ */
public function write_setting($data) {
$url = $this->baseurl . '&new=' . $data;
return '';
}
+ /**
+ * Builds XHTML to display the control
+ *
+ * @global object
+ * @param string $data
+ * @param string $query
+ * @return string XHTML
+ */
public function output_html($data, $query='') {
global $CFG;
@@ -5002,23 +6283,54 @@ class admin_setting_managewsprotocols extends admin_setting {
}
}
+/**
+ *
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package moodlecore
+ */
class admin_setting_managewsusersettings extends admin_setting {
+ /**
+ * @var string
+ */
private $baseurl;
+ /**
+ * Calls parent::__construct with specific arguments
+ *
+ * @global object
+ */
public function __construct() {
global $CFG;
parent::__construct('managewsusersettings', get_string('managewsusersettings', 'admin'), '', '');
$this->baseurl = $CFG->wwwroot . '/' . $CFG->admin . '/wsprotocols.php?sesskey=' . sesskey();
}
+ /**
+ * Always returns true does nothing
+ *
+ * @return true
+ */
public function get_setting() {
return true;
}
+ /**
+ * Does nothing always returns ''
+ *
+ * @return string Always returns ''
+ */
public function write_setting($data) {
$url = $this->baseurl . '&new=' . $data;
return '';
}
+ /**
+ * Build XHTML to display the control
+ *
+ * @global object
+ * @param string $data Unused
+ * @param string $query
+ * @return string XHTML
+ */
public function output_html($data, $query='') {
global $CFG;
$output = "";