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
219,500
moodle/moodle
question/format/xml/format.php
qformat_xml.import_combined_feedback
public function import_combined_feedback($qo, $questionxml, $withshownumpartscorrect = false) { $fields = array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback'); foreach ($fields as $field) { $qo->$field = $this->import_text_with_files($questionxml, arr...
php
public function import_combined_feedback($qo, $questionxml, $withshownumpartscorrect = false) { $fields = array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback'); foreach ($fields as $field) { $qo->$field = $this->import_text_with_files($questionxml, arr...
[ "public", "function", "import_combined_feedback", "(", "$", "qo", ",", "$", "questionxml", ",", "$", "withshownumpartscorrect", "=", "false", ")", "{", "$", "fields", "=", "array", "(", "'correctfeedback'", ",", "'partiallycorrectfeedback'", ",", "'incorrectfeedback...
Import the common overall feedback fields. @param object $question the part of the XML relating to this question. @param object $qo the question data to add the fields to. @param bool $withshownumpartscorrect include the shownumcorrect field.
[ "Import", "the", "common", "overall", "feedback", "fields", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L299-L315
219,501
moodle/moodle
question/format/xml/format.php
qformat_xml.import_hint
public function import_hint($hintxml, $defaultformat) { $hint = new stdClass(); if (array_key_exists('hintcontent', $hintxml['#'])) { // Backwards compatibility. $hint->hint = $this->import_text_with_files($hintxml, array('#', 'hintcontent', 0), '', $defaultf...
php
public function import_hint($hintxml, $defaultformat) { $hint = new stdClass(); if (array_key_exists('hintcontent', $hintxml['#'])) { // Backwards compatibility. $hint->hint = $this->import_text_with_files($hintxml, array('#', 'hintcontent', 0), '', $defaultf...
[ "public", "function", "import_hint", "(", "$", "hintxml", ",", "$", "defaultformat", ")", "{", "$", "hint", "=", "new", "stdClass", "(", ")", ";", "if", "(", "array_key_exists", "(", "'hintcontent'", ",", "$", "hintxml", "[", "'#'", "]", ")", ")", "{",...
Import a question hint @param array $hintxml hint xml fragment. @param string $defaultformat the text format to assume for hints that do not specify. @return object hint for storing in the database.
[ "Import", "a", "question", "hint" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L323-L346
219,502
moodle/moodle
question/format/xml/format.php
qformat_xml.import_hints
public function import_hints($qo, $questionxml, $withparts = false, $withoptions = false, $defaultformat = 'html') { if (!isset($questionxml['#']['hint'])) { return; } foreach ($questionxml['#']['hint'] as $hintxml) { $hint = $this->import_hint($hintxml, $def...
php
public function import_hints($qo, $questionxml, $withparts = false, $withoptions = false, $defaultformat = 'html') { if (!isset($questionxml['#']['hint'])) { return; } foreach ($questionxml['#']['hint'] as $hintxml) { $hint = $this->import_hint($hintxml, $def...
[ "public", "function", "import_hints", "(", "$", "qo", ",", "$", "questionxml", ",", "$", "withparts", "=", "false", ",", "$", "withoptions", "=", "false", ",", "$", "defaultformat", "=", "'html'", ")", "{", "if", "(", "!", "isset", "(", "$", "questionx...
Import all the question hints @param object $qo the question data that is being constructed. @param array $questionxml The xml representing the question. @param bool $withparts whether the extra fields relating to parts should be imported. @param bool $withoptions whether the extra options field should be imported. @p...
[ "Import", "all", "the", "question", "hints" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L358-L377
219,503
moodle/moodle
question/format/xml/format.php
qformat_xml.import_question_tags
public function import_question_tags($qo, $questionxml) { global $CFG; if (core_tag_tag::is_enabled('core_question', 'question')) { $qo->tags = []; if (!empty($questionxml['#']['tags'][0]['#']['tag'])) { foreach ($questionxml['#']['tags'][0]['#']['tag'] as $tagd...
php
public function import_question_tags($qo, $questionxml) { global $CFG; if (core_tag_tag::is_enabled('core_question', 'question')) { $qo->tags = []; if (!empty($questionxml['#']['tags'][0]['#']['tag'])) { foreach ($questionxml['#']['tags'][0]['#']['tag'] as $tagd...
[ "public", "function", "import_question_tags", "(", "$", "qo", ",", "$", "questionxml", ")", "{", "global", "$", "CFG", ";", "if", "(", "core_tag_tag", "::", "is_enabled", "(", "'core_question'", ",", "'question'", ")", ")", "{", "$", "qo", "->", "tags", ...
Import all the question tags @param object $qo the question data that is being constructed. @param array $questionxml The xml representing the question. @return array of objects representing the tags in the file.
[ "Import", "all", "the", "question", "tags" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L386-L405
219,504
moodle/moodle
question/format/xml/format.php
qformat_xml.import_files
public function import_files($xml) { $files = array(); foreach ($xml as $file) { $data = new stdClass(); $data->content = $file['#']; $data->encoding = $file['@']['encoding']; $data->name = $file['@']['name']; $files[] = $data; } ...
php
public function import_files($xml) { $files = array(); foreach ($xml as $file) { $data = new stdClass(); $data->content = $file['#']; $data->encoding = $file['@']['encoding']; $data->name = $file['@']['name']; $files[] = $data; } ...
[ "public", "function", "import_files", "(", "$", "xml", ")", "{", "$", "files", "=", "array", "(", ")", ";", "foreach", "(", "$", "xml", "as", "$", "file", ")", "{", "$", "data", "=", "new", "stdClass", "(", ")", ";", "$", "data", "->", "content",...
Import files from a node in the XML. @param array $xml an array of <file> nodes from the the parsed XML. @return array of things representing files - in the form that save_question expects.
[ "Import", "files", "from", "a", "node", "in", "the", "XML", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L412-L422
219,505
moodle/moodle
question/format/xml/format.php
qformat_xml.import_multichoice
public function import_multichoice($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to multichoice. $qo->qtype = 'multichoice'; $single = $this->getpath($question, array('#', 'single', 0, '#'), 'true'); $qo->single = $t...
php
public function import_multichoice($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to multichoice. $qo->qtype = 'multichoice'; $single = $this->getpath($question, array('#', 'single', 0, '#'), 'true'); $qo->single = $t...
[ "public", "function", "import_multichoice", "(", "$", "question", ")", "{", "// Get common parts.", "$", "qo", "=", "$", "this", "->", "import_headers", "(", "$", "question", ")", ";", "// Header parts particular to multichoice.", "$", "qo", "->", "qtype", "=", ...
import multiple choice question @param array question question array from xml tree @return object question object
[ "import", "multiple", "choice", "question" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L429-L464
219,506
moodle/moodle
question/format/xml/format.php
qformat_xml.import_shortanswer
public function import_shortanswer($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to shortanswer. $qo->qtype = 'shortanswer'; // Get usecase. $qo->usecase = $this->getpath($question, array('#', 'usecase', 0, '#'), $q...
php
public function import_shortanswer($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to shortanswer. $qo->qtype = 'shortanswer'; // Get usecase. $qo->usecase = $this->getpath($question, array('#', 'usecase', 0, '#'), $q...
[ "public", "function", "import_shortanswer", "(", "$", "question", ")", "{", "// Get common parts.", "$", "qo", "=", "$", "this", "->", "import_headers", "(", "$", "question", ")", ";", "// Header parts particular to shortanswer.", "$", "qo", "->", "qtype", "=", ...
Import short answer type question @param array question question array from xml tree @return object question object
[ "Import", "short", "answer", "type", "question" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L610-L634
219,507
moodle/moodle
question/format/xml/format.php
qformat_xml.import_description
public function import_description($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to shortanswer. $qo->qtype = 'description'; $qo->defaultmark = 0; $qo->length = 0; return $qo; }
php
public function import_description($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to shortanswer. $qo->qtype = 'description'; $qo->defaultmark = 0; $qo->length = 0; return $qo; }
[ "public", "function", "import_description", "(", "$", "question", ")", "{", "// Get common parts.", "$", "qo", "=", "$", "this", "->", "import_headers", "(", "$", "question", ")", ";", "// Header parts particular to shortanswer.", "$", "qo", "->", "qtype", "=", ...
Import description type question @param array question question array from xml tree @return object question object
[ "Import", "description", "type", "question" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L641-L649
219,508
moodle/moodle
question/format/xml/format.php
qformat_xml.import_match
public function import_match($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to matching. $qo->qtype = 'match'; $qo->shuffleanswers = $this->trans_single($this->getpath($question, array('#', 'shuffleanswers', 0...
php
public function import_match($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to matching. $qo->qtype = 'match'; $qo->shuffleanswers = $this->trans_single($this->getpath($question, array('#', 'shuffleanswers', 0...
[ "public", "function", "import_match", "(", "$", "question", ")", "{", "// Get common parts.", "$", "qo", "=", "$", "this", "->", "import_headers", "(", "$", "question", ")", ";", "// Header parts particular to matching.", "$", "qo", "->", "qtype", "=", "'match'"...
Import matching type question @param array question question array from xml tree @return object question object
[ "Import", "matching", "type", "question" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L726-L751
219,509
moodle/moodle
question/format/xml/format.php
qformat_xml.import_essay
public function import_essay($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to essay. $qo->qtype = 'essay'; $qo->responseformat = $this->getpath($question, array('#', 'responseformat', 0, '#'), 'editor'); ...
php
public function import_essay($question) { // Get common parts. $qo = $this->import_headers($question); // Header parts particular to essay. $qo->qtype = 'essay'; $qo->responseformat = $this->getpath($question, array('#', 'responseformat', 0, '#'), 'editor'); ...
[ "public", "function", "import_essay", "(", "$", "question", ")", "{", "// Get common parts.", "$", "qo", "=", "$", "this", "->", "import_headers", "(", "$", "question", ")", ";", "// Header parts particular to essay.", "$", "qo", "->", "qtype", "=", "'essay'", ...
Import essay type question @param array question question array from xml tree @return object question object
[ "Import", "essay", "type", "question" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L758-L783
219,510
moodle/moodle
question/format/xml/format.php
qformat_xml.xml_escape
public function xml_escape($string) { if (!empty($string) && htmlspecialchars($string) != $string) { // If the string contains something that looks like the end // of a CDATA section, then we need to avoid errors by splitting // the string between two CDATA sections. ...
php
public function xml_escape($string) { if (!empty($string) && htmlspecialchars($string) != $string) { // If the string contains something that looks like the end // of a CDATA section, then we need to avoid errors by splitting // the string between two CDATA sections. ...
[ "public", "function", "xml_escape", "(", "$", "string", ")", "{", "if", "(", "!", "empty", "(", "$", "string", ")", "&&", "htmlspecialchars", "(", "$", "string", ")", "!=", "$", "string", ")", "{", "// If the string contains something that looks like the end", ...
Take a string, and wrap it in a CDATA secion, if that is required to make the output XML valid. @param string $string a string @return string the string, wrapped in CDATA if necessary.
[ "Take", "a", "string", "and", "wrap", "it", "in", "a", "CDATA", "secion", "if", "that", "is", "required", "to", "make", "the", "output", "XML", "valid", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L1102-L1112
219,511
moodle/moodle
question/format/xml/format.php
qformat_xml.write_files
public function write_files($files) { if (empty($files)) { return ''; } $string = ''; foreach ($files as $file) { if ($file->is_directory()) { continue; } $string .= '<file name="' . $file->get_filename() . '" path="' . $fil...
php
public function write_files($files) { if (empty($files)) { return ''; } $string = ''; foreach ($files as $file) { if ($file->is_directory()) { continue; } $string .= '<file name="' . $file->get_filename() . '" path="' . $fil...
[ "public", "function", "write_files", "(", "$", "files", ")", "{", "if", "(", "empty", "(", "$", "files", ")", ")", "{", "return", "''", ";", "}", "$", "string", "=", "''", ";", "foreach", "(", "$", "files", "as", "$", "file", ")", "{", "if", "(...
Generte the XML to represent some files. @param array of store array of stored_file objects. @return string $string the XML.
[ "Generte", "the", "XML", "to", "represent", "some", "files", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L1139-L1153
219,512
moodle/moodle
question/format/xml/format.php
qformat_xml.write_hints
public function write_hints($question) { if (empty($question->hints)) { return ''; } $output = ''; foreach ($question->hints as $hint) { $output .= $this->write_hint($hint, $question->contextid); } return $output; }
php
public function write_hints($question) { if (empty($question->hints)) { return ''; } $output = ''; foreach ($question->hints as $hint) { $output .= $this->write_hint($hint, $question->contextid); } return $output; }
[ "public", "function", "write_hints", "(", "$", "question", ")", "{", "if", "(", "empty", "(", "$", "question", "->", "hints", ")", ")", "{", "return", "''", ";", "}", "$", "output", "=", "''", ";", "foreach", "(", "$", "question", "->", "hints", "a...
Write out the hints. @param object $question the question definition data. @return string XML to output.
[ "Write", "out", "the", "hints", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L1570-L1580
219,513
moodle/moodle
question/format/xml/format.php
qformat_xml.write_combined_feedback
public function write_combined_feedback($questionoptions, $questionid, $contextid) { $fs = get_file_storage(); $output = ''; $fields = array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback'); foreach ($fields as $field) { $formatfield = $field . 'format'; ...
php
public function write_combined_feedback($questionoptions, $questionid, $contextid) { $fs = get_file_storage(); $output = ''; $fields = array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback'); foreach ($fields as $field) { $formatfield = $field . 'format'; ...
[ "public", "function", "write_combined_feedback", "(", "$", "questionoptions", ",", "$", "questionid", ",", "$", "contextid", ")", "{", "$", "fs", "=", "get_file_storage", "(", ")", ";", "$", "output", "=", "''", ";", "$", "fields", "=", "array", "(", "'c...
Output the combined feedback fields. @param object $questionoptions the question definition data. @param int $questionid the question id. @param int $contextid the question context id. @return string XML to output.
[ "Output", "the", "combined", "feedback", "fields", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/format/xml/format.php#L1620-L1639
219,514
moodle/moodle
enrol/manual/externallib.php
enrol_manual_external.enrol_users
public static function enrol_users($enrolments) { global $DB, $CFG; require_once($CFG->libdir . '/enrollib.php'); $params = self::validate_parameters(self::enrol_users_parameters(), array('enrolments' => $enrolments)); $transaction = $DB->start_delegated_transaction();...
php
public static function enrol_users($enrolments) { global $DB, $CFG; require_once($CFG->libdir . '/enrollib.php'); $params = self::validate_parameters(self::enrol_users_parameters(), array('enrolments' => $enrolments)); $transaction = $DB->start_delegated_transaction();...
[ "public", "static", "function", "enrol_users", "(", "$", "enrolments", ")", "{", "global", "$", "DB", ",", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "libdir", ".", "'/enrollib.php'", ")", ";", "$", "params", "=", "self", "::", "validate_par...
Enrolment of users. Function throw an exception at the first error encountered. @param array $enrolments An array of user enrolment @since Moodle 2.2
[ "Enrolment", "of", "users", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/manual/externallib.php#L76-L147
219,515
moodle/moodle
enrol/manual/externallib.php
enrol_manual_external.unenrol_users
public static function unenrol_users($enrolments) { global $CFG, $DB; $params = self::validate_parameters(self::unenrol_users_parameters(), array('enrolments' => $enrolments)); require_once($CFG->libdir . '/enrollib.php'); $transaction = $DB->start_delegated_transaction(); // Rollback al...
php
public static function unenrol_users($enrolments) { global $CFG, $DB; $params = self::validate_parameters(self::unenrol_users_parameters(), array('enrolments' => $enrolments)); require_once($CFG->libdir . '/enrollib.php'); $transaction = $DB->start_delegated_transaction(); // Rollback al...
[ "public", "static", "function", "unenrol_users", "(", "$", "enrolments", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "unenrol_users_parameters", "(", ")", ",", "array", "(...
Unenrolment of users. @param array $enrolments an array of course user and role ids @throws coding_exception @throws dml_transaction_exception @throws invalid_parameter_exception @throws moodle_exception @throws required_capability_exception @throws restricted_context_exception
[ "Unenrolment", "of", "users", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/manual/externallib.php#L189-L217
219,516
moodle/moodle
admin/tool/uploaduser/user_form.php
admin_uploaduser_form2.definition_after_data
function definition_after_data() { $mform = $this->_form; $columns = $this->_customdata['columns']; foreach ($columns as $column) { if ($mform->elementExists($column)) { $mform->removeElement($column); } } if (!in_array('password', $col...
php
function definition_after_data() { $mform = $this->_form; $columns = $this->_customdata['columns']; foreach ($columns as $column) { if ($mform->elementExists($column)) { $mform->removeElement($column); } } if (!in_array('password', $col...
[ "function", "definition_after_data", "(", ")", "{", "$", "mform", "=", "$", "this", "->", "_form", ";", "$", "columns", "=", "$", "this", "->", "_customdata", "[", "'columns'", "]", ";", "foreach", "(", "$", "columns", "as", "$", "column", ")", "{", ...
Form tweaks that depend on current data.
[ "Form", "tweaks", "that", "depend", "on", "current", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/uploaduser/user_form.php#L329-L345
219,517
moodle/moodle
admin/tool/uploaduser/user_form.php
admin_uploaduser_form2.validation
function validation($data, $files) { $errors = parent::validation($data, $files); $columns = $this->_customdata['columns']; $optype = $data['uutype']; $updatetype = $data['uuupdatetype']; // detect if password column needed in file if (!in_array('password', $columns)) {...
php
function validation($data, $files) { $errors = parent::validation($data, $files); $columns = $this->_customdata['columns']; $optype = $data['uutype']; $updatetype = $data['uuupdatetype']; // detect if password column needed in file if (!in_array('password', $columns)) {...
[ "function", "validation", "(", "$", "data", ",", "$", "files", ")", "{", "$", "errors", "=", "parent", "::", "validation", "(", "$", "data", ",", "$", "files", ")", ";", "$", "columns", "=", "$", "this", "->", "_customdata", "[", "'columns'", "]", ...
Server side validation.
[ "Server", "side", "validation", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/uploaduser/user_form.php#L350-L410
219,518
moodle/moodle
admin/tool/uploaduser/user_form.php
admin_uploaduser_form2.get_data
function get_data() { $data = parent::get_data(); if ($data !== null and isset($data->description)) { $data->descriptionformat = $data->description['format']; $data->description = $data->description['text']; } return $data; }
php
function get_data() { $data = parent::get_data(); if ($data !== null and isset($data->description)) { $data->descriptionformat = $data->description['format']; $data->description = $data->description['text']; } return $data; }
[ "function", "get_data", "(", ")", "{", "$", "data", "=", "parent", "::", "get_data", "(", ")", ";", "if", "(", "$", "data", "!==", "null", "and", "isset", "(", "$", "data", "->", "description", ")", ")", "{", "$", "data", "->", "descriptionformat", ...
Used to reformat the data from the editor component @return stdClass
[ "Used", "to", "reformat", "the", "data", "from", "the", "editor", "component" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/uploaduser/user_form.php#L417-L426
219,519
moodle/moodle
lib/typo3/class.t3lib_utility_debug.php
t3lib_utility_Debug.prepareVariableForJavascript
public static function prepareVariableForJavascript($string, $asObject) { if ($asObject) { $string = str_replace(array( '"', '/', '<', "\n", "\r" ), array( '\"', '\/', '\<', '<br />', '' ), $string); } else { $string = str_replace(array( '"', '/', '<', "\n", "\r" ), array( '\"', '\/'...
php
public static function prepareVariableForJavascript($string, $asObject) { if ($asObject) { $string = str_replace(array( '"', '/', '<', "\n", "\r" ), array( '\"', '\/', '\<', '<br />', '' ), $string); } else { $string = str_replace(array( '"', '/', '<', "\n", "\r" ), array( '\"', '\/'...
[ "public", "static", "function", "prepareVariableForJavascript", "(", "$", "string", ",", "$", "asObject", ")", "{", "if", "(", "$", "asObject", ")", "{", "$", "string", "=", "str_replace", "(", "array", "(", "'\"'", ",", "'/'", ",", "'<'", ",", "\"\\n\""...
Replaces special characters for the usage inside javascript @param string $string @param boolean $asObject @return string
[ "Replaces", "special", "characters", "for", "the", "usage", "inside", "javascript" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_utility_debug.php#L123-L139
219,520
moodle/moodle
lib/typo3/class.t3lib_utility_debug.php
t3lib_utility_Debug.convertVariableToString
public static function convertVariableToString($variable) { $string = ''; if (is_array($variable)) { $string = self::viewArray($variable); } elseif (is_object($variable)) { $string = '<strong>|Object:<pre>'; $string .= print_r($variable, TRUE); $string .= '</pre>|</strong>'; } elseif ((string) $vari...
php
public static function convertVariableToString($variable) { $string = ''; if (is_array($variable)) { $string = self::viewArray($variable); } elseif (is_object($variable)) { $string = '<strong>|Object:<pre>'; $string .= print_r($variable, TRUE); $string .= '</pre>|</strong>'; } elseif ((string) $vari...
[ "public", "static", "function", "convertVariableToString", "(", "$", "variable", ")", "{", "$", "string", "=", "''", ";", "if", "(", "is_array", "(", "$", "variable", ")", ")", "{", "$", "string", "=", "self", "::", "viewArray", "(", "$", "variable", "...
Converts a variable to a string @param mixed $variable @return string
[ "Converts", "a", "variable", "to", "a", "string" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_utility_debug.php#L147-L162
219,521
moodle/moodle
lib/typo3/class.t3lib_utility_debug.php
t3lib_utility_Debug.debugInPopUpWindow
public static function debugInPopUpWindow($debugVariable, $header = 'Debug', $group = 'Debug') { $debugString = self::prepareVariableForJavascript( self::convertVariableToString($debugVariable), is_object($debugVariable) ); $script = ' (function debug() { var debugMessage = "' . $debugString . '", ...
php
public static function debugInPopUpWindow($debugVariable, $header = 'Debug', $group = 'Debug') { $debugString = self::prepareVariableForJavascript( self::convertVariableToString($debugVariable), is_object($debugVariable) ); $script = ' (function debug() { var debugMessage = "' . $debugString . '", ...
[ "public", "static", "function", "debugInPopUpWindow", "(", "$", "debugVariable", ",", "$", "header", "=", "'Debug'", ",", "$", "group", "=", "'Debug'", ")", "{", "$", "debugString", "=", "self", "::", "prepareVariableForJavascript", "(", "self", "::", "convert...
Opens a debug message inside a popup window @param mixed $debugVariable @param string $header @param string $group
[ "Opens", "a", "debug", "message", "inside", "a", "popup", "window" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_utility_debug.php#L171-L214
219,522
moodle/moodle
lib/typo3/class.t3lib_utility_debug.php
t3lib_utility_Debug.debugTrail
public static function debugTrail() { $trail = debug_backtrace(); $trail = array_reverse($trail); array_pop($trail); $path = array(); foreach ($trail as $dat) { $pathFragment = $dat['class'] . $dat['type'] . $dat['function']; // add the path of the included file if (in_array($dat['function'], array...
php
public static function debugTrail() { $trail = debug_backtrace(); $trail = array_reverse($trail); array_pop($trail); $path = array(); foreach ($trail as $dat) { $pathFragment = $dat['class'] . $dat['type'] . $dat['function']; // add the path of the included file if (in_array($dat['function'], array...
[ "public", "static", "function", "debugTrail", "(", ")", "{", "$", "trail", "=", "debug_backtrace", "(", ")", ";", "$", "trail", "=", "array_reverse", "(", "$", "trail", ")", ";", "array_pop", "(", "$", "trail", ")", ";", "$", "path", "=", "array", "(...
Displays the "path" of the function call stack in a string, using debug_backtrace @return string
[ "Displays", "the", "path", "of", "the", "function", "call", "stack", "in", "a", "string", "using", "debug_backtrace" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_utility_debug.php#L221-L237
219,523
moodle/moodle
lib/typo3/class.t3lib_utility_debug.php
t3lib_utility_Debug.debugRows
public static function debugRows($rows, $header = '', $returnHTML = FALSE) { if (is_array($rows)) { $firstEl = reset($rows); if (is_array($firstEl)) { $headerColumns = array_keys($firstEl); $tRows = array(); // Header: $tRows[] = '<tr><td colspan="' . count($headerColumns) . '" style=...
php
public static function debugRows($rows, $header = '', $returnHTML = FALSE) { if (is_array($rows)) { $firstEl = reset($rows); if (is_array($firstEl)) { $headerColumns = array_keys($firstEl); $tRows = array(); // Header: $tRows[] = '<tr><td colspan="' . count($headerColumns) . '" style=...
[ "public", "static", "function", "debugRows", "(", "$", "rows", ",", "$", "header", "=", "''", ",", "$", "returnHTML", "=", "FALSE", ")", "{", "if", "(", "is_array", "(", "$", "rows", ")", ")", "{", "$", "firstEl", "=", "reset", "(", "$", "rows", ...
Displays an array as rows in a table. Useful to debug output like an array of database records. @param mixed Array of arrays with similar keys @param string Table header @param boolean If TRUE, will return content instead of echo'ing out. @return void Outputs to browser.
[ "Displays", "an", "array", "as", "rows", "in", "a", "table", ".", "Useful", "to", "debug", "output", "like", "an", "array", "of", "database", "records", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_utility_debug.php#L247-L298
219,524
moodle/moodle
competency/classes/competency_framework.php
competency_framework.get_taxonomy
public function get_taxonomy($level) { $taxonomies = $this->get_taxonomies(); if (empty($taxonomies[$level])) { // If for some reason we cannot find the level, we fallback onto competency. $constant = self::TAXONOMY_COMPETENCY; } else { $constant = $taxonomie...
php
public function get_taxonomy($level) { $taxonomies = $this->get_taxonomies(); if (empty($taxonomies[$level])) { // If for some reason we cannot find the level, we fallback onto competency. $constant = self::TAXONOMY_COMPETENCY; } else { $constant = $taxonomie...
[ "public", "function", "get_taxonomy", "(", "$", "level", ")", "{", "$", "taxonomies", "=", "$", "this", "->", "get_taxonomies", "(", ")", ";", "if", "(", "empty", "(", "$", "taxonomies", "[", "$", "level", "]", ")", ")", "{", "// If for some reason we ca...
Get the constant name for a level. @param int $level The level of the term. @return string
[ "Get", "the", "constant", "name", "for", "a", "level", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L163-L174
219,525
moodle/moodle
competency/classes/competency_framework.php
competency_framework.get_taxonomies
protected function get_taxonomies() { $taxonomies = explode(',', $this->raw_get('taxonomies')); // Indexing first level at 1. array_unshift($taxonomies, null); unset($taxonomies[0]); // Ensure that we do not return empty levels. foreach ($taxonomies as $i => $taxonomy) ...
php
protected function get_taxonomies() { $taxonomies = explode(',', $this->raw_get('taxonomies')); // Indexing first level at 1. array_unshift($taxonomies, null); unset($taxonomies[0]); // Ensure that we do not return empty levels. foreach ($taxonomies as $i => $taxonomy) ...
[ "protected", "function", "get_taxonomies", "(", ")", "{", "$", "taxonomies", "=", "explode", "(", "','", ",", "$", "this", "->", "raw_get", "(", "'taxonomies'", ")", ")", ";", "// Indexing first level at 1.", "array_unshift", "(", "$", "taxonomies", ",", "null...
Return the taxonomy constants indexed by level. @return array Contains the list of taxonomy constants indexed by level.
[ "Return", "the", "taxonomy", "constants", "indexed", "by", "level", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L181-L196
219,526
moodle/moodle
competency/classes/competency_framework.php
competency_framework.set_taxonomies
protected function set_taxonomies($taxonomies) { if (is_array($taxonomies)) { $taxonomies = implode(',', $taxonomies); } $this->raw_set('taxonomies', $taxonomies); }
php
protected function set_taxonomies($taxonomies) { if (is_array($taxonomies)) { $taxonomies = implode(',', $taxonomies); } $this->raw_set('taxonomies', $taxonomies); }
[ "protected", "function", "set_taxonomies", "(", "$", "taxonomies", ")", "{", "if", "(", "is_array", "(", "$", "taxonomies", ")", ")", "{", "$", "taxonomies", "=", "implode", "(", "','", ",", "$", "taxonomies", ")", ";", "}", "$", "this", "->", "raw_set...
Convenience method to set taxonomies from an array or string. @param string|array $taxonomies A string, or an array where the values are the term constants.
[ "Convenience", "method", "to", "set", "taxonomies", "from", "an", "array", "or", "string", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L215-L220
219,527
moodle/moodle
competency/classes/competency_framework.php
competency_framework.validate_scaleid
protected function validate_scaleid($value) { global $DB; // Always validate that the scale exists. if (!$DB->record_exists_select('scale', 'id = :id', array('id' => $value))) { return new lang_string('invalidscaleid', 'error'); } // During update. if ($this...
php
protected function validate_scaleid($value) { global $DB; // Always validate that the scale exists. if (!$DB->record_exists_select('scale', 'id = :id', array('id' => $value))) { return new lang_string('invalidscaleid', 'error'); } // During update. if ($this...
[ "protected", "function", "validate_scaleid", "(", "$", "value", ")", "{", "global", "$", "DB", ";", "// Always validate that the scale exists.", "if", "(", "!", "$", "DB", "->", "record_exists_select", "(", "'scale'", ",", "'id = :id'", ",", "array", "(", "'id'"...
Validate the scale ID. @param string $value The scale ID. @return bool|lang_string
[ "Validate", "the", "scale", "ID", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L278-L299
219,528
moodle/moodle
competency/classes/competency_framework.php
competency_framework.validate_scaleconfiguration
protected function validate_scaleconfiguration($value) { $scaledefaultselected = false; $proficientselected = false; $scaleconfigurations = json_decode($value); if (is_array($scaleconfigurations)) { // The first element of the array contains the scale ID. $scale...
php
protected function validate_scaleconfiguration($value) { $scaledefaultselected = false; $proficientselected = false; $scaleconfigurations = json_decode($value); if (is_array($scaleconfigurations)) { // The first element of the array contains the scale ID. $scale...
[ "protected", "function", "validate_scaleconfiguration", "(", "$", "value", ")", "{", "$", "scaledefaultselected", "=", "false", ";", "$", "proficientselected", "=", "false", ";", "$", "scaleconfigurations", "=", "json_decode", "(", "$", "value", ")", ";", "if", ...
Validate the scale configuration. @param string $value The scale configuration. @return bool|lang_string
[ "Validate", "the", "scale", "configuration", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L307-L337
219,529
moodle/moodle
competency/classes/competency_framework.php
competency_framework.validate_taxonomies
protected function validate_taxonomies($value) { $terms = explode(',', $value); foreach ($terms as $term) { if (!empty($term) && !array_key_exists($term, self::get_taxonomies_list())) { return new lang_string('invalidtaxonomy', 'core_competency', $term); } ...
php
protected function validate_taxonomies($value) { $terms = explode(',', $value); foreach ($terms as $term) { if (!empty($term) && !array_key_exists($term, self::get_taxonomies_list())) { return new lang_string('invalidtaxonomy', 'core_competency', $term); } ...
[ "protected", "function", "validate_taxonomies", "(", "$", "value", ")", "{", "$", "terms", "=", "explode", "(", "','", ",", "$", "value", ")", ";", "foreach", "(", "$", "terms", "as", "$", "term", ")", "{", "if", "(", "!", "empty", "(", "$", "term"...
Validate taxonomies. @param mixed $value The taxonomies. @return true|lang_string
[ "Validate", "taxonomies", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L345-L355
219,530
moodle/moodle
competency/classes/competency_framework.php
competency_framework.get_default_grade_from_scale_configuration
public static function get_default_grade_from_scale_configuration($config) { $config = json_decode($config); if (!is_array($config)) { throw new coding_exception('Unexpected scale configuration.'); } // Remove the scale ID from the config. array_shift($config); ...
php
public static function get_default_grade_from_scale_configuration($config) { $config = json_decode($config); if (!is_array($config)) { throw new coding_exception('Unexpected scale configuration.'); } // Remove the scale ID from the config. array_shift($config); ...
[ "public", "static", "function", "get_default_grade_from_scale_configuration", "(", "$", "config", ")", "{", "$", "config", "=", "json_decode", "(", "$", "config", ")", ";", "if", "(", "!", "is_array", "(", "$", "config", ")", ")", "{", "throw", "new", "cod...
Extract the default grade from a scale configuration. Returns an array where the first element is the grade, and the second is a boolean representing whether or not this grade is considered 'proficient'. @param string $config JSON encoded config. @return array(int grade, int proficient)
[ "Extract", "the", "default", "grade", "from", "a", "scale", "configuration", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L366-L382
219,531
moodle/moodle
competency/classes/competency_framework.php
competency_framework.get_proficiency_of_grade_from_scale_configuration
public static function get_proficiency_of_grade_from_scale_configuration($config, $grade) { $config = json_decode($config); if (!is_array($config)) { throw new coding_exception('Unexpected scale configuration.'); } // Remove the scale ID from the config. array_shift(...
php
public static function get_proficiency_of_grade_from_scale_configuration($config, $grade) { $config = json_decode($config); if (!is_array($config)) { throw new coding_exception('Unexpected scale configuration.'); } // Remove the scale ID from the config. array_shift(...
[ "public", "static", "function", "get_proficiency_of_grade_from_scale_configuration", "(", "$", "config", ",", "$", "grade", ")", "{", "$", "config", "=", "json_decode", "(", "$", "config", ")", ";", "if", "(", "!", "is_array", "(", "$", "config", ")", ")", ...
Extract the proficiency of a grade from a scale configuration. @param string $config JSON encoded config. @param int $grade The grade. @return int Representing a boolean
[ "Extract", "the", "proficiency", "of", "a", "grade", "from", "a", "scale", "configuration", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L391-L407
219,532
moodle/moodle
competency/classes/competency_framework.php
competency_framework.get_taxonomies_list
public static function get_taxonomies_list() { static $list = null; // At some point we'll have to switch to not using static cache, mainly for Unit Tests in case we // decide to allow more taxonomies to be added dynamically from a CFG variable for instance. if ($list === null) { ...
php
public static function get_taxonomies_list() { static $list = null; // At some point we'll have to switch to not using static cache, mainly for Unit Tests in case we // decide to allow more taxonomies to be added dynamically from a CFG variable for instance. if ($list === null) { ...
[ "public", "static", "function", "get_taxonomies_list", "(", ")", "{", "static", "$", "list", "=", "null", ";", "// At some point we'll have to switch to not using static cache, mainly for Unit Tests in case we", "// decide to allow more taxonomies to be added dynamically from a CFG varia...
Get the list of all taxonomies. @return array Where the key is the taxonomy constant, and the value its translation.
[ "Get", "the", "list", "of", "all", "taxonomies", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L424-L446
219,533
moodle/moodle
competency/classes/competency_framework.php
competency_framework.get_unused_idnumber
public static function get_unused_idnumber($idnumber) { global $DB; $currentidnumber = $idnumber; $counter = 0; // Iteratere while the idnumber exists. while ($DB->record_exists_select(static::TABLE, 'idnumber = ?', array($currentidnumber))) { $suffixidnumber = '_' ....
php
public static function get_unused_idnumber($idnumber) { global $DB; $currentidnumber = $idnumber; $counter = 0; // Iteratere while the idnumber exists. while ($DB->record_exists_select(static::TABLE, 'idnumber = ?', array($currentidnumber))) { $suffixidnumber = '_' ....
[ "public", "static", "function", "get_unused_idnumber", "(", "$", "idnumber", ")", "{", "global", "$", "DB", ";", "$", "currentidnumber", "=", "$", "idnumber", ";", "$", "counter", "=", "0", ";", "// Iteratere while the idnumber exists.", "while", "(", "$", "DB...
Get a uniq idnumber. @param string $idnumber the framework idnumber @return string
[ "Get", "a", "uniq", "idnumber", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_framework.php#L454-L467
219,534
moodle/moodle
report/stats/classes/privacy/provider.php
provider.delete_stats
protected static function delete_stats(int $courseid, int $userid = null) { global $DB; $params = (isset($userid)) ? ['courseid' => $courseid, 'userid' => $userid] : ['courseid' => $courseid]; $DB->delete_records('stats_user_daily', $params); $DB->delete_records('stats_user_weekly', $par...
php
protected static function delete_stats(int $courseid, int $userid = null) { global $DB; $params = (isset($userid)) ? ['courseid' => $courseid, 'userid' => $userid] : ['courseid' => $courseid]; $DB->delete_records('stats_user_daily', $params); $DB->delete_records('stats_user_weekly', $par...
[ "protected", "static", "function", "delete_stats", "(", "int", "$", "courseid", ",", "int", "$", "userid", "=", "null", ")", "{", "global", "$", "DB", ";", "$", "params", "=", "(", "isset", "(", "$", "userid", ")", ")", "?", "[", "'courseid'", "=>", ...
Deletes stats for a given course. @param int $courseid The course ID to delete the stats for. @param int $userid Optionally a user id to delete records with.
[ "Deletes", "stats", "for", "a", "given", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/stats/classes/privacy/provider.php#L263-L269
219,535
moodle/moodle
question/type/multichoice/renderer.php
qtype_multichoice_renderer_base.correct_choices
protected function correct_choices(array $right) { // Return appropriate string for single/multiple correct answer(s). if (count($right) == 1) { return get_string('correctansweris', 'qtype_multichoice', implode(', ', $right)); } else if (count($right) > 1)...
php
protected function correct_choices(array $right) { // Return appropriate string for single/multiple correct answer(s). if (count($right) == 1) { return get_string('correctansweris', 'qtype_multichoice', implode(', ', $right)); } else if (count($right) > 1)...
[ "protected", "function", "correct_choices", "(", "array", "$", "right", ")", "{", "// Return appropriate string for single/multiple correct answer(s).", "if", "(", "count", "(", "$", "right", ")", "==", "1", ")", "{", "return", "get_string", "(", "'correctansweris'", ...
Function returns string based on number of correct answers @param array $right An Array of correct responses to the current question @return string based on number of correct responses
[ "Function", "returns", "string", "based", "on", "number", "of", "correct", "answers" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/multichoice/renderer.php#L207-L218
219,536
moodle/moodle
search/classes/document.php
document.add_stored_file
public function add_stored_file($file) { if (is_numeric($file)) { $this->files[$file] = $file; } else { $this->files[$file->get_id()] = $file; } }
php
public function add_stored_file($file) { if (is_numeric($file)) { $this->files[$file] = $file; } else { $this->files[$file->get_id()] = $file; } }
[ "public", "function", "add_stored_file", "(", "$", "file", ")", "{", "if", "(", "is_numeric", "(", "$", "file", ")", ")", "{", "$", "this", "->", "files", "[", "$", "file", "]", "=", "$", "file", ";", "}", "else", "{", "$", "this", "->", "files",...
Add a stored file to the document. @param \stored_file|int $file The file to add, or file id. @return void
[ "Add", "a", "stored", "file", "to", "the", "document", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/document.php#L231-L237
219,537
moodle/moodle
search/classes/document.php
document.get_files
public function get_files() { // The files array can contain stored file ids, so we need to get instances if asked. foreach ($this->files as $id => $listfile) { if (is_numeric($listfile)) { $fs = get_file_storage(); if ($file = $fs->get_file_by_id($id)) { ...
php
public function get_files() { // The files array can contain stored file ids, so we need to get instances if asked. foreach ($this->files as $id => $listfile) { if (is_numeric($listfile)) { $fs = get_file_storage(); if ($file = $fs->get_file_by_id($id)) { ...
[ "public", "function", "get_files", "(", ")", "{", "// The files array can contain stored file ids, so we need to get instances if asked.", "foreach", "(", "$", "this", "->", "files", "as", "$", "id", "=>", "$", "listfile", ")", "{", "if", "(", "is_numeric", "(", "$"...
Returns the array of attached files. @return \stored_file[]
[ "Returns", "the", "array", "of", "attached", "files", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/document.php#L244-L259
219,538
moodle/moodle
search/classes/document.php
document.is_set
public function is_set($field) { return (isset($this->data[$field]) || isset($this->extradata[$field])); }
php
public function is_set($field) { return (isset($this->data[$field]) || isset($this->extradata[$field])); }
[ "public", "function", "is_set", "(", "$", "field", ")", "{", "return", "(", "isset", "(", "$", "this", "->", "data", "[", "$", "field", "]", ")", "||", "isset", "(", "$", "this", "->", "extradata", "[", "$", "field", "]", ")", ")", ";", "}" ]
Checks if a field is set. @param string $field @return bool
[ "Checks", "if", "a", "field", "is", "set", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/document.php#L362-L364
219,539
moodle/moodle
search/classes/document.php
document.set_data_from_engine
public function set_data_from_engine($docdata) { $fields = static::$requiredfields + static::$optionalfields + static::$enginefields; foreach ($fields as $fieldname => $field) { // Optional params might not be there. if (isset($docdata[$fieldname])) { if ($field[...
php
public function set_data_from_engine($docdata) { $fields = static::$requiredfields + static::$optionalfields + static::$enginefields; foreach ($fields as $fieldname => $field) { // Optional params might not be there. if (isset($docdata[$fieldname])) { if ($field[...
[ "public", "function", "set_data_from_engine", "(", "$", "docdata", ")", "{", "$", "fields", "=", "static", "::", "$", "requiredfields", "+", "static", "::", "$", "optionalfields", "+", "static", "::", "$", "enginefields", ";", "foreach", "(", "$", "fields", ...
Fills the document with data coming from the search engine. @throws \core_search\engine_exception @param array $docdata @return void
[ "Fills", "the", "document", "with", "data", "coming", "from", "the", "search", "engine", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/document.php#L465-L483
219,540
moodle/moodle
search/classes/document.php
document.export_for_engine
public function export_for_engine() { // Set any unset defaults. $this->apply_defaults(); // We don't want to affect the document instance. $data = $this->data; // Apply specific engine-dependant formats and restrictions. foreach (static::$requiredfields as $fieldname =...
php
public function export_for_engine() { // Set any unset defaults. $this->apply_defaults(); // We don't want to affect the document instance. $data = $this->data; // Apply specific engine-dependant formats and restrictions. foreach (static::$requiredfields as $fieldname =...
[ "public", "function", "export_for_engine", "(", ")", "{", "// Set any unset defaults.", "$", "this", "->", "apply_defaults", "(", ")", ";", "// We don't want to affect the document instance.", "$", "data", "=", "$", "this", "->", "data", ";", "// Apply specific engine-d...
Returns the document ready to submit to the search engine. @throws \coding_exception @return array
[ "Returns", "the", "document", "ready", "to", "submit", "to", "the", "search", "engine", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/document.php#L541-L587
219,541
moodle/moodle
customfield/field/date/classes/field_controller.php
field_controller.config_form_validation
public function config_form_validation(array $data, $files = array()) : array { $errors = array(); // Make sure the start year is not greater than the end year. if (!empty($data['configdata']['mindate']) && !empty($data['configdata']['maxdate']) && $data['configdata']['mindate']...
php
public function config_form_validation(array $data, $files = array()) : array { $errors = array(); // Make sure the start year is not greater than the end year. if (!empty($data['configdata']['mindate']) && !empty($data['configdata']['maxdate']) && $data['configdata']['mindate']...
[ "public", "function", "config_form_validation", "(", "array", "$", "data", ",", "$", "files", "=", "array", "(", ")", ")", ":", "array", "{", "$", "errors", "=", "array", "(", ")", ";", "// Make sure the start year is not greater than the end year.", "if", "(", ...
Validate the data from the config form. @param array $data @param array $files @return array associative array of error messages
[ "Validate", "the", "data", "from", "the", "config", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/customfield/field/date/classes/field_controller.php#L49-L59
219,542
moodle/moodle
customfield/field/date/classes/field_controller.php
field_controller.config_form_definition
public function config_form_definition(\MoodleQuickForm $mform) { $config = $this->get('configdata'); // Add elements. $mform->addElement('header', 'header_specificsettings', get_string('specificsettings', 'customfield_date')); $mform->setExpanded('header_specificsettings', true); ...
php
public function config_form_definition(\MoodleQuickForm $mform) { $config = $this->get('configdata'); // Add elements. $mform->addElement('header', 'header_specificsettings', get_string('specificsettings', 'customfield_date')); $mform->setExpanded('header_specificsettings', true); ...
[ "public", "function", "config_form_definition", "(", "\\", "MoodleQuickForm", "$", "mform", ")", "{", "$", "config", "=", "$", "this", "->", "get", "(", "'configdata'", ")", ";", "// Add elements.", "$", "mform", "->", "addElement", "(", "'header'", ",", "'h...
Add fields for editing a date field. @param \MoodleQuickForm $mform
[ "Add", "fields", "for", "editing", "a", "date", "field", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/customfield/field/date/classes/field_controller.php#L66-L85
219,543
moodle/moodle
mod/forum/classes/local/factories/renderer.php
renderer.get_discussion_renderer
public function get_discussion_renderer( forum_entity $forum, discussion_entity $discussion, int $displaymode ) : discussion_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $ratingmanager = $this->managerfactory->get_rating_manager(); ...
php
public function get_discussion_renderer( forum_entity $forum, discussion_entity $discussion, int $displaymode ) : discussion_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $ratingmanager = $this->managerfactory->get_rating_manager(); ...
[ "public", "function", "get_discussion_renderer", "(", "forum_entity", "$", "forum", ",", "discussion_entity", "$", "discussion", ",", "int", "$", "displaymode", ")", ":", "discussion_renderer", "{", "$", "capabilitymanager", "=", "$", "this", "->", "managerfactory",...
Create a discussion renderer for the given forum and discussion. @param forum_entity $forum Forum the discussion belongs to @param discussion_entity $discussion Discussion to render @param int $displaymode How should the posts be formatted? @return discussion_renderer
[ "Create", "a", "discussion", "renderer", "for", "the", "given", "forum", "and", "discussion", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/factories/renderer.php#L114-L151
219,544
moodle/moodle
mod/forum/classes/local/factories/renderer.php
renderer.get_posts_search_results_renderer
public function get_posts_search_results_renderer(array $searchterms) : posts_renderer { $urlfactory = $this->urlfactory; return new posts_renderer( $this->rendererbase, $this->builderfactory->get_exported_posts_builder(), 'mod_forum/forum_posts_with_context_links', ...
php
public function get_posts_search_results_renderer(array $searchterms) : posts_renderer { $urlfactory = $this->urlfactory; return new posts_renderer( $this->rendererbase, $this->builderfactory->get_exported_posts_builder(), 'mod_forum/forum_posts_with_context_links', ...
[ "public", "function", "get_posts_search_results_renderer", "(", "array", "$", "searchterms", ")", ":", "posts_renderer", "{", "$", "urlfactory", "=", "$", "this", "->", "urlfactory", ";", "return", "new", "posts_renderer", "(", "$", "this", "->", "rendererbase", ...
Create a posts renderer to render posts in the forum search results. @param string[] $searchterms The search terms to be highlighted in the posts @return posts_renderer
[ "Create", "a", "posts", "renderer", "to", "render", "posts", "in", "the", "forum", "search", "results", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/factories/renderer.php#L274-L341
219,545
moodle/moodle
mod/forum/classes/local/factories/renderer.php
renderer.get_discussion_list_renderer
public function get_discussion_list_renderer( forum_entity $forum ) : discussion_list_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $rendererbase = $this->rendererbase; $notifications = []; switch ($forum->get_type()) { c...
php
public function get_discussion_list_renderer( forum_entity $forum ) : discussion_list_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $rendererbase = $this->rendererbase; $notifications = []; switch ($forum->get_type()) { c...
[ "public", "function", "get_discussion_list_renderer", "(", "forum_entity", "$", "forum", ")", ":", "discussion_list_renderer", "{", "$", "capabilitymanager", "=", "$", "this", "->", "managerfactory", "->", "get_capability_manager", "(", "$", "forum", ")", ";", "$", ...
Create a standard type discussion list renderer. @param forum_entity $forum The forum that the discussions belong to @return discussion_list_renderer
[ "Create", "a", "standard", "type", "discussion", "list", "renderer", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/factories/renderer.php#L387-L431
219,546
moodle/moodle
mod/forum/classes/local/factories/renderer.php
renderer.get_detailed_discussion_list_renderer
private function get_detailed_discussion_list_renderer( forum_entity $forum, string $template ) : discussion_list_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $rendererbase = $this->rendererbase; $notifications = []; return ...
php
private function get_detailed_discussion_list_renderer( forum_entity $forum, string $template ) : discussion_list_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $rendererbase = $this->rendererbase; $notifications = []; return ...
[ "private", "function", "get_detailed_discussion_list_renderer", "(", "forum_entity", "$", "forum", ",", "string", "$", "template", ")", ":", "discussion_list_renderer", "{", "$", "capabilitymanager", "=", "$", "this", "->", "managerfactory", "->", "get_capability_manage...
Create a discussion list renderer which shows more information about the first post. @param forum_entity $forum The forum that the discussions belong to @param string $template The template to use @return discussion_list_renderer
[ "Create", "a", "discussion", "list", "renderer", "which", "shows", "more", "information", "about", "the", "first", "post", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/factories/renderer.php#L440-L496
219,547
moodle/moodle
mod/forum/classes/local/factories/renderer.php
renderer.get_single_discussion_list_renderer
public function get_single_discussion_list_renderer( forum_entity $forum, discussion_entity $discussion, bool $hasmultiplediscussions, int $displaymode ) : discussion_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $ratingmanage...
php
public function get_single_discussion_list_renderer( forum_entity $forum, discussion_entity $discussion, bool $hasmultiplediscussions, int $displaymode ) : discussion_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $ratingmanage...
[ "public", "function", "get_single_discussion_list_renderer", "(", "forum_entity", "$", "forum", ",", "discussion_entity", "$", "discussion", ",", "bool", "$", "hasmultiplediscussions", ",", "int", "$", "displaymode", ")", ":", "discussion_renderer", "{", "$", "capabil...
Create a single type discussion list renderer. @param forum_entity $forum Forum the discussion belongs to @param discussion_entity $discussion The discussion entity @param bool $hasmultiplediscussions Whether the forum has multiple discussions (more than one) @param int $displaymode How should the posts be formatted? ...
[ "Create", "a", "single", "type", "discussion", "list", "renderer", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/factories/renderer.php#L543-L579
219,548
moodle/moodle
lib/behat/core_behat_file_helper.php
core_behat_file_helper.get_filepicker_node
protected function get_filepicker_node($filepickerelement) { // More info about the problem (in case there is a problem). $exception = new ExpectationException('"' . $filepickerelement . '" filepicker can not be found', $this->getSession()); // If no file picker label is mentioned take the fir...
php
protected function get_filepicker_node($filepickerelement) { // More info about the problem (in case there is a problem). $exception = new ExpectationException('"' . $filepickerelement . '" filepicker can not be found', $this->getSession()); // If no file picker label is mentioned take the fir...
[ "protected", "function", "get_filepicker_node", "(", "$", "filepickerelement", ")", "{", "// More info about the problem (in case there is a problem).", "$", "exception", "=", "new", "ExpectationException", "(", "'\"'", ".", "$", "filepickerelement", ".", "'\" filepicker can ...
Gets the NodeElement for filepicker of filemanager moodleform element. The filepicker/filemanager element label is pointing to a hidden input which is not recognized as a named selector, as it is hidden... @throws ExpectationException Thrown by behat_base::find @param string $filepickerelement The filepicker form fie...
[ "Gets", "the", "NodeElement", "for", "filepicker", "of", "filemanager", "moodleform", "element", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/core_behat_file_helper.php#L60-L84
219,549
moodle/moodle
lib/behat/core_behat_file_helper.php
core_behat_file_helper.open_element_contextual_menu
protected function open_element_contextual_menu($name, $filemanagerelement = false) { // If a filemanager is specified we restrict the search to the descendants of this particular filemanager form element. $containernode = false; $exceptionmsg = '"'.$name.'" element can not be found'; i...
php
protected function open_element_contextual_menu($name, $filemanagerelement = false) { // If a filemanager is specified we restrict the search to the descendants of this particular filemanager form element. $containernode = false; $exceptionmsg = '"'.$name.'" element can not be found'; i...
[ "protected", "function", "open_element_contextual_menu", "(", "$", "name", ",", "$", "filemanagerelement", "=", "false", ")", "{", "// If a filemanager is specified we restrict the search to the descendants of this particular filemanager form element.", "$", "containernode", "=", "...
Opens the contextual menu of a folder or a file. Works both in filemanager elements and when dealing with repository elements inside filepicker modal window. @throws ExpectationException Thrown by behat_base::find @param string $name The name of the folder/file @param string $filemanagerelement The filemanager form e...
[ "Opens", "the", "contextual", "menu", "of", "a", "folder", "or", "a", "file", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/core_behat_file_helper.php#L118-L169
219,550
moodle/moodle
lib/behat/core_behat_file_helper.php
core_behat_file_helper.open_add_file_window
protected function open_add_file_window($filemanagernode, $repositoryname) { $exception = new ExpectationException('No files can be added to the specified filemanager', $this->getSession()); // We should deal with single-file and multiple-file filemanagers, // catching the exception thrown by ...
php
protected function open_add_file_window($filemanagernode, $repositoryname) { $exception = new ExpectationException('No files can be added to the specified filemanager', $this->getSession()); // We should deal with single-file and multiple-file filemanagers, // catching the exception thrown by ...
[ "protected", "function", "open_add_file_window", "(", "$", "filemanagernode", ",", "$", "repositoryname", ")", "{", "$", "exception", "=", "new", "ExpectationException", "(", "'No files can be added to the specified filemanager'", ",", "$", "this", "->", "getSession", "...
Opens the filepicker modal window and selects the repository. @throws ExpectationException Thrown by behat_base::find @param NodeElement $filemanagernode The filemanager or filepicker form element DOM node. @param mixed $repositoryname The repo name. @return void
[ "Opens", "the", "filepicker", "modal", "window", "and", "selects", "the", "repository", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/core_behat_file_helper.php#L179-L225
219,551
moodle/moodle
lib/behat/core_behat_file_helper.php
core_behat_file_helper.wait_until_contents_are_updated
protected function wait_until_contents_are_updated($filepickernode) { $exception = new ExpectationException( 'The file manager contents are requiring too much time to be updated', $this->getSession() ); // Looks for the loading image not being displayed. For single-file...
php
protected function wait_until_contents_are_updated($filepickernode) { $exception = new ExpectationException( 'The file manager contents are requiring too much time to be updated', $this->getSession() ); // Looks for the loading image not being displayed. For single-file...
[ "protected", "function", "wait_until_contents_are_updated", "(", "$", "filepickernode", ")", "{", "$", "exception", "=", "new", "ExpectationException", "(", "'The file manager contents are requiring too much time to be updated'", ",", "$", "this", "->", "getSession", "(", "...
Checks that the file manager contents are not being updated. This method is not used by any of our step definitions, keeping it here for users already using it. @throws ExpectationException @param NodeElement $filepickernode The file manager DOM node @return void
[ "Checks", "that", "the", "file", "manager", "contents", "are", "not", "being", "updated", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/core_behat_file_helper.php#L257-L276
219,552
moodle/moodle
repository/nextcloud/classes/ocs_client.php
ocs_client.get_api_functions
public function get_api_functions() { return [ 'create_share' => [ 'endpoint' => $this->ocsendpoint->out(false), 'method' => 'post', 'args' => [ 'path' => PARAM_TEXT, // Could be PARAM_PATH, we really don't want to enforce a Moodle ...
php
public function get_api_functions() { return [ 'create_share' => [ 'endpoint' => $this->ocsendpoint->out(false), 'method' => 'post', 'args' => [ 'path' => PARAM_TEXT, // Could be PARAM_PATH, we really don't want to enforce a Moodle ...
[ "public", "function", "get_api_functions", "(", ")", "{", "return", "[", "'create_share'", "=>", "[", "'endpoint'", "=>", "$", "this", "->", "ocsendpoint", "->", "out", "(", "false", ")", ",", "'method'", "=>", "'post'", ",", "'args'", "=>", "[", "'path'",...
Define relevant functions of the OCS API. Previously, the instruction to create a oauthclient recommended the user to enter the return format (format=xml). However, in this case the shareid is appended at the wrong place. Therefore, a new url is build which inserts the shareid at the suitable place for delete_share an...
[ "Define", "relevant", "functions", "of", "the", "OCS", "API", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/nextcloud/classes/ocs_client.php#L96-L139
219,553
moodle/moodle
repository/nextcloud/classes/ocs_client.php
ocs_client.build_share_url
private function build_share_url() { // Out_omit_querystring() in combination with ocsendpoint->get_path() is not used since both function include // /ocs/v1.php. $shareurl = $this->ocsendpoint->get_scheme() . '://' . $this->ocsendpoint->get_host() . ':' . $this->ocsendpoint->get_por...
php
private function build_share_url() { // Out_omit_querystring() in combination with ocsendpoint->get_path() is not used since both function include // /ocs/v1.php. $shareurl = $this->ocsendpoint->get_scheme() . '://' . $this->ocsendpoint->get_host() . ':' . $this->ocsendpoint->get_por...
[ "private", "function", "build_share_url", "(", ")", "{", "// Out_omit_querystring() in combination with ocsendpoint->get_path() is not used since both function include", "// /ocs/v1.php.", "$", "shareurl", "=", "$", "this", "->", "ocsendpoint", "->", "get_scheme", "(", ")", "."...
Private Function to return a url with the shareid in the path. @return string
[ "Private", "Function", "to", "return", "a", "url", "with", "the", "shareid", "in", "the", "path", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/nextcloud/classes/ocs_client.php#L145-L152
219,554
moodle/moodle
repository/filesystem/classes/task/cron_task.php
cron_task.execute
public function execute() { global $CFG; require_once($CFG->dirroot . '/repository/lib.php'); $fs = get_file_storage(); // Find all generated thumbnails and group them in array by itemid (itemid == repository instance id). $allfiles = array_merge( $fs->get_area_files...
php
public function execute() { global $CFG; require_once($CFG->dirroot . '/repository/lib.php'); $fs = get_file_storage(); // Find all generated thumbnails and group them in array by itemid (itemid == repository instance id). $allfiles = array_merge( $fs->get_area_files...
[ "public", "function", "execute", "(", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/repository/lib.php'", ")", ";", "$", "fs", "=", "get_file_storage", "(", ")", ";", "// Find all generated thumbnails and group th...
Run file system repository cron.
[ "Run", "file", "system", "repository", "cron", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/filesystem/classes/task/cron_task.php#L40-L71
219,555
moodle/moodle
privacy/classes/local/sitepolicy/default_handler.php
default_handler.is_defined
public static function is_defined($forguests = false) { global $CFG; if (!empty($CFG->sitepolicyhandler)) { // This handler can also be used as a fallback in case of invalid $CFG->sitepolicyhandler, // in this case assume that no site policy is set. return false; ...
php
public static function is_defined($forguests = false) { global $CFG; if (!empty($CFG->sitepolicyhandler)) { // This handler can also be used as a fallback in case of invalid $CFG->sitepolicyhandler, // in this case assume that no site policy is set. return false; ...
[ "public", "static", "function", "is_defined", "(", "$", "forguests", "=", "false", ")", "{", "global", "$", "CFG", ";", "if", "(", "!", "empty", "(", "$", "CFG", "->", "sitepolicyhandler", ")", ")", "{", "// This handler can also be used as a fallback in case of...
Checks if the site has site policy defined @param bool $forguests @return bool
[ "Checks", "if", "the", "site", "has", "site", "policy", "defined" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/sitepolicy/default_handler.php#L46-L58
219,556
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.create_subscription
public static function create_subscription($ruleid, $courseid, $cmid, $userid = 0) { global $DB, $USER; $subscription = new \stdClass(); $subscription->ruleid = $ruleid; $subscription->courseid = $courseid; $subscription->cmid = $cmid; $subscription->userid = empty($user...
php
public static function create_subscription($ruleid, $courseid, $cmid, $userid = 0) { global $DB, $USER; $subscription = new \stdClass(); $subscription->ruleid = $ruleid; $subscription->courseid = $courseid; $subscription->cmid = $cmid; $subscription->userid = empty($user...
[ "public", "static", "function", "create_subscription", "(", "$", "ruleid", ",", "$", "courseid", ",", "$", "cmid", ",", "$", "userid", "=", "0", ")", "{", "global", "$", "DB", ",", "$", "USER", ";", "$", "subscription", "=", "new", "\\", "stdClass", ...
Subscribe a user to a given rule. @param int $ruleid Rule id. @param int $courseid Course id. @param int $cmid Course module id. @param int $userid User who is subscribing, defaults to $USER. @return bool|int returns id of the created subscription.
[ "Subscribe", "a", "user", "to", "a", "given", "rule", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L52-L92
219,557
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.delete_subscription
public static function delete_subscription($subscriptionorid, $checkuser = true) { global $DB, $USER; if (is_object($subscriptionorid)) { $subscription = $subscriptionorid; } else { $subscription = self::get_subscription($subscriptionorid); } if ($checkuse...
php
public static function delete_subscription($subscriptionorid, $checkuser = true) { global $DB, $USER; if (is_object($subscriptionorid)) { $subscription = $subscriptionorid; } else { $subscription = self::get_subscription($subscriptionorid); } if ($checkuse...
[ "public", "static", "function", "delete_subscription", "(", "$", "subscriptionorid", ",", "$", "checkuser", "=", "true", ")", "{", "global", "$", "DB", ",", "$", "USER", ";", "if", "(", "is_object", "(", "$", "subscriptionorid", ")", ")", "{", "$", "subs...
Delete a subscription. @param subscription|int $subscriptionorid an instance of subscription class or id. @param bool $checkuser Check if the subscription belongs to current user before deleting. @return bool @throws \coding_exception if $checkuser is true and the subscription doesn't belong to the current user.
[ "Delete", "a", "subscription", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L103-L145
219,558
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.remove_all_subscriptions_for_rule
public static function remove_all_subscriptions_for_rule($ruleid, $coursecontext = null) { global $DB; // Store all the subscriptions we have to delete. $subscriptions = $DB->get_recordset('tool_monitor_subscriptions', array('ruleid' => $ruleid)); // Now delete them. $success =...
php
public static function remove_all_subscriptions_for_rule($ruleid, $coursecontext = null) { global $DB; // Store all the subscriptions we have to delete. $subscriptions = $DB->get_recordset('tool_monitor_subscriptions', array('ruleid' => $ruleid)); // Now delete them. $success =...
[ "public", "static", "function", "remove_all_subscriptions_for_rule", "(", "$", "ruleid", ",", "$", "coursecontext", "=", "null", ")", "{", "global", "$", "DB", ";", "// Store all the subscriptions we have to delete.", "$", "subscriptions", "=", "$", "DB", "->", "get...
Delete all subscribers for a given rule. @param int $ruleid rule id. @param \context|null $coursecontext the context of the course - this is passed when we can not get the context via \context_course as the course has been deleted. @return bool
[ "Delete", "all", "subscribers", "for", "a", "given", "rule", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L180-L224
219,559
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.remove_all_subscriptions_in_course
public static function remove_all_subscriptions_in_course($coursecontext) { global $DB; // Store all the subscriptions we have to delete. if ($subscriptions = $DB->get_records('tool_monitor_subscriptions', ['courseid' => $coursecontext->instanceid])) { // Delete subscriptions in bul...
php
public static function remove_all_subscriptions_in_course($coursecontext) { global $DB; // Store all the subscriptions we have to delete. if ($subscriptions = $DB->get_records('tool_monitor_subscriptions', ['courseid' => $coursecontext->instanceid])) { // Delete subscriptions in bul...
[ "public", "static", "function", "remove_all_subscriptions_in_course", "(", "$", "coursecontext", ")", "{", "global", "$", "DB", ";", "// Store all the subscriptions we have to delete.", "if", "(", "$", "subscriptions", "=", "$", "DB", "->", "get_records", "(", "'tool_...
Delete all subscriptions in a course. This is called after a course was deleted, context no longer exists but we kept the object @param \context_course $coursecontext the context of the course
[ "Delete", "all", "subscriptions", "in", "a", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L233-L249
219,560
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.get_subscription
public static function get_subscription($subscriptionorid) { global $DB; if (is_object($subscriptionorid)) { return new subscription($subscriptionorid); } $sql = self::get_subscription_join_rule_sql(); $sql .= "WHERE s.id = :id"; $sub = $DB->get_record_sql($...
php
public static function get_subscription($subscriptionorid) { global $DB; if (is_object($subscriptionorid)) { return new subscription($subscriptionorid); } $sql = self::get_subscription_join_rule_sql(); $sql .= "WHERE s.id = :id"; $sub = $DB->get_record_sql($...
[ "public", "static", "function", "get_subscription", "(", "$", "subscriptionorid", ")", "{", "global", "$", "DB", ";", "if", "(", "is_object", "(", "$", "subscriptionorid", ")", ")", "{", "return", "new", "subscription", "(", "$", "subscriptionorid", ")", ";"...
Get a subscription instance for an given subscription id. @param subscription|int $subscriptionorid an instance of subscription class or id. @return subscription returns a instance of subscription class.
[ "Get", "a", "subscription", "instance", "for", "an", "given", "subscription", "id", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L258-L269
219,561
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.get_user_subscriptions_for_course
public static function get_user_subscriptions_for_course($courseid, $limitfrom = 0, $limitto = 0, $userid = 0, $order = 's.timecreated DESC' ) { global $DB, $USER; if ($userid == 0) { $userid = $USER->id; } $sql = self::get_subscription_join_rule_sql(); $s...
php
public static function get_user_subscriptions_for_course($courseid, $limitfrom = 0, $limitto = 0, $userid = 0, $order = 's.timecreated DESC' ) { global $DB, $USER; if ($userid == 0) { $userid = $USER->id; } $sql = self::get_subscription_join_rule_sql(); $s...
[ "public", "static", "function", "get_user_subscriptions_for_course", "(", "$", "courseid", ",", "$", "limitfrom", "=", "0", ",", "$", "limitto", "=", "0", ",", "$", "userid", "=", "0", ",", "$", "order", "=", "'s.timecreated DESC'", ")", "{", "global", "$"...
Get an array of subscriptions for a given user in a given course. @param int $courseid course id. @param int $limitfrom Limit from which to fetch rules. @param int $limitto Limit to which rules need to be fetched. @param int $userid Id of the user for which the subscription needs to be fetched. Defaults to $USER; @pa...
[ "Get", "an", "array", "of", "subscriptions", "for", "a", "given", "user", "in", "a", "given", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L282-L293
219,562
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.count_user_subscriptions_for_course
public static function count_user_subscriptions_for_course($courseid, $userid = 0) { global $DB, $USER; if ($userid == 0) { $userid = $USER->id; } $sql = self::get_subscription_join_rule_sql(true); $sql .= "WHERE s.courseid = :courseid AND s.userid = :userid"; ...
php
public static function count_user_subscriptions_for_course($courseid, $userid = 0) { global $DB, $USER; if ($userid == 0) { $userid = $USER->id; } $sql = self::get_subscription_join_rule_sql(true); $sql .= "WHERE s.courseid = :courseid AND s.userid = :userid"; ...
[ "public", "static", "function", "count_user_subscriptions_for_course", "(", "$", "courseid", ",", "$", "userid", "=", "0", ")", "{", "global", "$", "DB", ",", "$", "USER", ";", "if", "(", "$", "userid", "==", "0", ")", "{", "$", "userid", "=", "$", "...
Get count of subscriptions for a given user in a given course. @param int $courseid course id. @param int $userid Id of the user for which the subscription needs to be fetched. Defaults to $USER; @return int number of subscriptions
[ "Get", "count", "of", "subscriptions", "for", "a", "given", "user", "in", "a", "given", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L303-L312
219,563
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.count_user_subscriptions
public static function count_user_subscriptions($userid = 0) { global $DB, $USER;; if ($userid == 0) { $userid = $USER->id; } $sql = self::get_subscription_join_rule_sql(true); $sql .= "WHERE s.userid = :userid"; return $DB->count_records_sql($sql, array('use...
php
public static function count_user_subscriptions($userid = 0) { global $DB, $USER;; if ($userid == 0) { $userid = $USER->id; } $sql = self::get_subscription_join_rule_sql(true); $sql .= "WHERE s.userid = :userid"; return $DB->count_records_sql($sql, array('use...
[ "public", "static", "function", "count_user_subscriptions", "(", "$", "userid", "=", "0", ")", "{", "global", "$", "DB", ",", "$", "USER", ";", ";", "if", "(", "$", "userid", "==", "0", ")", "{", "$", "userid", "=", "$", "USER", "->", "id", ";", ...
Get count of subscriptions for a given user. @param int $userid Id of the user for which the subscription needs to be fetched. Defaults to $USER; @return int number of subscriptions
[ "Get", "count", "of", "subscriptions", "for", "a", "given", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L343-L352
219,564
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.get_subscriptions_by_event
public static function get_subscriptions_by_event(\stdClass $event) { global $DB; $sql = self::get_subscription_join_rule_sql(); if ($event->contextlevel == CONTEXT_MODULE && $event->contextinstanceid != 0) { $sql .= "WHERE r.eventname = :eventname AND s.courseid = :courseid AND (s....
php
public static function get_subscriptions_by_event(\stdClass $event) { global $DB; $sql = self::get_subscription_join_rule_sql(); if ($event->contextlevel == CONTEXT_MODULE && $event->contextinstanceid != 0) { $sql .= "WHERE r.eventname = :eventname AND s.courseid = :courseid AND (s....
[ "public", "static", "function", "get_subscriptions_by_event", "(", "\\", "stdClass", "$", "event", ")", "{", "global", "$", "DB", ";", "$", "sql", "=", "self", "::", "get_subscription_join_rule_sql", "(", ")", ";", "if", "(", "$", "event", "->", "contextleve...
Return a list of subscriptions for a given event. @param \stdClass $event the event object. @return array
[ "Return", "a", "list", "of", "subscriptions", "for", "a", "given", "event", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L361-L373
219,565
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.count_rule_subscriptions
public static function count_rule_subscriptions($ruleid) { global $DB; $sql = self::get_subscription_join_rule_sql(true); $sql .= "WHERE s.ruleid = :ruleid"; return $DB->count_records_sql($sql, array('ruleid' => $ruleid)); }
php
public static function count_rule_subscriptions($ruleid) { global $DB; $sql = self::get_subscription_join_rule_sql(true); $sql .= "WHERE s.ruleid = :ruleid"; return $DB->count_records_sql($sql, array('ruleid' => $ruleid)); }
[ "public", "static", "function", "count_rule_subscriptions", "(", "$", "ruleid", ")", "{", "global", "$", "DB", ";", "$", "sql", "=", "self", "::", "get_subscription_join_rule_sql", "(", "true", ")", ";", "$", "sql", ".=", "\"WHERE s.ruleid = :ruleid\"", ";", "...
Get count of subscriptions for a given rule. @param int $ruleid rule id of the subscription. @return int number of subscriptions
[ "Get", "count", "of", "subscriptions", "for", "a", "given", "rule", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L418-L424
219,566
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.event_has_subscriptions
public static function event_has_subscriptions($eventname, $courseid) { global $DB; // Check if we can return these from cache. $cache = \cache::make('tool_monitor', 'eventsubscriptions'); // The SQL we will be using to fill the cache if it is empty. $sql = "SELECT DISTINCT(r.e...
php
public static function event_has_subscriptions($eventname, $courseid) { global $DB; // Check if we can return these from cache. $cache = \cache::make('tool_monitor', 'eventsubscriptions'); // The SQL we will be using to fill the cache if it is empty. $sql = "SELECT DISTINCT(r.e...
[ "public", "static", "function", "event_has_subscriptions", "(", "$", "eventname", ",", "$", "courseid", ")", "{", "global", "$", "DB", ";", "// Check if we can return these from cache.", "$", "cache", "=", "\\", "cache", "::", "make", "(", "'tool_monitor'", ",", ...
Returns true if an event in a particular course has a subscription. @param string $eventname the name of the event @param int $courseid the course id @return bool returns true if the event has subscriptions in a given course, false otherwise.
[ "Returns", "true", "if", "an", "event", "in", "a", "particular", "course", "has", "a", "subscription", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L433-L488
219,567
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.activate_subscriptions
public static function activate_subscriptions(array $ids) { global $DB; if (!empty($ids)) { list($sql, $params) = $DB->get_in_or_equal($ids); $success = $DB->set_field_select('tool_monitor_subscriptions', 'inactivedate', '0', 'id ' . $sql, $params); return $success; ...
php
public static function activate_subscriptions(array $ids) { global $DB; if (!empty($ids)) { list($sql, $params) = $DB->get_in_or_equal($ids); $success = $DB->set_field_select('tool_monitor_subscriptions', 'inactivedate', '0', 'id ' . $sql, $params); return $success; ...
[ "public", "static", "function", "activate_subscriptions", "(", "array", "$", "ids", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "empty", "(", "$", "ids", ")", ")", "{", "list", "(", "$", "sql", ",", "$", "params", ")", "=", "$", "DB", "->...
Activates a group of subscriptions based on an input array of ids. @since 3.2.0 @param array $ids of subscription ids. @return bool true if the operation was successful, false otherwise.
[ "Activates", "a", "group", "of", "subscriptions", "based", "on", "an", "input", "array", "of", "ids", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L497-L505
219,568
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.deactivate_subscriptions
public static function deactivate_subscriptions(array $ids) { global $DB; if (!empty($ids)) { $inactivedate = time(); list($sql, $params) = $DB->get_in_or_equal($ids); $success = $DB->set_field_select('tool_monitor_subscriptions', 'inactivedate', $inactivedate, 'id ' ...
php
public static function deactivate_subscriptions(array $ids) { global $DB; if (!empty($ids)) { $inactivedate = time(); list($sql, $params) = $DB->get_in_or_equal($ids); $success = $DB->set_field_select('tool_monitor_subscriptions', 'inactivedate', $inactivedate, 'id ' ...
[ "public", "static", "function", "deactivate_subscriptions", "(", "array", "$", "ids", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "empty", "(", "$", "ids", ")", ")", "{", "$", "inactivedate", "=", "time", "(", ")", ";", "list", "(", "$", "s...
Deactivates a group of subscriptions based on an input array of ids. @since 3.2.0 @param array $ids of subscription ids. @return bool true if the operation was successful, false otherwise.
[ "Deactivates", "a", "group", "of", "subscriptions", "based", "on", "an", "input", "array", "of", "ids", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L514-L524
219,569
moodle/moodle
admin/tool/monitor/classes/subscription_manager.php
subscription_manager.delete_stale_subscriptions
public static function delete_stale_subscriptions($userid = 0) { global $DB; // Get the expiry duration, in days. $cutofftime = strtotime("-" . self::INACTIVE_SUBSCRIPTION_LIFESPAN_IN_DAYS . " days", time()); if (!empty($userid)) { // Remove any stale subscriptions for the d...
php
public static function delete_stale_subscriptions($userid = 0) { global $DB; // Get the expiry duration, in days. $cutofftime = strtotime("-" . self::INACTIVE_SUBSCRIPTION_LIFESPAN_IN_DAYS . " days", time()); if (!empty($userid)) { // Remove any stale subscriptions for the d...
[ "public", "static", "function", "delete_stale_subscriptions", "(", "$", "userid", "=", "0", ")", "{", "global", "$", "DB", ";", "// Get the expiry duration, in days.", "$", "cutofftime", "=", "strtotime", "(", "\"-\"", ".", "self", "::", "INACTIVE_SUBSCRIPTION_LIFES...
Deletes subscriptions which have been inactive for a period of time. @since 3.2.0 @param int $userid if provided, only this user's stale subscriptions will be deleted. @return bool true if the operation was successful, false otherwise.
[ "Deletes", "subscriptions", "which", "have", "been", "inactive", "for", "a", "period", "of", "time", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/subscription_manager.php#L533-L551
219,570
moodle/moodle
lib/htmlpurifier/HTMLPurifier/PercentEncoder.php
HTMLPurifier_PercentEncoder.encode
public function encode($string) { $ret = ''; for ($i = 0, $c = strlen($string); $i < $c; $i++) { if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])])) { $ret .= '%' . sprintf('%02X', $int); } else { $ret .= $string[$i]; ...
php
public function encode($string) { $ret = ''; for ($i = 0, $c = strlen($string); $i < $c; $i++) { if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])])) { $ret .= '%' . sprintf('%02X', $int); } else { $ret .= $string[$i]; ...
[ "public", "function", "encode", "(", "$", "string", ")", "{", "$", "ret", "=", "''", ";", "for", "(", "$", "i", "=", "0", ",", "$", "c", "=", "strlen", "(", "$", "string", ")", ";", "$", "i", "<", "$", "c", ";", "$", "i", "++", ")", "{", ...
Our replacement for urlencode, it encodes all non-reserved characters, as well as any extra characters that were instructed to be preserved. @note Assumes that the string has already been normalized, making any and all percent escape sequences valid. Percents will not be re-escaped, regardless of their status in $prese...
[ "Our", "replacement", "for", "urlencode", "it", "encodes", "all", "non", "-", "reserved", "characters", "as", "well", "as", "any", "extra", "characters", "that", "were", "instructed", "to", "be", "preserved", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/PercentEncoder.php#L59-L70
219,571
moodle/moodle
customfield/field/textarea/classes/data_controller.php
data_controller.value_editor_options
protected function value_editor_options() { /** @var field_controller $field */ $field = $this->get_field(); return $field->value_editor_options($this->get('id') ? $this->get_context() : null); }
php
protected function value_editor_options() { /** @var field_controller $field */ $field = $this->get_field(); return $field->value_editor_options($this->get('id') ? $this->get_context() : null); }
[ "protected", "function", "value_editor_options", "(", ")", "{", "/** @var field_controller $field */", "$", "field", "=", "$", "this", "->", "get_field", "(", ")", ";", "return", "$", "field", "->", "value_editor_options", "(", "$", "this", "->", "get", "(", "...
Options for the editor @return array
[ "Options", "for", "the", "editor" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/customfield/field/textarea/classes/data_controller.php#L51-L55
219,572
moodle/moodle
backup/util/ui/base_ui_stage.class.php
base_ui_stage.display
public function display(core_backup_renderer $renderer) { $form = $this->initialise_stage_form(); // A nasty hack follows to work around the sad fact that moodle quickforms // do not allow to actually return the HTML content, just to echo it. flush(); ob_start(); $form->...
php
public function display(core_backup_renderer $renderer) { $form = $this->initialise_stage_form(); // A nasty hack follows to work around the sad fact that moodle quickforms // do not allow to actually return the HTML content, just to echo it. flush(); ob_start(); $form->...
[ "public", "function", "display", "(", "core_backup_renderer", "$", "renderer", ")", "{", "$", "form", "=", "$", "this", "->", "initialise_stage_form", "(", ")", ";", "// A nasty hack follows to work around the sad fact that moodle quickforms", "// do not allow to actually ret...
Displays the stage. By default this involves instantiating the form for the stage and the calling it to display. @param core_backup_renderer $renderer @return string HTML code to echo
[ "Displays", "the", "stage", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/ui/base_ui_stage.class.php#L135-L147
219,573
moodle/moodle
backup/moodle2/backup_qtype_plugin.class.php
backup_qtype_plugin.get_components_and_fileareas
public static function get_components_and_fileareas($filter = null) { $components = array(); // Get all the plugins of this type $qtypes = core_component::get_plugin_list('qtype'); foreach ($qtypes as $name => $path) { // Apply filter if specified if (!is_null($fi...
php
public static function get_components_and_fileareas($filter = null) { $components = array(); // Get all the plugins of this type $qtypes = core_component::get_plugin_list('qtype'); foreach ($qtypes as $name => $path) { // Apply filter if specified if (!is_null($fi...
[ "public", "static", "function", "get_components_and_fileareas", "(", "$", "filter", "=", "null", ")", "{", "$", "components", "=", "array", "(", ")", ";", "// Get all the plugins of this type", "$", "qtypes", "=", "core_component", "::", "get_plugin_list", "(", "'...
Returns all the components and fileareas used by all the installed qtypes The method introspects each qtype, asking it about fileareas used. Then, one 2-level array is returned. 1st level is the component name (qtype_xxxx) and 2nd level is one array of filearea => mappings to look Note that this function is used both...
[ "Returns", "all", "the", "components", "and", "fileareas", "used", "by", "all", "the", "installed", "qtypes" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/backup_qtype_plugin.class.php#L176-L198
219,574
moodle/moodle
repository/upload/lib.php
repository_upload.upload
public function upload($saveas_filename, $maxbytes) { global $CFG; $types = optional_param_array('accepted_types', '*', PARAM_RAW); $savepath = optional_param('savepath', '/', PARAM_PATH); $itemid = optional_param('itemid', 0, PARAM_INT); $license = optional_param('license', ...
php
public function upload($saveas_filename, $maxbytes) { global $CFG; $types = optional_param_array('accepted_types', '*', PARAM_RAW); $savepath = optional_param('savepath', '/', PARAM_PATH); $itemid = optional_param('itemid', 0, PARAM_INT); $license = optional_param('license', ...
[ "public", "function", "upload", "(", "$", "saveas_filename", ",", "$", "maxbytes", ")", "{", "global", "$", "CFG", ";", "$", "types", "=", "optional_param_array", "(", "'accepted_types'", ",", "'*'", ",", "PARAM_RAW", ")", ";", "$", "savepath", "=", "optio...
Process uploaded file @return array|bool
[ "Process", "uploaded", "file" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/upload/lib.php#L52-L64
219,575
moodle/moodle
repository/upload/lib.php
repository_upload.get_listing
public function get_listing($path = '', $page = '') { global $CFG; $ret = array(); $ret['nologin'] = true; $ret['nosearch'] = true; $ret['norefresh'] = true; $ret['list'] = array(); $ret['dynload'] = false; $ret['upload'] = array('label'=>get_string('atta...
php
public function get_listing($path = '', $page = '') { global $CFG; $ret = array(); $ret['nologin'] = true; $ret['nosearch'] = true; $ret['norefresh'] = true; $ret['list'] = array(); $ret['dynload'] = false; $ret['upload'] = array('label'=>get_string('atta...
[ "public", "function", "get_listing", "(", "$", "path", "=", "''", ",", "$", "page", "=", "''", ")", "{", "global", "$", "CFG", ";", "$", "ret", "=", "array", "(", ")", ";", "$", "ret", "[", "'nologin'", "]", "=", "true", ";", "$", "ret", "[", ...
Return a upload form @return array
[ "Return", "a", "upload", "form" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/upload/lib.php#L269-L280
219,576
moodle/moodle
mod/assign/feedbackplugin.php
assign_feedback_plugin.is_feedback_modified
public function is_feedback_modified(stdClass $grade, stdClass $data) { debugging('This plugin (' . $this->get_name() . ') has not overwritten the is_feedback_modified() method. Please add this method to your plugin', DEBUG_DEVELOPER); return true; }
php
public function is_feedback_modified(stdClass $grade, stdClass $data) { debugging('This plugin (' . $this->get_name() . ') has not overwritten the is_feedback_modified() method. Please add this method to your plugin', DEBUG_DEVELOPER); return true; }
[ "public", "function", "is_feedback_modified", "(", "stdClass", "$", "grade", ",", "stdClass", "$", "data", ")", "{", "debugging", "(", "'This plugin ('", ".", "$", "this", "->", "get_name", "(", ")", ".", "') has not overwritten the is_feedback_modified() method.\n ...
Has the plugin form element been modified in the current submission? @param stdClass $grade The grade. @param stdClass $data Form data from the feedback form. @return boolean - True if the form element has been modified.
[ "Has", "the", "plugin", "form", "element", "been", "modified", "in", "the", "current", "submission?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedbackplugin.php#L144-L148
219,577
moodle/moodle
user/filters/lib.php
user_filtering.get_sql_filter
public function get_sql_filter($extra='', array $params=null) { global $SESSION; $sqls = array(); if ($extra != '') { $sqls[] = $extra; } $params = (array)$params; if (!empty($SESSION->user_filtering)) { foreach ($SESSION->user_filtering as $fnam...
php
public function get_sql_filter($extra='', array $params=null) { global $SESSION; $sqls = array(); if ($extra != '') { $sqls[] = $extra; } $params = (array)$params; if (!empty($SESSION->user_filtering)) { foreach ($SESSION->user_filtering as $fnam...
[ "public", "function", "get_sql_filter", "(", "$", "extra", "=", "''", ",", "array", "$", "params", "=", "null", ")", "{", "global", "$", "SESSION", ";", "$", "sqls", "=", "array", "(", ")", ";", "if", "(", "$", "extra", "!=", "''", ")", "{", "$",...
Returns sql where statement based on active user filters @param string $extra sql @param array $params named params (recommended prefix ex) @return array sql string and $params
[ "Returns", "sql", "where", "statement", "based", "on", "active", "user", "filters" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/filters/lib.php#L204-L233
219,578
moodle/moodle
grade/grading/form/guide/edit_form.php
gradingform_guide_editguide.definition
public function definition() { $form = $this->_form; $form->addElement('hidden', 'areaid'); $form->setType('areaid', PARAM_INT); $form->addElement('hidden', 'returnurl'); $form->setType('returnurl', PARAM_LOCALURL); // Name. $form->addElement('text', 'name', ge...
php
public function definition() { $form = $this->_form; $form->addElement('hidden', 'areaid'); $form->setType('areaid', PARAM_INT); $form->addElement('hidden', 'returnurl'); $form->setType('returnurl', PARAM_LOCALURL); // Name. $form->addElement('text', 'name', ge...
[ "public", "function", "definition", "(", ")", "{", "$", "form", "=", "$", "this", "->", "_form", ";", "$", "form", "->", "addElement", "(", "'hidden'", ",", "'areaid'", ")", ";", "$", "form", "->", "setType", "(", "'areaid'", ",", "PARAM_INT", ")", "...
Form element definition
[ "Form", "element", "definition" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/edit_form.php#L44-L88
219,579
moodle/moodle
grade/grading/form/guide/edit_form.php
gradingform_guide_editguide.need_confirm_regrading
public function need_confirm_regrading($controller) { $data = $this->get_data(); if (isset($data->guide['regrade'])) { // We have already displayed the confirmation on the previous step. return false; } if (!isset($data->saveguide) || !$data->saveguide) { ...
php
public function need_confirm_regrading($controller) { $data = $this->get_data(); if (isset($data->guide['regrade'])) { // We have already displayed the confirmation on the previous step. return false; } if (!isset($data->saveguide) || !$data->saveguide) { ...
[ "public", "function", "need_confirm_regrading", "(", "$", "controller", ")", "{", "$", "data", "=", "$", "this", "->", "get_data", "(", ")", ";", "if", "(", "isset", "(", "$", "data", "->", "guide", "[", "'regrade'", "]", ")", ")", "{", "// We have alr...
Check if there are changes in the guide and it is needed to ask user whether to mark the current grades for re-grading. User may confirm re-grading and continue, return to editing or cancel the changes @param gradingform_guide_controller $controller
[ "Check", "if", "there", "are", "changes", "in", "the", "guide", "and", "it", "is", "needed", "to", "ask", "user", "whether", "to", "mark", "the", "current", "grades", "for", "re", "-", "grading", ".", "User", "may", "confirm", "re", "-", "grading", "an...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/edit_form.php#L165-L204
219,580
moodle/moodle
question/type/numerical/backup/moodle1/lib.php
moodle1_qtype_numerical_handler.process_question
public function process_question(array $data, array $raw) { // Convert and write the answers first. if (isset($data['answers'])) { $this->write_answers($data['answers'], $this->pluginname); } // Convert and write the numerical units and numerical options. if (isset(...
php
public function process_question(array $data, array $raw) { // Convert and write the answers first. if (isset($data['answers'])) { $this->write_answers($data['answers'], $this->pluginname); } // Convert and write the numerical units and numerical options. if (isset(...
[ "public", "function", "process_question", "(", "array", "$", "data", ",", "array", "$", "raw", ")", "{", "// Convert and write the answers first.", "if", "(", "isset", "(", "$", "data", "[", "'answers'", "]", ")", ")", "{", "$", "this", "->", "write_answers"...
Appends the numerical specific information to the question
[ "Appends", "the", "numerical", "specific", "information", "to", "the", "question" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/numerical/backup/moodle1/lib.php#L45-L74
219,581
moodle/moodle
admin/tool/monitor/classes/privacy/provider.php
provider.export_user_data
public static function export_user_data(approved_contextlist $contextlist) { global $DB; // Export rules. $context = \context_user::instance($contextlist->get_user()->id); $rules = $DB->get_records('tool_monitor_rules', ['userid' => $contextlist->get_user()->id]); if ($rules) { ...
php
public static function export_user_data(approved_contextlist $contextlist) { global $DB; // Export rules. $context = \context_user::instance($contextlist->get_user()->id); $rules = $DB->get_records('tool_monitor_rules', ['userid' => $contextlist->get_user()->id]); if ($rules) { ...
[ "public", "static", "function", "export_user_data", "(", "approved_contextlist", "$", "contextlist", ")", "{", "global", "$", "DB", ";", "// Export rules.", "$", "context", "=", "\\", "context_user", "::", "instance", "(", "$", "contextlist", "->", "get_user", "...
Export all event monitor information for the list of contexts and this user. @param approved_contextlist $contextlist The list of approved contexts for a user.
[ "Export", "all", "event", "monitor", "information", "for", "the", "list", "of", "contexts", "and", "this", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/privacy/provider.php#L135-L148
219,582
moodle/moodle
admin/tool/monitor/classes/privacy/provider.php
provider.delete_user_data
protected static function delete_user_data(int $userid) { global $DB; // Delete this user's subscriptions first. subscription_manager::delete_user_subscriptions($userid); // Because we only use user contexts the instance ID is the user ID. // Get the rules and check if this user ...
php
protected static function delete_user_data(int $userid) { global $DB; // Delete this user's subscriptions first. subscription_manager::delete_user_subscriptions($userid); // Because we only use user contexts the instance ID is the user ID. // Get the rules and check if this user ...
[ "protected", "static", "function", "delete_user_data", "(", "int", "$", "userid", ")", "{", "global", "$", "DB", ";", "// Delete this user's subscriptions first.", "subscription_manager", "::", "delete_user_subscriptions", "(", "$", "userid", ")", ";", "// Because we on...
This does the deletion of user data for the event monitor. @param int $userid The user ID
[ "This", "does", "the", "deletion", "of", "user", "data", "for", "the", "event", "monitor", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/privacy/provider.php#L192-L206
219,583
moodle/moodle
admin/tool/monitor/classes/privacy/provider.php
provider.export_monitor_rules
protected static function export_monitor_rules(array $rules, \context_user $context) { foreach ($rules as $rule) { $rule = rule_manager::get_rule($rule); $ruledata = new \stdClass(); $ruledata->name = $rule->name; $ruledata->eventname = $rule->get_event_name(); ...
php
protected static function export_monitor_rules(array $rules, \context_user $context) { foreach ($rules as $rule) { $rule = rule_manager::get_rule($rule); $ruledata = new \stdClass(); $ruledata->name = $rule->name; $ruledata->eventname = $rule->get_event_name(); ...
[ "protected", "static", "function", "export_monitor_rules", "(", "array", "$", "rules", ",", "\\", "context_user", "$", "context", ")", "{", "foreach", "(", "$", "rules", "as", "$", "rule", ")", "{", "$", "rule", "=", "rule_manager", "::", "get_rule", "(", ...
This formats and then exports the monitor rules. @param array $rules The monitor rules. @param context_user $context The user context
[ "This", "formats", "and", "then", "exports", "the", "monitor", "rules", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/privacy/provider.php#L214-L230
219,584
moodle/moodle
admin/tool/monitor/classes/privacy/provider.php
provider.export_monitor_subscriptions
protected static function export_monitor_subscriptions(array $subscriptions, \context_user $context) { foreach ($subscriptions as $subscription) { $subscriptiondata = new \stdClass(); $subscriptiondata->instancename = $subscription->get_instance_name(); $subscriptiondata->eve...
php
protected static function export_monitor_subscriptions(array $subscriptions, \context_user $context) { foreach ($subscriptions as $subscription) { $subscriptiondata = new \stdClass(); $subscriptiondata->instancename = $subscription->get_instance_name(); $subscriptiondata->eve...
[ "protected", "static", "function", "export_monitor_subscriptions", "(", "array", "$", "subscriptions", ",", "\\", "context_user", "$", "context", ")", "{", "foreach", "(", "$", "subscriptions", "as", "$", "subscription", ")", "{", "$", "subscriptiondata", "=", "...
This formats and then exports the event monitor subscriptions. @param array $subscriptions Subscriptions @param \context_user $context The user context
[ "This", "formats", "and", "then", "exports", "the", "event", "monitor", "subscriptions", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/privacy/provider.php#L238-L254
219,585
moodle/moodle
lib/spout/src/Spout/Reader/Common/XMLProcessor.php
XMLProcessor.readUntilStopped
public function readUntilStopped() { while ($this->xmlReader->read()) { $nodeType = $this->xmlReader->nodeType; $nodeNamePossiblyWithPrefix = $this->xmlReader->name; $nodeNameWithoutPrefix = $this->xmlReader->localName; $callbackData = $this->getRegisteredCal...
php
public function readUntilStopped() { while ($this->xmlReader->read()) { $nodeType = $this->xmlReader->nodeType; $nodeNamePossiblyWithPrefix = $this->xmlReader->name; $nodeNameWithoutPrefix = $this->xmlReader->localName; $callbackData = $this->getRegisteredCal...
[ "public", "function", "readUntilStopped", "(", ")", "{", "while", "(", "$", "this", "->", "xmlReader", "->", "read", "(", ")", ")", "{", "$", "nodeType", "=", "$", "this", "->", "xmlReader", "->", "nodeType", ";", "$", "nodeNamePossiblyWithPrefix", "=", ...
Resumes the reading of the XML file where it was left off. Stops whenever a callback indicates that reading should stop or at the end of the file. @return void @throws \Box\Spout\Reader\Exception\XMLProcessingException
[ "Resumes", "the", "reading", "of", "the", "XML", "file", "where", "it", "was", "left", "off", ".", "Stops", "whenever", "a", "callback", "indicates", "that", "reading", "should", "stop", "or", "at", "the", "end", "of", "the", "file", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Reader/Common/XMLProcessor.php#L96-L114
219,586
moodle/moodle
lib/portfolio/caller.php
portfolio_caller_base.expected_time_file
public function expected_time_file() { if ($this->multifiles) { return portfolio_expected_time_file($this->multifiles); } else if ($this->singlefile) { return portfolio_expected_time_file($this->singlefile); } return PORTFOLIO_TIME_LOW; }
php
public function expected_time_file() { if ($this->multifiles) { return portfolio_expected_time_file($this->multifiles); } else if ($this->singlefile) { return portfolio_expected_time_file($this->singlefile); } return PORTFOLIO_TIME_LOW; }
[ "public", "function", "expected_time_file", "(", ")", "{", "if", "(", "$", "this", "->", "multifiles", ")", "{", "return", "portfolio_expected_time_file", "(", "$", "this", "->", "multifiles", ")", ";", "}", "else", "if", "(", "$", "this", "->", "singlefil...
Helper method to calculate expected time for multi or single file exports @return string file time expectation
[ "Helper", "method", "to", "calculate", "expected", "time", "for", "multi", "or", "single", "file", "exports" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/portfolio/caller.php#L130-L138
219,587
moodle/moodle
lib/portfolio/caller.php
portfolio_caller_base.get_sha1_file
public function get_sha1_file() { if (empty($this->singlefile) && empty($this->multifiles)) { throw new portfolio_caller_exception('invalidsha1file', 'portfolio', $this->get_return_url()); } if ($this->singlefile) { return $this->singlefile->get_contenthash(); } ...
php
public function get_sha1_file() { if (empty($this->singlefile) && empty($this->multifiles)) { throw new portfolio_caller_exception('invalidsha1file', 'portfolio', $this->get_return_url()); } if ($this->singlefile) { return $this->singlefile->get_contenthash(); } ...
[ "public", "function", "get_sha1_file", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "singlefile", ")", "&&", "empty", "(", "$", "this", "->", "multifiles", ")", ")", "{", "throw", "new", "portfolio_caller_exception", "(", "'invalidsha1file'", ...
Helper function to calculate the sha1 for multi or single file exports @return string sha1 file exports
[ "Helper", "function", "to", "calculate", "the", "sha1", "for", "multi", "or", "single", "file", "exports" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/portfolio/caller.php#L155-L168
219,588
moodle/moodle
lib/portfolio/caller.php
portfolio_caller_base.prepare_package_file
public function prepare_package_file() { if (empty($this->singlefile) && empty($this->multifiles)) { throw new portfolio_caller_exception('invalidpreparepackagefile', 'portfolio', $this->get_return_url()); } if ($this->singlefile) { return $this->exporter->copy_existing_f...
php
public function prepare_package_file() { if (empty($this->singlefile) && empty($this->multifiles)) { throw new portfolio_caller_exception('invalidpreparepackagefile', 'portfolio', $this->get_return_url()); } if ($this->singlefile) { return $this->exporter->copy_existing_f...
[ "public", "function", "prepare_package_file", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "singlefile", ")", "&&", "empty", "(", "$", "this", "->", "multifiles", ")", ")", "{", "throw", "new", "portfolio_caller_exception", "(", "'invalidprepar...
Helper function to copy files into the temp area for single or multi file exports. @return stored_file|bool
[ "Helper", "function", "to", "copy", "files", "into", "the", "temp", "area", "for", "single", "or", "multi", "file", "exports", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/portfolio/caller.php#L295-L305
219,589
moodle/moodle
lib/portfolio/caller.php
portfolio_caller_base.supported_formats
public final function supported_formats() { $basic = $this->base_supported_formats(); if (empty($this->supportedformats)) { $specific = array(); } else if (!is_array($this->supportedformats)) { debugging(get_class($this) . ' has set a non array value of member variable su...
php
public final function supported_formats() { $basic = $this->base_supported_formats(); if (empty($this->supportedformats)) { $specific = array(); } else if (!is_array($this->supportedformats)) { debugging(get_class($this) . ' has set a non array value of member variable su...
[ "public", "final", "function", "supported_formats", "(", ")", "{", "$", "basic", "=", "$", "this", "->", "base_supported_formats", "(", ")", ";", "if", "(", "empty", "(", "$", "this", "->", "supportedformats", ")", ")", "{", "$", "specific", "=", "array"...
Array of formats this caller supports. @return array list of formats
[ "Array", "of", "formats", "this", "caller", "supports", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/portfolio/caller.php#L312-L323
219,590
moodle/moodle
lib/portfolio/caller.php
portfolio_caller_base.set_formats_from_button
public function set_formats_from_button($formats) { $base = $this->base_supported_formats(); if (count($base) != count($formats) || count($base) != count(array_intersect($base, $formats))) { $this->supportedformats = portfolio_most_specific_formats($formats, $base); ...
php
public function set_formats_from_button($formats) { $base = $this->base_supported_formats(); if (count($base) != count($formats) || count($base) != count(array_intersect($base, $formats))) { $this->supportedformats = portfolio_most_specific_formats($formats, $base); ...
[ "public", "function", "set_formats_from_button", "(", "$", "formats", ")", "{", "$", "base", "=", "$", "this", "->", "base_supported_formats", "(", ")", ";", "if", "(", "count", "(", "$", "base", ")", "!=", "count", "(", "$", "formats", ")", "||", "cou...
The button-location always knows best what the formats are... so it should be trusted. @todo MDL-31298 - re-analyze set_formats_from_button comment @param array $formats array of PORTFOLIO_FORMAT_XX @return void
[ "The", "button", "-", "location", "always", "knows", "best", "what", "the", "formats", "are", "...", "so", "it", "should", "be", "trusted", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/portfolio/caller.php#L425-L436
219,591
moodle/moodle
lib/portfolio/caller.php
portfolio_caller_base.add_format
protected function add_format($format) { if (in_array($format, $this->supportedformats)) { return; } $this->supportedformats = portfolio_most_specific_formats(array($format), $this->supportedformats); }
php
protected function add_format($format) { if (in_array($format, $this->supportedformats)) { return; } $this->supportedformats = portfolio_most_specific_formats(array($format), $this->supportedformats); }
[ "protected", "function", "add_format", "(", "$", "format", ")", "{", "if", "(", "in_array", "(", "$", "format", ",", "$", "this", "->", "supportedformats", ")", ")", "{", "return", ";", "}", "$", "this", "->", "supportedformats", "=", "portfolio_most_speci...
Adds a new format to the list of supported formats. This functions also handles removing conflicting and less specific formats at the same time. @param string $format one of PORTFOLIO_FORMAT_XX @return void
[ "Adds", "a", "new", "format", "to", "the", "list", "of", "supported", "formats", ".", "This", "functions", "also", "handles", "removing", "conflicting", "and", "less", "specific", "formats", "at", "the", "same", "time", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/portfolio/caller.php#L446-L451
219,592
moodle/moodle
lib/portfolio/caller.php
portfolio_module_caller_base.get_return_url
public function get_return_url() { global $CFG; return $CFG->wwwroot . '/mod/' . $this->cm->modname . '/view.php?id=' . $this->cm->id; }
php
public function get_return_url() { global $CFG; return $CFG->wwwroot . '/mod/' . $this->cm->modname . '/view.php?id=' . $this->cm->id; }
[ "public", "function", "get_return_url", "(", ")", "{", "global", "$", "CFG", ";", "return", "$", "CFG", "->", "wwwroot", ".", "'/mod/'", ".", "$", "this", "->", "cm", "->", "modname", ".", "'/view.php?id='", ".", "$", "this", "->", "cm", "->", "id", ...
The url to return to after export or on cancel. Defaults value is set to the module 'view' page. Override this if it's deeper inside the module. @return string
[ "The", "url", "to", "return", "to", "after", "export", "or", "on", "cancel", ".", "Defaults", "value", "is", "set", "to", "the", "module", "view", "page", ".", "Override", "this", "if", "it", "s", "deeper", "inside", "the", "module", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/portfolio/caller.php#L533-L536
219,593
moodle/moodle
lib/portfolio/caller.php
portfolio_module_caller_base.get
public function get($key) { if ($key != 'course') { return parent::get($key); } global $DB; if (empty($this->course)) { $this->course = $DB->get_record('course', array('id' => $this->cm->course)); } return $this->course; }
php
public function get($key) { if ($key != 'course') { return parent::get($key); } global $DB; if (empty($this->course)) { $this->course = $DB->get_record('course', array('id' => $this->cm->course)); } return $this->course; }
[ "public", "function", "get", "(", "$", "key", ")", "{", "if", "(", "$", "key", "!=", "'course'", ")", "{", "return", "parent", "::", "get", "(", "$", "key", ")", ";", "}", "global", "$", "DB", ";", "if", "(", "empty", "(", "$", "this", "->", ...
Override the parent get function to make sure when we're asked for a course, We retrieve the object from the database as needed. @param string $key the name of get function @return stdClass
[ "Override", "the", "parent", "get", "function", "to", "make", "sure", "when", "we", "re", "asked", "for", "a", "course", "We", "retrieve", "the", "object", "from", "the", "database", "as", "needed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/portfolio/caller.php#L546-L555
219,594
moodle/moodle
mod/label/classes/search/activity.php
activity.get_doc_url
public function get_doc_url(\core_search\document $doc) { // Get correct URL to section that contains label, from course format. $cminfo = $this->get_cm($this->get_module_name(), strval($doc->get('itemid')), $doc->get('courseid')); $format = course_get_format($cminfo->get_course()); $url...
php
public function get_doc_url(\core_search\document $doc) { // Get correct URL to section that contains label, from course format. $cminfo = $this->get_cm($this->get_module_name(), strval($doc->get('itemid')), $doc->get('courseid')); $format = course_get_format($cminfo->get_course()); $url...
[ "public", "function", "get_doc_url", "(", "\\", "core_search", "\\", "document", "$", "doc", ")", "{", "// Get correct URL to section that contains label, from course format.", "$", "cminfo", "=", "$", "this", "->", "get_cm", "(", "$", "this", "->", "get_module_name",...
Overwritten as labels are displayed in-course. @param \core_search\document $doc @return \moodle_url
[ "Overwritten", "as", "labels", "are", "displayed", "in", "-", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/label/classes/search/activity.php#L56-L65
219,595
moodle/moodle
report/eventlist/classes/list_generator.php
report_eventlist_list_generator.get_all_events_list
public static function get_all_events_list($detail = true) { return array_merge(self::get_core_events_list($detail), self::get_non_core_event_list($detail)); }
php
public static function get_all_events_list($detail = true) { return array_merge(self::get_core_events_list($detail), self::get_non_core_event_list($detail)); }
[ "public", "static", "function", "get_all_events_list", "(", "$", "detail", "=", "true", ")", "{", "return", "array_merge", "(", "self", "::", "get_core_events_list", "(", "$", "detail", ")", ",", "self", "::", "get_non_core_event_list", "(", "$", "detail", ")"...
Convenience method. Returns all of the core events either with or without details. @param bool $detail True will return details, but no abstract classes, False will return all events, but no details. @return array All events.
[ "Convenience", "method", ".", "Returns", "all", "of", "the", "core", "events", "either", "with", "or", "without", "details", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/eventlist/classes/list_generator.php#L42-L44
219,596
moodle/moodle
report/eventlist/classes/list_generator.php
report_eventlist_list_generator.get_edulevel_string
public static function get_edulevel_string($edulevel) { switch ($edulevel) { case \core\event\base::LEVEL_PARTICIPATING: return get_string('participating', 'report_eventlist'); break; case \core\event\base::LEVEL_TEACHING: return get_strin...
php
public static function get_edulevel_string($edulevel) { switch ($edulevel) { case \core\event\base::LEVEL_PARTICIPATING: return get_string('participating', 'report_eventlist'); break; case \core\event\base::LEVEL_TEACHING: return get_strin...
[ "public", "static", "function", "get_edulevel_string", "(", "$", "edulevel", ")", "{", "switch", "(", "$", "edulevel", ")", "{", "case", "\\", "core", "\\", "event", "\\", "base", "::", "LEVEL_PARTICIPATING", ":", "return", "get_string", "(", "'participating'"...
Returns the appropriate string for the event education level. @param int $edulevel Takes either the edulevel constant or string. @return string get_string for the specific education level.
[ "Returns", "the", "appropriate", "string", "for", "the", "event", "education", "level", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/eventlist/classes/list_generator.php#L126-L141
219,597
moodle/moodle
report/eventlist/classes/list_generator.php
report_eventlist_list_generator.get_observer_list
public static function get_observer_list() { $events = \core\event\manager::get_all_observers(); foreach ($events as $key => $observers) { foreach ($observers as $observerskey => $observer) { $events[$key][$observerskey]->parentplugin = \core_plugin_ma...
php
public static function get_observer_list() { $events = \core\event\manager::get_all_observers(); foreach ($events as $key => $observers) { foreach ($observers as $observerskey => $observer) { $events[$key][$observerskey]->parentplugin = \core_plugin_ma...
[ "public", "static", "function", "get_observer_list", "(", ")", "{", "$", "events", "=", "\\", "core", "\\", "event", "\\", "manager", "::", "get_all_observers", "(", ")", ";", "foreach", "(", "$", "events", "as", "$", "key", "=>", "$", "observers", ")", ...
Get the full list of observers for the system. @return array An array of observers in the system.
[ "Get", "the", "full", "list", "of", "observers", "for", "the", "system", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/eventlist/classes/list_generator.php#L223-L232
219,598
moodle/moodle
report/eventlist/classes/list_generator.php
report_eventlist_list_generator.format_data
private static function format_data($eventdata, $eventfullpath) { // Get general event information. $eventdata[$eventfullpath] = $eventfullpath::get_static_info(); // Create a link for further event detail. $url = new \moodle_url('eventdetail.php', array('eventname' => $eventfullpath)); ...
php
private static function format_data($eventdata, $eventfullpath) { // Get general event information. $eventdata[$eventfullpath] = $eventfullpath::get_static_info(); // Create a link for further event detail. $url = new \moodle_url('eventdetail.php', array('eventname' => $eventfullpath)); ...
[ "private", "static", "function", "format_data", "(", "$", "eventdata", ",", "$", "eventfullpath", ")", "{", "// Get general event information.", "$", "eventdata", "[", "$", "eventfullpath", "]", "=", "$", "eventfullpath", "::", "get_static_info", "(", ")", ";", ...
Returns the event data list section with url links and other formatting. @param array $eventdata The event data list section. @param string $eventfullpath Full path to the events for this plugin / subplugin. @return array The event data list section with additional formatting.
[ "Returns", "the", "event", "data", "list", "section", "with", "url", "links", "and", "other", "formatting", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/eventlist/classes/list_generator.php#L241-L284
219,599
moodle/moodle
enrol/lti/backup/moodle2/backup_enrol_lti_plugin.class.php
backup_enrol_lti_plugin.define_enrol_plugin_structure
public function define_enrol_plugin_structure() { // Get the parent we will be adding these elements to. $plugin = $this->get_plugin_element(); // Define our elements. $tool = new backup_nested_element('tool', array('id'), array( 'enrolid', 'contextid', 'institution', 'lang'...
php
public function define_enrol_plugin_structure() { // Get the parent we will be adding these elements to. $plugin = $this->get_plugin_element(); // Define our elements. $tool = new backup_nested_element('tool', array('id'), array( 'enrolid', 'contextid', 'institution', 'lang'...
[ "public", "function", "define_enrol_plugin_structure", "(", ")", "{", "// Get the parent we will be adding these elements to.", "$", "plugin", "=", "$", "this", "->", "get_plugin_element", "(", ")", ";", "// Define our elements.", "$", "tool", "=", "new", "backup_nested_e...
Defines the other LTI enrolment structures to append. @return backup_plugin_element
[ "Defines", "the", "other", "LTI", "enrolment", "structures", "to", "append", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/backup/moodle2/backup_enrol_lti_plugin.class.php#L41-L70