id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
215,900
moodle/moodle
mod/forum/externallib.php
mod_forum_external.get_forum_discussions_paginated_parameters
public static function get_forum_discussions_paginated_parameters() { return new external_function_parameters ( array( 'forumid' => new external_value(PARAM_INT, 'forum instance id', VALUE_REQUIRED), 'sortby' => new external_value(PARAM_ALPHA, 'sor...
php
public static function get_forum_discussions_paginated_parameters() { return new external_function_parameters ( array( 'forumid' => new external_value(PARAM_INT, 'forum instance id', VALUE_REQUIRED), 'sortby' => new external_value(PARAM_ALPHA, 'sor...
[ "public", "static", "function", "get_forum_discussions_paginated_parameters", "(", ")", "{", "return", "new", "external_function_parameters", "(", "array", "(", "'forumid'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'forum instance id'", ",", "VALUE_REQUIRED"...
Describes the parameters for get_forum_discussions_paginated. @deprecated since 3.7 @return external_function_parameters @since Moodle 2.8
[ "Describes", "the", "parameters", "for", "get_forum_discussions_paginated", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L503-L514
215,901
moodle/moodle
mod/forum/externallib.php
mod_forum_external.get_forum_discussions_paginated_returns
public static function get_forum_discussions_paginated_returns() { return new external_single_structure( array( 'discussions' => new external_multiple_structure( new external_single_structure( array( ...
php
public static function get_forum_discussions_paginated_returns() { return new external_single_structure( array( 'discussions' => new external_multiple_structure( new external_single_structure( array( ...
[ "public", "static", "function", "get_forum_discussions_paginated_returns", "(", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'discussions'", "=>", "new", "external_multiple_structure", "(", "new", "external_single_structure", "(", "array", "...
Describes the get_forum_discussions_paginated return value. @deprecated since 3.7 @return external_single_structure @since Moodle 2.8
[ "Describes", "the", "get_forum_discussions_paginated", "return", "value", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L700-L744
215,902
moodle/moodle
mod/forum/externallib.php
mod_forum_external.get_forum_discussions_parameters
public static function get_forum_discussions_parameters() { return new external_function_parameters ( array( 'forumid' => new external_value(PARAM_INT, 'forum instance id', VALUE_REQUIRED), 'sortorder' => new external_value(PARAM_INT, 'sort by this...
php
public static function get_forum_discussions_parameters() { return new external_function_parameters ( array( 'forumid' => new external_value(PARAM_INT, 'forum instance id', VALUE_REQUIRED), 'sortorder' => new external_value(PARAM_INT, 'sort by this...
[ "public", "static", "function", "get_forum_discussions_parameters", "(", ")", "{", "return", "new", "external_function_parameters", "(", "array", "(", "'forumid'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'forum instance id'", ",", "VALUE_REQUIRED", ")", ...
Describes the parameters for get_forum_discussions. @return external_function_parameters @since Moodle 3.7
[ "Describes", "the", "parameters", "for", "get_forum_discussions", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L752-L763
215,903
moodle/moodle
mod/forum/externallib.php
mod_forum_external.view_forum_discussion
public static function view_forum_discussion($discussionid) { global $DB, $CFG, $USER; require_once($CFG->dirroot . "/mod/forum/lib.php"); $params = self::validate_parameters(self::view_forum_discussion_parameters(), array( ...
php
public static function view_forum_discussion($discussionid) { global $DB, $CFG, $USER; require_once($CFG->dirroot . "/mod/forum/lib.php"); $params = self::validate_parameters(self::view_forum_discussion_parameters(), array( ...
[ "public", "static", "function", "view_forum_discussion", "(", "$", "discussionid", ")", "{", "global", "$", "DB", ",", "$", "CFG", ",", "$", "USER", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "\"/mod/forum/lib.php\"", ")", ";", "$", "param...
Trigger the discussion viewed event. @param int $discussionid the discussion id @return array of warnings and status result @since Moodle 2.9 @throws moodle_exception
[ "Trigger", "the", "discussion", "viewed", "event", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L1114-L1146
215,904
moodle/moodle
mod/forum/externallib.php
mod_forum_external.toggle_favourite_state
public static function toggle_favourite_state($discussionid, $targetstate) { global $DB, $PAGE, $USER; $params = self::validate_parameters(self::toggle_favourite_state_parameters(), [ 'discussionid' => $discussionid, 'targetstate' => $targetstate ]); $vaultfacto...
php
public static function toggle_favourite_state($discussionid, $targetstate) { global $DB, $PAGE, $USER; $params = self::validate_parameters(self::toggle_favourite_state_parameters(), [ 'discussionid' => $discussionid, 'targetstate' => $targetstate ]); $vaultfacto...
[ "public", "static", "function", "toggle_favourite_state", "(", "$", "discussionid", ",", "$", "targetstate", ")", "{", "global", "$", "DB", ",", "$", "PAGE", ",", "$", "USER", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::",...
Toggle the favouriting value for the discussion provided @param int $discussionid The discussion we need to favourite @param bool $targetstate The state of the favourite value @return array The exported discussion
[ "Toggle", "the", "favouriting", "value", "for", "the", "discussion", "provided" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L1391-L1430
215,905
moodle/moodle
mod/forum/externallib.php
mod_forum_external.get_forum_access_information
public static function get_forum_access_information($forumid) { global $DB; $params = self::validate_parameters(self::get_forum_access_information_parameters(), array('forumid' => $forumid)); // Request and permission validation. $forum = $DB->get_record('forum', array('id' => $params[...
php
public static function get_forum_access_information($forumid) { global $DB; $params = self::validate_parameters(self::get_forum_access_information_parameters(), array('forumid' => $forumid)); // Request and permission validation. $forum = $DB->get_record('forum', array('id' => $params[...
[ "public", "static", "function", "get_forum_access_information", "(", "$", "forumid", ")", "{", "global", "$", "DB", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "get_forum_access_information_parameters", "(", ")", ",", "array", ...
Return access information for a given forum. @param int $forumid forum instance id @return array of warnings and the access information @since Moodle 3.7 @throws moodle_exception
[ "Return", "access", "information", "for", "a", "given", "forum", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L1744-L1767
215,906
moodle/moodle
mod/forum/externallib.php
mod_forum_external.get_forum_access_information_returns
public static function get_forum_access_information_returns() { $structure = array( 'warnings' => new external_warnings() ); $capabilities = load_capability_def('mod_forum'); foreach ($capabilities as $capname => $capdata) { // Get fields like cansubmit so it is...
php
public static function get_forum_access_information_returns() { $structure = array( 'warnings' => new external_warnings() ); $capabilities = load_capability_def('mod_forum'); foreach ($capabilities as $capname => $capdata) { // Get fields like cansubmit so it is...
[ "public", "static", "function", "get_forum_access_information_returns", "(", ")", "{", "$", "structure", "=", "array", "(", "'warnings'", "=>", "new", "external_warnings", "(", ")", ")", ";", "$", "capabilities", "=", "load_capability_def", "(", "'mod_forum'", ")"...
Describes the get_forum_access_information return value. @return external_single_structure @since Moodle 3.7
[ "Describes", "the", "get_forum_access_information", "return", "value", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L1775-L1790
215,907
moodle/moodle
mod/forum/externallib.php
mod_forum_external.set_subscription_state
public static function set_subscription_state($forumid, $discussionid, $targetstate) { global $PAGE, $USER; $params = self::validate_parameters(self::set_subscription_state_parameters(), [ 'forumid' => $forumid, 'discussionid' => $discussionid, 'targetstate' => $targ...
php
public static function set_subscription_state($forumid, $discussionid, $targetstate) { global $PAGE, $USER; $params = self::validate_parameters(self::set_subscription_state_parameters(), [ 'forumid' => $forumid, 'discussionid' => $discussionid, 'targetstate' => $targ...
[ "public", "static", "function", "set_subscription_state", "(", "$", "forumid", ",", "$", "discussionid", ",", "$", "targetstate", ")", "{", "global", "$", "PAGE", ",", "$", "USER", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", ...
Set the subscription state. @param int $forumid @param int $discussionid @param bool $targetstate @return \stdClass
[ "Set", "the", "subscription", "state", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L1800-L1849
215,908
moodle/moodle
mod/forum/externallib.php
mod_forum_external.set_lock_state
public static function set_lock_state($forumid, $discussionid, $targetstate) { global $DB, $PAGE, $USER; $params = self::validate_parameters(self::set_lock_state_parameters(), [ 'forumid' => $forumid, 'discussionid' => $discussionid, 'targetstate' => $targetstate ...
php
public static function set_lock_state($forumid, $discussionid, $targetstate) { global $DB, $PAGE, $USER; $params = self::validate_parameters(self::set_lock_state_parameters(), [ 'forumid' => $forumid, 'discussionid' => $discussionid, 'targetstate' => $targetstate ...
[ "public", "static", "function", "set_lock_state", "(", "$", "forumid", ",", "$", "discussionid", ",", "$", "targetstate", ")", "{", "global", "$", "DB", ",", "$", "PAGE", ",", "$", "USER", ";", "$", "params", "=", "self", "::", "validate_parameters", "("...
Set the lock state. @param int $forumid @param int $discussionid @param string $targetstate @return \stdClass
[ "Set", "the", "lock", "state", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L1883-L1917
215,909
moodle/moodle
mod/forum/externallib.php
mod_forum_external.set_pin_state
public static function set_pin_state($discussionid, $targetstate) { global $PAGE, $USER; $params = self::validate_parameters(self::set_pin_state_parameters(), [ 'discussionid' => $discussionid, 'targetstate' => $targetstate, ]); $vaultfactory = mod_forum\local\con...
php
public static function set_pin_state($discussionid, $targetstate) { global $PAGE, $USER; $params = self::validate_parameters(self::set_pin_state_parameters(), [ 'discussionid' => $discussionid, 'targetstate' => $targetstate, ]); $vaultfactory = mod_forum\local\con...
[ "public", "static", "function", "set_pin_state", "(", "$", "discussionid", ",", "$", "targetstate", ")", "{", "global", "$", "PAGE", ",", "$", "USER", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "set_pin_state_parameters", ...
Set the pin state. @param int $discussionid @param bool $targetstate @return \stdClass
[ "Set", "the", "pin", "state", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/externallib.php#L1956-L1984
215,910
moodle/moodle
cache/forms.php
cachestore_addinstance_form.definition
protected final function definition() { $form = $this->_form; $store = $this->_customdata['store']; $plugin = $this->_customdata['plugin']; $locks = $this->_customdata['locks']; $form->addElement('hidden', 'plugin', $plugin); $form->setType('plugin', PARAM_PLUGIN); ...
php
protected final function definition() { $form = $this->_form; $store = $this->_customdata['store']; $plugin = $this->_customdata['plugin']; $locks = $this->_customdata['locks']; $form->addElement('hidden', 'plugin', $plugin); $form->setType('plugin', PARAM_PLUGIN); ...
[ "protected", "final", "function", "definition", "(", ")", "{", "$", "form", "=", "$", "this", "->", "_form", ";", "$", "store", "=", "$", "this", "->", "_customdata", "[", "'store'", "]", ";", "$", "plugin", "=", "$", "this", "->", "_customdata", "["...
The definition of the add instance form
[ "The", "definition", "of", "the", "add", "instance", "form" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/forms.php#L45-L84
215,911
moodle/moodle
cache/forms.php
cachestore_addinstance_form.validation
public function validation($data, $files) { $errors = parent::validation($data, $files); if (!array_key_exists('name', $errors)) { if (!preg_match('#^[a-zA-Z0-9\-_ ]+$#', $data['name'])) { $errors['name'] = get_string('storenameinvalid', 'cache'); } else if (empt...
php
public function validation($data, $files) { $errors = parent::validation($data, $files); if (!array_key_exists('name', $errors)) { if (!preg_match('#^[a-zA-Z0-9\-_ ]+$#', $data['name'])) { $errors['name'] = get_string('storenameinvalid', 'cache'); } else if (empt...
[ "public", "function", "validation", "(", "$", "data", ",", "$", "files", ")", "{", "$", "errors", "=", "parent", "::", "validation", "(", "$", "data", ",", "$", "files", ")", ";", "if", "(", "!", "array_key_exists", "(", "'name'", ",", "$", "errors",...
Validates the add instance form data @param array $data @param array $files @return array
[ "Validates", "the", "add", "instance", "form", "data" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/forms.php#L93-L118
215,912
moodle/moodle
cache/forms.php
cache_definition_sharing_form.set_data
public function set_data($data) { if (!isset($data['sharing'])) { // Set the default value here. mforms doesn't handle defaults very nicely. $data['sharing'] = cache_administration_helper::get_definition_sharing_options(cache_definition::SHARING_DEFAULT); } parent::set_da...
php
public function set_data($data) { if (!isset($data['sharing'])) { // Set the default value here. mforms doesn't handle defaults very nicely. $data['sharing'] = cache_administration_helper::get_definition_sharing_options(cache_definition::SHARING_DEFAULT); } parent::set_da...
[ "public", "function", "set_data", "(", "$", "data", ")", "{", "if", "(", "!", "isset", "(", "$", "data", "[", "'sharing'", "]", ")", ")", "{", "// Set the default value here. mforms doesn't handle defaults very nicely.", "$", "data", "[", "'sharing'", "]", "=", ...
Sets the data for this form. @param array $data
[ "Sets", "the", "data", "for", "this", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/forms.php#L247-L253
215,913
moodle/moodle
cache/forms.php
cache_definition_sharing_form.validation
public function validation($data, $files) { $errors = parent::validation($data, $files); if (count($errors) === 0 && !isset($data['sharing'])) { // They must select at least one sharing option. $errors['sharing'] = get_string('sharingrequired', 'cache'); } return ...
php
public function validation($data, $files) { $errors = parent::validation($data, $files); if (count($errors) === 0 && !isset($data['sharing'])) { // They must select at least one sharing option. $errors['sharing'] = get_string('sharingrequired', 'cache'); } return ...
[ "public", "function", "validation", "(", "$", "data", ",", "$", "files", ")", "{", "$", "errors", "=", "parent", "::", "validation", "(", "$", "data", ",", "$", "files", ")", ";", "if", "(", "count", "(", "$", "errors", ")", "===", "0", "&&", "!"...
Validates this form @param array $data @param array $files @return array
[ "Validates", "this", "form" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/forms.php#L262-L269
215,914
moodle/moodle
cache/forms.php
cache_lock_form.definition
final public function definition() { $plugin = $this->_customdata['lock']; $this->_form->addElement('hidden', 'action', 'newlockinstance'); $this->_form->setType('action', PARAM_ALPHANUMEXT); $this->_form->addElement('hidden', 'lock', $plugin); $this->_form->setType('lock', PARA...
php
final public function definition() { $plugin = $this->_customdata['lock']; $this->_form->addElement('hidden', 'action', 'newlockinstance'); $this->_form->setType('action', PARAM_ALPHANUMEXT); $this->_form->addElement('hidden', 'lock', $plugin); $this->_form->setType('lock', PARA...
[ "final", "public", "function", "definition", "(", ")", "{", "$", "plugin", "=", "$", "this", "->", "_customdata", "[", "'lock'", "]", ";", "$", "this", "->", "_form", "->", "addElement", "(", "'hidden'", ",", "'action'", ",", "'newlockinstance'", ")", ";...
Defines this form.
[ "Defines", "this", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/forms.php#L331-L346
215,915
moodle/moodle
cache/forms.php
cache_lock_form.validation
final public function validation($data, $files) { $errors = parent::validation($data, $files); if (!isset($errors['name'])) { $config = cache_config::instance(); if (in_array($data['name'], array_keys($config->get_locks()))) { $errors['name'] = get_string('locknam...
php
final public function validation($data, $files) { $errors = parent::validation($data, $files); if (!isset($errors['name'])) { $config = cache_config::instance(); if (in_array($data['name'], array_keys($config->get_locks()))) { $errors['name'] = get_string('locknam...
[ "final", "public", "function", "validation", "(", "$", "data", ",", "$", "files", ")", "{", "$", "errors", "=", "parent", "::", "validation", "(", "$", "data", ",", "$", "files", ")", ";", "if", "(", "!", "isset", "(", "$", "errors", "[", "'name'",...
Validates this form. @param array $data @param array $files @return array
[ "Validates", "this", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/forms.php#L355-L365
215,916
moodle/moodle
lib/filebrowser/file_info_stored.php
file_info_stored.get_readable_fullname
public function get_readable_fullname() { global $CFG; // retrieve the readable path with all parents (excluding the top most 'System') $fpath = array(); for ($parent = $this; $parent && $parent->get_parent(); $parent = $parent->get_parent()) { array_unshift($fpath, $parent->...
php
public function get_readable_fullname() { global $CFG; // retrieve the readable path with all parents (excluding the top most 'System') $fpath = array(); for ($parent = $this; $parent && $parent->get_parent(); $parent = $parent->get_parent()) { array_unshift($fpath, $parent->...
[ "public", "function", "get_readable_fullname", "(", ")", "{", "global", "$", "CFG", ";", "// retrieve the readable path with all parents (excluding the top most 'System')", "$", "fpath", "=", "array", "(", ")", ";", "for", "(", "$", "parent", "=", "$", "this", ";", ...
Returns the localised human-readable name of the file together with virtual path @return string
[ "Returns", "the", "localised", "human", "-", "readable", "name", "of", "the", "file", "together", "with", "virtual", "path" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filebrowser/file_info_stored.php#L121-L154
215,917
moodle/moodle
lib/filebrowser/file_info_stored.php
file_info_stored.is_empty_area
public function is_empty_area() { if ($this->lf->get_filepath() === '/' and $this->lf->get_filename() === '.') { // test the emptiness only in the top most level, it does not make sense at lower levels $fs = get_file_storage(); return $fs->is_area_empty($this->lf->get_context...
php
public function is_empty_area() { if ($this->lf->get_filepath() === '/' and $this->lf->get_filename() === '.') { // test the emptiness only in the top most level, it does not make sense at lower levels $fs = get_file_storage(); return $fs->is_area_empty($this->lf->get_context...
[ "public", "function", "is_empty_area", "(", ")", "{", "if", "(", "$", "this", "->", "lf", "->", "get_filepath", "(", ")", "===", "'/'", "and", "$", "this", "->", "lf", "->", "get_filename", "(", ")", "===", "'.'", ")", "{", "// test the emptiness only in...
Whether or not this is an empty area @return bool
[ "Whether", "or", "not", "this", "is", "an", "empty", "area" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filebrowser/file_info_stored.php#L211-L219
215,918
moodle/moodle
lib/filebrowser/file_info_stored.php
file_info_stored.get_parent
public function get_parent() { if ($this->lf->get_filepath() === '/' and $this->lf->is_directory()) { if ($this->areaonly) { return null; } else if ($this->itemidused) { return $this->browser->get_file_info($this->context, $this->lf->get_component(), $this...
php
public function get_parent() { if ($this->lf->get_filepath() === '/' and $this->lf->is_directory()) { if ($this->areaonly) { return null; } else if ($this->itemidused) { return $this->browser->get_file_info($this->context, $this->lf->get_component(), $this...
[ "public", "function", "get_parent", "(", ")", "{", "if", "(", "$", "this", "->", "lf", "->", "get_filepath", "(", ")", "===", "'/'", "and", "$", "this", "->", "lf", "->", "is_directory", "(", ")", ")", "{", "if", "(", "$", "this", "->", "areaonly",...
Returns parent file_info instance @return file_info|null file_info instance or null for root
[ "Returns", "parent", "file_info", "instance" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filebrowser/file_info_stored.php#L436-L459
215,919
moodle/moodle
lib/filebrowser/file_info_stored.php
file_info_stored.create_directory
public function create_directory($newdirname, $userid = NULL) { if (!$this->is_writable() or !$this->lf->is_directory()) { return null; } $newdirname = clean_param($newdirname, PARAM_FILE); if ($newdirname === '') { return null; } $filepath = $th...
php
public function create_directory($newdirname, $userid = NULL) { if (!$this->is_writable() or !$this->lf->is_directory()) { return null; } $newdirname = clean_param($newdirname, PARAM_FILE); if ($newdirname === '') { return null; } $filepath = $th...
[ "public", "function", "create_directory", "(", "$", "newdirname", ",", "$", "userid", "=", "NULL", ")", "{", "if", "(", "!", "$", "this", "->", "is_writable", "(", ")", "or", "!", "$", "this", "->", "lf", "->", "is_directory", "(", ")", ")", "{", "...
Create new directory, may throw exception - make sure params are valid. @param string $newdirname name of new directory @param int $userid id of author, default $USER->id @return file_info|null new directory's file_info instance or null if failed
[ "Create", "new", "directory", "may", "throw", "exception", "-", "make", "sure", "params", "are", "valid", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filebrowser/file_info_stored.php#L469-L487
215,920
moodle/moodle
lib/filebrowser/file_info_stored.php
file_info_stored.create_file_from_string
public function create_file_from_string($newfilename, $content, $userid = NULL) { if (!$this->is_writable() or !$this->lf->is_directory()) { return null; } $newfilename = clean_param($newfilename, PARAM_FILE); if ($newfilename === '') { return null; } ...
php
public function create_file_from_string($newfilename, $content, $userid = NULL) { if (!$this->is_writable() or !$this->lf->is_directory()) { return null; } $newfilename = clean_param($newfilename, PARAM_FILE); if ($newfilename === '') { return null; } ...
[ "public", "function", "create_file_from_string", "(", "$", "newfilename", ",", "$", "content", ",", "$", "userid", "=", "NULL", ")", "{", "if", "(", "!", "$", "this", "->", "is_writable", "(", ")", "or", "!", "$", "this", "->", "lf", "->", "is_director...
Create new file from string - make sure params are valid. @param string $newfilename name of new file @param string $content of file @param int $userid id of author, default $USER->id @return file_info|null new file's file_info instance or null if failed
[ "Create", "new", "file", "from", "string", "-", "make", "sure", "params", "are", "valid", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filebrowser/file_info_stored.php#L499-L535
215,921
moodle/moodle
lib/filebrowser/file_info_stored.php
file_info_stored.delete
public function delete() { if (!$this->is_writable()) { return false; } if ($this->is_directory()) { $filepath = $this->lf->get_filepath(); $fs = get_file_storage(); $storedfiles = $fs->get_area_files($this->context->id, $this->get_component(), $t...
php
public function delete() { if (!$this->is_writable()) { return false; } if ($this->is_directory()) { $filepath = $this->lf->get_filepath(); $fs = get_file_storage(); $storedfiles = $fs->get_area_files($this->context->id, $this->get_component(), $t...
[ "public", "function", "delete", "(", ")", "{", "if", "(", "!", "$", "this", "->", "is_writable", "(", ")", ")", "{", "return", "false", ";", "}", "if", "(", "$", "this", "->", "is_directory", "(", ")", ")", "{", "$", "filepath", "=", "$", "this",...
Delete file, make sure file is deletable first. @return bool success
[ "Delete", "file", "make", "sure", "file", "is", "deletable", "first", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filebrowser/file_info_stored.php#L636-L653
215,922
moodle/moodle
lib/classes/event/course_module_deleted.php
course_module_deleted.get_legacy_eventdata
protected function get_legacy_eventdata() { $eventdata = new \stdClass(); $eventdata->modulename = $this->other['modulename']; $eventdata->cmid = $this->objectid; $eventdata->courseid = $this->courseid; $eventdata->userid = $this->userid; return $eventdata; ...
php
protected function get_legacy_eventdata() { $eventdata = new \stdClass(); $eventdata->modulename = $this->other['modulename']; $eventdata->cmid = $this->objectid; $eventdata->courseid = $this->courseid; $eventdata->userid = $this->userid; return $eventdata; ...
[ "protected", "function", "get_legacy_eventdata", "(", ")", "{", "$", "eventdata", "=", "new", "\\", "stdClass", "(", ")", ";", "$", "eventdata", "->", "modulename", "=", "$", "this", "->", "other", "[", "'modulename'", "]", ";", "$", "eventdata", "->", "...
Legacy event data. @return \stdClass
[ "Legacy", "event", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/course_module_deleted.php#L89-L96
215,923
moodle/moodle
lib/classes/task/asynchronous_backup_task.php
asynchronous_backup_task.execute
public function execute() { global $DB; $started = time(); $backupid = $this->get_custom_data()->backupid; $backuprecordid = $DB->get_field('backup_controllers', 'id', array('backupid' => $backupid), MUST_EXIST); mtrace('Processing asynchronous backup for backup: ' . $backupid);...
php
public function execute() { global $DB; $started = time(); $backupid = $this->get_custom_data()->backupid; $backuprecordid = $DB->get_field('backup_controllers', 'id', array('backupid' => $backupid), MUST_EXIST); mtrace('Processing asynchronous backup for backup: ' . $backupid);...
[ "public", "function", "execute", "(", ")", "{", "global", "$", "DB", ";", "$", "started", "=", "time", "(", ")", ";", "$", "backupid", "=", "$", "this", "->", "get_custom_data", "(", ")", "->", "backupid", ";", "$", "backuprecordid", "=", "$", "DB", ...
Run the adhoc task and preform the backup.
[ "Run", "the", "adhoc", "task", "and", "preform", "the", "backup", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/asynchronous_backup_task.php#L46-L88
215,924
moodle/moodle
lib/horde/framework/Horde/Mime/Id.php
Horde_Mime_Id.idArithmetic
public function idArithmetic($action, array $options = array()) { return $this->_idArithmetic($this->id, $action, array_merge(array( 'count' => 1 ), $options)); }
php
public function idArithmetic($action, array $options = array()) { return $this->_idArithmetic($this->id, $action, array_merge(array( 'count' => 1 ), $options)); }
[ "public", "function", "idArithmetic", "(", "$", "action", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "return", "$", "this", "->", "_idArithmetic", "(", "$", "this", "->", "id", ",", "$", "action", ",", "array_merge", "(", "array", ...
Performs MIME ID "arithmetic". @param string $action One of: - ID_DOWN: ID of child. Note: ID_DOWN will first traverse to "$id.0" if given an ID *NOT* of the form "$id.0". If given an ID of the form "$id.0", ID_DOWN will traverse to "$id.1". This behavior can be avoided if 'no_rfc822' option is set. - ID_NEXT: ID of ...
[ "Performs", "MIME", "ID", "arithmetic", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Id.php#L79-L84
215,925
moodle/moodle
lib/horde/framework/Horde/Mime/Id.php
Horde_Mime_Id.isChild
public function isChild($id) { $base = (substr($this->id, -2) == '.0') ? substr($this->id, 0, -1) : rtrim($this->id, '.') . '.'; return ((($base == 0) && ($id != 0)) || (strpos(strval($id), strval($base)) === 0)); }
php
public function isChild($id) { $base = (substr($this->id, -2) == '.0') ? substr($this->id, 0, -1) : rtrim($this->id, '.') . '.'; return ((($base == 0) && ($id != 0)) || (strpos(strval($id), strval($base)) === 0)); }
[ "public", "function", "isChild", "(", "$", "id", ")", "{", "$", "base", "=", "(", "substr", "(", "$", "this", "->", "id", ",", "-", "2", ")", "==", "'.0'", ")", "?", "substr", "(", "$", "this", "->", "id", ",", "0", ",", "-", "1", ")", ":",...
Determines if a given MIME ID lives underneath a base ID. @param string $id The MIME ID to query. @return boolean Whether $id lives under the base ID ($this->id).
[ "Determines", "if", "a", "given", "MIME", "ID", "lives", "underneath", "a", "base", "ID", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Id.php#L142-L150
215,926
moodle/moodle
lib/horde/framework/Horde/Mime/Headers.php
Horde_Mime_Headers.toArray
public function toArray(array $opts = array()) { $charset = array_key_exists('charset', $opts) ? (empty($opts['charset']) ? 'UTF-8' : $opts['charset']) : null; $eol = empty($opts['canonical']) ? $this->_eol : "\r\n"; $ret = array(); fo...
php
public function toArray(array $opts = array()) { $charset = array_key_exists('charset', $opts) ? (empty($opts['charset']) ? 'UTF-8' : $opts['charset']) : null; $eol = empty($opts['canonical']) ? $this->_eol : "\r\n"; $ret = array(); fo...
[ "public", "function", "toArray", "(", "array", "$", "opts", "=", "array", "(", ")", ")", "{", "$", "charset", "=", "array_key_exists", "(", "'charset'", ",", "$", "opts", ")", "?", "(", "empty", "(", "$", "opts", "[", "'charset'", "]", ")", "?", "'...
Returns the headers in array format. @param array $opts Optional parameters: <pre> - broken_rfc2231: (boolean) Attempt to work around non-RFC 2231-compliant MUAs by generating both a RFC 2047-like parameter name and also the correct RFC 2231 parameter DEFAULT: false - canonical: (boolean) Use canonical (RFC 822/2045)...
[ "Returns", "the", "headers", "in", "array", "format", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Headers.php#L103-L157
215,927
moodle/moodle
lib/horde/framework/Horde/Mime/Headers.php
Horde_Mime_Headers.toString
public function toString(array $opts = array()) { $eol = empty($opts['canonical']) ? $this->_eol : "\r\n"; $text = ''; foreach ($this->toArray($opts) as $key => $val) { foreach ((is_array($val) ? $val : array($val)) as $entry) { $text .= $...
php
public function toString(array $opts = array()) { $eol = empty($opts['canonical']) ? $this->_eol : "\r\n"; $text = ''; foreach ($this->toArray($opts) as $key => $val) { foreach ((is_array($val) ? $val : array($val)) as $entry) { $text .= $...
[ "public", "function", "toString", "(", "array", "$", "opts", "=", "array", "(", ")", ")", "{", "$", "eol", "=", "empty", "(", "$", "opts", "[", "'canonical'", "]", ")", "?", "$", "this", "->", "_eol", ":", "\"\\r\\n\"", ";", "$", "text", "=", "''...
Returns all headers concatenated into a single string. @param array $opts See toArray(). @return string The headers in string format.
[ "Returns", "all", "headers", "concatenated", "into", "a", "single", "string", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Headers.php#L166-L180
215,928
moodle/moodle
lib/horde/framework/Horde/Mime/Headers.php
Horde_Mime_Headers.addHeaderOb
public function addHeaderOb(Horde_Mime_Headers_Element $ob, $check = false) { if ($check) { $cname = $this->_getHeaderClassName($ob->name); if (!($ob instanceof $cname)) { throw new InvalidArgumentException(sprintf( 'Object is not correct class: %s...
php
public function addHeaderOb(Horde_Mime_Headers_Element $ob, $check = false) { if ($check) { $cname = $this->_getHeaderClassName($ob->name); if (!($ob instanceof $cname)) { throw new InvalidArgumentException(sprintf( 'Object is not correct class: %s...
[ "public", "function", "addHeaderOb", "(", "Horde_Mime_Headers_Element", "$", "ob", ",", "$", "check", "=", "false", ")", "{", "if", "(", "$", "check", ")", "{", "$", "cname", "=", "$", "this", "->", "_getHeaderClassName", "(", "$", "ob", "->", "name", ...
Add a Horde_Mime_Headers_Element object to the current header list. @since 2.5.0 @param Horde_Mime_Headers_Element $ob Header object to add. @param boolean $check Check that the header and object type match? @throws InvalidArgumentException
[ "Add", "a", "Horde_Mime_Headers_Element", "object", "to", "the", "current", "header", "list", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Headers.php#L235-L253
215,929
moodle/moodle
lib/horde/framework/Horde/Mime/Headers.php
Horde_Mime_Headers._getHeaderClassName
protected function _getHeaderClassName($header) { if (empty(self::$_handlers)) { $search = array( 'Horde_Mime_Headers_Element_Single', 'Horde_Mime_Headers_AddressesMulti', 'Horde_Mime_Headers_Addresses', 'Horde_Mime_Headers_ContentD...
php
protected function _getHeaderClassName($header) { if (empty(self::$_handlers)) { $search = array( 'Horde_Mime_Headers_Element_Single', 'Horde_Mime_Headers_AddressesMulti', 'Horde_Mime_Headers_Addresses', 'Horde_Mime_Headers_ContentD...
[ "protected", "function", "_getHeaderClassName", "(", "$", "header", ")", "{", "if", "(", "empty", "(", "self", "::", "$", "_handlers", ")", ")", "{", "$", "search", "=", "array", "(", "'Horde_Mime_Headers_Element_Single'", ",", "'Horde_Mime_Headers_AddressesMulti'...
Return the header class to use for a header name. @param string $header The header name. @return string The Horde_Mime_Headers_* class to use.
[ "Return", "the", "header", "class", "to", "use", "for", "a", "header", "name", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Headers.php#L262-L297
215,930
moodle/moodle
lib/horde/framework/Horde/Mime/Headers.php
Horde_Mime_Headers.parseHeaders
public static function parseHeaders($text) { $curr = null; $headers = new Horde_Mime_Headers(); $hdr_list = array(); if ($text instanceof Horde_Stream) { $stream = $text; $stream->rewind(); } else { $stream = new Horde_Stream_Temp(); ...
php
public static function parseHeaders($text) { $curr = null; $headers = new Horde_Mime_Headers(); $hdr_list = array(); if ($text instanceof Horde_Stream) { $stream = $text; $stream->rewind(); } else { $stream = new Horde_Stream_Temp(); ...
[ "public", "static", "function", "parseHeaders", "(", "$", "text", ")", "{", "$", "curr", "=", "null", ";", "$", "headers", "=", "new", "Horde_Mime_Headers", "(", ")", ";", "$", "hdr_list", "=", "array", "(", ")", ";", "if", "(", "$", "text", "instanc...
Builds a Horde_Mime_Headers object from header text. @param mixed $text A text string (or, as of 2.3.0, a Horde_Stream object or stream resource) containing the headers. @return Horde_Mime_Headers A new Horde_Mime_Headers object.
[ "Builds", "a", "Horde_Mime_Headers", "object", "from", "header", "text", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Headers.php#L332-L380
215,931
moodle/moodle
lib/classes/event/question_category_base.php
question_category_base.create_from_question_category_instance
public static function create_from_question_category_instance($category, $context = null) { $params = ['objectid' => $category->id]; if (!empty($category->contextid)) { $params['contextid'] = $category->contextid; } $params['context'] = $context; $event = self::cr...
php
public static function create_from_question_category_instance($category, $context = null) { $params = ['objectid' => $category->id]; if (!empty($category->contextid)) { $params['contextid'] = $category->contextid; } $params['context'] = $context; $event = self::cr...
[ "public", "static", "function", "create_from_question_category_instance", "(", "$", "category", ",", "$", "context", "=", "null", ")", "{", "$", "params", "=", "[", "'objectid'", "=>", "$", "category", "->", "id", "]", ";", "if", "(", "!", "empty", "(", ...
Create a event from question category object @param object $category @param object|null $context @return base @throws \coding_exception
[ "Create", "a", "event", "from", "question", "category", "object" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/question_category_base.php#L81-L93
215,932
moodle/moodle
enrol/flatfile/lib.php
enrol_flatfile_plugin.sync
public function sync(progress_trace $trace) { if (!enrol_is_enabled('flatfile')) { return 2; } $mailadmins = $this->get_config('mailadmins', 0); if ($mailadmins) { $buffer = new progress_trace_buffer(new text_progress_trace(), false); $trace = new co...
php
public function sync(progress_trace $trace) { if (!enrol_is_enabled('flatfile')) { return 2; } $mailadmins = $this->get_config('mailadmins', 0); if ($mailadmins) { $buffer = new progress_trace_buffer(new text_progress_trace(), false); $trace = new co...
[ "public", "function", "sync", "(", "progress_trace", "$", "trace", ")", "{", "if", "(", "!", "enrol_is_enabled", "(", "'flatfile'", ")", ")", "{", "return", "2", ";", "}", "$", "mailadmins", "=", "$", "this", "->", "get_config", "(", "'mailadmins'", ",",...
Execute synchronisation. @param progress_trace @return int exit code, 0 means ok, 2 means plugin disabled
[ "Execute", "synchronisation", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/flatfile/lib.php#L145-L183
215,933
moodle/moodle
enrol/flatfile/lib.php
enrol_flatfile_plugin.obfuscate_filepath
protected function obfuscate_filepath($filepath) { global $CFG; if (strpos($filepath, $CFG->dataroot.'/') === 0 or strpos($filepath, $CFG->dataroot.'\\') === 0) { $disclosefile = '$CFG->dataroot'.substr($filepath, strlen($CFG->dataroot)); } else if (strpos($filepath, $CFG->dirroot....
php
protected function obfuscate_filepath($filepath) { global $CFG; if (strpos($filepath, $CFG->dataroot.'/') === 0 or strpos($filepath, $CFG->dataroot.'\\') === 0) { $disclosefile = '$CFG->dataroot'.substr($filepath, strlen($CFG->dataroot)); } else if (strpos($filepath, $CFG->dirroot....
[ "protected", "function", "obfuscate_filepath", "(", "$", "filepath", ")", "{", "global", "$", "CFG", ";", "if", "(", "strpos", "(", "$", "filepath", ",", "$", "CFG", "->", "dataroot", ".", "'/'", ")", "===", "0", "or", "strpos", "(", "$", "filepath", ...
Sorry, we do not want to show paths in cron output. @param string $filepath @return string
[ "Sorry", "we", "do", "not", "want", "to", "show", "paths", "in", "cron", "output", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/flatfile/lib.php#L191-L205
215,934
moodle/moodle
enrol/flatfile/lib.php
enrol_flatfile_plugin.process_buffer
protected function process_buffer(progress_trace $trace) { global $DB; if (!$future_enrols = $DB->get_records_select('enrol_flatfile', "timestart < ?", array(time()))) { $trace->output("No enrolments to be processed in flatfile buffer"); $trace->finished(); return fa...
php
protected function process_buffer(progress_trace $trace) { global $DB; if (!$future_enrols = $DB->get_records_select('enrol_flatfile', "timestart < ?", array(time()))) { $trace->output("No enrolments to be processed in flatfile buffer"); $trace->finished(); return fa...
[ "protected", "function", "process_buffer", "(", "progress_trace", "$", "trace", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "$", "future_enrols", "=", "$", "DB", "->", "get_records_select", "(", "'enrol_flatfile'", ",", "\"timestart < ?\"", ",", "array...
Process any future enrollments stored in the buffer. @param progress_trace $trace @return bool true if any data processed, false if not
[ "Process", "any", "future", "enrollments", "stored", "in", "the", "buffer", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/flatfile/lib.php#L349-L372
215,935
moodle/moodle
enrol/flatfile/lib.php
enrol_flatfile_plugin.get_enroller
protected function get_enroller($courseid) { if ($this->lasternollercourseid == $courseid and $this->lasternoller) { return $this->lasternoller; } $context = context_course::instance($courseid); $users = get_enrolled_users($context, 'enrol/flatfile:manage'); if (!$u...
php
protected function get_enroller($courseid) { if ($this->lasternollercourseid == $courseid and $this->lasternoller) { return $this->lasternoller; } $context = context_course::instance($courseid); $users = get_enrolled_users($context, 'enrol/flatfile:manage'); if (!$u...
[ "protected", "function", "get_enroller", "(", "$", "courseid", ")", "{", "if", "(", "$", "this", "->", "lasternollercourseid", "==", "$", "courseid", "and", "$", "this", "->", "lasternoller", ")", "{", "return", "$", "this", "->", "lasternoller", ";", "}",...
Returns the user who is responsible for flatfile enrolments in given curse. Usually it is the first editing teacher - the person with "highest authority" as defined by sort_by_roleassignment_authority() having 'enrol/flatfile:manage' or 'moodle/role:assign' capability. @param int $courseid enrolment instance id @retu...
[ "Returns", "the", "user", "who", "is", "responsible", "for", "flatfile", "enrolments", "in", "given", "curse", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/flatfile/lib.php#L599-L622
215,936
moodle/moodle
enrol/flatfile/lib.php
enrol_flatfile_plugin.get_role_map
protected function get_role_map(progress_trace $trace) { global $DB; // Get all roles. $rolemap = array(); $roles = $DB->get_records('role', null, '', 'id, name, shortname'); foreach ($roles as $id=>$role) { $alias = $this->get_config('map_'.$id, $role->shortname, ''...
php
protected function get_role_map(progress_trace $trace) { global $DB; // Get all roles. $rolemap = array(); $roles = $DB->get_records('role', null, '', 'id, name, shortname'); foreach ($roles as $id=>$role) { $alias = $this->get_config('map_'.$id, $role->shortname, ''...
[ "protected", "function", "get_role_map", "(", "progress_trace", "$", "trace", ")", "{", "global", "$", "DB", ";", "// Get all roles.", "$", "rolemap", "=", "array", "(", ")", ";", "$", "roles", "=", "$", "DB", "->", "get_records", "(", "'role'", ",", "nu...
Returns a mapping of ims roles to role ids. @param progress_trace $trace @return array imsrolename=>roleid
[ "Returns", "a", "mapping", "of", "ims", "roles", "to", "role", "ids", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/flatfile/lib.php#L630-L651
215,937
moodle/moodle
lib/horde/framework/Horde/Imap/Client/Auth/Scram.php
Horde_Imap_Client_Auth_Scram.getClientFirstMessage
public function getClientFirstMessage() { /* n: client doesn't support channel binding, * <empty>, * n=<user>: SASLprepped username with "," and "=" escaped, * r=<nonce>: Random nonce */ $this->_authmsg = 'n=' . str_replace( array(',', '='), array('...
php
public function getClientFirstMessage() { /* n: client doesn't support channel binding, * <empty>, * n=<user>: SASLprepped username with "," and "=" escaped, * r=<nonce>: Random nonce */ $this->_authmsg = 'n=' . str_replace( array(',', '='), array('...
[ "public", "function", "getClientFirstMessage", "(", ")", "{", "/* n: client doesn't support channel binding,\n * <empty>,\n * n=<user>: SASLprepped username with \",\" and \"=\" escaped,\n * r=<nonce>: Random nonce */", "$", "this", "->", "_authmsg", "=", "'n='", "....
Return the initial client message. @return string Initial client message.
[ "Return", "the", "initial", "client", "message", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Auth/Scram.php#L139-L152
215,938
moodle/moodle
lib/horde/framework/Horde/Imap/Client/Auth/Scram.php
Horde_Imap_Client_Auth_Scram.parseServerFirstMessage
public function parseServerFirstMessage($msg) { $i = $r = $s = false; foreach (explode(',', $msg) as $val) { list($attr, $aval) = array_map('trim', explode('=', $val, 2)); switch ($attr) { case 'i': $this->_iterations = intval($aval); ...
php
public function parseServerFirstMessage($msg) { $i = $r = $s = false; foreach (explode(',', $msg) as $val) { list($attr, $aval) = array_map('trim', explode('=', $val, 2)); switch ($attr) { case 'i': $this->_iterations = intval($aval); ...
[ "public", "function", "parseServerFirstMessage", "(", "$", "msg", ")", "{", "$", "i", "=", "$", "r", "=", "$", "s", "=", "false", ";", "foreach", "(", "explode", "(", "','", ",", "$", "msg", ")", "as", "$", "val", ")", "{", "list", "(", "$", "a...
Process the initial server message response. @param string $msg Initial server response. @return boolean False if authentication failed at this stage.
[ "Process", "the", "initial", "server", "message", "response", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Auth/Scram.php#L161-L197
215,939
moodle/moodle
lib/horde/framework/Horde/Imap/Client/Auth/Scram.php
Horde_Imap_Client_Auth_Scram.getClientFinalMessage
public function getClientFinalMessage() { $final_msg = 'c=biws,r=' . $this->_nonce; /* Salted password. */ $s_pass = strval(new Horde_Crypt_Blowfish_Pbkdf2( $this->_pass, strlen(hash($this->_hash, '', true)), array( 'algo' => $this->_hash,...
php
public function getClientFinalMessage() { $final_msg = 'c=biws,r=' . $this->_nonce; /* Salted password. */ $s_pass = strval(new Horde_Crypt_Blowfish_Pbkdf2( $this->_pass, strlen(hash($this->_hash, '', true)), array( 'algo' => $this->_hash,...
[ "public", "function", "getClientFinalMessage", "(", ")", "{", "$", "final_msg", "=", "'c=biws,r='", ".", "$", "this", "->", "_nonce", ";", "/* Salted password. */", "$", "s_pass", "=", "strval", "(", "new", "Horde_Crypt_Blowfish_Pbkdf2", "(", "$", "this", "->", ...
Return the final client message. @return string Final client message.
[ "Return", "the", "final", "client", "message", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Auth/Scram.php#L204-L244
215,940
moodle/moodle
lib/horde/framework/Horde/Imap/Client/Auth/Scram.php
Horde_Imap_Client_Auth_Scram.parseServerFinalMessage
public function parseServerFinalMessage($msg) { foreach (explode(',', $msg) as $val) { list($attr, $aval) = array_map('trim', explode('=', $val, 2)); switch ($attr) { case 'e': return false; case 'v': return (base64_decode($av...
php
public function parseServerFinalMessage($msg) { foreach (explode(',', $msg) as $val) { list($attr, $aval) = array_map('trim', explode('=', $val, 2)); switch ($attr) { case 'e': return false; case 'v': return (base64_decode($av...
[ "public", "function", "parseServerFinalMessage", "(", "$", "msg", ")", "{", "foreach", "(", "explode", "(", "','", ",", "$", "msg", ")", "as", "$", "val", ")", "{", "list", "(", "$", "attr", ",", "$", "aval", ")", "=", "array_map", "(", "'trim'", "...
Process the final server message response. @param string $msg Final server response. @return boolean False if authentication failed.
[ "Process", "the", "final", "server", "message", "response", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Auth/Scram.php#L253-L268
215,941
moodle/moodle
admin/tool/behat/locallib.php
tool_behat.stepsdefinitions
public static function stepsdefinitions($type, $component, $filter) { // We don't require the test environment to be enabled to list the steps definitions // so test writers can more easily set up the environment. behat_command::behat_setup_problem(); // The loaded steps depends on the...
php
public static function stepsdefinitions($type, $component, $filter) { // We don't require the test environment to be enabled to list the steps definitions // so test writers can more easily set up the environment. behat_command::behat_setup_problem(); // The loaded steps depends on the...
[ "public", "static", "function", "stepsdefinitions", "(", "$", "type", ",", "$", "component", ",", "$", "filter", ")", "{", "// We don't require the test environment to be enabled to list the steps definitions", "// so test writers can more easily set up the environment.", "behat_co...
Lists the available steps definitions @param string $type @param string $component @param string $filter @return array System steps or empty array if case there are no steps
[ "Lists", "the", "available", "steps", "definitions" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/behat/locallib.php#L49-L74
215,942
moodle/moodle
lib/phpexcel/PHPExcel/Cell/DataType.php
PHPExcel_Cell_DataType.checkString
public static function checkString($pValue = null) { if ($pValue instanceof PHPExcel_RichText) { // TODO: Sanitize Rich-Text string (max. character count is 32,767) return $pValue; } // string must never be longer than 32,767 characters, truncate if necessary ...
php
public static function checkString($pValue = null) { if ($pValue instanceof PHPExcel_RichText) { // TODO: Sanitize Rich-Text string (max. character count is 32,767) return $pValue; } // string must never be longer than 32,767 characters, truncate if necessary ...
[ "public", "static", "function", "checkString", "(", "$", "pValue", "=", "null", ")", "{", "if", "(", "$", "pValue", "instanceof", "PHPExcel_RichText", ")", "{", "// TODO: Sanitize Rich-Text string (max. character count is 32,767)", "return", "$", "pValue", ";", "}", ...
Check a string that it satisfies Excel requirements @param mixed Value to sanitize to an Excel string @return mixed Sanitized value
[ "Check", "a", "string", "that", "it", "satisfies", "Excel", "requirements" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Cell/DataType.php#L83-L97
215,943
moodle/moodle
auth/shibboleth/auth.php
auth_plugin_shibboleth.get_userinfo
function get_userinfo($username) { // reads user information from shibboleth attributes and return it in array() global $CFG; // Check whether we have got all the essential attributes if ( empty($_SERVER[$this->config->user_attribute]) ) { print_error( 'shib_not_all_attributes_e...
php
function get_userinfo($username) { // reads user information from shibboleth attributes and return it in array() global $CFG; // Check whether we have got all the essential attributes if ( empty($_SERVER[$this->config->user_attribute]) ) { print_error( 'shib_not_all_attributes_e...
[ "function", "get_userinfo", "(", "$", "username", ")", "{", "// reads user information from shibboleth attributes and return it in array()", "global", "$", "CFG", ";", "// Check whether we have got all the essential attributes", "if", "(", "empty", "(", "$", "_SERVER", "[", "...
Returns the user information for 'external' users. In this case the attributes provided by Shibboleth @return array $result Associative array of user data
[ "Returns", "the", "user", "information", "for", "external", "users", ".", "In", "this", "case", "the", "attributes", "provided", "by", "Shibboleth" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/shibboleth/auth.php#L102-L145
215,944
moodle/moodle
auth/shibboleth/auth.php
auth_plugin_shibboleth.get_attributes
function get_attributes() { $configarray = (array) $this->config; $moodleattributes = array(); $userfields = array_merge($this->userfields, $this->get_custom_user_profile_fields()); foreach ($userfields as $field) { if (isset($configarray["field_map_$field"])) { ...
php
function get_attributes() { $configarray = (array) $this->config; $moodleattributes = array(); $userfields = array_merge($this->userfields, $this->get_custom_user_profile_fields()); foreach ($userfields as $field) { if (isset($configarray["field_map_$field"])) { ...
[ "function", "get_attributes", "(", ")", "{", "$", "configarray", "=", "(", "array", ")", "$", "this", "->", "config", ";", "$", "moodleattributes", "=", "array", "(", ")", ";", "$", "userfields", "=", "array_merge", "(", "$", "this", "->", "userfields", ...
Returns array containg attribute mappings between Moodle and Shibboleth. @return array
[ "Returns", "array", "containg", "attribute", "mappings", "between", "Moodle", "and", "Shibboleth", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/shibboleth/auth.php#L152-L165
215,945
moodle/moodle
competency/classes/plan.php
plan.can_manage
public function can_manage() { if ($this->is_draft()) { return self::can_manage_user_draft($this->get('userid')); } return self::can_manage_user($this->get('userid')); }
php
public function can_manage() { if ($this->is_draft()) { return self::can_manage_user_draft($this->get('userid')); } return self::can_manage_user($this->get('userid')); }
[ "public", "function", "can_manage", "(", ")", "{", "if", "(", "$", "this", "->", "is_draft", "(", ")", ")", "{", "return", "self", "::", "can_manage_user_draft", "(", "$", "this", "->", "get", "(", "'userid'", ")", ")", ";", "}", "return", "self", ":...
Whether the current user can manage the plan. @return bool
[ "Whether", "the", "current", "user", "can", "manage", "the", "plan", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L141-L146
215,946
moodle/moodle
competency/classes/plan.php
plan.can_read
public function can_read() { if ($this->is_draft()) { return self::can_read_user_draft($this->get('userid')); } return self::can_read_user($this->get('userid')); }
php
public function can_read() { if ($this->is_draft()) { return self::can_read_user_draft($this->get('userid')); } return self::can_read_user($this->get('userid')); }
[ "public", "function", "can_read", "(", ")", "{", "if", "(", "$", "this", "->", "is_draft", "(", ")", ")", "{", "return", "self", "::", "can_read_user_draft", "(", "$", "this", "->", "get", "(", "'userid'", ")", ")", ";", "}", "return", "self", "::", ...
Whether the current user can read the plan. @return bool
[ "Whether", "the", "current", "user", "can", "read", "the", "plan", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L153-L158
215,947
moodle/moodle
competency/classes/plan.php
plan.get_comment_object
public function get_comment_object() { global $CFG; require_once($CFG->dirroot . '/comment/lib.php'); if (!$this->get('id')) { throw new \coding_exception('The plan must exist.'); } $comment = new comment((object) array( 'client_id' => 'plancommentarea' ...
php
public function get_comment_object() { global $CFG; require_once($CFG->dirroot . '/comment/lib.php'); if (!$this->get('id')) { throw new \coding_exception('The plan must exist.'); } $comment = new comment((object) array( 'client_id' => 'plancommentarea' ...
[ "public", "function", "get_comment_object", "(", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/comment/lib.php'", ")", ";", "if", "(", "!", "$", "this", "->", "get", "(", "'id'", ")", ")", "{", "throw", ...
Get the comment object. @return comment
[ "Get", "the", "comment", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L192-L210
215,948
moodle/moodle
competency/classes/plan.php
plan.get_competencies
public function get_competencies() { $competencies = array(); if ($this->get('status') == self::STATUS_COMPLETE) { // Get the competencies from the archive of the plan. $competencies = user_competency_plan::list_competencies($this->get('id'), $this->get('userid')); } els...
php
public function get_competencies() { $competencies = array(); if ($this->get('status') == self::STATUS_COMPLETE) { // Get the competencies from the archive of the plan. $competencies = user_competency_plan::list_competencies($this->get('id'), $this->get('userid')); } els...
[ "public", "function", "get_competencies", "(", ")", "{", "$", "competencies", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "get", "(", "'status'", ")", "==", "self", "::", "STATUS_COMPLETE", ")", "{", "// Get the competencies from the archive of ...
Get the competencies in this plan. @return competency[]
[ "Get", "the", "competencies", "in", "this", "plan", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L217-L232
215,949
moodle/moodle
competency/classes/plan.php
plan.get_competency
public function get_competency($competencyid) { $competency = null; if ($this->get('status') == self::STATUS_COMPLETE) { // Get the competency from the archive of the plan. $competency = user_competency_plan::get_competency_by_planid($this->get('id'), $competencyid); } e...
php
public function get_competency($competencyid) { $competency = null; if ($this->get('status') == self::STATUS_COMPLETE) { // Get the competency from the archive of the plan. $competency = user_competency_plan::get_competency_by_planid($this->get('id'), $competencyid); } e...
[ "public", "function", "get_competency", "(", "$", "competencyid", ")", "{", "$", "competency", "=", "null", ";", "if", "(", "$", "this", "->", "get", "(", "'status'", ")", "==", "self", "::", "STATUS_COMPLETE", ")", "{", "// Get the competency from the archive...
Get a single competency from this plan. This will throw an exception if the competency does not belong to the plan. @param int $competencyid The competency ID. @return competency
[ "Get", "a", "single", "competency", "from", "this", "plan", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L242-L256
215,950
moodle/moodle
competency/classes/plan.php
plan.validate_userid
protected function validate_userid($value) { global $DB; // During create. if (!$this->get('id')) { // Check that the user exists. We do not need to do that on update because // the userid of a plan should never change. if (!$DB->record_exists('user', array(...
php
protected function validate_userid($value) { global $DB; // During create. if (!$this->get('id')) { // Check that the user exists. We do not need to do that on update because // the userid of a plan should never change. if (!$DB->record_exists('user', array(...
[ "protected", "function", "validate_userid", "(", "$", "value", ")", "{", "global", "$", "DB", ";", "// During create.", "if", "(", "!", "$", "this", "->", "get", "(", "'id'", ")", ")", "{", "// Check that the user exists. We do not need to do that on update because"...
Validate the user ID. @param int $value @return true|lang_string
[ "Validate", "the", "user", "ID", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L347-L362
215,951
moodle/moodle
competency/classes/plan.php
plan.can_comment_user
public static function can_comment_user($planuserid) { global $USER; $capabilities = array('moodle/competency:plancomment'); if ($USER->id == $planuserid) { $capabilities[] = 'moodle/competency:plancommentown'; } return has_any_capability($capabilities, context_user...
php
public static function can_comment_user($planuserid) { global $USER; $capabilities = array('moodle/competency:plancomment'); if ($USER->id == $planuserid) { $capabilities[] = 'moodle/competency:plancommentown'; } return has_any_capability($capabilities, context_user...
[ "public", "static", "function", "can_comment_user", "(", "$", "planuserid", ")", "{", "global", "$", "USER", ";", "$", "capabilities", "=", "array", "(", "'moodle/competency:plancomment'", ")", ";", "if", "(", "$", "USER", "->", "id", "==", "$", "planuserid"...
Can the current user comment on a user's plan? @param int $planuserid The user ID the plan belongs to. @return bool
[ "Can", "the", "current", "user", "comment", "on", "a", "user", "s", "plan?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L370-L379
215,952
moodle/moodle
competency/classes/plan.php
plan.can_manage_user
public static function can_manage_user($planuserid) { global $USER; $context = context_user::instance($planuserid); $capabilities = array('moodle/competency:planmanage'); if ($context->instanceid == $USER->id) { $capabilities[] = 'moodle/competency:planmanageown'; } ...
php
public static function can_manage_user($planuserid) { global $USER; $context = context_user::instance($planuserid); $capabilities = array('moodle/competency:planmanage'); if ($context->instanceid == $USER->id) { $capabilities[] = 'moodle/competency:planmanageown'; } ...
[ "public", "static", "function", "can_manage_user", "(", "$", "planuserid", ")", "{", "global", "$", "USER", ";", "$", "context", "=", "context_user", "::", "instance", "(", "$", "planuserid", ")", ";", "$", "capabilities", "=", "array", "(", "'moodle/compete...
Can the current user manage a user's plan? @param int $planuserid The user to whom the plan would belong. @return bool
[ "Can", "the", "current", "user", "manage", "a", "user", "s", "plan?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L387-L397
215,953
moodle/moodle
competency/classes/plan.php
plan.can_request_review_user
public static function can_request_review_user($planuserid) { global $USER; $capabilities = array('moodle/competency:planrequestreview'); if ($USER->id == $planuserid) { $capabilities[] = 'moodle/competency:planrequestreviewown'; } return has_any_capability($capabil...
php
public static function can_request_review_user($planuserid) { global $USER; $capabilities = array('moodle/competency:planrequestreview'); if ($USER->id == $planuserid) { $capabilities[] = 'moodle/competency:planrequestreviewown'; } return has_any_capability($capabil...
[ "public", "static", "function", "can_request_review_user", "(", "$", "planuserid", ")", "{", "global", "$", "USER", ";", "$", "capabilities", "=", "array", "(", "'moodle/competency:planrequestreview'", ")", ";", "if", "(", "$", "USER", "->", "id", "==", "$", ...
Can the current user request the draft to be reviewed. @param int $planuserid The user to whom the plan would belong. @return bool
[ "Can", "the", "current", "user", "request", "the", "draft", "to", "be", "reviewed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L472-L481
215,954
moodle/moodle
competency/classes/plan.php
plan.get_by_user_and_competency
public static function get_by_user_and_competency($userid, $competencyid) { global $DB; $sql = 'SELECT p.* FROM {' . self::TABLE . '} p LEFT JOIN {' . plan_competency::TABLE . '} pc ON pc.planid = p.id AND pc.competencyid = :competen...
php
public static function get_by_user_and_competency($userid, $competencyid) { global $DB; $sql = 'SELECT p.* FROM {' . self::TABLE . '} p LEFT JOIN {' . plan_competency::TABLE . '} pc ON pc.planid = p.id AND pc.competencyid = :competen...
[ "public", "static", "function", "get_by_user_and_competency", "(", "$", "userid", ",", "$", "competencyid", ")", "{", "global", "$", "DB", ";", "$", "sql", "=", "'SELECT p.*\n FROM {'", ".", "self", "::", "TABLE", ".", "'} p\n LEFT JOIN ...
Get the plans of a user containing a specific competency. @param int $userid The user ID. @param int $competencyid The competency ID. @return plans[]
[ "Get", "the", "plans", "of", "a", "user", "containing", "a", "specific", "competency", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L503-L537
215,955
moodle/moodle
competency/classes/plan.php
plan.get_recordset_for_due_and_incomplete
public static function get_recordset_for_due_and_incomplete() { global $DB; $sql = "duedate > 0 AND duedate < :now AND status = :status"; $params = array('now' => time(), 'status' => self::STATUS_ACTIVE); return $DB->get_recordset_select(self::TABLE, $sql, $params); }
php
public static function get_recordset_for_due_and_incomplete() { global $DB; $sql = "duedate > 0 AND duedate < :now AND status = :status"; $params = array('now' => time(), 'status' => self::STATUS_ACTIVE); return $DB->get_recordset_select(self::TABLE, $sql, $params); }
[ "public", "static", "function", "get_recordset_for_due_and_incomplete", "(", ")", "{", "global", "$", "DB", ";", "$", "sql", "=", "\"duedate > 0 AND duedate < :now AND status = :status\"", ";", "$", "params", "=", "array", "(", "'now'", "=>", "time", "(", ")", ","...
Get the recordset of the plans that are due, incomplete and not draft. @return \moodle_recordset
[ "Get", "the", "recordset", "of", "the", "plans", "that", "are", "due", "incomplete", "and", "not", "draft", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L553-L558
215,956
moodle/moodle
competency/classes/plan.php
plan.get_status_list
public static function get_status_list($userid) { $status = array(); if (self::can_manage_user_draft($userid)) { $status[self::STATUS_DRAFT] = get_string('planstatusdraft', 'core_competency'); } if (self::can_manage_user($userid)) { $status[self::STATUS_ACTIVE] = ...
php
public static function get_status_list($userid) { $status = array(); if (self::can_manage_user_draft($userid)) { $status[self::STATUS_DRAFT] = get_string('planstatusdraft', 'core_competency'); } if (self::can_manage_user($userid)) { $status[self::STATUS_ACTIVE] = ...
[ "public", "static", "function", "get_status_list", "(", "$", "userid", ")", "{", "$", "status", "=", "array", "(", ")", ";", "if", "(", "self", "::", "can_manage_user_draft", "(", "$", "userid", ")", ")", "{", "$", "status", "[", "self", "::", "STATUS_...
Return a list of status depending on capabilities. @param int $userid The user to whom the plan would belong. @return array
[ "Return", "a", "list", "of", "status", "depending", "on", "capabilities", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L566-L575
215,957
moodle/moodle
competency/classes/plan.php
plan.update_multiple_from_template
public static function update_multiple_from_template(template $template) { global $DB; if (!$template->is_valid()) { // As we will bypass this model's validation we rely on the template being validated. throw new \coding_exception('The template must be validated before updating p...
php
public static function update_multiple_from_template(template $template) { global $DB; if (!$template->is_valid()) { // As we will bypass this model's validation we rely on the template being validated. throw new \coding_exception('The template must be validated before updating p...
[ "public", "static", "function", "update_multiple_from_template", "(", "template", "$", "template", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "$", "template", "->", "is_valid", "(", ")", ")", "{", "// As we will bypass this model's validation we rely on the...
Update from template. Bulk update a lot of plans from a template @param template $template @return bool
[ "Update", "from", "template", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L585-L611
215,958
moodle/moodle
competency/classes/plan.php
plan.validate_duedate
protected function validate_duedate($value) { // We do not check duedate when plan is draft, complete, unset, or based on a template. if ($this->is_based_on_template() || $this->is_draft() || $this->get('status') == self::STATUS_COMPLETE || empty($value))...
php
protected function validate_duedate($value) { // We do not check duedate when plan is draft, complete, unset, or based on a template. if ($this->is_based_on_template() || $this->is_draft() || $this->get('status') == self::STATUS_COMPLETE || empty($value))...
[ "protected", "function", "validate_duedate", "(", "$", "value", ")", "{", "// We do not check duedate when plan is draft, complete, unset, or based on a template.", "if", "(", "$", "this", "->", "is_based_on_template", "(", ")", "||", "$", "this", "->", "is_draft", "(", ...
Validate the due date. When setting a due date it must not exceed the DUEDATE_THRESHOLD. @param int $value The due date. @return bool|lang_string
[ "Validate", "the", "due", "date", ".", "When", "setting", "a", "due", "date", "it", "must", "not", "exceed", "the", "DUEDATE_THRESHOLD", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L638-L671
215,959
moodle/moodle
competency/classes/plan.php
plan.count_records_for_template
public static function count_records_for_template($templateid, $status) { $filters = array('templateid' => $templateid); if ($status > 0) { $filters['status'] = $status; } return self::count_records($filters); }
php
public static function count_records_for_template($templateid, $status) { $filters = array('templateid' => $templateid); if ($status > 0) { $filters['status'] = $status; } return self::count_records($filters); }
[ "public", "static", "function", "count_records_for_template", "(", "$", "templateid", ",", "$", "status", ")", "{", "$", "filters", "=", "array", "(", "'templateid'", "=>", "$", "templateid", ")", ";", "if", "(", "$", "status", ">", "0", ")", "{", "$", ...
Count the number of plans for a template, optionally filtering by status. @param int $templateid The template ID @param int $status The plan status. 0 means all statuses. @return int
[ "Count", "the", "number", "of", "plans", "for", "a", "template", "optionally", "filtering", "by", "status", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L690-L696
215,960
moodle/moodle
competency/classes/plan.php
plan.get_records_for_template
public static function get_records_for_template($templateid, $status = 0, $skip = 0, $limit = 100) { $filters = array('templateid' => $templateid); if ($status > 0) { $filters['status'] = $status; } return self::get_records($filters, $skip, $limit); }
php
public static function get_records_for_template($templateid, $status = 0, $skip = 0, $limit = 100) { $filters = array('templateid' => $templateid); if ($status > 0) { $filters['status'] = $status; } return self::get_records($filters, $skip, $limit); }
[ "public", "static", "function", "get_records_for_template", "(", "$", "templateid", ",", "$", "status", "=", "0", ",", "$", "skip", "=", "0", ",", "$", "limit", "=", "100", ")", "{", "$", "filters", "=", "array", "(", "'templateid'", "=>", "$", "templa...
Get the plans for a template, optionally filtering by status. @param int $templateid The template ID @param int $status The plan status. 0 means all statuses. @param int $skip The number of plans to skip @param int $limit The max number of plans to return @return int
[ "Get", "the", "plans", "for", "a", "template", "optionally", "filtering", "by", "status", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/plan.php#L707-L713
215,961
moodle/moodle
mod/glossary/classes/privacy/provider.php
provider.export_glossary_data_for_user
protected static function export_glossary_data_for_user(array $glossarydata, \context_module $context, array $subcontext, \stdClass $user) { // Fetch the generic module data for the glossary. $contextdata = helper::get_context_data($context, $u...
php
protected static function export_glossary_data_for_user(array $glossarydata, \context_module $context, array $subcontext, \stdClass $user) { // Fetch the generic module data for the glossary. $contextdata = helper::get_context_data($context, $u...
[ "protected", "static", "function", "export_glossary_data_for_user", "(", "array", "$", "glossarydata", ",", "\\", "context_module", "$", "context", ",", "array", "$", "subcontext", ",", "\\", "stdClass", "$", "user", ")", "{", "// Fetch the generic module data for the...
Export the supplied personal data for a single glossary activity, along with any generic data or area files. @param array $glossarydata The personal data to export for the glossary. @param \context_module $context The context of the glossary. @param array $subcontext The location within the current context that this d...
[ "Export", "the", "supplied", "personal", "data", "for", "a", "single", "glossary", "activity", "along", "with", "any", "generic", "data", "or", "area", "files", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/glossary/classes/privacy/provider.php#L308-L317
215,962
moodle/moodle
lib/classes/event/user_password_updated.php
user_password_updated.create_from_user
public static function create_from_user(\stdClass $user, $forgottenreset = false) { $data = array( 'context' => \context_user::instance($user->id), 'relateduserid' => $user->id, 'other' => array('forgottenreset' => $forgottenreset), ); $event = self::create($d...
php
public static function create_from_user(\stdClass $user, $forgottenreset = false) { $data = array( 'context' => \context_user::instance($user->id), 'relateduserid' => $user->id, 'other' => array('forgottenreset' => $forgottenreset), ); $event = self::create($d...
[ "public", "static", "function", "create_from_user", "(", "\\", "stdClass", "$", "user", ",", "$", "forgottenreset", "=", "false", ")", "{", "$", "data", "=", "array", "(", "'context'", "=>", "\\", "context_user", "::", "instance", "(", "$", "user", "->", ...
Create event for user password changing and resetting. @param \stdClass $user @param bool $forgottenreset true if reset via recovery link @return user_password_updated
[ "Create", "event", "for", "user", "password", "changing", "and", "resetting", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/user_password_updated.php#L51-L60
215,963
moodle/moodle
lib/filestorage/file_system_filedir.php
file_system_filedir.get_local_path_from_storedfile
protected function get_local_path_from_storedfile(stored_file $file, $fetchifnotfound = false) { $filepath = $this->get_local_path_from_hash($file->get_contenthash(), $fetchifnotfound); // Try content recovery. if ($fetchifnotfound && !is_readable($filepath)) { $this->recover_file($...
php
protected function get_local_path_from_storedfile(stored_file $file, $fetchifnotfound = false) { $filepath = $this->get_local_path_from_hash($file->get_contenthash(), $fetchifnotfound); // Try content recovery. if ($fetchifnotfound && !is_readable($filepath)) { $this->recover_file($...
[ "protected", "function", "get_local_path_from_storedfile", "(", "stored_file", "$", "file", ",", "$", "fetchifnotfound", "=", "false", ")", "{", "$", "filepath", "=", "$", "this", "->", "get_local_path_from_hash", "(", "$", "file", "->", "get_contenthash", "(", ...
Get a remote filepath for the specified stored file. @param stored_file $file The file to fetch the path for @param bool $fetchifnotfound Whether to attempt to fetch from the remote path if not found. @return string The full path to the content file
[ "Get", "a", "remote", "filepath", "for", "the", "specified", "stored", "file", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/file_system_filedir.php#L122-L131
215,964
moodle/moodle
lib/filestorage/file_system_filedir.php
file_system_filedir.copy_content_from_storedfile
public function copy_content_from_storedfile(stored_file $file, $target) { $source = $this->get_local_path_from_storedfile($file, true); return copy($source, $target); }
php
public function copy_content_from_storedfile(stored_file $file, $target) { $source = $this->get_local_path_from_storedfile($file, true); return copy($source, $target); }
[ "public", "function", "copy_content_from_storedfile", "(", "stored_file", "$", "file", ",", "$", "target", ")", "{", "$", "source", "=", "$", "this", "->", "get_local_path_from_storedfile", "(", "$", "file", ",", "true", ")", ";", "return", "copy", "(", "$",...
Copy content of file to given pathname. @param stored_file $file The file to be copied @param string $target real path to the new file @return bool success
[ "Copy", "content", "of", "file", "to", "given", "pathname", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/file_system_filedir.php#L232-L235
215,965
moodle/moodle
lib/filestorage/file_system_filedir.php
file_system_filedir.recover_file
protected function recover_file(stored_file $file) { $contentfile = $this->get_local_path_from_storedfile($file, false); if (file_exists($contentfile)) { // The file already exists on the file system. No need to recover. return true; } $contenthash = $file->get_...
php
protected function recover_file(stored_file $file) { $contentfile = $this->get_local_path_from_storedfile($file, false); if (file_exists($contentfile)) { // The file already exists on the file system. No need to recover. return true; } $contenthash = $file->get_...
[ "protected", "function", "recover_file", "(", "stored_file", "$", "file", ")", "{", "$", "contentfile", "=", "$", "this", "->", "get_local_path_from_storedfile", "(", "$", "file", ",", "false", ")", ";", "if", "(", "file_exists", "(", "$", "contentfile", ")"...
Tries to recover missing content of file from trash. @param stored_file $file stored_file instance @return bool success
[ "Tries", "to", "recover", "missing", "content", "of", "file", "from", "trash", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/file_system_filedir.php#L243-L280
215,966
moodle/moodle
lib/filestorage/file_system_filedir.php
file_system_filedir.remove_file
public function remove_file($contenthash) { if (!self::is_file_removable($contenthash)) { // Don't remove the file - it's still in use. return; } if (!$this->is_file_readable_remotely_by_hash($contenthash)) { // The file wasn't found in the first place. Just ...
php
public function remove_file($contenthash) { if (!self::is_file_removable($contenthash)) { // Don't remove the file - it's still in use. return; } if (!$this->is_file_readable_remotely_by_hash($contenthash)) { // The file wasn't found in the first place. Just ...
[ "public", "function", "remove_file", "(", "$", "contenthash", ")", "{", "if", "(", "!", "self", "::", "is_file_removable", "(", "$", "contenthash", ")", ")", "{", "// Don't remove the file - it's still in use.", "return", ";", "}", "if", "(", "!", "$", "this",...
Marks pool file as candidate for deleting. @param string $contenthash
[ "Marks", "pool", "file", "as", "candidate", "for", "deleting", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/file_system_filedir.php#L287-L321
215,967
moodle/moodle
lib/filestorage/file_system_filedir.php
file_system_filedir.add_file_from_path
public function add_file_from_path($pathname, $contenthash = null) { list($contenthash, $filesize) = $this->validate_hash_and_file_size($contenthash, $pathname); $hashpath = $this->get_fulldir_from_hash($contenthash); $hashfile = $this->get_local_path_from_hash($contenthash, false); $...
php
public function add_file_from_path($pathname, $contenthash = null) { list($contenthash, $filesize) = $this->validate_hash_and_file_size($contenthash, $pathname); $hashpath = $this->get_fulldir_from_hash($contenthash); $hashfile = $this->get_local_path_from_hash($contenthash, false); $...
[ "public", "function", "add_file_from_path", "(", "$", "pathname", ",", "$", "contenthash", "=", "null", ")", "{", "list", "(", "$", "contenthash", ",", "$", "filesize", ")", "=", "$", "this", "->", "validate_hash_and_file_size", "(", "$", "contenthash", ",",...
Add the supplied file to the file system. Note: If overriding this function, it is advisable to store the file in the path returned by get_local_path_from_hash as there may be subsequent uses of the file in the same request. @param string $pathname Path to file currently on disk @param string $contenthash SHA1 hash o...
[ "Add", "the", "supplied", "file", "to", "the", "file", "system", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/file_system_filedir.php#L346-L400
215,968
moodle/moodle
lib/filestorage/file_system_filedir.php
file_system_filedir.add_file_from_string
public function add_file_from_string($content) { global $CFG; $contenthash = file_storage::hash_from_string($content); // Binary length. $filesize = strlen($content); $hashpath = $this->get_fulldir_from_hash($contenthash); $hashfile = $this->get_local_path_from_hash($co...
php
public function add_file_from_string($content) { global $CFG; $contenthash = file_storage::hash_from_string($content); // Binary length. $filesize = strlen($content); $hashpath = $this->get_fulldir_from_hash($contenthash); $hashfile = $this->get_local_path_from_hash($co...
[ "public", "function", "add_file_from_string", "(", "$", "content", ")", "{", "global", "$", "CFG", ";", "$", "contenthash", "=", "file_storage", "::", "hash_from_string", "(", "$", "content", ")", ";", "// Binary length.", "$", "filesize", "=", "strlen", "(", ...
Add a file with the supplied content to the file system. Note: If overriding this function, it is advisable to store the file in the path returned by get_local_path_from_hash as there may be subsequent uses of the file in the same request. @param string $content file content - binary string @return array (contenthash...
[ "Add", "a", "file", "with", "the", "supplied", "content", "to", "the", "file", "system", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/file_system_filedir.php#L412-L474
215,969
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.set_theme_suite_to_include_core_features
public function set_theme_suite_to_include_core_features($themetoset) { // If no value passed to --add-core-features-to-theme or ALL is passed, then set core features for all themes. if (!empty($themetoset)) { if (is_number($themetoset) || is_bool($themetoset) || (self::ALL_THEMES_TO_RUN ===...
php
public function set_theme_suite_to_include_core_features($themetoset) { // If no value passed to --add-core-features-to-theme or ALL is passed, then set core features for all themes. if (!empty($themetoset)) { if (is_number($themetoset) || is_bool($themetoset) || (self::ALL_THEMES_TO_RUN ===...
[ "public", "function", "set_theme_suite_to_include_core_features", "(", "$", "themetoset", ")", "{", "// If no value passed to --add-core-features-to-theme or ALL is passed, then set core features for all themes.", "if", "(", "!", "empty", "(", "$", "themetoset", ")", ")", "{", ...
Set value for theme suite to include all core features. This should be used if your want all core features to be run with theme. @param bool $themetoset
[ "Set", "value", "for", "theme", "suite", "to", "include", "all", "core", "features", ".", "This", "should", "be", "used", "if", "your", "want", "all", "core", "features", "to", "be", "run", "with", "theme", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L99-L109
215,970
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.set_parallel_run
public function set_parallel_run($parallelruns, $currentrun) { if ($parallelruns < $currentrun) { behat_error(BEHAT_EXITCODE_REQUIREMENT, 'Parallel runs('.$parallelruns.') should be more then current run('.$currentrun.')'); } $this->parallelruns = $parallelruns; ...
php
public function set_parallel_run($parallelruns, $currentrun) { if ($parallelruns < $currentrun) { behat_error(BEHAT_EXITCODE_REQUIREMENT, 'Parallel runs('.$parallelruns.') should be more then current run('.$currentrun.')'); } $this->parallelruns = $parallelruns; ...
[ "public", "function", "set_parallel_run", "(", "$", "parallelruns", ",", "$", "currentrun", ")", "{", "if", "(", "$", "parallelruns", "<", "$", "currentrun", ")", "{", "behat_error", "(", "BEHAT_EXITCODE_REQUIREMENT", ",", "'Parallel runs('", ".", "$", "parallel...
Set parallel run to be used for generating config. @param int $parallelruns number of parallel runs. @param int $currentrun current run
[ "Set", "parallel", "run", "to", "be", "used", "for", "generating", "config", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L126-L135
215,971
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_number_of_parallel_run
public function get_number_of_parallel_run() { // Get number of parallel runs if not passed. if (empty($this->parallelruns) && ($this->parallelruns !== false)) { $this->parallelruns = behat_config_manager::get_behat_run_config_value('parallel'); } return $this->parallelruns;...
php
public function get_number_of_parallel_run() { // Get number of parallel runs if not passed. if (empty($this->parallelruns) && ($this->parallelruns !== false)) { $this->parallelruns = behat_config_manager::get_behat_run_config_value('parallel'); } return $this->parallelruns;...
[ "public", "function", "get_number_of_parallel_run", "(", ")", "{", "// Get number of parallel runs if not passed.", "if", "(", "empty", "(", "$", "this", "->", "parallelruns", ")", "&&", "(", "$", "this", "->", "parallelruns", "!==", "false", ")", ")", "{", "$",...
Return parallel runs @return int number of parallel runs.
[ "Return", "parallel", "runs" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L142-L149
215,972
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_current_run
public function get_current_run() { global $CFG; // Get number of parallel runs if not passed. if (empty($this->currentrun) && ($this->currentrun !== false) && !empty($CFG->behatrunprocess)) { $this->currentrun = $CFG->behatrunprocess; } return $this->currentrun; ...
php
public function get_current_run() { global $CFG; // Get number of parallel runs if not passed. if (empty($this->currentrun) && ($this->currentrun !== false) && !empty($CFG->behatrunprocess)) { $this->currentrun = $CFG->behatrunprocess; } return $this->currentrun; ...
[ "public", "function", "get_current_run", "(", ")", "{", "global", "$", "CFG", ";", "// Get number of parallel runs if not passed.", "if", "(", "empty", "(", "$", "this", "->", "currentrun", ")", "&&", "(", "$", "this", "->", "currentrun", "!==", "false", ")", ...
Return current run @return int current run.
[ "Return", "current", "run" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L156-L165
215,973
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_components_features
public function get_components_features($tags = '') { global $CFG; // If we already have a list created then just return that, as it's up-to-date. // If tags are passed then it's a new filter of features we need. if (!empty($this->features) && empty($tags)) { return $this->f...
php
public function get_components_features($tags = '') { global $CFG; // If we already have a list created then just return that, as it's up-to-date. // If tags are passed then it's a new filter of features we need. if (!empty($this->features) && empty($tags)) { return $this->f...
[ "public", "function", "get_components_features", "(", "$", "tags", "=", "''", ")", "{", "global", "$", "CFG", ";", "// If we already have a list created then just return that, as it's up-to-date.", "// If tags are passed then it's a new filter of features we need.", "if", "(", "!...
Return list of features. @param string $tags tags. @return array
[ "Return", "list", "of", "features", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L173-L237
215,974
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_clean_feature_key_and_path
public function get_clean_feature_key_and_path($featurepath) { global $CFG; // Fix directory path. $featurepath = testing_cli_fix_directory_separator($featurepath); $dirroot = testing_cli_fix_directory_separator($CFG->dirroot . DIRECTORY_SEPARATOR); $key = basename($featurepath...
php
public function get_clean_feature_key_and_path($featurepath) { global $CFG; // Fix directory path. $featurepath = testing_cli_fix_directory_separator($featurepath); $dirroot = testing_cli_fix_directory_separator($CFG->dirroot . DIRECTORY_SEPARATOR); $key = basename($featurepath...
[ "public", "function", "get_clean_feature_key_and_path", "(", "$", "featurepath", ")", "{", "global", "$", "CFG", ";", "// Fix directory path.", "$", "featurepath", "=", "testing_cli_fix_directory_separator", "(", "$", "featurepath", ")", ";", "$", "dirroot", "=", "t...
Return feature key for featurepath @param string $featurepath @return array key and featurepath.
[ "Return", "feature", "key", "for", "featurepath" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L245-L266
215,975
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_component_contexts
private function get_component_contexts($component) { if (empty($component)) { return $this->contexts; } $componentcontexts = array(); foreach ($this->contexts as $key => $path) { if ($component == '' || $component === $key) { $componentcontexts[...
php
private function get_component_contexts($component) { if (empty($component)) { return $this->contexts; } $componentcontexts = array(); foreach ($this->contexts as $key => $path) { if ($component == '' || $component === $key) { $componentcontexts[...
[ "private", "function", "get_component_contexts", "(", "$", "component", ")", "{", "if", "(", "empty", "(", "$", "component", ")", ")", "{", "return", "$", "this", "->", "contexts", ";", "}", "$", "componentcontexts", "=", "array", "(", ")", ";", "foreach...
Get component contexts. @param string $component component name. @return array
[ "Get", "component", "contexts", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L274-L288
215,976
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_components_contexts
public function get_components_contexts($component = '') { // If we already have a list created then just return that, as it's up-to-date. if (!empty($this->contexts)) { return $this->get_component_contexts($component); } $components = $this->get_components_with_tests(); ...
php
public function get_components_contexts($component = '') { // If we already have a list created then just return that, as it's up-to-date. if (!empty($this->contexts)) { return $this->get_component_contexts($component); } $components = $this->get_components_with_tests(); ...
[ "public", "function", "get_components_contexts", "(", "$", "component", "=", "''", ")", "{", "// If we already have a list created then just return that, as it's up-to-date.", "if", "(", "!", "empty", "(", "$", "this", "->", "contexts", ")", ")", "{", "return", "$", ...
Gets the list of Moodle behat contexts Class name as a key and the filepath as value Externalized from update_config_file() to use it from the steps definitions web interface @param string $component Restricts the obtained steps definitions to the specified component @return array
[ "Gets", "the", "list", "of", "Moodle", "behat", "contexts" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L301-L334
215,977
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_config_file_contents
public function get_config_file_contents($features = '', $contexts = '', $tags = '', $parallelruns = 0, $currentrun = 0) { global $CFG; // Set current run and parallel run. if (!empty($parallelruns) && !empty($currentrun)) { $this->set_parallel_run($parallelruns, $currentrun); ...
php
public function get_config_file_contents($features = '', $contexts = '', $tags = '', $parallelruns = 0, $currentrun = 0) { global $CFG; // Set current run and parallel run. if (!empty($parallelruns) && !empty($currentrun)) { $this->set_parallel_run($parallelruns, $currentrun); ...
[ "public", "function", "get_config_file_contents", "(", "$", "features", "=", "''", ",", "$", "contexts", "=", "''", ",", "$", "tags", "=", "''", ",", "$", "parallelruns", "=", "0", ",", "$", "currentrun", "=", "0", ")", "{", "global", "$", "CFG", ";"...
Behat config file specifing the main context class, the required Behat extensions and Moodle test wwwroot. @param array $features The system feature files @param array $contexts The system steps definitions @param string $tags filter features with specified tags. @param int $parallelruns number of parallel runs. @para...
[ "Behat", "config", "file", "specifing", "the", "main", "context", "class", "the", "required", "Behat", "extensions", "and", "Moodle", "test", "wwwroot", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L347-L389
215,978
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.filtered_features_with_tags
public function filtered_features_with_tags($features = '', $tags = '') { // This is for BC. Features if not passed then we already have a list in this object. if (empty($features)) { $features = $this->features; } // If no tags defined then return full list. if (em...
php
public function filtered_features_with_tags($features = '', $tags = '') { // This is for BC. Features if not passed then we already have a list in this object. if (empty($features)) { $features = $this->features; } // If no tags defined then return full list. if (em...
[ "public", "function", "filtered_features_with_tags", "(", "$", "features", "=", "''", ",", "$", "tags", "=", "''", ")", "{", "// This is for BC. Features if not passed then we already have a list in this object.", "if", "(", "empty", "(", "$", "features", ")", ")", "{...
Search feature files for set of tags. @param array $features set of feature files. @param string $tags list of tags (currently support && only.) @return array filtered list of feature files with tags.
[ "Search", "feature", "files", "for", "set", "of", "tags", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L398-L459
215,979
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.build_config
protected function build_config($parallelruns = 0, $currentrun = 0) { global $CFG; if (!empty($parallelruns) && !empty($currentrun)) { $this->set_parallel_run($parallelruns, $currentrun); } else { $currentrun = $this->get_current_run(); $parallelruns = $this-...
php
protected function build_config($parallelruns = 0, $currentrun = 0) { global $CFG; if (!empty($parallelruns) && !empty($currentrun)) { $this->set_parallel_run($parallelruns, $currentrun); } else { $currentrun = $this->get_current_run(); $parallelruns = $this-...
[ "protected", "function", "build_config", "(", "$", "parallelruns", "=", "0", ",", "$", "currentrun", "=", "0", ")", "{", "global", "$", "CFG", ";", "if", "(", "!", "empty", "(", "$", "parallelruns", ")", "&&", "!", "empty", "(", "$", "currentrun", ")...
Build config for behat.yml. @param int $parallelruns how many parallel runs feature needs to be divided. @param int $currentrun current run for which features should be returned. @return array
[ "Build", "config", "for", "behat", ".", "yml", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L468-L539
215,980
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_features_for_the_run
protected function get_features_for_the_run($features, $parallelruns, $currentrun) { // If no features are passed then just return. if (empty($features)) { return $features; } $allocatedfeatures = $features; // If parallel run, then only divide features. if...
php
protected function get_features_for_the_run($features, $parallelruns, $currentrun) { // If no features are passed then just return. if (empty($features)) { return $features; } $allocatedfeatures = $features; // If parallel run, then only divide features. if...
[ "protected", "function", "get_features_for_the_run", "(", "$", "features", ",", "$", "parallelruns", ",", "$", "currentrun", ")", "{", "// If no features are passed then just return.", "if", "(", "empty", "(", "$", "features", ")", ")", "{", "return", "$", "featur...
Divide features between the runs and return list. @param array $features list of features to be divided. @param int $parallelruns how many parallel runs feature needs to be divided. @param int $currentrun current run for which features should be returned. @return array
[ "Divide", "features", "between", "the", "runs", "and", "return", "list", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L549-L591
215,981
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_mobile_version_tags
protected function get_mobile_version_tags($verbose = true) : string { global $CFG; if (!empty($CFG->behat_ionic_dirroot)) { // Get app version from package.json. $jsonpath = $CFG->behat_ionic_dirroot . '/package.json'; $json = @file_get_contents($jsonpath); ...
php
protected function get_mobile_version_tags($verbose = true) : string { global $CFG; if (!empty($CFG->behat_ionic_dirroot)) { // Get app version from package.json. $jsonpath = $CFG->behat_ionic_dirroot . '/package.json'; $json = @file_get_contents($jsonpath); ...
[ "protected", "function", "get_mobile_version_tags", "(", "$", "verbose", "=", "true", ")", ":", "string", "{", "global", "$", "CFG", ";", "if", "(", "!", "empty", "(", "$", "CFG", "->", "behat_ionic_dirroot", ")", ")", "{", "// Get app version from package.jso...
Gets version tags to use for the mobile app. This is based on the current mobile app version (from its package.json) and all known mobile app versions (based on the list appversions.json in the lib/behat directory). @param bool $verbose If true, outputs information about installed app version @return string List of t...
[ "Gets", "version", "tags", "to", "use", "for", "the", "mobile", "app", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L706-L791
215,982
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.merge_config
public function merge_config($config, $localconfig) { if (!is_array($config) && !is_array($localconfig)) { return $localconfig; } // Local overrides also deeper default values. if (is_array($config) && !is_array($localconfig)) { return $localconfig; } ...
php
public function merge_config($config, $localconfig) { if (!is_array($config) && !is_array($localconfig)) { return $localconfig; } // Local overrides also deeper default values. if (is_array($config) && !is_array($localconfig)) { return $localconfig; } ...
[ "public", "function", "merge_config", "(", "$", "config", ",", "$", "localconfig", ")", "{", "if", "(", "!", "is_array", "(", "$", "config", ")", "&&", "!", "is_array", "(", "$", "localconfig", ")", ")", "{", "return", "$", "localconfig", ";", "}", "...
Overrides default config with local config values array_merge does not merge completely the array's values @param mixed $config The node of the default config @param mixed $localconfig The node of the local config @return mixed The merge result
[ "Overrides", "default", "config", "with", "local", "config", "values" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L881-L908
215,983
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_behat_theme_selector_override_classname
public static final function get_behat_theme_selector_override_classname($themename, $selectortype, $includeclass = false) { global $CFG; if ($selectortype !== 'named_partial' && $selectortype !== 'named_exact') { throw new coding_exception("Unknown selector override type '{$selectortype}'"...
php
public static final function get_behat_theme_selector_override_classname($themename, $selectortype, $includeclass = false) { global $CFG; if ($selectortype !== 'named_partial' && $selectortype !== 'named_exact') { throw new coding_exception("Unknown selector override type '{$selectortype}'"...
[ "public", "static", "final", "function", "get_behat_theme_selector_override_classname", "(", "$", "themename", ",", "$", "selectortype", ",", "$", "includeclass", "=", "false", ")", "{", "global", "$", "CFG", ";", "if", "(", "$", "selectortype", "!==", "'named_p...
Return context name of behat_theme selector to use. @param string $themename name of the theme. @param string $selectortype The type of selector (partial or exact at this stage) @param bool $includeclass if class should be included. @return string
[ "Return", "context", "name", "of", "behat_theme", "selector", "to", "use", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L1029-L1048
215,984
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.remove_blacklisted_features_from_list
protected function remove_blacklisted_features_from_list($features, $blacklist) { // If no blacklist passed then return. if (empty($blacklist)) { return $features; } // If there is no feature in suite then just return what was passed. if (empty($features)) { ...
php
protected function remove_blacklisted_features_from_list($features, $blacklist) { // If no blacklist passed then return. if (empty($blacklist)) { return $features; } // If there is no feature in suite then just return what was passed. if (empty($features)) { ...
[ "protected", "function", "remove_blacklisted_features_from_list", "(", "$", "features", ",", "$", "blacklist", ")", "{", "// If no blacklist passed then return.", "if", "(", "empty", "(", "$", "blacklist", ")", ")", "{", "return", "$", "features", ";", "}", "// If...
Remove list of blacklisted features from the feature list. @param array $features list of original features. @param array|string $blacklist list of features which needs to be removed. @return array features - blacklisted features.
[ "Remove", "list", "of", "blacklisted", "features", "from", "the", "feature", "list", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L1070-L1103
215,985
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_list_of_themes
protected function get_list_of_themes() { $selectablethemes = array(); // Get all themes installed on site. $themes = core_component::get_plugin_list('theme'); ksort($themes); foreach ($themes as $themename => $themedir) { // Load the theme config. try {...
php
protected function get_list_of_themes() { $selectablethemes = array(); // Get all themes installed on site. $themes = core_component::get_plugin_list('theme'); ksort($themes); foreach ($themes as $themename => $themedir) { // Load the theme config. try {...
[ "protected", "function", "get_list_of_themes", "(", ")", "{", "$", "selectablethemes", "=", "array", "(", ")", ";", "// Get all themes installed on site.", "$", "themes", "=", "core_component", "::", "get_plugin_list", "(", "'theme'", ")", ";", "ksort", "(", "$", ...
Return list of themes which can be set in moodle. @return array list of themes with tests.
[ "Return", "list", "of", "themes", "which", "can", "be", "set", "in", "moodle", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L1201-L1229
215,986
moodle/moodle
lib/behat/classes/behat_config_util.php
behat_config_util.get_behat_features_for_theme
protected function get_behat_features_for_theme($theme) { global $CFG; // Get list of features defined by theme. $themefeatures = $this->get_tests_for_theme($theme, 'features'); $themeblacklistfeatures = $this->get_blacklisted_tests_for_theme($theme, 'features'); $themeblacklist...
php
protected function get_behat_features_for_theme($theme) { global $CFG; // Get list of features defined by theme. $themefeatures = $this->get_tests_for_theme($theme, 'features'); $themeblacklistfeatures = $this->get_blacklisted_tests_for_theme($theme, 'features'); $themeblacklist...
[ "protected", "function", "get_behat_features_for_theme", "(", "$", "theme", ")", "{", "global", "$", "CFG", ";", "// Get list of features defined by theme.", "$", "themefeatures", "=", "$", "this", "->", "get_tests_for_theme", "(", "$", "theme", ",", "'features'", "...
Return list of blacklisted behat features for theme and features defined by theme only. @param string $theme theme name. @return array ($blacklistfeatures, $blacklisttags, $features)
[ "Return", "list", "of", "blacklisted", "behat", "features", "for", "theme", "and", "features", "defined", "by", "theme", "only", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_config_util.php#L1367-L1424
215,987
moodle/moodle
mod/assign/quickgradingform.php
mod_assign_quick_grading_form.definition
public function definition() { $mform = $this->_form; $instance = $this->_customdata; // Visible elements. $mform->addElement('html', $instance['gradingtable']); // Hidden params. $mform->addElement('hidden', 'id', $instance['cm']); $mform->setType('id', PARAM_I...
php
public function definition() { $mform = $this->_form; $instance = $this->_customdata; // Visible elements. $mform->addElement('html', $instance['gradingtable']); // Hidden params. $mform->addElement('hidden', 'id', $instance['cm']); $mform->setType('id', PARAM_I...
[ "public", "function", "definition", "(", ")", "{", "$", "mform", "=", "$", "this", "->", "_form", ";", "$", "instance", "=", "$", "this", "->", "_customdata", ";", "// Visible elements.", "$", "mform", "->", "addElement", "(", "'html'", ",", "$", "instan...
Define this form - called from the parent constructor
[ "Define", "this", "form", "-", "called", "from", "the", "parent", "constructor" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/quickgradingform.php#L42-L64
215,988
moodle/moodle
lib/classes/dml/table.php
table.get_fieldlist
protected function get_fieldlist() : array { global $DB; if (null === $this->fields) { $fields = []; foreach (array_keys($DB->get_columns($this->tablename)) as $fieldname) { $fields["{$this->fieldprefix}{$fieldname}"] = $fieldname; } $thi...
php
protected function get_fieldlist() : array { global $DB; if (null === $this->fields) { $fields = []; foreach (array_keys($DB->get_columns($this->tablename)) as $fieldname) { $fields["{$this->fieldprefix}{$fieldname}"] = $fieldname; } $thi...
[ "protected", "function", "get_fieldlist", "(", ")", ":", "array", "{", "global", "$", "DB", ";", "if", "(", "null", "===", "$", "this", "->", "fields", ")", "{", "$", "fields", "=", "[", "]", ";", "foreach", "(", "array_keys", "(", "$", "DB", "->",...
Get the list of fields in a table for use in preloading fields. @return array The list of columns in a table. The array key is the column name with an applied prefix.
[ "Get", "the", "list", "of", "fields", "in", "a", "table", "for", "use", "in", "preloading", "fields", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/dml/table.php#L80-L93
215,989
moodle/moodle
lib/classes/dml/table.php
table.get_field_select
public function get_field_select() : string { $fieldlist = $this->get_fieldlist(); return implode(', ', array_map(function($fieldname, $fieldalias) { return "{$this->tablealias}.{$fieldname} AS {$fieldalias}"; }, $fieldlist, array_keys($fieldlist))); }
php
public function get_field_select() : string { $fieldlist = $this->get_fieldlist(); return implode(', ', array_map(function($fieldname, $fieldalias) { return "{$this->tablealias}.{$fieldname} AS {$fieldalias}"; }, $fieldlist, array_keys($fieldlist))); }
[ "public", "function", "get_field_select", "(", ")", ":", "string", "{", "$", "fieldlist", "=", "$", "this", "->", "get_fieldlist", "(", ")", ";", "return", "implode", "(", "', '", ",", "array_map", "(", "function", "(", "$", "fieldname", ",", "$", "field...
Get the SELECT SQL to select a set of columns for this table. This function is intended to be used in combination with extract_from_result(). @return string The SQL to use in the SELECT
[ "Get", "the", "SELECT", "SQL", "to", "select", "a", "set", "of", "columns", "for", "this", "table", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/dml/table.php#L102-L108
215,990
moodle/moodle
lib/classes/dml/table.php
table.extract_from_result
public function extract_from_result(stdClass $result) : stdClass { $record = new stdClass(); $fieldlist = $this->get_fieldlist(); foreach ($fieldlist as $fieldalias => $fieldname) { if (property_exists($result, $fieldalias)) { $record->$fieldname = $result->$fieldali...
php
public function extract_from_result(stdClass $result) : stdClass { $record = new stdClass(); $fieldlist = $this->get_fieldlist(); foreach ($fieldlist as $fieldalias => $fieldname) { if (property_exists($result, $fieldalias)) { $record->$fieldname = $result->$fieldali...
[ "public", "function", "extract_from_result", "(", "stdClass", "$", "result", ")", ":", "stdClass", "{", "$", "record", "=", "new", "stdClass", "(", ")", ";", "$", "fieldlist", "=", "$", "this", "->", "get_fieldlist", "(", ")", ";", "foreach", "(", "$", ...
Extract fields from the specified result. The fields are removed from the original object. This function is intended to be used in combination with get_field_select(). @param stdClass $result The result retrieved from the database with fields to be extracted @return stdClass The extracted result
[ "Extract", "fields", "from", "the", "specified", "result", ".", "The", "fields", "are", "removed", "from", "the", "original", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/dml/table.php#L118-L132
215,991
moodle/moodle
lib/classes/php_time_limit.php
core_php_time_limit.raise
public static function raise($newlimit = 0) { global $CFG; // Special behaviour in unit tests so that we can check the value. if (PHPUNIT_TEST) { self::$unittestdata[] = $newlimit; } // If the time limit has already been set to 'infinite', ignore. Also do //...
php
public static function raise($newlimit = 0) { global $CFG; // Special behaviour in unit tests so that we can check the value. if (PHPUNIT_TEST) { self::$unittestdata[] = $newlimit; } // If the time limit has already been set to 'infinite', ignore. Also do //...
[ "public", "static", "function", "raise", "(", "$", "newlimit", "=", "0", ")", "{", "global", "$", "CFG", ";", "// Special behaviour in unit tests so that we can check the value.", "if", "(", "PHPUNIT_TEST", ")", "{", "self", "::", "$", "unittestdata", "[", "]", ...
Sets the PHP time limit to a number of seconds from now. This function will always extend the time limit (in other words, if the time limit has already been set further in the future, it will do nothing). In order to support front-end servers which may time out silently if no output is displayed, you should ideally o...
[ "Sets", "the", "PHP", "time", "limit", "to", "a", "number", "of", "seconds", "from", "now", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/php_time_limit.php#L55-L101
215,992
moodle/moodle
lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
PHPExcel_Writer_Excel2007_Style.writeGradientFill
private function writeGradientFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) { // fill $objWriter->startElement('fill'); // gradientFill $objWriter->startElement('gradientFill'); $objWriter->writeAttribute('type', $pFill->getFillType());...
php
private function writeGradientFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) { // fill $objWriter->startElement('fill'); // gradientFill $objWriter->startElement('gradientFill'); $objWriter->writeAttribute('type', $pFill->getFillType());...
[ "private", "function", "writeGradientFill", "(", "PHPExcel_Shared_XMLWriter", "$", "objWriter", "=", "null", ",", "PHPExcel_Style_Fill", "$", "pFill", "=", "null", ")", "{", "// fill", "$", "objWriter", "->", "startElement", "(", "'fill'", ")", ";", "// gradientFi...
Write Gradient Fill @param PHPExcel_Shared_XMLWriter $objWriter XML Writer @param PHPExcel_Style_Fill $pFill Fill style @throws PHPExcel_Writer_Exception
[ "Write", "Gradient", "Fill" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php#L187-L222
215,993
moodle/moodle
lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
PHPExcel_Writer_Excel2007_Style.writePatternFill
private function writePatternFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) { // fill $objWriter->startElement('fill'); // patternFill $objWriter->startElement('patternFill'); $objWriter->writeAttribute('patternType', $pFill->getFillType...
php
private function writePatternFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) { // fill $objWriter->startElement('fill'); // patternFill $objWriter->startElement('patternFill'); $objWriter->writeAttribute('patternType', $pFill->getFillType...
[ "private", "function", "writePatternFill", "(", "PHPExcel_Shared_XMLWriter", "$", "objWriter", "=", "null", ",", "PHPExcel_Style_Fill", "$", "pFill", "=", "null", ")", "{", "// fill", "$", "objWriter", "->", "startElement", "(", "'fill'", ")", ";", "// patternFill...
Write Pattern Fill @param PHPExcel_Shared_XMLWriter $objWriter XML Writer @param PHPExcel_Style_Fill $pFill Fill style @throws PHPExcel_Writer_Exception
[ "Write", "Pattern", "Fill" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php#L231-L260
215,994
moodle/moodle
lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
PHPExcel_Writer_Excel2007_Style.allConditionalStyles
public function allConditionalStyles(PHPExcel $pPHPExcel = null) { // Get an array of all styles $aStyles = array(); $sheetCount = $pPHPExcel->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { foreach ($pPHPExcel->getSheet($i)->getConditionalStylesCollection() as $...
php
public function allConditionalStyles(PHPExcel $pPHPExcel = null) { // Get an array of all styles $aStyles = array(); $sheetCount = $pPHPExcel->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { foreach ($pPHPExcel->getSheet($i)->getConditionalStylesCollection() as $...
[ "public", "function", "allConditionalStyles", "(", "PHPExcel", "$", "pPHPExcel", "=", "null", ")", "{", "// Get an array of all styles", "$", "aStyles", "=", "array", "(", ")", ";", "$", "sheetCount", "=", "$", "pPHPExcel", "->", "getSheetCount", "(", ")", ";"...
Get an array of all conditional styles @param PHPExcel $pPHPExcel @return PHPExcel_Style_Conditional[] All conditional styles in PHPExcel @throws PHPExcel_Writer_Exception
[ "Get", "an", "array", "of", "all", "conditional", "styles" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php#L583-L598
215,995
moodle/moodle
lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
PHPExcel_Writer_Excel2007_Style.allFills
public function allFills(PHPExcel $pPHPExcel = null) { // Get an array of unique fills $aFills = array(); // Two first fills are predefined $fill0 = new PHPExcel_Style_Fill(); $fill0->setFillType(PHPExcel_Style_Fill::FILL_NONE); $aFills[] = $fill0; $fill1 = ...
php
public function allFills(PHPExcel $pPHPExcel = null) { // Get an array of unique fills $aFills = array(); // Two first fills are predefined $fill0 = new PHPExcel_Style_Fill(); $fill0->setFillType(PHPExcel_Style_Fill::FILL_NONE); $aFills[] = $fill0; $fill1 = ...
[ "public", "function", "allFills", "(", "PHPExcel", "$", "pPHPExcel", "=", "null", ")", "{", "// Get an array of unique fills", "$", "aFills", "=", "array", "(", ")", ";", "// Two first fills are predefined", "$", "fill0", "=", "new", "PHPExcel_Style_Fill", "(", ")...
Get an array of all fills @param PHPExcel $pPHPExcel @return PHPExcel_Style_Fill[] All fills in PHPExcel @throws PHPExcel_Writer_Exception
[ "Get", "an", "array", "of", "all", "fills" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php#L607-L629
215,996
moodle/moodle
lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
PHPExcel_Writer_Excel2007_Style.allFonts
public function allFonts(PHPExcel $pPHPExcel = null) { // Get an array of unique fonts $aFonts = array(); $aStyles = $this->allStyles($pPHPExcel); foreach ($aStyles as $style) { if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) { $aFonts[ ...
php
public function allFonts(PHPExcel $pPHPExcel = null) { // Get an array of unique fonts $aFonts = array(); $aStyles = $this->allStyles($pPHPExcel); foreach ($aStyles as $style) { if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) { $aFonts[ ...
[ "public", "function", "allFonts", "(", "PHPExcel", "$", "pPHPExcel", "=", "null", ")", "{", "// Get an array of unique fonts", "$", "aFonts", "=", "array", "(", ")", ";", "$", "aStyles", "=", "$", "this", "->", "allStyles", "(", "$", "pPHPExcel", ")", ";",...
Get an array of all fonts @param PHPExcel $pPHPExcel @return PHPExcel_Style_Font[] All fonts in PHPExcel @throws PHPExcel_Writer_Exception
[ "Get", "an", "array", "of", "all", "fonts" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php#L638-L651
215,997
moodle/moodle
lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
PHPExcel_Writer_Excel2007_Style.allBorders
public function allBorders(PHPExcel $pPHPExcel = null) { // Get an array of unique borders $aBorders = array(); $aStyles = $this->allStyles($pPHPExcel); foreach ($aStyles as $style) { if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) { ...
php
public function allBorders(PHPExcel $pPHPExcel = null) { // Get an array of unique borders $aBorders = array(); $aStyles = $this->allStyles($pPHPExcel); foreach ($aStyles as $style) { if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) { ...
[ "public", "function", "allBorders", "(", "PHPExcel", "$", "pPHPExcel", "=", "null", ")", "{", "// Get an array of unique borders", "$", "aBorders", "=", "array", "(", ")", ";", "$", "aStyles", "=", "$", "this", "->", "allStyles", "(", "$", "pPHPExcel", ")", ...
Get an array of all borders @param PHPExcel $pPHPExcel @return PHPExcel_Style_Borders[] All borders in PHPExcel @throws PHPExcel_Writer_Exception
[ "Get", "an", "array", "of", "all", "borders" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php#L660-L673
215,998
moodle/moodle
lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
PHPExcel_Writer_Excel2007_Style.allNumberFormats
public function allNumberFormats(PHPExcel $pPHPExcel = null) { // Get an array of unique number formats $aNumFmts = array(); $aStyles = $this->allStyles($pPHPExcel); foreach ($aStyles as $style) { if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_...
php
public function allNumberFormats(PHPExcel $pPHPExcel = null) { // Get an array of unique number formats $aNumFmts = array(); $aStyles = $this->allStyles($pPHPExcel); foreach ($aStyles as $style) { if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_...
[ "public", "function", "allNumberFormats", "(", "PHPExcel", "$", "pPHPExcel", "=", "null", ")", "{", "// Get an array of unique number formats", "$", "aNumFmts", "=", "array", "(", ")", ";", "$", "aStyles", "=", "$", "this", "->", "allStyles", "(", "$", "pPHPEx...
Get an array of all number formats @param PHPExcel $pPHPExcel @return PHPExcel_Style_NumberFormat[] All number formats in PHPExcel @throws PHPExcel_Writer_Exception
[ "Get", "an", "array", "of", "all", "number", "formats" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php#L682-L695
215,999
moodle/moodle
badges/endorsement_form.php
endorsement_form.validation
public function validation($data, $files) { $errors = parent::validation($data, $files); if ($data['issueremail'] && !validate_email($data['issueremail'])) { $errors['issueremail'] = get_string('invalidemail'); } if ($data['issuerurl'] && !preg_match('@^https?://.+@', $data['...
php
public function validation($data, $files) { $errors = parent::validation($data, $files); if ($data['issueremail'] && !validate_email($data['issueremail'])) { $errors['issueremail'] = get_string('invalidemail'); } if ($data['issuerurl'] && !preg_match('@^https?://.+@', $data['...
[ "public", "function", "validation", "(", "$", "data", ",", "$", "files", ")", "{", "$", "errors", "=", "parent", "::", "validation", "(", "$", "data", ",", "$", "files", ")", ";", "if", "(", "$", "data", "[", "'issueremail'", "]", "&&", "!", "valid...
Validates form data. @param array $data submitted data. @param array $files submitted files. @return array $errors An array of errors.
[ "Validates", "form", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/endorsement_form.php#L84-L96