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
212,600
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_favourite_discussion
public function can_favourite_discussion(stdClass $user) : bool { $context = $this->get_context(); return has_capability('mod/forum:cantogglefavourite', $context, $user); }
php
public function can_favourite_discussion(stdClass $user) : bool { $context = $this->get_context(); return has_capability('mod/forum:cantogglefavourite', $context, $user); }
[ "public", "function", "can_favourite_discussion", "(", "stdClass", "$", "user", ")", ":", "bool", "{", "$", "context", "=", "$", "this", "->", "get_context", "(", ")", ";", "return", "has_capability", "(", "'mod/forum:cantogglefavourite'", ",", "$", "context", ...
Can the user favourite the discussion @param stdClass $user The user to check @return bool
[ "Can", "the", "user", "favourite", "the", "discussion" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L330-L333
212,601
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_view_discussion
public function can_view_discussion(stdClass $user, discussion_entity $discussion) : bool { $forumrecord = $this->get_forum_record(); $discussionrecord = $this->get_discussion_record($discussion); $context = $this->get_context(); return forum_user_can_see_discussion($forumrecord, $discu...
php
public function can_view_discussion(stdClass $user, discussion_entity $discussion) : bool { $forumrecord = $this->get_forum_record(); $discussionrecord = $this->get_discussion_record($discussion); $context = $this->get_context(); return forum_user_can_see_discussion($forumrecord, $discu...
[ "public", "function", "can_view_discussion", "(", "stdClass", "$", "user", ",", "discussion_entity", "$", "discussion", ")", ":", "bool", "{", "$", "forumrecord", "=", "$", "this", "->", "get_forum_record", "(", ")", ";", "$", "discussionrecord", "=", "$", "...
Can the user view the content of a discussion? @param stdClass $user The user to check @param discussion_entity $discussion The discussion to check @return bool
[ "Can", "the", "user", "view", "the", "content", "of", "a", "discussion?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L342-L348
212,602
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_view_post
public function can_view_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { if (!$this->can_view_post_shell($user, $post)) { return false; } $forum = $this->get_forum(); $forumrecord = $this->get_forum_record(); $discussionrecord = $this-...
php
public function can_view_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { if (!$this->can_view_post_shell($user, $post)) { return false; } $forum = $this->get_forum(); $forumrecord = $this->get_forum_record(); $discussionrecord = $this-...
[ "public", "function", "can_view_post", "(", "stdClass", "$", "user", ",", "discussion_entity", "$", "discussion", ",", "post_entity", "$", "post", ")", ":", "bool", "{", "if", "(", "!", "$", "this", "->", "can_view_post_shell", "(", "$", "user", ",", "$", ...
Can the user view the content of the post in this discussion? @param stdClass $user The user to check @param discussion_entity $discussion The discussion to check @param post_entity $post The post the user wants to view @return bool
[ "Can", "the", "user", "view", "the", "content", "of", "the", "post", "in", "this", "discussion?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L358-L369
212,603
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_view_post_shell
public function can_view_post_shell(stdClass $user, post_entity $post) : bool { if (!$post->is_private_reply()) { return true; } if ($post->is_private_reply_intended_for_user($user)) { return true; } return $this->can_view_any_private_reply($user); }
php
public function can_view_post_shell(stdClass $user, post_entity $post) : bool { if (!$post->is_private_reply()) { return true; } if ($post->is_private_reply_intended_for_user($user)) { return true; } return $this->can_view_any_private_reply($user); }
[ "public", "function", "can_view_post_shell", "(", "stdClass", "$", "user", ",", "post_entity", "$", "post", ")", ":", "bool", "{", "if", "(", "!", "$", "post", "->", "is_private_reply", "(", ")", ")", "{", "return", "true", ";", "}", "if", "(", "$", ...
Can the user view the post at all? In some situations the user can view the shell of a post without being able to view its content. @param stdClass $user The user to check @param post_entity $post The post the user wants to view @return bool
[ "Can", "the", "user", "view", "the", "post", "at", "all?", "In", "some", "situations", "the", "user", "can", "view", "the", "shell", "of", "a", "post", "without", "being", "able", "to", "view", "its", "content", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L380-L390
212,604
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_edit_post
public function can_edit_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { global $CFG; $context = $this->get_context(); $ownpost = $post->is_owned_by_user($user); $ineditingtime = $post->get_age() < $CFG->maxeditingtime; switch ($this->forum->get_...
php
public function can_edit_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { global $CFG; $context = $this->get_context(); $ownpost = $post->is_owned_by_user($user); $ineditingtime = $post->get_age() < $CFG->maxeditingtime; switch ($this->forum->get_...
[ "public", "function", "can_edit_post", "(", "stdClass", "$", "user", ",", "discussion_entity", "$", "discussion", ",", "post_entity", "$", "post", ")", ":", "bool", "{", "global", "$", "CFG", ";", "$", "context", "=", "$", "this", "->", "get_context", "(",...
Can the user edit the post in this discussion? @param stdClass $user The user to check @param discussion_entity $discussion The discussion to check @param post_entity $post The post the user wants to edit @return bool
[ "Can", "the", "user", "edit", "the", "post", "in", "this", "discussion?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L410-L427
212,605
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_delete_post
public function can_delete_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { global $CFG; $forum = $this->get_forum(); if ($forum->get_type() == 'single' && $discussion->is_first_post($post)) { // Do not allow deleting of first post in single simple ty...
php
public function can_delete_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { global $CFG; $forum = $this->get_forum(); if ($forum->get_type() == 'single' && $discussion->is_first_post($post)) { // Do not allow deleting of first post in single simple ty...
[ "public", "function", "can_delete_post", "(", "stdClass", "$", "user", ",", "discussion_entity", "$", "discussion", ",", "post_entity", "$", "post", ")", ":", "bool", "{", "global", "$", "CFG", ";", "$", "forum", "=", "$", "this", "->", "get_forum", "(", ...
Can the user delete the post in this discussion? @param stdClass $user The user to check @param discussion_entity $discussion The discussion to check @param post_entity $post The post the user wants to delete @return bool
[ "Can", "the", "user", "delete", "the", "post", "in", "this", "discussion?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L437-L453
212,606
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_split_post
public function can_split_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { if ($post->is_private_reply()) { // It is not possible to create a private discussion. return false; } return $this->can_split_discussions($user) && $post->has_paren...
php
public function can_split_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { if ($post->is_private_reply()) { // It is not possible to create a private discussion. return false; } return $this->can_split_discussions($user) && $post->has_paren...
[ "public", "function", "can_split_post", "(", "stdClass", "$", "user", ",", "discussion_entity", "$", "discussion", ",", "post_entity", "$", "post", ")", ":", "bool", "{", "if", "(", "$", "post", "->", "is_private_reply", "(", ")", ")", "{", "// It is not pos...
Can the user split the post in this discussion? @param stdClass $user The user to check @param discussion_entity $discussion The discussion to check @param post_entity $post The post the user wants to split @return bool
[ "Can", "the", "user", "split", "the", "post", "in", "this", "discussion?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L463-L470
212,607
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_reply_to_post
public function can_reply_to_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { if ($post->is_private_reply()) { // It is not possible to reply to a private reply. return false; } return $this->can_post_in_discussion($user, $discussion); ...
php
public function can_reply_to_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { if ($post->is_private_reply()) { // It is not possible to reply to a private reply. return false; } return $this->can_post_in_discussion($user, $discussion); ...
[ "public", "function", "can_reply_to_post", "(", "stdClass", "$", "user", ",", "discussion_entity", "$", "discussion", ",", "post_entity", "$", "post", ")", ":", "bool", "{", "if", "(", "$", "post", "->", "is_private_reply", "(", ")", ")", "{", "// It is not ...
Can the user reply to the post in this discussion? @param stdClass $user The user to check @param discussion_entity $discussion The discussion to check @param post_entity $post The post the user wants to reply to @return bool
[ "Can", "the", "user", "reply", "to", "the", "post", "in", "this", "discussion?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L480-L487
212,608
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_reply_privately_to_post
public function can_reply_privately_to_post(stdClass $user, post_entity $post) : bool { if ($post->is_private_reply()) { // You cannot reply privately to a post which is, itself, a private reply. return false; } return has_capability('mod/forum:postprivatereply', $this->...
php
public function can_reply_privately_to_post(stdClass $user, post_entity $post) : bool { if ($post->is_private_reply()) { // You cannot reply privately to a post which is, itself, a private reply. return false; } return has_capability('mod/forum:postprivatereply', $this->...
[ "public", "function", "can_reply_privately_to_post", "(", "stdClass", "$", "user", ",", "post_entity", "$", "post", ")", ":", "bool", "{", "if", "(", "$", "post", "->", "is_private_reply", "(", ")", ")", "{", "// You cannot reply privately to a post which is, itself...
Can the user reply privately to the specified post? @param stdClass $user The user to check @param post_entity $post The post the user wants to reply to @return bool
[ "Can", "the", "user", "reply", "privately", "to", "the", "specified", "post?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L496-L503
212,609
moodle/moodle
mod/forum/classes/local/managers/capability.php
capability.can_view_participants
public function can_view_participants(stdClass $user, discussion_entity $discussion) : bool { return course_can_view_participants($this->get_context()) && !$this->must_post_before_viewing_discussion($user, $discussion); }
php
public function can_view_participants(stdClass $user, discussion_entity $discussion) : bool { return course_can_view_participants($this->get_context()) && !$this->must_post_before_viewing_discussion($user, $discussion); }
[ "public", "function", "can_view_participants", "(", "stdClass", "$", "user", ",", "discussion_entity", "$", "discussion", ")", ":", "bool", "{", "return", "course_can_view_participants", "(", "$", "this", "->", "get_context", "(", ")", ")", "&&", "!", "$", "th...
Can the user view the participants of this discussion? @param stdClass $user The user to check @param discussion_entity $discussion The discussion to check @return bool
[ "Can", "the", "user", "view", "the", "participants", "of", "this", "discussion?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/managers/capability.php#L573-L576
212,610
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_gradebook_structure_step.gradebook_calculation_freeze
protected function gradebook_calculation_freeze() { global $CFG; $gradebookcalculationsfreeze = get_config('core', 'gradebook_calculations_freeze_' . $this->get_courseid()); preg_match('/(\d{8})/', $this->get_task()->get_info()->moodle_release, $matches); $backupbuild = (int)$matches[1];...
php
protected function gradebook_calculation_freeze() { global $CFG; $gradebookcalculationsfreeze = get_config('core', 'gradebook_calculations_freeze_' . $this->get_courseid()); preg_match('/(\d{8})/', $this->get_task()->get_info()->moodle_release, $matches); $backupbuild = (int)$matches[1];...
[ "protected", "function", "gradebook_calculation_freeze", "(", ")", "{", "global", "$", "CFG", ";", "$", "gradebookcalculationsfreeze", "=", "get_config", "(", "'core'", ",", "'gradebook_calculations_freeze_'", ".", "$", "this", "->", "get_courseid", "(", ")", ")", ...
Freeze gradebook calculation if needed. This is similar to various upgrade scripts that check if the freeze is needed.
[ "Freeze", "gradebook", "calculation", "if", "needed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L500-L526
212,611
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_gradebook_structure_step.check_minmaxtouse
protected function check_minmaxtouse() { global $CFG, $DB; require_once($CFG->libdir . '/gradelib.php'); $userinfo = $this->task->get_setting_value('users'); $settingname = 'minmaxtouse'; $courseid = $this->get_courseid(); $minmaxtouse = $DB->get_field('grade_settings', ...
php
protected function check_minmaxtouse() { global $CFG, $DB; require_once($CFG->libdir . '/gradelib.php'); $userinfo = $this->task->get_setting_value('users'); $settingname = 'minmaxtouse'; $courseid = $this->get_courseid(); $minmaxtouse = $DB->get_field('grade_settings', ...
[ "protected", "function", "check_minmaxtouse", "(", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "require_once", "(", "$", "CFG", "->", "libdir", ".", "'/gradelib.php'", ")", ";", "$", "userinfo", "=", "$", "this", "->", "task", "->", "get_setting...
Checks what should happen with the course grade setting minmaxtouse. This is related to the upgrade step at the time the setting was added. @see MDL-48618 @return void
[ "Checks", "what", "should", "happen", "with", "the", "course", "grade", "setting", "minmaxtouse", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L536-L592
212,612
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_gradebook_structure_step.rewrite_step_backup_file_for_legacy_freeze
protected function rewrite_step_backup_file_for_legacy_freeze($filepath) { $foundnode = false; $newfile = make_request_directory(true) . DIRECTORY_SEPARATOR . 'file.xml'; $fr = fopen($filepath, 'r'); $fw = fopen($newfile, 'w'); if ($fr && $fw) { while (($line = fgets(...
php
protected function rewrite_step_backup_file_for_legacy_freeze($filepath) { $foundnode = false; $newfile = make_request_directory(true) . DIRECTORY_SEPARATOR . 'file.xml'; $fr = fopen($filepath, 'r'); $fw = fopen($newfile, 'w'); if ($fr && $fw) { while (($line = fgets(...
[ "protected", "function", "rewrite_step_backup_file_for_legacy_freeze", "(", "$", "filepath", ")", "{", "$", "foundnode", "=", "false", ";", "$", "newfile", "=", "make_request_directory", "(", "true", ")", ".", "DIRECTORY_SEPARATOR", ".", "'file.xml'", ";", "$", "f...
Rewrite step definition to handle the legacy freeze attribute. In previous backups the calculations_freeze property was stored as an attribute of the top level node <gradebook>. The backup API, however, do not process grandparent nodes. It only processes definitive children, and their parent attributes. We had: <gra...
[ "Rewrite", "step", "definition", "to", "handle", "the", "legacy", "freeze", "attribute", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L635-L670
212,613
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_structure_step.process_customfield
public function process_customfield($data) { $handler = core_course\customfield\course_handler::create(); $handler->restore_instance_data_from_backup($this->task, $data); }
php
public function process_customfield($data) { $handler = core_course\customfield\course_handler::create(); $handler->restore_instance_data_from_backup($this->task, $data); }
[ "public", "function", "process_customfield", "(", "$", "data", ")", "{", "$", "handler", "=", "core_course", "\\", "customfield", "\\", "course_handler", "::", "create", "(", ")", ";", "$", "handler", "->", "restore_instance_data_from_backup", "(", "$", "this", ...
Process custom fields @param array $data
[ "Process", "custom", "fields" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L1944-L1947
212,614
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_enrolments_structure_step.process_enrolment
public function process_enrolment($data) { global $DB; if (!isset($this->plugins)) { $this->plugins = enrol_get_plugins(true); } $data = (object)$data; // Process only if parent instance have been mapped. if ($enrolid = $this->get_new_parentid('enrol')) { ...
php
public function process_enrolment($data) { global $DB; if (!isset($this->plugins)) { $this->plugins = enrol_get_plugins(true); } $data = (object)$data; // Process only if parent instance have been mapped. if ($enrolid = $this->get_new_parentid('enrol')) { ...
[ "public", "function", "process_enrolment", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "plugins", ")", ")", "{", "$", "this", "->", "plugins", "=", "enrol_get_plugins", "(", "true", ")", ";",...
Create user enrolments. This has to be called after creation of enrolment instances and before adding of role assignments. Roles are assigned in restore_ras_and_caps_structure_step::process_assignment() processing afterwards. @param mixed $data @return void
[ "Create", "user", "enrolments", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L2292-L2317
212,615
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_badges_structure_step.process_endorsement
public function process_endorsement($data) { global $DB; $data = (object)$data; $params = [ 'badgeid' => $this->get_new_parentid('badge'), 'issuername' => $data->issuername, 'issuerurl' => $data->issuerurl, 'issueremail' => $data->issueremail, ...
php
public function process_endorsement($data) { global $DB; $data = (object)$data; $params = [ 'badgeid' => $this->get_new_parentid('badge'), 'issuername' => $data->issuername, 'issuerurl' => $data->issuerurl, 'issueremail' => $data->issueremail, ...
[ "public", "function", "process_endorsement", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "$", "params", "=", "[", "'badgeid'", "=>", "$", "this", "->", "get_new_parentid", "(", "'badge'"...
Create an endorsement for a badge. @param mixed $data @return void
[ "Create", "an", "endorsement", "for", "a", "badge", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L2586-L2602
212,616
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_badges_structure_step.process_alignment
public function process_alignment($data) { global $DB; $data = (object)$data; $params = array( 'badgeid' => $this->get_new_parentid('badge'), 'targetname' => $data->targetname, 'targeturl' => $data->targeturl, ...
php
public function process_alignment($data) { global $DB; $data = (object)$data; $params = array( 'badgeid' => $this->get_new_parentid('badge'), 'targetname' => $data->targetname, 'targeturl' => $data->targeturl, ...
[ "public", "function", "process_alignment", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "$", "params", "=", "array", "(", "'badgeid'", "=>", "$", "this", "->", "get_new_parentid", "(", ...
Link to an alignment for a badge. @param mixed $data @return void
[ "Link", "to", "an", "alignment", "for", "a", "badge", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L2632-L2646
212,617
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_completion_structure_step.process_course_completion_criteria
public function process_course_completion_criteria($data) { global $DB; $data = (object)$data; $data->course = $this->get_courseid(); // Apply the date offset to the time end field $data->timeend = $this->apply_date_offset($data->timeend); // Map the role from the crit...
php
public function process_course_completion_criteria($data) { global $DB; $data = (object)$data; $data->course = $this->get_courseid(); // Apply the date offset to the time end field $data->timeend = $this->apply_date_offset($data->timeend); // Map the role from the crit...
[ "public", "function", "process_course_completion_criteria", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "$", "data", "->", "course", "=", "$", "this", "->", "get_courseid", "(", ")", ";"...
Process course completion criteria @global moodle_database $DB @param stdClass $data
[ "Process", "course", "completion", "criteria" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L2986-L3066
212,618
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_completion_structure_step.process_course_completion_crit_compl
public function process_course_completion_crit_compl($data) { global $DB; $data = (object)$data; // This may be empty if criteria could not be restored $data->criteriaid = $this->get_mappingid('course_completion_criteria', $data->criteriaid); $data->course = $this->get_coursei...
php
public function process_course_completion_crit_compl($data) { global $DB; $data = (object)$data; // This may be empty if criteria could not be restored $data->criteriaid = $this->get_mappingid('course_completion_criteria', $data->criteriaid); $data->course = $this->get_coursei...
[ "public", "function", "process_course_completion_crit_compl", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "// This may be empty if criteria could not be restored", "$", "data", "->", "criteriaid", "...
Processes course compltion criteria complete records @global moodle_database $DB @param stdClass $data
[ "Processes", "course", "compltion", "criteria", "complete", "records" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3074-L3100
212,619
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_completion_structure_step.process_course_completions
public function process_course_completions($data) { global $DB; $data = (object)$data; $data->course = $this->get_courseid(); $data->userid = $this->get_mappingid('user', $data->userid); if (!empty($data->userid)) { $params = array( 'userid' => $dat...
php
public function process_course_completions($data) { global $DB; $data = (object)$data; $data->course = $this->get_courseid(); $data->userid = $this->get_mappingid('user', $data->userid); if (!empty($data->userid)) { $params = array( 'userid' => $dat...
[ "public", "function", "process_course_completions", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "$", "data", "->", "course", "=", "$", "this", "->", "get_courseid", "(", ")", ";", "$",...
Process course completions @global moodle_database $DB @param stdClass $data
[ "Process", "course", "completions" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3108-L3141
212,620
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_completion_structure_step.process_course_completion_aggr_methd
public function process_course_completion_aggr_methd($data) { global $DB; $data = (object)$data; $data->course = $this->get_courseid(); // Only create the course_completion_aggr_methd records if // the target course has not them defined. MDL-28180 if (!$DB->record_exis...
php
public function process_course_completion_aggr_methd($data) { global $DB; $data = (object)$data; $data->course = $this->get_courseid(); // Only create the course_completion_aggr_methd records if // the target course has not them defined. MDL-28180 if (!$DB->record_exis...
[ "public", "function", "process_course_completion_aggr_methd", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "$", "data", "->", "course", "=", "$", "this", "->", "get_courseid", "(", ")", "...
Process course completion aggregate methods @global moodle_database $DB @param stdClass $data
[ "Process", "course", "completion", "aggregate", "methods" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3149-L3169
212,621
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_logstores_structure_step.define_structure
protected function define_structure() { $paths = array(); $logstore = new restore_path_element('logstore', '/logstores/logstore'); $paths[] = $logstore; // Add logstore subplugin support to the 'logstore' element. $this->add_subplugin_structure('logstore', $logstore, 'tool', '...
php
protected function define_structure() { $paths = array(); $logstore = new restore_path_element('logstore', '/logstores/logstore'); $paths[] = $logstore; // Add logstore subplugin support to the 'logstore' element. $this->add_subplugin_structure('logstore', $logstore, 'tool', '...
[ "protected", "function", "define_structure", "(", ")", "{", "$", "paths", "=", "array", "(", ")", ";", "$", "logstore", "=", "new", "restore_path_element", "(", "'logstore'", ",", "'/logstores/logstore'", ")", ";", "$", "paths", "[", "]", "=", "$", "logsto...
Return the elements to be processed on restore of logstores. @return restore_path_element[] array of elements to be processed on restore.
[ "Return", "the", "elements", "to", "be", "processed", "on", "restore", "of", "logstores", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3349-L3360
212,622
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_competencies_structure_step.process_course_competency_settings
public function process_course_competency_settings($data) { global $DB; $data = (object) $data; // We do not restore the course settings during merge. $target = $this->get_task()->get_target(); if ($target == backup::TARGET_CURRENT_ADDING || $target == backup::TARGET_EXISTING_AD...
php
public function process_course_competency_settings($data) { global $DB; $data = (object) $data; // We do not restore the course settings during merge. $target = $this->get_task()->get_target(); if ($target == backup::TARGET_CURRENT_ADDING || $target == backup::TARGET_EXISTING_AD...
[ "public", "function", "process_course_competency_settings", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "// We do not restore the course settings during merge.", "$", "target", "=", "$", "this", "...
Process a course competency settings. @param array $data The data.
[ "Process", "a", "course", "competency", "settings", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3411-L3434
212,623
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_competencies_structure_step.process_course_competency
public function process_course_competency($data) { $data = (object) $data; // Mapping the competency by ID numbers. $framework = \core_competency\competency_framework::get_record(array('idnumber' => $data->frameworkidnumber)); if (!$framework) { return; } $co...
php
public function process_course_competency($data) { $data = (object) $data; // Mapping the competency by ID numbers. $framework = \core_competency\competency_framework::get_record(array('idnumber' => $data->frameworkidnumber)); if (!$framework) { return; } $co...
[ "public", "function", "process_course_competency", "(", "$", "data", ")", "{", "$", "data", "=", "(", "object", ")", "$", "data", ";", "// Mapping the competency by ID numbers.", "$", "framework", "=", "\\", "core_competency", "\\", "competency_framework", "::", "...
Process a course competency. @param array $data The data.
[ "Process", "a", "course", "competency", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3441-L3470
212,624
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_competencies_structure_step.process_user_competency_course
public function process_user_competency_course($data) { global $USER, $DB; $data = (object) $data; $data->competencyid = $this->get_mappingid(\core_competency\competency::TABLE, $data->competencyid); if (!$data->competencyid) { // This is strange, the competency does not bel...
php
public function process_user_competency_course($data) { global $USER, $DB; $data = (object) $data; $data->competencyid = $this->get_mappingid(\core_competency\competency::TABLE, $data->competencyid); if (!$data->competencyid) { // This is strange, the competency does not bel...
[ "public", "function", "process_user_competency_course", "(", "$", "data", ")", "{", "global", "$", "USER", ",", "$", "DB", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "$", "data", "->", "competencyid", "=", "$", "this", "->", "get_mapp...
Process the user competency course. @param array $data The data.
[ "Process", "the", "user", "competency", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3477-L3505
212,625
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_activity_competencies_structure_step.process_course_module_competency
public function process_course_module_competency($data) { $data = (object) $data; // Mapping the competency by ID numbers. $framework = \core_competency\competency_framework::get_record(array('idnumber' => $data->frameworkidnumber)); if (!$framework) { return; } ...
php
public function process_course_module_competency($data) { $data = (object) $data; // Mapping the competency by ID numbers. $framework = \core_competency\competency_framework::get_record(array('idnumber' => $data->frameworkidnumber)); if (!$framework) { return; } ...
[ "public", "function", "process_course_module_competency", "(", "$", "data", ")", "{", "$", "data", "=", "(", "object", ")", "$", "data", ";", "// Mapping the competency by ID numbers.", "$", "framework", "=", "\\", "core_competency", "\\", "competency_framework", ":...
Process a course module competency. @param array $data The data.
[ "Process", "a", "course", "module", "competency", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3552-L3580
212,626
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_activity_grading_structure_step.define_structure
protected function define_structure() { $paths = array(); $userinfo = $this->get_setting_value('userinfo'); $area = new restore_path_element('grading_area', '/areas/area'); $paths[] = $area; // attach local plugin stucture to $area element $this->add_plugin_structure('l...
php
protected function define_structure() { $paths = array(); $userinfo = $this->get_setting_value('userinfo'); $area = new restore_path_element('grading_area', '/areas/area'); $paths[] = $area; // attach local plugin stucture to $area element $this->add_plugin_structure('l...
[ "protected", "function", "define_structure", "(", ")", "{", "$", "paths", "=", "array", "(", ")", ";", "$", "userinfo", "=", "$", "this", "->", "get_setting_value", "(", "'userinfo'", ")", ";", "$", "area", "=", "new", "restore_path_element", "(", "'gradin...
Declares paths in the grading.xml file we are interested in
[ "Declares", "paths", "in", "the", "grading", ".", "xml", "file", "we", "are", "interested", "in" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3632-L3659
212,627
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_activity_grading_structure_step.process_grading_area
protected function process_grading_area($data) { global $DB; $task = $this->get_task(); $data = (object)$data; $oldid = $data->id; $data->component = 'mod_'.$task->get_modulename(); $data->contextid = $task->get_contextid(); $newid = $DB->insert_record('grading_...
php
protected function process_grading_area($data) { global $DB; $task = $this->get_task(); $data = (object)$data; $oldid = $data->id; $data->component = 'mod_'.$task->get_modulename(); $data->contextid = $task->get_contextid(); $newid = $DB->insert_record('grading_...
[ "protected", "function", "process_grading_area", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "task", "=", "$", "this", "->", "get_task", "(", ")", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "$", "oldid", "=", "$", ...
Processes one grading area element @param array $data element data
[ "Processes", "one", "grading", "area", "element" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3666-L3677
212,628
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_activity_grading_structure_step.process_grading_definition
protected function process_grading_definition($data) { global $DB; $task = $this->get_task(); $data = (object)$data; $oldid = $data->id; $data->areaid = $this->get_new_parentid('grading_area'); $data->copiedfromid = null; $data->timecreated = time(); $dat...
php
protected function process_grading_definition($data) { global $DB; $task = $this->get_task(); $data = (object)$data; $oldid = $data->id; $data->areaid = $this->get_new_parentid('grading_area'); $data->copiedfromid = null; $data->timecreated = time(); $dat...
[ "protected", "function", "process_grading_definition", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "task", "=", "$", "this", "->", "get_task", "(", ")", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "$", "oldid", "=", ...
Processes one grading definition element @param array $data element data
[ "Processes", "one", "grading", "definition", "element" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3684-L3699
212,629
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_activity_grading_structure_step.process_grading_instance
protected function process_grading_instance($data) { global $DB; $data = (object)$data; // new form definition id $newformid = $this->get_new_parentid('grading_definition'); // get the name of the area we are restoring to $sql = "SELECT ga.areaname FR...
php
protected function process_grading_instance($data) { global $DB; $data = (object)$data; // new form definition id $newformid = $this->get_new_parentid('grading_definition'); // get the name of the area we are restoring to $sql = "SELECT ga.areaname FR...
[ "protected", "function", "process_grading_instance", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "=", "(", "object", ")", "$", "data", ";", "// new form definition id", "$", "newformid", "=", "$", "this", "->", "get_new_parentid", "(",...
Processes one grading form instance element @param array $data element data
[ "Processes", "one", "grading", "form", "instance", "element" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3706-L3732
212,630
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_activity_grades_structure_step.process_grade_letter
protected function process_grade_letter($data) { global $DB; $data['contextid'] = $this->task->get_contextid(); $gradeletter = (object)$data; // Check if it exists before adding it unset($data['id']); if (!$DB->record_exists('grade_letters', $data)) { $newit...
php
protected function process_grade_letter($data) { global $DB; $data['contextid'] = $this->task->get_contextid(); $gradeletter = (object)$data; // Check if it exists before adding it unset($data['id']); if (!$DB->record_exists('grade_letters', $data)) { $newit...
[ "protected", "function", "process_grade_letter", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "[", "'contextid'", "]", "=", "$", "this", "->", "task", "->", "get_contextid", "(", ")", ";", "$", "gradeletter", "=", "(", "object", "...
process activity grade_letters. Note that, while these are possible, because grade_letters are contextid based, in practice, only course context letters can be defined. So we keep here this method knowing it won't be executed ever. gradebook restore will restore course letters.
[ "process", "activity", "grade_letters", ".", "Note", "that", "while", "these", "are", "possible", "because", "grade_letters", "are", "contextid", "based", "in", "practice", "only", "course", "context", "letters", "can", "be", "defined", ".", "So", "we", "keep", ...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L3877-L3889
212,631
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_module_structure_step.after_restore
protected function after_restore() { global $DB; $contextid = $this->task->get_contextid(); $instanceid = $this->task->get_activityid(); $olditemid = $this->task->get_old_activityid(); $DB->set_field('tag_instance', 'itemid', $instanceid, array('contextid' => $contextid, 'itemi...
php
protected function after_restore() { global $DB; $contextid = $this->task->get_contextid(); $instanceid = $this->task->get_activityid(); $olditemid = $this->task->get_old_activityid(); $DB->set_field('tag_instance', 'itemid', $instanceid, array('contextid' => $contextid, 'itemi...
[ "protected", "function", "after_restore", "(", ")", "{", "global", "$", "DB", ";", "$", "contextid", "=", "$", "this", "->", "task", "->", "get_contextid", "(", ")", ";", "$", "instanceid", "=", "$", "this", "->", "task", "->", "get_activityid", "(", "...
This method will be executed after the rest of the restore has been processed. Update old tag instance itemid(s).
[ "This", "method", "will", "be", "executed", "after", "the", "rest", "of", "the", "restore", "has", "been", "processed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L4377-L4385
212,632
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_activity_structure_step.process_activity
protected function process_activity($data) { $data = (object)$data; $this->task->set_old_contextid($data->contextid); // Save old contextid in task $this->set_mapping('context', $data->contextid, $this->task->get_contextid()); // Set the mapping $this->task->set_old_activityid($data->id)...
php
protected function process_activity($data) { $data = (object)$data; $this->task->set_old_contextid($data->contextid); // Save old contextid in task $this->set_mapping('context', $data->contextid, $this->task->get_contextid()); // Set the mapping $this->task->set_old_activityid($data->id)...
[ "protected", "function", "process_activity", "(", "$", "data", ")", "{", "$", "data", "=", "(", "object", ")", "$", "data", ";", "$", "this", "->", "task", "->", "set_old_contextid", "(", "$", "data", "->", "contextid", ")", ";", "// Save old contextid in ...
Process the activity path, informing the task about various ids, needed later
[ "Process", "the", "activity", "path", "informing", "the", "task", "about", "various", "ids", "needed", "later" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L4482-L4487
212,633
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_create_question_files.define_execution
protected function define_execution() { global $DB; // Track progress, as this task can take a long time. $progress = $this->task->get_progress(); $progress->start_progress($this->get_name(), \core\progress\base::INDETERMINATE); // Parentitemids of question_createds in backup_i...
php
protected function define_execution() { global $DB; // Track progress, as this task can take a long time. $progress = $this->task->get_progress(); $progress->start_progress($this->get_name(), \core\progress\base::INDETERMINATE); // Parentitemids of question_createds in backup_i...
[ "protected", "function", "define_execution", "(", ")", "{", "global", "$", "DB", ";", "// Track progress, as this task can take a long time.", "$", "progress", "=", "$", "this", "->", "task", "->", "get_progress", "(", ")", ";", "$", "progress", "->", "start_progr...
Preform the restore_create_question_files step.
[ "Preform", "the", "restore_create_question_files", "step", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L4894-L4938
212,634
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_create_question_files.send_common_files
private function send_common_files($oldctxid, $newctxid, $progress) { // Add common question files (question and question_answer ones). restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'questiontext', $oldctxid, $this->task->get_userid(), 'ques...
php
private function send_common_files($oldctxid, $newctxid, $progress) { // Add common question files (question and question_answer ones). restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'questiontext', $oldctxid, $this->task->get_userid(), 'ques...
[ "private", "function", "send_common_files", "(", "$", "oldctxid", ",", "$", "newctxid", ",", "$", "progress", ")", "{", "// Add common question files (question and question_answer ones).", "restore_dbops", "::", "send_files_to_pool", "(", "$", "this", "->", "get_basepath"...
Send the common question files to a new context. @param int $oldctxid Old context id. @param int $newctxid New context id. @param \core\progress $progress Progress object to use.
[ "Send", "the", "common", "question", "files", "to", "a", "new", "context", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L4947-L4965
212,635
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_create_question_files.send_qtype_files
private function send_qtype_files($qtype, $oldctxid, $newctxid, $progress) { if (!isset($this->qtypecomponentscache[$qtype])) { $this->qtypecomponentscache[$qtype] = backup_qtype_plugin::get_components_and_fileareas($qtype); } $components = $this->qtypecomponentscache[$qtype]; ...
php
private function send_qtype_files($qtype, $oldctxid, $newctxid, $progress) { if (!isset($this->qtypecomponentscache[$qtype])) { $this->qtypecomponentscache[$qtype] = backup_qtype_plugin::get_components_and_fileareas($qtype); } $components = $this->qtypecomponentscache[$qtype]; ...
[ "private", "function", "send_qtype_files", "(", "$", "qtype", ",", "$", "oldctxid", ",", "$", "newctxid", ",", "$", "progress", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "qtypecomponentscache", "[", "$", "qtype", "]", ")", ")", "{", ...
Send the question type specific files to a new context. @param text $qtype The qtype name to send. @param int $oldctxid Old context id. @param int $newctxid New context id. @param \core\progress $progress Progress object to use.
[ "Send", "the", "question", "type", "specific", "files", "to", "a", "new", "context", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L4975-L4986
212,636
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_process_file_aliases_queue.choose_repository
private function choose_repository(stdClass $info) { global $DB, $CFG; require_once($CFG->dirroot.'/repository/lib.php'); if ($this->task->is_samesite()) { // We can rely on repository instance id. if (array_key_exists($info->oldfile->repositoryid, $this->cachereposbyid...
php
private function choose_repository(stdClass $info) { global $DB, $CFG; require_once($CFG->dirroot.'/repository/lib.php'); if ($this->task->is_samesite()) { // We can rely on repository instance id. if (array_key_exists($info->oldfile->repositoryid, $this->cachereposbyid...
[ "private", "function", "choose_repository", "(", "stdClass", "$", "info", ")", "{", "global", "$", "DB", ",", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/repository/lib.php'", ")", ";", "if", "(", "$", "this", "->", "task",...
Choose the repository instance that should handle the alias. At the same site, we can rely on repository instance id and we just check it still exists. On other site, try to find matching Server files or Legacy course files repository instance. Return null if no matching repository instance can be found. @param stdCl...
[ "Choose", "the", "repository", "instance", "that", "should", "handle", "the", "alias", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5165-L5224
212,637
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_process_file_aliases_queue.notify_success
private function notify_success(stdClass $info) { $filedesc = $this->describe_alias($info); $this->log('successfully restored alias', backup::LOG_DEBUG, $filedesc, 1); }
php
private function notify_success(stdClass $info) { $filedesc = $this->describe_alias($info); $this->log('successfully restored alias', backup::LOG_DEBUG, $filedesc, 1); }
[ "private", "function", "notify_success", "(", "stdClass", "$", "info", ")", "{", "$", "filedesc", "=", "$", "this", "->", "describe_alias", "(", "$", "info", ")", ";", "$", "this", "->", "log", "(", "'successfully restored alias'", ",", "backup", "::", "LO...
Let the user know that the given alias was successfully restored @param stdClass $info
[ "Let", "the", "user", "know", "that", "the", "given", "alias", "was", "successfully", "restored" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5231-L5234
212,638
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_process_file_aliases_queue.notify_failure
private function notify_failure(stdClass $info, $reason = '') { $filedesc = $this->describe_alias($info); if ($reason) { $reason = ' ('.$reason.')'; } $this->log('unable to restore alias'.$reason, backup::LOG_WARNING, $filedesc, 1); $this->add_result_item('file_aliase...
php
private function notify_failure(stdClass $info, $reason = '') { $filedesc = $this->describe_alias($info); if ($reason) { $reason = ' ('.$reason.')'; } $this->log('unable to restore alias'.$reason, backup::LOG_WARNING, $filedesc, 1); $this->add_result_item('file_aliase...
[ "private", "function", "notify_failure", "(", "stdClass", "$", "info", ",", "$", "reason", "=", "''", ")", "{", "$", "filedesc", "=", "$", "this", "->", "describe_alias", "(", "$", "info", ")", ";", "if", "(", "$", "reason", ")", "{", "$", "reason", ...
Let the user know that the given alias can't be restored @param stdClass $info @param string $reason detailed reason to be logged
[ "Let", "the", "user", "know", "that", "the", "given", "alias", "can", "t", "be", "restored" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5242-L5249
212,639
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_process_file_aliases_queue.describe_alias
private function describe_alias(stdClass $info) { $filedesc = $this->expected_alias_location($info->newfile); if (!is_null($info->oldfile->source)) { $filedesc .= ' ('.$info->oldfile->source.')'; } return $filedesc; }
php
private function describe_alias(stdClass $info) { $filedesc = $this->expected_alias_location($info->newfile); if (!is_null($info->oldfile->source)) { $filedesc .= ' ('.$info->oldfile->source.')'; } return $filedesc; }
[ "private", "function", "describe_alias", "(", "stdClass", "$", "info", ")", "{", "$", "filedesc", "=", "$", "this", "->", "expected_alias_location", "(", "$", "info", "->", "newfile", ")", ";", "if", "(", "!", "is_null", "(", "$", "info", "->", "oldfile"...
Return a human readable description of the alias file @param stdClass $info @return string
[ "Return", "a", "human", "readable", "description", "of", "the", "alias", "file" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5257-L5266
212,640
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_process_file_aliases_queue.expected_alias_location
private function expected_alias_location($filerecord) { $filedesc = '/'.$filerecord->contextid.'/'.$filerecord->component.'/'.$filerecord->filearea; if (!is_null($filerecord->itemid)) { $filedesc .= '/'.$filerecord->itemid; } $filedesc .= $filerecord->filepath.$filerecord->f...
php
private function expected_alias_location($filerecord) { $filedesc = '/'.$filerecord->contextid.'/'.$filerecord->component.'/'.$filerecord->filearea; if (!is_null($filerecord->itemid)) { $filedesc .= '/'.$filerecord->itemid; } $filedesc .= $filerecord->filepath.$filerecord->f...
[ "private", "function", "expected_alias_location", "(", "$", "filerecord", ")", "{", "$", "filedesc", "=", "'/'", ".", "$", "filerecord", "->", "contextid", ".", "'/'", ".", "$", "filerecord", "->", "component", ".", "'/'", ".", "$", "filerecord", "->", "fi...
Return the expected location of a file Please note this may and may not work as a part of URL to pluginfile.php (depends on how the given component/filearea deals with the itemid). @param stdClass $filerecord @return string
[ "Return", "the", "expected", "location", "of", "a", "file" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5277-L5286
212,641
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_process_file_aliases_queue.add_result_item
private function add_result_item($name, $value) { $results = $this->task->get_results(); if (isset($results[$name])) { if (!is_array($results[$name])) { throw new coding_exception('Unable to append a result item into a non-array structure.'); } $curr...
php
private function add_result_item($name, $value) { $results = $this->task->get_results(); if (isset($results[$name])) { if (!is_array($results[$name])) { throw new coding_exception('Unable to append a result item into a non-array structure.'); } $curr...
[ "private", "function", "add_result_item", "(", "$", "name", ",", "$", "value", ")", "{", "$", "results", "=", "$", "this", "->", "task", "->", "get_results", "(", ")", ";", "if", "(", "isset", "(", "$", "results", "[", "$", "name", "]", ")", ")", ...
Append a value to the given resultset @param string $name name of the result containing a list of values @param mixed $value value to add as another item in that result
[ "Append", "a", "value", "to", "the", "given", "resultset" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5294-L5309
212,642
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_questions_activity_structure_step.questions_recode_response_data
public function questions_recode_response_data( $qtype, $newquestionid, $sequencenumber, array $response) { $qtyperestorer = $this->get_qtype_restorer($qtype); if ($qtyperestorer) { $response = $qtyperestorer->recode_response($newquestionid, $sequencenumber, $response); }...
php
public function questions_recode_response_data( $qtype, $newquestionid, $sequencenumber, array $response) { $qtyperestorer = $this->get_qtype_restorer($qtype); if ($qtyperestorer) { $response = $qtyperestorer->recode_response($newquestionid, $sequencenumber, $response); }...
[ "public", "function", "questions_recode_response_data", "(", "$", "qtype", ",", "$", "newquestionid", ",", "$", "sequencenumber", ",", "array", "$", "response", ")", "{", "$", "qtyperestorer", "=", "$", "this", "->", "get_qtype_restorer", "(", "$", "qtype", ")...
Recode the respones data for a particular step of an attempt at at particular question. @param string $qtype the question type. @param int $newquestionid the question id. @param int $sequencenumber the sequence number. @param array $response the response data to recode.
[ "Recode", "the", "respones", "data", "for", "a", "particular", "step", "of", "an", "attempt", "at", "at", "particular", "question", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5502-L5509
212,643
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_questions_activity_structure_step.get_qtype_restorer
protected function get_qtype_restorer($qtype) { // Build one static cache to store {@link restore_qtype_plugin} // while we are needing them, just to save zillions of instantiations // or using static stuff that will break our nice API static $qtypeplugins = array(); if (!isset(...
php
protected function get_qtype_restorer($qtype) { // Build one static cache to store {@link restore_qtype_plugin} // while we are needing them, just to save zillions of instantiations // or using static stuff that will break our nice API static $qtypeplugins = array(); if (!isset(...
[ "protected", "function", "get_qtype_restorer", "(", "$", "qtype", ")", "{", "// Build one static cache to store {@link restore_qtype_plugin}", "// while we are needing them, just to save zillions of instantiations", "// or using static stuff that will break our nice API", "static", "$", "q...
Get the restore_qtype_plugin subclass for a specific question type. @param string $qtype e.g. multichoice. @return restore_qtype_plugin instance.
[ "Get", "the", "restore_qtype_plugin", "subclass", "for", "a", "specific", "question", "type", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5535-L5550
212,644
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_questions_activity_structure_step.recode_legacy_response_data
protected function recode_legacy_response_data($question, $qsession, $qstates) { $qsession->questionid = $question->id; foreach ($qstates as &$state) { $state->question = $question->id; $state->answer = $this->restore_recode_legacy_answer($state, $question->qtype); } ...
php
protected function recode_legacy_response_data($question, $qsession, $qstates) { $qsession->questionid = $question->id; foreach ($qstates as &$state) { $state->question = $question->id; $state->answer = $this->restore_recode_legacy_answer($state, $question->qtype); } ...
[ "protected", "function", "recode_legacy_response_data", "(", "$", "question", ",", "$", "qsession", ",", "$", "qstates", ")", "{", "$", "qsession", "->", "questionid", "=", "$", "question", "->", "id", ";", "foreach", "(", "$", "qstates", "as", "&", "$", ...
Recode any ids in the response data @param object $question the question data @param object $qsession the question sessions. @param array $qstates the question states.
[ "Recode", "any", "ids", "in", "the", "response", "data" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5699-L5708
212,645
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_questions_activity_structure_step.restore_recode_legacy_answer
public function restore_recode_legacy_answer($state, $qtype) { $restorer = $this->get_qtype_restorer($qtype); if ($restorer) { return $restorer->recode_legacy_state_answer($state); } else { return $state->answer; } }
php
public function restore_recode_legacy_answer($state, $qtype) { $restorer = $this->get_qtype_restorer($qtype); if ($restorer) { return $restorer->recode_legacy_state_answer($state); } else { return $state->answer; } }
[ "public", "function", "restore_recode_legacy_answer", "(", "$", "state", ",", "$", "qtype", ")", "{", "$", "restorer", "=", "$", "this", "->", "get_qtype_restorer", "(", "$", "qtype", ")", ";", "if", "(", "$", "restorer", ")", "{", "return", "$", "restor...
Recode the legacy answer field. @param object $state the state to recode the answer of. @param string $qtype the question type.
[ "Recode", "the", "legacy", "answer", "field", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5715-L5722
212,646
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_completion_defaults_structure_step.process_completion_defaults
protected function process_completion_defaults($data) { global $DB; $data = (array)$data; $oldid = $data['id']; unset($data['id']); // Find the module by name since id may be different in another site. if (!$mod = $DB->get_record('modules', ['name' => $data['modulename'...
php
protected function process_completion_defaults($data) { global $DB; $data = (array)$data; $oldid = $data['id']; unset($data['id']); // Find the module by name since id may be different in another site. if (!$mod = $DB->get_record('modules', ['name' => $data['modulename'...
[ "protected", "function", "process_completion_defaults", "(", "$", "data", ")", "{", "global", "$", "DB", ";", "$", "data", "=", "(", "array", ")", "$", "data", ";", "$", "oldid", "=", "$", "data", "[", "'id'", "]", ";", "unset", "(", "$", "data", "...
Processor for path element 'completion_defaults' @param stdClass|array $data
[ "Processor", "for", "path", "element", "completion_defaults" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5767-L5792
212,647
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_course_search_index.define_execution
protected function define_execution() { $context = \context_course::instance($this->task->get_courseid()); \core_search\manager::request_index($context); }
php
protected function define_execution() { $context = \context_course::instance($this->task->get_courseid()); \core_search\manager::request_index($context); }
[ "protected", "function", "define_execution", "(", ")", "{", "$", "context", "=", "\\", "context_course", "::", "instance", "(", "$", "this", "->", "task", "->", "get_courseid", "(", ")", ")", ";", "\\", "core_search", "\\", "manager", "::", "request_index", ...
When this step is executed, we add the course context to the queue for reindexing.
[ "When", "this", "step", "is", "executed", "we", "add", "the", "course", "context", "to", "the", "queue", "for", "reindexing", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5806-L5809
212,648
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_activity_search_index.define_execution
protected function define_execution() { $context = \context::instance_by_id($this->task->get_contextid()); \core_search\manager::request_index($context); }
php
protected function define_execution() { $context = \context::instance_by_id($this->task->get_contextid()); \core_search\manager::request_index($context); }
[ "protected", "function", "define_execution", "(", ")", "{", "$", "context", "=", "\\", "context", "::", "instance_by_id", "(", "$", "this", "->", "task", "->", "get_contextid", "(", ")", ")", ";", "\\", "core_search", "\\", "manager", "::", "request_index", ...
When this step is executed, we add the activity context to the queue for reindexing.
[ "When", "this", "step", "is", "executed", "we", "add", "the", "activity", "context", "to", "the", "queue", "for", "reindexing", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5823-L5826
212,649
moodle/moodle
backup/moodle2/restore_stepslib.php
restore_block_search_index.define_execution
protected function define_execution() { // A block in the restore list may be skipped because a duplicate is detected. // In this case, there is no new blockid (or context) to get. if (!empty($this->task->get_blockid())) { $context = \context_block::instance($this->task->get_blockid(...
php
protected function define_execution() { // A block in the restore list may be skipped because a duplicate is detected. // In this case, there is no new blockid (or context) to get. if (!empty($this->task->get_blockid())) { $context = \context_block::instance($this->task->get_blockid(...
[ "protected", "function", "define_execution", "(", ")", "{", "// A block in the restore list may be skipped because a duplicate is detected.", "// In this case, there is no new blockid (or context) to get.", "if", "(", "!", "empty", "(", "$", "this", "->", "task", "->", "get_block...
When this step is executed, we add the block context to the queue for reindexing.
[ "When", "this", "step", "is", "executed", "we", "add", "the", "block", "context", "to", "the", "queue", "for", "reindexing", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_stepslib.php#L5840-L5847
212,650
moodle/moodle
cache/stores/static/lib.php
static_data_store.flush_store
protected static function flush_store() { $ids = array_keys(self::$staticstore); unset(self::$staticstore); self::$staticstore = array(); foreach ($ids as $id) { self::$staticstore[$id] = array(); } }
php
protected static function flush_store() { $ids = array_keys(self::$staticstore); unset(self::$staticstore); self::$staticstore = array(); foreach ($ids as $id) { self::$staticstore[$id] = array(); } }
[ "protected", "static", "function", "flush_store", "(", ")", "{", "$", "ids", "=", "array_keys", "(", "self", "::", "$", "staticstore", ")", ";", "unset", "(", "self", "::", "$", "staticstore", ")", ";", "self", "::", "$", "staticstore", "=", "array", "...
Flushes all of the values from all stores. @copyright 2012 Sam Hemelryk @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
[ "Flushes", "all", "of", "the", "values", "from", "all", "stores", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/static/lib.php#L73-L80
212,651
moodle/moodle
cache/stores/static/lib.php
cachestore_static.has_all
public function has_all(array $keys) { foreach ($keys as $key) { if (!is_array($key)) { $key = array('key' => $key); } $key = $key['key']; if (!isset($this->store[$key])) { return false; } } return true; ...
php
public function has_all(array $keys) { foreach ($keys as $key) { if (!is_array($key)) { $key = array('key' => $key); } $key = $key['key']; if (!isset($this->store[$key])) { return false; } } return true; ...
[ "public", "function", "has_all", "(", "array", "$", "keys", ")", "{", "foreach", "(", "$", "keys", "as", "$", "key", ")", "{", "if", "(", "!", "is_array", "(", "$", "key", ")", ")", "{", "$", "key", "=", "array", "(", "'key'", "=>", "$", "key",...
Returns true if the store contains records for all of the given keys. @param array $keys @return bool
[ "Returns", "true", "if", "the", "store", "contains", "records", "for", "all", "of", "the", "given", "keys", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/static/lib.php#L397-L408
212,652
moodle/moodle
cache/stores/static/lib.php
cachestore_static.reduce_for_maxsize
protected function reduce_for_maxsize() { $diff = $this->storecount - $this->maxsize; if ($diff < 1) { return 0; } // Reduce it by an extra 10% to avoid calling this repetitively if we are in a loop. $diff += floor($this->maxsize / 10); $this->store = array_sl...
php
protected function reduce_for_maxsize() { $diff = $this->storecount - $this->maxsize; if ($diff < 1) { return 0; } // Reduce it by an extra 10% to avoid calling this repetitively if we are in a loop. $diff += floor($this->maxsize / 10); $this->store = array_sl...
[ "protected", "function", "reduce_for_maxsize", "(", ")", "{", "$", "diff", "=", "$", "this", "->", "storecount", "-", "$", "this", "->", "maxsize", ";", "if", "(", "$", "diff", "<", "1", ")", "{", "return", "0", ";", "}", "// Reduce it by an extra 10% to...
Reduces the size of the array if maxsize has been hit. This function reduces the size of the store reducing it by 10% of its maxsize. It removes the oldest items in the store when doing this. The reason it does this an doesn't use a least recently used system is purely the overhead such a system requires. The current ...
[ "Reduces", "the", "size", "of", "the", "array", "if", "maxsize", "has", "been", "hit", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/static/lib.php#L497-L507
212,653
moodle/moodle
lib/classes/event/user_graded.php
user_graded.get_legacy_logdata
public function get_legacy_logdata() { $user = $this->get_record_snapshot('user', $this->relateduserid); $fullname = fullname($user); $info = $this->grade->grade_item->itemname . ': ' . $fullname; $url = '/report/grader/index.php?id=' . $this->courseid; return array($this->cours...
php
public function get_legacy_logdata() { $user = $this->get_record_snapshot('user', $this->relateduserid); $fullname = fullname($user); $info = $this->grade->grade_item->itemname . ': ' . $fullname; $url = '/report/grader/index.php?id=' . $this->courseid; return array($this->cours...
[ "public", "function", "get_legacy_logdata", "(", ")", "{", "$", "user", "=", "$", "this", "->", "get_record_snapshot", "(", "'user'", ",", "$", "this", "->", "relateduserid", ")", ";", "$", "fullname", "=", "fullname", "(", "$", "user", ")", ";", "$", ...
Return legacy log info. @return null|array of parameters to be passed to legacy add_to_log() function.
[ "Return", "legacy", "log", "info", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/user_graded.php#L139-L146
212,654
moodle/moodle
lib/xhprof/xhprof_moodle.php
moodle_xhprofrun.get_run
public function get_run($run_id, $type, &$run_desc) { global $DB; $rec = $DB->get_record('profiling', array('runid' => $run_id), '*', MUST_EXIST); $this->runid = $rec->runid; $this->url = $rec->url; $this->totalexecutiontime = $rec->totalexecutiontime; $this->totalcputi...
php
public function get_run($run_id, $type, &$run_desc) { global $DB; $rec = $DB->get_record('profiling', array('runid' => $run_id), '*', MUST_EXIST); $this->runid = $rec->runid; $this->url = $rec->url; $this->totalexecutiontime = $rec->totalexecutiontime; $this->totalcputi...
[ "public", "function", "get_run", "(", "$", "run_id", ",", "$", "type", ",", "&", "$", "run_desc", ")", "{", "global", "$", "DB", ";", "$", "rec", "=", "$", "DB", "->", "get_record", "(", "'profiling'", ",", "array", "(", "'runid'", "=>", "$", "run_...
Given one runid and one type, return the run data and some extra info in run_desc from DB Note that $type is completely ignored
[ "Given", "one", "runid", "and", "one", "type", "return", "the", "run", "data", "and", "some", "extra", "info", "in", "run_desc", "from", "DB" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xhprof/xhprof_moodle.php#L868-L889
212,655
moodle/moodle
lib/xhprof/xhprof_moodle.php
moodle_xhprofrun.save_run
public function save_run($xhprof_data, $type, $run_id = null) { global $DB, $CFG; if (is_null($this->url)) { xhprof_error("Warning: You must use the prepare_run() method before saving it"); } // Calculate runid if needed $this->runid = is_null($run_id) ? md5($this->...
php
public function save_run($xhprof_data, $type, $run_id = null) { global $DB, $CFG; if (is_null($this->url)) { xhprof_error("Warning: You must use the prepare_run() method before saving it"); } // Calculate runid if needed $this->runid = is_null($run_id) ? md5($this->...
[ "public", "function", "save_run", "(", "$", "xhprof_data", ",", "$", "type", ",", "$", "run_id", "=", "null", ")", "{", "global", "$", "DB", ",", "$", "CFG", ";", "if", "(", "is_null", "(", "$", "this", "->", "url", ")", ")", "{", "xhprof_error", ...
Given some run data, one type and, optionally, one runid store the information in DB Note that $type is completely ignored
[ "Given", "some", "run", "data", "one", "type", "and", "optionally", "one", "runid", "store", "the", "information", "in", "DB" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xhprof/xhprof_moodle.php#L897-L956
212,656
moodle/moodle
lib/xhprof/xhprof_moodle.php
xhprof_table_sql.col_url
protected function col_url($row) { global $OUTPUT; // Build the link to latest run for the script $scripturl = new moodle_url('/admin/tool/profiling/index.php', array('script' => $row->url, 'listurl' => $row->url)); $scriptaction = $OUTPUT->action_link($scripturl, $row->url); /...
php
protected function col_url($row) { global $OUTPUT; // Build the link to latest run for the script $scripturl = new moodle_url('/admin/tool/profiling/index.php', array('script' => $row->url, 'listurl' => $row->url)); $scriptaction = $OUTPUT->action_link($scripturl, $row->url); /...
[ "protected", "function", "col_url", "(", "$", "row", ")", "{", "global", "$", "OUTPUT", ";", "// Build the link to latest run for the script", "$", "scripturl", "=", "new", "moodle_url", "(", "'/admin/tool/profiling/index.php'", ",", "array", "(", "'script'", "=>", ...
Format URL, so it points to last run for that url
[ "Format", "URL", "so", "it", "points", "to", "last", "run", "for", "that", "url" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xhprof/xhprof_moodle.php#L996-L1014
212,657
moodle/moodle
lib/xhprof/xhprof_moodle.php
xhprof_table_sql.col_timecreated
protected function col_timecreated($row) { global $OUTPUT; $fdate = userdate($row->timecreated, '%d %b %Y, %H:%M'); $url = new moodle_url('/admin/tool/profiling/index.php', array('runid' => $row->runid, 'listurl' => $row->url)); return $OUTPUT->action_link($url, $fdate); }
php
protected function col_timecreated($row) { global $OUTPUT; $fdate = userdate($row->timecreated, '%d %b %Y, %H:%M'); $url = new moodle_url('/admin/tool/profiling/index.php', array('runid' => $row->runid, 'listurl' => $row->url)); return $OUTPUT->action_link($url, $fdate); }
[ "protected", "function", "col_timecreated", "(", "$", "row", ")", "{", "global", "$", "OUTPUT", ";", "$", "fdate", "=", "userdate", "(", "$", "row", "->", "timecreated", ",", "'%d %b %Y, %H:%M'", ")", ";", "$", "url", "=", "new", "moodle_url", "(", "'/ad...
Format profiling date, human and pointing to run
[ "Format", "profiling", "date", "human", "and", "pointing", "to", "run" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xhprof/xhprof_moodle.php#L1019-L1024
212,658
moodle/moodle
course/classes/search/course.php
course.get_document
public function get_document($record, $options = array()) { try { $context = \context_course::instance($record->id); } catch (\moodle_exception $ex) { // Notify it as we run here as admin, we should see everything. debugging('Error retrieving ' . $this->areaid . ' ' ....
php
public function get_document($record, $options = array()) { try { $context = \context_course::instance($record->id); } catch (\moodle_exception $ex) { // Notify it as we run here as admin, we should see everything. debugging('Error retrieving ' . $this->areaid . ' ' ....
[ "public", "function", "get_document", "(", "$", "record", ",", "$", "options", "=", "array", "(", ")", ")", "{", "try", "{", "$", "context", "=", "\\", "context_course", "::", "instance", "(", "$", "record", "->", "id", ")", ";", "}", "catch", "(", ...
Returns the document associated with this course. @param stdClass $record @param array $options @return \core_search\document
[ "Returns", "the", "document", "associated", "with", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/classes/search/course.php#L75-L101
212,659
moodle/moodle
lib/phpexcel/PHPExcel/Style.php
PHPExcel_Style.setConditionalStyles
public function setConditionalStyles($pValue = null) { if (is_array($pValue)) { $this->getActiveSheet()->setConditionalStyles($this->getSelectedCells(), $pValue); } return $this; }
php
public function setConditionalStyles($pValue = null) { if (is_array($pValue)) { $this->getActiveSheet()->setConditionalStyles($this->getSelectedCells(), $pValue); } return $this; }
[ "public", "function", "setConditionalStyles", "(", "$", "pValue", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "pValue", ")", ")", "{", "$", "this", "->", "getActiveSheet", "(", ")", "->", "setConditionalStyles", "(", "$", "this", "->", "getSe...
Set Conditional Styles. Only used on supervisor. @param PHPExcel_Style_Conditional[] $pValue Array of condtional styles @return PHPExcel_Style
[ "Set", "Conditional", "Styles", ".", "Only", "used", "on", "supervisor", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Style.php#L550-L556
212,660
moodle/moodle
calendar/lib.php
calendar_event.calculate_context
protected function calculate_context() { global $USER, $DB; $context = null; if (isset($this->properties->categoryid) && $this->properties->categoryid > 0) { $context = \context_coursecat::instance($this->properties->categoryid); } else if (isset($this->properties->courseid)...
php
protected function calculate_context() { global $USER, $DB; $context = null; if (isset($this->properties->categoryid) && $this->properties->categoryid > 0) { $context = \context_coursecat::instance($this->properties->categoryid); } else if (isset($this->properties->courseid)...
[ "protected", "function", "calculate_context", "(", ")", "{", "global", "$", "USER", ",", "$", "DB", ";", "$", "context", "=", "null", ";", "if", "(", "isset", "(", "$", "this", "->", "properties", "->", "categoryid", ")", "&&", "$", "this", "->", "pr...
Calculate the context value needed for an event. Event's type can be determine by the available value store in $data It is important to check for the existence of course/courseid to determine the course event. Default value is set to CONTEXT_USER @return \stdClass The context object.
[ "Calculate", "the", "context", "value", "needed", "for", "an", "event", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L311-L338
212,661
moodle/moodle
calendar/lib.php
calendar_event.get_context
protected function get_context() { if (!isset($this->properties->context)) { $this->properties->context = $this->calculate_context(); } return $this->properties->context; }
php
protected function get_context() { if (!isset($this->properties->context)) { $this->properties->context = $this->calculate_context(); } return $this->properties->context; }
[ "protected", "function", "get_context", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "properties", "->", "context", ")", ")", "{", "$", "this", "->", "properties", "->", "context", "=", "$", "this", "->", "calculate_context", "(", ")...
Returns the context for this event. The context is calculated the first time is is requested and then stored in a member variable to be returned each subsequent time. This is a magical getter function that will be called when ever the context property is accessed, e.g. $event->context. @return context
[ "Returns", "the", "context", "for", "this", "event", ".", "The", "context", "is", "calculated", "the", "first", "time", "is", "is", "requested", "and", "then", "stored", "in", "a", "member", "variable", "to", "be", "returned", "each", "subsequent", "time", ...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L350-L356
212,662
moodle/moodle
calendar/lib.php
calendar_event.count_repeats
public function count_repeats() { global $DB; if (!empty($this->properties->repeatid)) { $this->properties->eventrepeats = $DB->count_records('event', array('repeatid' => $this->properties->repeatid)); // We don't want to count ourselves. $this->proper...
php
public function count_repeats() { global $DB; if (!empty($this->properties->repeatid)) { $this->properties->eventrepeats = $DB->count_records('event', array('repeatid' => $this->properties->repeatid)); // We don't want to count ourselves. $this->proper...
[ "public", "function", "count_repeats", "(", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "properties", "->", "repeatid", ")", ")", "{", "$", "this", "->", "properties", "->", "eventrepeats", "=", "$", "DB", "->...
Return the number of repeat events there are in this events series. @return int number of event repeated
[ "Return", "the", "number", "of", "repeat", "events", "there", "are", "in", "this", "events", "series", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L412-L421
212,663
moodle/moodle
calendar/lib.php
calendar_event.properties
public function properties($prepareeditor = false) { global $DB; // First take a copy of the properties. We don't want to actually change the // properties or we'd forever be converting back and forwards between an // editor formatted description and not. $properties = clone($th...
php
public function properties($prepareeditor = false) { global $DB; // First take a copy of the properties. We don't want to actually change the // properties or we'd forever be converting back and forwards between an // editor formatted description and not. $properties = clone($th...
[ "public", "function", "properties", "(", "$", "prepareeditor", "=", "false", ")", "{", "global", "$", "DB", ";", "// First take a copy of the properties. We don't want to actually change the", "// properties or we'd forever be converting back and forwards between an", "// editor form...
Fetch all event properties. This function returns all of the events properties as an object and optionally can prepare an editor for the description field at the same time. This is designed to work when the properties are going to be used to set the default values of a moodle forms form. @param bool $prepareeditor If...
[ "Fetch", "all", "event", "properties", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L773-L853
212,664
moodle/moodle
calendar/lib.php
calendar_event.toggle_visibility
public function toggle_visibility($force = null) { global $DB; // Set visible to the default if it is not already set. if (empty($this->properties->visible)) { $this->properties->visible = 1; } if ($force === true || ($force !== false && $this->properties->visible =...
php
public function toggle_visibility($force = null) { global $DB; // Set visible to the default if it is not already set. if (empty($this->properties->visible)) { $this->properties->visible = 1; } if ($force === true || ($force !== false && $this->properties->visible =...
[ "public", "function", "toggle_visibility", "(", "$", "force", "=", "null", ")", "{", "global", "$", "DB", ";", "// Set visible to the default if it is not already set.", "if", "(", "empty", "(", "$", "this", "->", "properties", "->", "visible", ")", ")", "{", ...
Toggles the visibility of an event @param null|bool $force If it is left null the events visibility is flipped, If it is false the event is made hidden, if it is true it is made visible. @return bool if event is successfully updated, toggle will be visible
[ "Toggles", "the", "visibility", "of", "an", "event" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L863-L898
212,665
moodle/moodle
calendar/lib.php
calendar_event.load
public static function load($param) { global $DB; if (is_object($param)) { $event = new calendar_event($param); } else { $event = $DB->get_record('event', array('id' => (int)$param), '*', MUST_EXIST); $event = new calendar_event($event); } retu...
php
public static function load($param) { global $DB; if (is_object($param)) { $event = new calendar_event($param); } else { $event = $DB->get_record('event', array('id' => (int)$param), '*', MUST_EXIST); $event = new calendar_event($event); } retu...
[ "public", "static", "function", "load", "(", "$", "param", ")", "{", "global", "$", "DB", ";", "if", "(", "is_object", "(", "$", "param", ")", ")", "{", "$", "event", "=", "new", "calendar_event", "(", "$", "param", ")", ";", "}", "else", "{", "$...
Returns an event object when provided with an event id. This function makes use of MUST_EXIST, if the event id passed in is invalid it will result in an exception being thrown. @param int|object $param event object or event id @return calendar_event
[ "Returns", "an", "event", "object", "when", "provided", "with", "an", "event", "id", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L909-L918
212,666
moodle/moodle
calendar/lib.php
calendar_event.create
public static function create($properties, $checkcapability = true) { if (is_array($properties)) { $properties = (object)$properties; } if (!is_object($properties)) { throw new \coding_exception('When creating an event properties should be either an object or an assoc arr...
php
public static function create($properties, $checkcapability = true) { if (is_array($properties)) { $properties = (object)$properties; } if (!is_object($properties)) { throw new \coding_exception('When creating an event properties should be either an object or an assoc arr...
[ "public", "static", "function", "create", "(", "$", "properties", ",", "$", "checkcapability", "=", "true", ")", "{", "if", "(", "is_array", "(", "$", "properties", ")", ")", "{", "$", "properties", "=", "(", "object", ")", "$", "properties", ";", "}",...
Creates a new event and returns an event object. Capability checking should be performed if the user is directly creating the event and no other capability has been tested. However if the event is not being created directly by the user and another capability has been checked for them to do this then capabilites should...
[ "Creates", "a", "new", "event", "and", "returns", "an", "event", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L938-L951
212,667
moodle/moodle
calendar/lib.php
calendar_event.format_external_text
public function format_external_text() { if ($this->editorcontext === null) { // Switch on the event type to decide upon the appropriate context to use for this event. $this->editorcontext = $this->get_context(); if (!calendar_is_valid_eventtype($this->properties->eventtype...
php
public function format_external_text() { if ($this->editorcontext === null) { // Switch on the event type to decide upon the appropriate context to use for this event. $this->editorcontext = $this->get_context(); if (!calendar_is_valid_eventtype($this->properties->eventtype...
[ "public", "function", "format_external_text", "(", ")", "{", "if", "(", "$", "this", "->", "editorcontext", "===", "null", ")", "{", "// Switch on the event type to decide upon the appropriate context to use for this event.", "$", "this", "->", "editorcontext", "=", "$", ...
Format the text using the external API. This function should we used when text formatting is required in external functions. @return array an array containing the text formatted and the text format
[ "Format", "the", "text", "using", "the", "external", "API", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L960-L981
212,668
moodle/moodle
calendar/lib.php
calendar_information.create
public static function create($time, int $courseid, int $categoryid = null) : calendar_information { $calendar = new static(0, 0, 0, $time); if ($courseid != SITEID && !empty($courseid)) { // Course ID must be valid and existing. $course = get_course($courseid); $cale...
php
public static function create($time, int $courseid, int $categoryid = null) : calendar_information { $calendar = new static(0, 0, 0, $time); if ($courseid != SITEID && !empty($courseid)) { // Course ID must be valid and existing. $course = get_course($courseid); $cale...
[ "public", "static", "function", "create", "(", "$", "time", ",", "int", "$", "courseid", ",", "int", "$", "categoryid", "=", "null", ")", ":", "calendar_information", "{", "$", "calendar", "=", "new", "static", "(", "0", ",", "0", ",", "0", ",", "$",...
Creates and set up a instance. @param int $time the unixtimestamp representing the date we want to view. @param int $courseid The ID of the course the user wishes to view. @param int $categoryid The ID of the category the user wishes to view If a course...
[ "Creates", "and", "set", "up", "a", "instance", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L1069-L1107
212,669
moodle/moodle
calendar/lib.php
calendar_information.set_time
public function set_time($time = null) { if (empty($time)) { $this->time = time(); } else { $this->time = $time; } return $this; }
php
public function set_time($time = null) { if (empty($time)) { $this->time = time(); } else { $this->time = $time; } return $this; }
[ "public", "function", "set_time", "(", "$", "time", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "time", ")", ")", "{", "$", "this", "->", "time", "=", "time", "(", ")", ";", "}", "else", "{", "$", "this", "->", "time", "=", "$", "tim...
Set the time period of this instance. @param int $time the unixtimestamp representing the date we want to view. @return $this
[ "Set", "the", "time", "period", "of", "this", "instance", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L1115-L1123
212,670
moodle/moodle
calendar/lib.php
calendar_information.prepare_for_view
public function prepare_for_view(stdClass $course, array $coursestoload, $ignorefilters = false) { debugging('The prepare_for_view() function has been deprecated. Please update your code to use set_sources()', DEBUG_DEVELOPER); $this->set_sources($course, $coursestoload); }
php
public function prepare_for_view(stdClass $course, array $coursestoload, $ignorefilters = false) { debugging('The prepare_for_view() function has been deprecated. Please update your code to use set_sources()', DEBUG_DEVELOPER); $this->set_sources($course, $coursestoload); }
[ "public", "function", "prepare_for_view", "(", "stdClass", "$", "course", ",", "array", "$", "coursestoload", ",", "$", "ignorefilters", "=", "false", ")", "{", "debugging", "(", "'The prepare_for_view() function has been deprecated. Please update your code to use set_sources...
Initialize calendar information @deprecated 3.4 @param stdClass $course object @param array $coursestoload An array of courses [$course->id => $course] @param bool $ignorefilters options to use filter
[ "Initialize", "calendar", "information" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L1133-L1137
212,671
moodle/moodle
calendar/lib.php
calendar_information.set_sources
public function set_sources(stdClass $course, array $courses, stdClass $category = null) { global $USER; // A cousre must always be specified. $this->course = $course; $this->courseid = $course->id; list($courseids, $group, $user) = calendar_set_filters($courses); $this...
php
public function set_sources(stdClass $course, array $courses, stdClass $category = null) { global $USER; // A cousre must always be specified. $this->course = $course; $this->courseid = $course->id; list($courseids, $group, $user) = calendar_set_filters($courses); $this...
[ "public", "function", "set_sources", "(", "stdClass", "$", "course", ",", "array", "$", "courses", ",", "stdClass", "$", "category", "=", "null", ")", "{", "global", "$", "USER", ";", "// A cousre must always be specified.", "$", "this", "->", "course", "=", ...
Set the sources for events within the calendar. If no category is provided, then the category path for the current course will be used. @param stdClass $course The current course being viewed. @param stdClass[] $courses The list of all courses currently accessible. @param stdClass $category The current c...
[ "Set", "the", "sources", "for", "events", "within", "the", "calendar", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L1149-L1217
212,672
moodle/moodle
calendar/lib.php
calendar_information.checkdate
public function checkdate($defaultonow = true) { if (!checkdate($this->month, $this->day, $this->year)) { if ($defaultonow) { $now = usergetdate(time()); $this->day = intval($now['mday']); $this->month = intval($now['mon']); $this->year...
php
public function checkdate($defaultonow = true) { if (!checkdate($this->month, $this->day, $this->year)) { if ($defaultonow) { $now = usergetdate(time()); $this->day = intval($now['mday']); $this->month = intval($now['mon']); $this->year...
[ "public", "function", "checkdate", "(", "$", "defaultonow", "=", "true", ")", "{", "if", "(", "!", "checkdate", "(", "$", "this", "->", "month", ",", "$", "this", "->", "day", ",", "$", "this", "->", "year", ")", ")", "{", "if", "(", "$", "defaul...
Ensures the date for the calendar is correct and either sets it to now or throws a moodle_exception if not @param bool $defaultonow use current time @throws moodle_exception @return bool validation of checkdate
[ "Ensures", "the", "date", "for", "the", "calendar", "is", "correct", "and", "either", "sets", "it", "to", "now", "or", "throws", "a", "moodle_exception", "if", "not" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L1227-L1240
212,673
moodle/moodle
calendar/lib.php
calendar_information.add_sidecalendar_blocks
public function add_sidecalendar_blocks(core_calendar_renderer $renderer, $showfilters=false, $view=null) { if ($showfilters) { $filters = new block_contents(); $filters->content = $renderer->event_filter(); $filters->footer = ''; $filters->title = get_string('eve...
php
public function add_sidecalendar_blocks(core_calendar_renderer $renderer, $showfilters=false, $view=null) { if ($showfilters) { $filters = new block_contents(); $filters->content = $renderer->event_filter(); $filters->footer = ''; $filters->title = get_string('eve...
[ "public", "function", "add_sidecalendar_blocks", "(", "core_calendar_renderer", "$", "renderer", ",", "$", "showfilters", "=", "false", ",", "$", "view", "=", "null", ")", "{", "if", "(", "$", "showfilters", ")", "{", "$", "filters", "=", "new", "block_conte...
Adds the pretend blocks for the calendar @param core_calendar_renderer $renderer @param bool $showfilters display filters, false is set as default @param string|null $view preference view options (eg: day, month, upcoming)
[ "Adds", "the", "pretend", "blocks", "for", "the", "calendar" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/lib.php#L1265-L1278
212,674
moodle/moodle
lib/phpexcel/PHPExcel/Writer/OpenDocument/Meta.php
PHPExcel_Writer_OpenDocument_Meta.write
public function write(PHPExcel $pPHPExcel = null) { if (!$pPHPExcel) { $pPHPExcel = $this->getParentWriter()->getPHPExcel(); } $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_X...
php
public function write(PHPExcel $pPHPExcel = null) { if (!$pPHPExcel) { $pPHPExcel = $this->getParentWriter()->getPHPExcel(); } $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_X...
[ "public", "function", "write", "(", "PHPExcel", "$", "pPHPExcel", "=", "null", ")", "{", "if", "(", "!", "$", "pPHPExcel", ")", "{", "$", "pPHPExcel", "=", "$", "this", "->", "getParentWriter", "(", ")", "->", "getPHPExcel", "(", ")", ";", "}", "$", ...
Write meta.xml to XML format @param PHPExcel $pPHPExcel @return string XML Output @throws PHPExcel_Writer_Exception
[ "Write", "meta", ".", "xml", "to", "XML", "format" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/OpenDocument/Meta.php#L37-L94
212,675
moodle/moodle
blocks/admin_bookmarks/block_admin_bookmarks.php
block_admin_bookmarks.init
function init() { $this->blockname = get_class($this); $this->title = get_string('pluginname', $this->blockname); }
php
function init() { $this->blockname = get_class($this); $this->title = get_string('pluginname', $this->blockname); }
[ "function", "init", "(", ")", "{", "$", "this", "->", "blockname", "=", "get_class", "(", "$", "this", ")", ";", "$", "this", "->", "title", "=", "get_string", "(", "'pluginname'", ",", "$", "this", "->", "blockname", ")", ";", "}" ]
Set the initial properties for the block
[ "Set", "the", "initial", "properties", "for", "the", "block" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/admin_bookmarks/block_admin_bookmarks.php#L44-L47
212,676
moodle/moodle
badges/lib/awardlib.php
badge_potential_users_selector.find_users
public function find_users($search) { global $DB; $whereconditions = array(); list($wherecondition, $params) = $this->search_sql($search, 'u'); if ($wherecondition) { $whereconditions[] = $wherecondition; } $existingids = array(); foreach ($this->exi...
php
public function find_users($search) { global $DB; $whereconditions = array(); list($wherecondition, $params) = $this->search_sql($search, 'u'); if ($wherecondition) { $whereconditions[] = $wherecondition; } $existingids = array(); foreach ($this->exi...
[ "public", "function", "find_users", "(", "$", "search", ")", "{", "global", "$", "DB", ";", "$", "whereconditions", "=", "array", "(", ")", ";", "list", "(", "$", "wherecondition", ",", "$", "params", ")", "=", "$", "this", "->", "search_sql", "(", "...
Finds all potential badge recipients Potential badge recipients are all enroled users who haven't got a badge from current issuer role. @param string $search @return array
[ "Finds", "all", "potential", "badge", "recipients" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/lib/awardlib.php#L119-L175
212,677
moodle/moodle
badges/lib/awardlib.php
badge_existing_users_selector.find_users
public function find_users($search) { global $DB; list($wherecondition, $params) = $this->search_sql($search, 'u'); $params['badgeid'] = $this->badgeid; $params['issuerrole'] = $this->issuerrole; list($esql, $eparams) = get_enrolled_sql($this->context, 'moodle/badges:earnbadge',...
php
public function find_users($search) { global $DB; list($wherecondition, $params) = $this->search_sql($search, 'u'); $params['badgeid'] = $this->badgeid; $params['issuerrole'] = $this->issuerrole; list($esql, $eparams) = get_enrolled_sql($this->context, 'moodle/badges:earnbadge',...
[ "public", "function", "find_users", "(", "$", "search", ")", "{", "global", "$", "DB", ";", "list", "(", "$", "wherecondition", ",", "$", "params", ")", "=", "$", "this", "->", "search_sql", "(", "$", "search", ",", "'u'", ")", ";", "$", "params", ...
Finds all users who already have been awarded a badge by current role @param string $search @return array
[ "Finds", "all", "users", "who", "already", "have", "been", "awarded", "a", "badge", "by", "current", "role" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/lib/awardlib.php#L197-L216
212,678
moodle/moodle
lib/spout/src/Spout/Reader/XLSX/Helper/DateFormatHelper.php
DateFormatHelper.toPHPDateFormat
public static function toPHPDateFormat($excelDateFormat) { // Remove brackets potentially present at the beginning of the format string // and text portion of the format at the end of it (starting with ";") // See §18.8.31 of ECMA-376 for more detail. $dateFormat = preg_replace('/^(?...
php
public static function toPHPDateFormat($excelDateFormat) { // Remove brackets potentially present at the beginning of the format string // and text portion of the format at the end of it (starting with ";") // See §18.8.31 of ECMA-376 for more detail. $dateFormat = preg_replace('/^(?...
[ "public", "static", "function", "toPHPDateFormat", "(", "$", "excelDateFormat", ")", "{", "// Remove brackets potentially present at the beginning of the format string", "// and text portion of the format at the end of it (starting with \";\")", "// See §18.8.31 of ECMA-376 for more detail.", ...
Converts the given Excel date format to a format understandable by the PHP date function. @param string $excelDateFormat Excel date format @return string PHP date format (as defined here: http://php.net/manual/en/function.date.php)
[ "Converts", "the", "given", "Excel", "date", "format", "to", "a", "format", "understandable", "by", "the", "PHP", "date", "function", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Reader/XLSX/Helper/DateFormatHelper.php#L62-L114
212,679
moodle/moodle
blocks/classes/external.php
core_block_external.get_block_structure
private static function get_block_structure() { return new external_single_structure( array( 'instanceid' => new external_value(PARAM_INT, 'Block instance id.'), 'name' => new external_value(PARAM_PLUGIN, 'Block name.'), 'region' => ...
php
private static function get_block_structure() { return new external_single_structure( array( 'instanceid' => new external_value(PARAM_INT, 'Block instance id.'), 'name' => new external_value(PARAM_PLUGIN, 'Block name.'), 'region' => ...
[ "private", "static", "function", "get_block_structure", "(", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'instanceid'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'Block instance id.'", ")", ",", "'name'", "=>", "new", "...
Returns a block structure. @return external_single_structure a block single structure. @since Moodle 3.6
[ "Returns", "a", "block", "structure", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/classes/external.php#L49-L72
212,680
moodle/moodle
blocks/classes/external.php
core_block_external.get_course_blocks
public static function get_course_blocks($courseid, $returncontents = false) { global $PAGE; $warnings = array(); $params = self::validate_parameters(self::get_course_blocks_parameters(), ['courseid' => $courseid, 'returncontents' => $returncontents]); $course = get_course(...
php
public static function get_course_blocks($courseid, $returncontents = false) { global $PAGE; $warnings = array(); $params = self::validate_parameters(self::get_course_blocks_parameters(), ['courseid' => $courseid, 'returncontents' => $returncontents]); $course = get_course(...
[ "public", "static", "function", "get_course_blocks", "(", "$", "courseid", ",", "$", "returncontents", "=", "false", ")", "{", "global", "$", "PAGE", ";", "$", "warnings", "=", "array", "(", ")", ";", "$", "params", "=", "self", "::", "validate_parameters"...
Returns blocks information for a course. @param int $courseid The course id @param bool $returncontents Whether to return the block contents @return array Blocks list and possible warnings @throws moodle_exception @since Moodle 3.3
[ "Returns", "blocks", "information", "for", "a", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/classes/external.php#L143-L171
212,681
moodle/moodle
blocks/classes/external.php
core_block_external.get_dashboard_blocks
public static function get_dashboard_blocks($userid = 0, $returncontents = false) { global $CFG, $USER, $PAGE; require_once($CFG->dirroot . '/my/lib.php'); $warnings = array(); $params = self::validate_parameters(self::get_dashboard_blocks_parameters(), ['userid' => $userid...
php
public static function get_dashboard_blocks($userid = 0, $returncontents = false) { global $CFG, $USER, $PAGE; require_once($CFG->dirroot . '/my/lib.php'); $warnings = array(); $params = self::validate_parameters(self::get_dashboard_blocks_parameters(), ['userid' => $userid...
[ "public", "static", "function", "get_dashboard_blocks", "(", "$", "userid", "=", "0", ",", "$", "returncontents", "=", "false", ")", "{", "global", "$", "CFG", ",", "$", "USER", ",", "$", "PAGE", ";", "require_once", "(", "$", "CFG", "->", "dirroot", "...
Returns blocks information for the given user dashboard. @param int $userid The user id to retrive the blocks from, optional, default is to current user. @param bool $returncontents Whether to return the block contents @return array Blocks list and possible warnings @throws moodle_exception @since Moodle 3.6
[ "Returns", "blocks", "information", "for", "the", "given", "user", "dashboard", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/classes/external.php#L213-L256
212,682
moodle/moodle
lib/form/tags.php
MoodleQuickForm_tags.is_tagging_enabled
protected function is_tagging_enabled() { if (!empty($this->tagsoptions['itemtype']) && !empty($this->tagsoptions['component'])) { $enabled = core_tag_tag::is_enabled($this->tagsoptions['component'], $this->tagsoptions['itemtype']); if ($enabled === false) { return false;...
php
protected function is_tagging_enabled() { if (!empty($this->tagsoptions['itemtype']) && !empty($this->tagsoptions['component'])) { $enabled = core_tag_tag::is_enabled($this->tagsoptions['component'], $this->tagsoptions['itemtype']); if ($enabled === false) { return false;...
[ "protected", "function", "is_tagging_enabled", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "tagsoptions", "[", "'itemtype'", "]", ")", "&&", "!", "empty", "(", "$", "this", "->", "tagsoptions", "[", "'component'", "]", ")", ")", "{"...
Checks if tagging is enabled for this itemtype @return boolean
[ "Checks", "if", "tagging", "is", "enabled", "for", "this", "itemtype" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/tags.php#L146-L155
212,683
moodle/moodle
lib/form/tags.php
MoodleQuickForm_tags.get_tag_collection
protected function get_tag_collection() { if (empty($this->tagsoptions['tagcollid']) && (empty($this->tagsoptions['itemtype']) || empty($this->tagsoptions['component']))) { debugging('You need to specify \'itemtype\' and \'component\' of the tagged ' . 'area in th...
php
protected function get_tag_collection() { if (empty($this->tagsoptions['tagcollid']) && (empty($this->tagsoptions['itemtype']) || empty($this->tagsoptions['component']))) { debugging('You need to specify \'itemtype\' and \'component\' of the tagged ' . 'area in th...
[ "protected", "function", "get_tag_collection", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "tagsoptions", "[", "'tagcollid'", "]", ")", "&&", "(", "empty", "(", "$", "this", "->", "tagsoptions", "[", "'itemtype'", "]", ")", "||", "empty", ...
Finds the tag collection to use for standard tag selector @return int
[ "Finds", "the", "tag", "collection", "to", "use", "for", "standard", "tag", "selector" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/tags.php#L172-L189
212,684
moodle/moodle
lib/form/tags.php
MoodleQuickForm_tags.load_standard_tags
protected function load_standard_tags() { global $CFG, $DB; if (!$this->is_tagging_enabled()) { return array(); } $namefield = empty($CFG->keeptagnamecase) ? 'name' : 'rawname'; $tags = $DB->get_records_menu('tag', array('isstandard' => 1, 'tagcollid' => $...
php
protected function load_standard_tags() { global $CFG, $DB; if (!$this->is_tagging_enabled()) { return array(); } $namefield = empty($CFG->keeptagnamecase) ? 'name' : 'rawname'; $tags = $DB->get_records_menu('tag', array('isstandard' => 1, 'tagcollid' => $...
[ "protected", "function", "load_standard_tags", "(", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "if", "(", "!", "$", "this", "->", "is_tagging_enabled", "(", ")", ")", "{", "return", "array", "(", ")", ";", "}", "$", "namefield", "=", "empty...
Internal function to load standard tags
[ "Internal", "function", "to", "load", "standard", "tags" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/tags.php#L226-L236
212,685
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_users
public function get_users($sort, $direction='ASC', $page=0, $perpage=25) { global $DB; if ($direction !== 'ASC') { $direction = 'DESC'; } $key = md5("$sort-$direction-$page-$perpage"); if (!array_key_exists($key, $this->users)) { list($instancessql, $param...
php
public function get_users($sort, $direction='ASC', $page=0, $perpage=25) { global $DB; if ($direction !== 'ASC') { $direction = 'DESC'; } $key = md5("$sort-$direction-$page-$perpage"); if (!array_key_exists($key, $this->users)) { list($instancessql, $param...
[ "public", "function", "get_users", "(", "$", "sort", ",", "$", "direction", "=", "'ASC'", ",", "$", "page", "=", "0", ",", "$", "perpage", "=", "25", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "direction", "!==", "'ASC'", ")", "{", "$", ...
Gets all of the users enrolled in this course. If a filter was specified this will be the users who were enrolled in this course by means of that instance. If role or search filters were specified then these will also be applied. @global moodle_database $DB @param string $sort @param string $direction ASC or DESC @pa...
[ "Gets", "all", "of", "the", "users", "enrolled", "in", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L231-L258
212,686
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_other_users
public function get_other_users($sort, $direction='ASC', $page=0, $perpage=25) { global $DB; if ($direction !== 'ASC') { $direction = 'DESC'; } $key = md5("$sort-$direction-$page-$perpage"); if (!array_key_exists($key, $this->otherusers)) { list($ctxcondit...
php
public function get_other_users($sort, $direction='ASC', $page=0, $perpage=25) { global $DB; if ($direction !== 'ASC') { $direction = 'DESC'; } $key = md5("$sort-$direction-$page-$perpage"); if (!array_key_exists($key, $this->otherusers)) { list($ctxcondit...
[ "public", "function", "get_other_users", "(", "$", "sort", ",", "$", "direction", "=", "'ASC'", ",", "$", "page", "=", "0", ",", "$", "perpage", "=", "25", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "direction", "!==", "'ASC'", ")", "{", ...
Gets and array of other users. Other users are users who have been assigned roles or inherited roles within this course but who have not been enrolled in the course @global moodle_database $DB @param string $sort @param string $direction @param int $page @param int $perpage @return array
[ "Gets", "and", "array", "of", "other", "users", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L334-L363
212,687
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_potential_users
public function get_potential_users($enrolid, $search = '', $searchanywhere = false, $page = 0, $perpage = 25, $addedenrollment = 0, $returnexactcount = false) { global $DB; list($ufields, $params, $wherecondition) = $this->get_basic_search_conditions($search, $searchanywhere); $fi...
php
public function get_potential_users($enrolid, $search = '', $searchanywhere = false, $page = 0, $perpage = 25, $addedenrollment = 0, $returnexactcount = false) { global $DB; list($ufields, $params, $wherecondition) = $this->get_basic_search_conditions($search, $searchanywhere); $fi...
[ "public", "function", "get_potential_users", "(", "$", "enrolid", ",", "$", "search", "=", "''", ",", "$", "searchanywhere", "=", "false", ",", "$", "page", "=", "0", ",", "$", "perpage", "=", "25", ",", "$", "addedenrollment", "=", "0", ",", "$", "r...
Gets an array of the users that can be enrolled in this course. @global moodle_database $DB @param int $enrolid @param string $search @param bool $searchanywhere @param int $page Defaults to 0 @param int $perpage Defaults to 25 @param int $addedenrollment Defaults to 0 @param bool $returnexactcount Return the exact to...
[ "Gets", "an", "array", "of", "the", "users", "that", "can", "be", "enrolled", "in", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L485-L501
212,688
moodle/moodle
enrol/locallib.php
course_enrolment_manager.search_other_users
public function search_other_users($search = '', $searchanywhere = false, $page = 0, $perpage = 25, $returnexactcount = false) { global $DB, $CFG; list($ufields, $params, $wherecondition) = $this->get_basic_search_conditions($search, $searchanywhere); $fields = 'SELECT ' . $ufields; ...
php
public function search_other_users($search = '', $searchanywhere = false, $page = 0, $perpage = 25, $returnexactcount = false) { global $DB, $CFG; list($ufields, $params, $wherecondition) = $this->get_basic_search_conditions($search, $searchanywhere); $fields = 'SELECT ' . $ufields; ...
[ "public", "function", "search_other_users", "(", "$", "search", "=", "''", ",", "$", "searchanywhere", "=", "false", ",", "$", "page", "=", "0", ",", "$", "perpage", "=", "25", ",", "$", "returnexactcount", "=", "false", ")", "{", "global", "$", "DB", ...
Searches other users and returns paginated results @global moodle_database $DB @param string $search @param bool $searchanywhere @param int $page Starting at 0 @param int $perpage @param bool $returnexactcount Return the exact total users using count_record or not. @return array with two or three elements: int totalus...
[ "Searches", "other", "users", "and", "returns", "paginated", "results" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L518-L532
212,689
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_instance_sql
protected function get_instance_sql() { global $DB; if ($this->_instancessql === null) { $instances = $this->get_enrolment_instances(); $filter = $this->get_enrolment_filter(); if ($filter && array_key_exists($filter, $instances)) { $sql = " = :ifilter...
php
protected function get_instance_sql() { global $DB; if ($this->_instancessql === null) { $instances = $this->get_enrolment_instances(); $filter = $this->get_enrolment_filter(); if ($filter && array_key_exists($filter, $instances)) { $sql = " = :ifilter...
[ "protected", "function", "get_instance_sql", "(", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "this", "->", "_instancessql", "===", "null", ")", "{", "$", "instances", "=", "$", "this", "->", "get_enrolment_instances", "(", ")", ";", "$", "filter...
Gets an array containing some SQL to user for when selecting, params for that SQL, and the filter that was used in constructing the sql. @global moodle_database $DB @return string
[ "Gets", "an", "array", "containing", "some", "SQL", "to", "user", "for", "when", "selecting", "params", "for", "that", "SQL", "and", "the", "filter", "that", "was", "used", "in", "constructing", "the", "sql", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L541-L563
212,690
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_enrolment_instances
public function get_enrolment_instances($onlyenabled = false) { if ($this->_instances === null) { $this->_instances = enrol_get_instances($this->course->id, $onlyenabled); } return $this->_instances; }
php
public function get_enrolment_instances($onlyenabled = false) { if ($this->_instances === null) { $this->_instances = enrol_get_instances($this->course->id, $onlyenabled); } return $this->_instances; }
[ "public", "function", "get_enrolment_instances", "(", "$", "onlyenabled", "=", "false", ")", "{", "if", "(", "$", "this", "->", "_instances", "===", "null", ")", "{", "$", "this", "->", "_instances", "=", "enrol_get_instances", "(", "$", "this", "->", "cou...
Returns all of the enrolment instances for this course. @param bool $onlyenabled Whether to return data from enabled enrolment instance names only. @return array
[ "Returns", "all", "of", "the", "enrolment", "instances", "for", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L571-L576
212,691
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_enrolment_instance_names
public function get_enrolment_instance_names($onlyenabled = false) { if ($this->_inames === null) { $instances = $this->get_enrolment_instances($onlyenabled); $plugins = $this->get_enrolment_plugins(false); foreach ($instances as $key=>$instance) { if (!isset(...
php
public function get_enrolment_instance_names($onlyenabled = false) { if ($this->_inames === null) { $instances = $this->get_enrolment_instances($onlyenabled); $plugins = $this->get_enrolment_plugins(false); foreach ($instances as $key=>$instance) { if (!isset(...
[ "public", "function", "get_enrolment_instance_names", "(", "$", "onlyenabled", "=", "false", ")", "{", "if", "(", "$", "this", "->", "_inames", "===", "null", ")", "{", "$", "instances", "=", "$", "this", "->", "get_enrolment_instances", "(", "$", "onlyenabl...
Returns the names for all of the enrolment instances for this course. @param bool $onlyenabled Whether to return data from enabled enrolment instance names only. @return array
[ "Returns", "the", "names", "for", "all", "of", "the", "enrolment", "instances", "for", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L584-L598
212,692
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_enrolment_plugins
public function get_enrolment_plugins($onlyenabled = true) { if ($this->_plugins === null) { $this->_plugins = enrol_get_plugins(true); } if ($onlyenabled) { return $this->_plugins; } if ($this->_allplugins === null) { // Make sure we have th...
php
public function get_enrolment_plugins($onlyenabled = true) { if ($this->_plugins === null) { $this->_plugins = enrol_get_plugins(true); } if ($onlyenabled) { return $this->_plugins; } if ($this->_allplugins === null) { // Make sure we have th...
[ "public", "function", "get_enrolment_plugins", "(", "$", "onlyenabled", "=", "true", ")", "{", "if", "(", "$", "this", "->", "_plugins", "===", "null", ")", "{", "$", "this", "->", "_plugins", "=", "enrol_get_plugins", "(", "true", ")", ";", "}", "if", ...
Gets all of the enrolment plugins that are available for this course. @param bool $onlyenabled return only enabled enrol plugins @return array
[ "Gets", "all", "of", "the", "enrolment", "plugins", "that", "are", "available", "for", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L606-L626
212,693
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_assignable_roles
public function get_assignable_roles($otherusers = false) { if ($this->_assignableroles === null) { $this->_assignableroles = get_assignable_roles($this->context, ROLENAME_ALIAS, false); // verifies unassign access control too } if ($otherusers) { if (!is_array($this->_a...
php
public function get_assignable_roles($otherusers = false) { if ($this->_assignableroles === null) { $this->_assignableroles = get_assignable_roles($this->context, ROLENAME_ALIAS, false); // verifies unassign access control too } if ($otherusers) { if (!is_array($this->_a...
[ "public", "function", "get_assignable_roles", "(", "$", "otherusers", "=", "false", ")", "{", "if", "(", "$", "this", "->", "_assignableroles", "===", "null", ")", "{", "$", "this", "->", "_assignableroles", "=", "get_assignable_roles", "(", "$", "this", "->...
Gets all of the assignable roles for this course. @return array
[ "Gets", "all", "of", "the", "assignable", "roles", "for", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L657-L676
212,694
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_assignable_roles_for_json
public function get_assignable_roles_for_json($otherusers = false) { $rolesarray = array(); $assignable = $this->get_assignable_roles($otherusers); foreach ($assignable as $id => $role) { $rolesarray[] = array('id' => $id, 'name' => $role); } return $rolesarray; }
php
public function get_assignable_roles_for_json($otherusers = false) { $rolesarray = array(); $assignable = $this->get_assignable_roles($otherusers); foreach ($assignable as $id => $role) { $rolesarray[] = array('id' => $id, 'name' => $role); } return $rolesarray; }
[ "public", "function", "get_assignable_roles_for_json", "(", "$", "otherusers", "=", "false", ")", "{", "$", "rolesarray", "=", "array", "(", ")", ";", "$", "assignable", "=", "$", "this", "->", "get_assignable_roles", "(", "$", "otherusers", ")", ";", "forea...
Gets all of the assignable roles for this course, wrapped in an array to ensure role sort order is not lost during json deserialisation. @param boolean $otherusers whether to include the assignable roles for other users @return array
[ "Gets", "all", "of", "the", "assignable", "roles", "for", "this", "course", "wrapped", "in", "an", "array", "to", "ensure", "role", "sort", "order", "is", "not", "lost", "during", "json", "deserialisation", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L685-L692
212,695
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_all_groups
public function get_all_groups() { if ($this->_groups === null) { $this->_groups = groups_get_all_groups($this->course->id); foreach ($this->_groups as $gid=>$group) { $this->_groups[$gid]->name = format_string($group->name); } } return $this->...
php
public function get_all_groups() { if ($this->_groups === null) { $this->_groups = groups_get_all_groups($this->course->id); foreach ($this->_groups as $gid=>$group) { $this->_groups[$gid]->name = format_string($group->name); } } return $this->...
[ "public", "function", "get_all_groups", "(", ")", "{", "if", "(", "$", "this", "->", "_groups", "===", "null", ")", "{", "$", "this", "->", "_groups", "=", "groups_get_all_groups", "(", "$", "this", "->", "course", "->", "id", ")", ";", "foreach", "(",...
Gets all of the groups for this course. @return array
[ "Gets", "all", "of", "the", "groups", "for", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L699-L707
212,696
moodle/moodle
enrol/locallib.php
course_enrolment_manager.unenrol_user
public function unenrol_user($ue) { global $DB; list ($instance, $plugin) = $this->get_user_enrolment_components($ue); if ($instance && $plugin && $plugin->allow_unenrol_user($instance, $ue) && has_capability("enrol/$instance->enrol:unenrol", $this->context)) { $plugin->unenrol_user(...
php
public function unenrol_user($ue) { global $DB; list ($instance, $plugin) = $this->get_user_enrolment_components($ue); if ($instance && $plugin && $plugin->allow_unenrol_user($instance, $ue) && has_capability("enrol/$instance->enrol:unenrol", $this->context)) { $plugin->unenrol_user(...
[ "public", "function", "unenrol_user", "(", "$", "ue", ")", "{", "global", "$", "DB", ";", "list", "(", "$", "instance", ",", "$", "plugin", ")", "=", "$", "this", "->", "get_user_enrolment_components", "(", "$", "ue", ")", ";", "if", "(", "$", "insta...
Unenrols a user from the course given the users ue entry @global moodle_database $DB @param stdClass $ue @return bool
[ "Unenrols", "a", "user", "from", "the", "course", "given", "the", "users", "ue", "entry" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L716-L724
212,697
moodle/moodle
enrol/locallib.php
course_enrolment_manager.get_user_enrolment_components
public function get_user_enrolment_components($userenrolment) { global $DB; if (is_numeric($userenrolment)) { $userenrolment = $DB->get_record('user_enrolments', array('id'=>(int)$userenrolment)); } $instances = $this->get_enrolment_instances(); $plugins = $this->get_...
php
public function get_user_enrolment_components($userenrolment) { global $DB; if (is_numeric($userenrolment)) { $userenrolment = $DB->get_record('user_enrolments', array('id'=>(int)$userenrolment)); } $instances = $this->get_enrolment_instances(); $plugins = $this->get_...
[ "public", "function", "get_user_enrolment_components", "(", "$", "userenrolment", ")", "{", "global", "$", "DB", ";", "if", "(", "is_numeric", "(", "$", "userenrolment", ")", ")", "{", "$", "userenrolment", "=", "$", "DB", "->", "get_record", "(", "'user_enr...
Given a user enrolment record this method returns the plugin and enrolment instance that relate to it. @param stdClass|int $userenrolment @return array array($instance, $plugin)
[ "Given", "a", "user", "enrolment", "record", "this", "method", "returns", "the", "plugin", "and", "enrolment", "instance", "that", "relate", "to", "it", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L733-L746
212,698
moodle/moodle
enrol/locallib.php
course_enrolment_manager.unassign_role_from_user
public function unassign_role_from_user($userid, $roleid) { global $DB; // Admins may unassign any role, others only those they could assign. if (!is_siteadmin() and !array_key_exists($roleid, $this->get_assignable_roles())) { if (defined('AJAX_SCRIPT')) { throw new m...
php
public function unassign_role_from_user($userid, $roleid) { global $DB; // Admins may unassign any role, others only those they could assign. if (!is_siteadmin() and !array_key_exists($roleid, $this->get_assignable_roles())) { if (defined('AJAX_SCRIPT')) { throw new m...
[ "public", "function", "unassign_role_from_user", "(", "$", "userid", ",", "$", "roleid", ")", "{", "global", "$", "DB", ";", "// Admins may unassign any role, others only those they could assign.", "if", "(", "!", "is_siteadmin", "(", ")", "and", "!", "array_key_exist...
Removes an assigned role from a user. @global moodle_database $DB @param int $userid @param int $roleid @return bool
[ "Removes", "an", "assigned", "role", "from", "a", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L756-L782
212,699
moodle/moodle
enrol/locallib.php
course_enrolment_manager.add_user_to_group
public function add_user_to_group($user, $groupid) { require_capability('moodle/course:managegroups', $this->context); $group = $this->get_group($groupid); if (!$group) { return false; } return groups_add_member($group->id, $user->id); }
php
public function add_user_to_group($user, $groupid) { require_capability('moodle/course:managegroups', $this->context); $group = $this->get_group($groupid); if (!$group) { return false; } return groups_add_member($group->id, $user->id); }
[ "public", "function", "add_user_to_group", "(", "$", "user", ",", "$", "groupid", ")", "{", "require_capability", "(", "'moodle/course:managegroups'", ",", "$", "this", "->", "context", ")", ";", "$", "group", "=", "$", "this", "->", "get_group", "(", "$", ...
Adds a user to a group @param stdClass $user @param int $groupid @return bool
[ "Adds", "a", "user", "to", "a", "group" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/locallib.php#L809-L816