id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
215,200 | moodle/moodle | mod/workshop/locallib.php | workshop.aggregate_submission_grades_process | protected function aggregate_submission_grades_process(array $assessments) {
global $DB;
$submissionid = null; // the id of the submission being processed
$current = null; // the grade currently saved in database
$finalgrade = null; // the new grade to be calculated
... | php | protected function aggregate_submission_grades_process(array $assessments) {
global $DB;
$submissionid = null; // the id of the submission being processed
$current = null; // the grade currently saved in database
$finalgrade = null; // the new grade to be calculated
... | [
"protected",
"function",
"aggregate_submission_grades_process",
"(",
"array",
"$",
"assessments",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"submissionid",
"=",
"null",
";",
"// the id of the submission being processed",
"$",
"current",
"=",
"null",
";",
"// the grade ... | Given an array of all assessments of a single submission, calculates the final grade for this submission
This calculates the weighted mean of the passed assessment grades. If, however, the submission grade
was overridden by a teacher, the gradeover value is returned and the rest of grades are ignored.
@param array $a... | [
"Given",
"an",
"array",
"of",
"all",
"assessments",
"of",
"a",
"single",
"submission",
"calculates",
"the",
"final",
"grade",
"for",
"this",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3221-L3262 |
215,201 | moodle/moodle | mod/workshop/locallib.php | workshop.aggregate_grading_grades_process | protected function aggregate_grading_grades_process(array $assessments, $timegraded = null) {
global $DB;
$reviewerid = null; // the id of the reviewer being processed
$current = null; // the gradinggrade currently saved in database
$finalgrade = null; // the new grade to be calculat... | php | protected function aggregate_grading_grades_process(array $assessments, $timegraded = null) {
global $DB;
$reviewerid = null; // the id of the reviewer being processed
$current = null; // the gradinggrade currently saved in database
$finalgrade = null; // the new grade to be calculat... | [
"protected",
"function",
"aggregate_grading_grades_process",
"(",
"array",
"$",
"assessments",
",",
"$",
"timegraded",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"reviewerid",
"=",
"null",
";",
"// the id of the reviewer being processed",
"$",
"current",
... | Given an array of all assessments done by a single reviewer, calculates the final grading grade
This calculates the simple mean of the passed grading grades. If, however, the grading grade
was overridden by a teacher, the gradinggradeover value is returned and the rest of grades are ignored.
@param array $assessments... | [
"Given",
"an",
"array",
"of",
"all",
"assessments",
"done",
"by",
"a",
"single",
"reviewer",
"calculates",
"the",
"final",
"grading",
"grade"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3274-L3353 |
215,202 | moodle/moodle | mod/workshop/locallib.php | workshop.get_users_with_capability_sql | protected function get_users_with_capability_sql($capability, $musthavesubmission, $groupid) {
global $CFG;
/** @var int static counter used to generate unique parameter holders */
static $inc = 0;
$inc++;
// If the caller requests all groups and we are using a selected grouping... | php | protected function get_users_with_capability_sql($capability, $musthavesubmission, $groupid) {
global $CFG;
/** @var int static counter used to generate unique parameter holders */
static $inc = 0;
$inc++;
// If the caller requests all groups and we are using a selected grouping... | [
"protected",
"function",
"get_users_with_capability_sql",
"(",
"$",
"capability",
",",
"$",
"musthavesubmission",
",",
"$",
"groupid",
")",
"{",
"global",
"$",
"CFG",
";",
"/** @var int static counter used to generate unique parameter holders */",
"static",
"$",
"inc",
"=... | Returns SQL to fetch all enrolled users with the given capability in the current workshop
The returned array consists of string $sql and the $params array. Note that the $sql can be
empty if a grouping is selected and it has no groups.
The list is automatically restricted according to any availability restrictions
th... | [
"Returns",
"SQL",
"to",
"fetch",
"all",
"enrolled",
"users",
"with",
"the",
"given",
"capability",
"in",
"the",
"current",
"workshop"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3369-L3417 |
215,203 | moodle/moodle | mod/workshop/locallib.php | workshop.get_participants_sql | protected function get_participants_sql($musthavesubmission=false, $groupid=0) {
list($sql1, $params1) = $this->get_users_with_capability_sql('mod/workshop:submit', $musthavesubmission, $groupid);
list($sql2, $params2) = $this->get_users_with_capability_sql('mod/workshop:peerassess', $musthavesubmissio... | php | protected function get_participants_sql($musthavesubmission=false, $groupid=0) {
list($sql1, $params1) = $this->get_users_with_capability_sql('mod/workshop:submit', $musthavesubmission, $groupid);
list($sql2, $params2) = $this->get_users_with_capability_sql('mod/workshop:peerassess', $musthavesubmissio... | [
"protected",
"function",
"get_participants_sql",
"(",
"$",
"musthavesubmission",
"=",
"false",
",",
"$",
"groupid",
"=",
"0",
")",
"{",
"list",
"(",
"$",
"sql1",
",",
"$",
"params1",
")",
"=",
"$",
"this",
"->",
"get_users_with_capability_sql",
"(",
"'mod/wo... | Returns SQL statement that can be used to fetch all actively enrolled participants in the workshop
@param bool $musthavesubmission if true, return only users who have already submitted
@param int $groupid 0 means ignore groups, any other value limits the result by group id
@return array of (string)sql, (array)params | [
"Returns",
"SQL",
"statement",
"that",
"can",
"be",
"used",
"to",
"fetch",
"all",
"actively",
"enrolled",
"participants",
"in",
"the",
"workshop"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3426-L3447 |
215,204 | moodle/moodle | mod/workshop/locallib.php | workshop.reset_userdata_submissions | protected function reset_userdata_submissions(stdClass $data) {
global $DB;
$submissions = $this->get_submissions();
foreach ($submissions as $submission) {
$this->delete_submission($submission);
}
return true;
} | php | protected function reset_userdata_submissions(stdClass $data) {
global $DB;
$submissions = $this->get_submissions();
foreach ($submissions as $submission) {
$this->delete_submission($submission);
}
return true;
} | [
"protected",
"function",
"reset_userdata_submissions",
"(",
"stdClass",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"submissions",
"=",
"$",
"this",
"->",
"get_submissions",
"(",
")",
";",
"foreach",
"(",
"$",
"submissions",
"as",
"$",
"submission"... | Removes all user data related to participants' submissions.
@param stdClass $data The actual course reset settings.
@return bool|string True on success, error message otherwise. | [
"Removes",
"all",
"user",
"data",
"related",
"to",
"participants",
"submissions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3511-L3520 |
215,205 | moodle/moodle | mod/workshop/locallib.php | workshop.reset_phase | protected function reset_phase() {
global $DB;
$DB->set_field('workshop', 'phase', self::PHASE_SETUP, array('id' => $this->id));
$this->phase = self::PHASE_SETUP;
} | php | protected function reset_phase() {
global $DB;
$DB->set_field('workshop', 'phase', self::PHASE_SETUP, array('id' => $this->id));
$this->phase = self::PHASE_SETUP;
} | [
"protected",
"function",
"reset_phase",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"DB",
"->",
"set_field",
"(",
"'workshop'",
",",
"'phase'",
",",
"self",
"::",
"PHASE_SETUP",
",",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"id",
")",
")",
";... | Hard set the workshop phase to the setup one. | [
"Hard",
"set",
"the",
"workshop",
"phase",
"to",
"the",
"setup",
"one",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3525-L3530 |
215,206 | moodle/moodle | mod/workshop/locallib.php | workshop_user_plan.get_examples | public function get_examples() {
if (is_null($this->examples)) {
$this->examples = $this->workshop->get_examples_for_reviewer($this->userid);
}
return $this->examples;
} | php | public function get_examples() {
if (is_null($this->examples)) {
$this->examples = $this->workshop->get_examples_for_reviewer($this->userid);
}
return $this->examples;
} | [
"public",
"function",
"get_examples",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"examples",
")",
")",
"{",
"$",
"this",
"->",
"examples",
"=",
"$",
"this",
"->",
"workshop",
"->",
"get_examples_for_reviewer",
"(",
"$",
"this",
"->",
... | Returns example submissions to be assessed by the owner of the planner
This is here to cache the DB query because the same list is needed later in view.php
@see workshop::get_examples_for_reviewer() for the format of returned value
@return array | [
"Returns",
"example",
"submissions",
"to",
"be",
"assessed",
"by",
"the",
"owner",
"of",
"the",
"planner"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3984-L3989 |
215,207 | moodle/moodle | mod/workshop/locallib.php | workshop_submission_base.anonymize | public function anonymize() {
$authorfields = explode(',', user_picture::fields());
foreach ($authorfields as $field) {
$prefixedusernamefield = 'author' . $field;
unset($this->{$prefixedusernamefield});
}
$this->anonymous = true;
} | php | public function anonymize() {
$authorfields = explode(',', user_picture::fields());
foreach ($authorfields as $field) {
$prefixedusernamefield = 'author' . $field;
unset($this->{$prefixedusernamefield});
}
$this->anonymous = true;
} | [
"public",
"function",
"anonymize",
"(",
")",
"{",
"$",
"authorfields",
"=",
"explode",
"(",
"','",
",",
"user_picture",
"::",
"fields",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"authorfields",
"as",
"$",
"field",
")",
"{",
"$",
"prefixedusernamefield",
"... | Unsets all author-related properties so that the renderer does not have access to them
Usually this is called by the contructor but can be called explicitely, too. | [
"Unsets",
"all",
"author",
"-",
"related",
"properties",
"so",
"that",
"the",
"renderer",
"does",
"not",
"have",
"access",
"to",
"them"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L4044-L4051 |
215,208 | moodle/moodle | mod/workshop/locallib.php | workshop_assessment_base.add_action | public function add_action(moodle_url $url, $label, $method = 'get') {
$action = new stdClass();
$action->url = $url;
$action->label = $label;
$action->method = $method;
$this->actions[] = $action;
} | php | public function add_action(moodle_url $url, $label, $method = 'get') {
$action = new stdClass();
$action->url = $url;
$action->label = $label;
$action->method = $method;
$this->actions[] = $action;
} | [
"public",
"function",
"add_action",
"(",
"moodle_url",
"$",
"url",
",",
"$",
"label",
",",
"$",
"method",
"=",
"'get'",
")",
"{",
"$",
"action",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"action",
"->",
"url",
"=",
"$",
"url",
";",
"$",
"action",... | Adds a new action
@param moodle_url $url action URL
@param string $label action label
@param string $method get|post | [
"Adds",
"a",
"new",
"action"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L4285-L4293 |
215,209 | moodle/moodle | mod/workshop/locallib.php | workshop_assessment.get_overall_feedback_content | public function get_overall_feedback_content() {
if ($this->workshop->overallfeedbackmode == 0) {
return false;
}
if (trim($this->feedbackauthor) === '') {
return null;
}
$content = file_rewrite_pluginfile_urls($this->feedbackauthor, 'pluginfile.php', $... | php | public function get_overall_feedback_content() {
if ($this->workshop->overallfeedbackmode == 0) {
return false;
}
if (trim($this->feedbackauthor) === '') {
return null;
}
$content = file_rewrite_pluginfile_urls($this->feedbackauthor, 'pluginfile.php', $... | [
"public",
"function",
"get_overall_feedback_content",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"workshop",
"->",
"overallfeedbackmode",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"trim",
"(",
"$",
"this",
"->",
"feedbackauthor",
")",
... | Format the overall feedback text content
False is returned if the overall feedback feature is disabled. Null is returned
if the overall feedback content has not been found. Otherwise, string with
formatted feedback text is returned.
@return string|bool|null | [
"Format",
"the",
"overall",
"feedback",
"text",
"content"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L4359-L4375 |
215,210 | moodle/moodle | mod/workshop/locallib.php | workshop_assessment.get_overall_feedback_attachments | public function get_overall_feedback_attachments() {
if ($this->workshop->overallfeedbackmode == 0) {
return false;
}
if ($this->workshop->overallfeedbackfiles == 0) {
return false;
}
if (empty($this->feedbackauthorattachment)) {
return arra... | php | public function get_overall_feedback_attachments() {
if ($this->workshop->overallfeedbackmode == 0) {
return false;
}
if ($this->workshop->overallfeedbackfiles == 0) {
return false;
}
if (empty($this->feedbackauthorattachment)) {
return arra... | [
"public",
"function",
"get_overall_feedback_attachments",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"workshop",
"->",
"overallfeedbackmode",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"workshop",
"->",
"overallfeedback... | Prepares the list of overall feedback attachments
Returns false if overall feedback attachments are not allowed. Otherwise returns
list of attachments (may be empty).
@return bool|array of stdClass | [
"Prepares",
"the",
"list",
"of",
"overall",
"feedback",
"attachments"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L4385-L4423 |
215,211 | moodle/moodle | mod/workshop/locallib.php | workshop_message.set_type | public function set_type($type = self::TYPE_INFO) {
if (in_array($type, array(self::TYPE_OK, self::TYPE_ERROR, self::TYPE_INFO))) {
$this->type = $type;
} else {
throw new coding_exception('Unknown message type.');
}
} | php | public function set_type($type = self::TYPE_INFO) {
if (in_array($type, array(self::TYPE_OK, self::TYPE_ERROR, self::TYPE_INFO))) {
$this->type = $type;
} else {
throw new coding_exception('Unknown message type.');
}
} | [
"public",
"function",
"set_type",
"(",
"$",
"type",
"=",
"self",
"::",
"TYPE_INFO",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"type",
",",
"array",
"(",
"self",
"::",
"TYPE_OK",
",",
"self",
"::",
"TYPE_ERROR",
",",
"self",
"::",
"TYPE_INFO",
")",
"... | Sets the message type
@param int $type | [
"Sets",
"the",
"message",
"type"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L4507-L4513 |
215,212 | moodle/moodle | mod/workshop/locallib.php | workshop_message.set_action | public function set_action(moodle_url $url, $label) {
$this->actionurl = $url;
$this->actionlabel = $label;
} | php | public function set_action(moodle_url $url, $label) {
$this->actionurl = $url;
$this->actionlabel = $label;
} | [
"public",
"function",
"set_action",
"(",
"moodle_url",
"$",
"url",
",",
"$",
"label",
")",
"{",
"$",
"this",
"->",
"actionurl",
"=",
"$",
"url",
";",
"$",
"this",
"->",
"actionlabel",
"=",
"$",
"label",
";",
"}"
] | Sets the optional message action
@param moodle_url $url to follow on action
@param string $label action label | [
"Sets",
"the",
"optional",
"message",
"action"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L4521-L4524 |
215,213 | moodle/moodle | mod/workshop/locallib.php | workshop_grading_report.export_data_for_external | public function export_data_for_external() {
$data = $this->get_data();
$options = $this->get_options();
foreach ($data->grades as $reportdata) {
// If we are in submission phase ignore the following data.
if ($options->workshopphase == workshop::PHASE_SUBMISSION) {
... | php | public function export_data_for_external() {
$data = $this->get_data();
$options = $this->get_options();
foreach ($data->grades as $reportdata) {
// If we are in submission phase ignore the following data.
if ($options->workshopphase == workshop::PHASE_SUBMISSION) {
... | [
"public",
"function",
"export_data_for_external",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"get_data",
"(",
")",
";",
"$",
"options",
"=",
"$",
"this",
"->",
"get_options",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"->",
"grades",
"as",
... | Prepare the data to be exported to a external system via Web Services.
This function applies extra capabilities checks.
@return stdClass the data ready for external systems | [
"Prepare",
"the",
"data",
"to",
"be",
"exported",
"to",
"a",
"external",
"system",
"via",
"Web",
"Services",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L4606-L4646 |
215,214 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Config.php | HTMLPurifier_Config.create | public static function create($config, $schema = null)
{
if ($config instanceof HTMLPurifier_Config) {
// pass-through
return $config;
}
if (!$schema) {
$ret = HTMLPurifier_Config::createDefault();
} else {
$ret = new HTMLPurifier_Confi... | php | public static function create($config, $schema = null)
{
if ($config instanceof HTMLPurifier_Config) {
// pass-through
return $config;
}
if (!$schema) {
$ret = HTMLPurifier_Config::createDefault();
} else {
$ret = new HTMLPurifier_Confi... | [
"public",
"static",
"function",
"create",
"(",
"$",
"config",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"config",
"instanceof",
"HTMLPurifier_Config",
")",
"{",
"// pass-through",
"return",
"$",
"config",
";",
"}",
"if",
"(",
"!",
"$",
... | Convenience constructor that creates a config object based on a mixed var
@param mixed $config Variable that defines the state of the config
object. Can be: a HTMLPurifier_Config() object,
an array of directives based on loadArray(),
or a string filename of an ini file.
@param HTMLPurifier_ConfigSchema $schema Schema o... | [
"Convenience",
"constructor",
"that",
"creates",
"a",
"config",
"object",
"based",
"on",
"a",
"mixed",
"var"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Config.php#L123-L138 |
215,215 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Config.php | HTMLPurifier_Config.get | public function get($key, $a = null)
{
if ($a !== null) {
$this->triggerError(
"Using deprecated API: use \$config->get('$key.$a') instead",
E_USER_WARNING
);
$key = "$key.$a";
}
if (!$this->finalized) {
$this->a... | php | public function get($key, $a = null)
{
if ($a !== null) {
$this->triggerError(
"Using deprecated API: use \$config->get('$key.$a') instead",
E_USER_WARNING
);
$key = "$key.$a";
}
if (!$this->finalized) {
$this->a... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"a",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"a",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"triggerError",
"(",
"\"Using deprecated API: use \\$config->get('$key.$a') instead\"",
",",
"E_USER_WARNING",
... | Retrieves a value from the configuration.
@param string $key String key
@param mixed $a
@return mixed | [
"Retrieves",
"a",
"value",
"from",
"the",
"configuration",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Config.php#L169-L211 |
215,216 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Config.php | HTMLPurifier_Config.getBatch | public function getBatch($namespace)
{
if (!$this->finalized) {
$this->autoFinalize();
}
$full = $this->getAll();
if (!isset($full[$namespace])) {
$this->triggerError(
'Cannot retrieve undefined namespace ' .
htmlspecialchars($n... | php | public function getBatch($namespace)
{
if (!$this->finalized) {
$this->autoFinalize();
}
$full = $this->getAll();
if (!isset($full[$namespace])) {
$this->triggerError(
'Cannot retrieve undefined namespace ' .
htmlspecialchars($n... | [
"public",
"function",
"getBatch",
"(",
"$",
"namespace",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"finalized",
")",
"{",
"$",
"this",
"->",
"autoFinalize",
"(",
")",
";",
"}",
"$",
"full",
"=",
"$",
"this",
"->",
"getAll",
"(",
")",
";",
"if"... | Retrieves an array of directives to values from a given namespace
@param string $namespace String namespace
@return array | [
"Retrieves",
"an",
"array",
"of",
"directives",
"to",
"values",
"from",
"a",
"given",
"namespace"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Config.php#L220-L235 |
215,217 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Config.php | HTMLPurifier_Config.getBatchSerial | public function getBatchSerial($namespace)
{
if (empty($this->serials[$namespace])) {
$batch = $this->getBatch($namespace);
unset($batch['DefinitionRev']);
$this->serials[$namespace] = sha1(serialize($batch));
}
return $this->serials[$namespace];
} | php | public function getBatchSerial($namespace)
{
if (empty($this->serials[$namespace])) {
$batch = $this->getBatch($namespace);
unset($batch['DefinitionRev']);
$this->serials[$namespace] = sha1(serialize($batch));
}
return $this->serials[$namespace];
} | [
"public",
"function",
"getBatchSerial",
"(",
"$",
"namespace",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"serials",
"[",
"$",
"namespace",
"]",
")",
")",
"{",
"$",
"batch",
"=",
"$",
"this",
"->",
"getBatch",
"(",
"$",
"namespace",
")",
... | Returns a SHA-1 signature of a segment of the configuration object
that uniquely identifies that particular configuration
@param string $namespace Namespace to get serial for
@return string
@note Revision is handled specially and is removed from the batch
before processing! | [
"Returns",
"a",
"SHA",
"-",
"1",
"signature",
"of",
"a",
"segment",
"of",
"the",
"configuration",
"object",
"that",
"uniquely",
"identifies",
"that",
"particular",
"configuration"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Config.php#L247-L255 |
215,218 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Config.php | HTMLPurifier_Config.getSerial | public function getSerial()
{
if (empty($this->serial)) {
$this->serial = sha1(serialize($this->getAll()));
}
return $this->serial;
} | php | public function getSerial()
{
if (empty($this->serial)) {
$this->serial = sha1(serialize($this->getAll()));
}
return $this->serial;
} | [
"public",
"function",
"getSerial",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"serial",
")",
")",
"{",
"$",
"this",
"->",
"serial",
"=",
"sha1",
"(",
"serialize",
"(",
"$",
"this",
"->",
"getAll",
"(",
")",
")",
")",
";",
"}",
"... | Returns a SHA-1 signature for the entire configuration object
that uniquely identifies that particular configuration
@return string | [
"Returns",
"a",
"SHA",
"-",
"1",
"signature",
"for",
"the",
"entire",
"configuration",
"object",
"that",
"uniquely",
"identifies",
"that",
"particular",
"configuration"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Config.php#L263-L269 |
215,219 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Config.php | HTMLPurifier_Config._listify | private function _listify($lookup)
{
$list = array();
foreach ($lookup as $name => $b) {
$list[] = $name;
}
return implode(', ', $list);
} | php | private function _listify($lookup)
{
$list = array();
foreach ($lookup as $name => $b) {
$list[] = $name;
}
return implode(', ', $list);
} | [
"private",
"function",
"_listify",
"(",
"$",
"lookup",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"lookup",
"as",
"$",
"name",
"=>",
"$",
"b",
")",
"{",
"$",
"list",
"[",
"]",
"=",
"$",
"name",
";",
"}",
"return",
... | Convenience function for error reporting
@param array $lookup
@return string | [
"Convenience",
"function",
"for",
"error",
"reporting"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Config.php#L390-L397 |
215,220 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Config.php | HTMLPurifier_Config.isFinalized | public function isFinalized($error = false)
{
if ($this->finalized && $error) {
$this->triggerError($error, E_USER_ERROR);
}
return $this->finalized;
} | php | public function isFinalized($error = false)
{
if ($this->finalized && $error) {
$this->triggerError($error, E_USER_ERROR);
}
return $this->finalized;
} | [
"public",
"function",
"isFinalized",
"(",
"$",
"error",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"finalized",
"&&",
"$",
"error",
")",
"{",
"$",
"this",
"->",
"triggerError",
"(",
"$",
"error",
",",
"E_USER_ERROR",
")",
";",
"}",
"return... | Checks whether or not the configuration object is finalized.
@param string|bool $error String error message, or false for no error
@return bool | [
"Checks",
"whether",
"or",
"not",
"the",
"configuration",
"object",
"is",
"finalized",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Config.php#L847-L853 |
215,221 | moodle/moodle | enrol/lti/classes/helper.php | helper.create_username | public static function create_username($consumerkey, $ltiuserid) {
if (!empty($ltiuserid) && !empty($consumerkey)) {
$userkey = $consumerkey . ':' . $ltiuserid;
} else {
$userkey = false;
}
return 'enrol_lti' . sha1($consumerkey . '::' . $userkey);
} | php | public static function create_username($consumerkey, $ltiuserid) {
if (!empty($ltiuserid) && !empty($consumerkey)) {
$userkey = $consumerkey . ':' . $ltiuserid;
} else {
$userkey = false;
}
return 'enrol_lti' . sha1($consumerkey . '::' . $userkey);
} | [
"public",
"static",
"function",
"create_username",
"(",
"$",
"consumerkey",
",",
"$",
"ltiuserid",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"ltiuserid",
")",
"&&",
"!",
"empty",
"(",
"$",
"consumerkey",
")",
")",
"{",
"$",
"userkey",
"=",
"$",
"c... | Creates a unique username.
@param string $consumerkey Consumer key
@param string $ltiuserid External tool user id
@return string The new username | [
"Creates",
"a",
"unique",
"username",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L89-L97 |
215,222 | moodle/moodle | enrol/lti/classes/helper.php | helper.assign_user_tool_data | public static function assign_user_tool_data($tool, $user) {
global $CFG;
$user->city = (!empty($tool->city)) ? $tool->city : "";
$user->country = (!empty($tool->country)) ? $tool->country : "";
$user->institution = (!empty($tool->institution)) ? $tool->institution : "";
$user->... | php | public static function assign_user_tool_data($tool, $user) {
global $CFG;
$user->city = (!empty($tool->city)) ? $tool->city : "";
$user->country = (!empty($tool->country)) ? $tool->country : "";
$user->institution = (!empty($tool->institution)) ? $tool->institution : "";
$user->... | [
"public",
"static",
"function",
"assign_user_tool_data",
"(",
"$",
"tool",
",",
"$",
"user",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"user",
"->",
"city",
"=",
"(",
"!",
"empty",
"(",
"$",
"tool",
"->",
"city",
")",
")",
"?",
"$",
"tool",
"->",
... | Adds default values for the user object based on the tool provided.
@param \stdClass $tool
@param \stdClass $user
@return \stdClass The $user class with added default values | [
"Adds",
"default",
"values",
"for",
"the",
"user",
"object",
"based",
"on",
"the",
"tool",
"provided",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L106-L125 |
215,223 | moodle/moodle | enrol/lti/classes/helper.php | helper.user_match | public static function user_match($newuser, $olduser) {
if ($newuser->firstname != $olduser->firstname) {
return false;
}
if ($newuser->lastname != $olduser->lastname) {
return false;
}
if ($newuser->email != $olduser->email) {
return false;
... | php | public static function user_match($newuser, $olduser) {
if ($newuser->firstname != $olduser->firstname) {
return false;
}
if ($newuser->lastname != $olduser->lastname) {
return false;
}
if ($newuser->email != $olduser->email) {
return false;
... | [
"public",
"static",
"function",
"user_match",
"(",
"$",
"newuser",
",",
"$",
"olduser",
")",
"{",
"if",
"(",
"$",
"newuser",
"->",
"firstname",
"!=",
"$",
"olduser",
"->",
"firstname",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"newuser",
... | Compares two users.
@param \stdClass $newuser The new user
@param \stdClass $olduser The old user
@return bool True if both users are the same | [
"Compares",
"two",
"users",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L134-L170 |
215,224 | moodle/moodle | enrol/lti/classes/helper.php | helper.update_user_profile_image | public static function update_user_profile_image($userid, $url) {
global $CFG, $DB;
require_once($CFG->libdir . '/filelib.php');
require_once($CFG->libdir . '/gdlib.php');
$fs = get_file_storage();
$context = \context_user::instance($userid, MUST_EXIST);
$fs->delete_ar... | php | public static function update_user_profile_image($userid, $url) {
global $CFG, $DB;
require_once($CFG->libdir . '/filelib.php');
require_once($CFG->libdir . '/gdlib.php');
$fs = get_file_storage();
$context = \context_user::instance($userid, MUST_EXIST);
$fs->delete_ar... | [
"public",
"static",
"function",
"update_user_profile_image",
"(",
"$",
"userid",
",",
"$",
"url",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/filelib.php'",
")",
";",
"require_once",
"(",
... | Updates the users profile image.
@param int $userid the id of the user
@param string $url the url of the image
@return bool|string true if successful, else a string explaining why it failed | [
"Updates",
"the",
"users",
"profile",
"image",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L179-L231 |
215,225 | moodle/moodle | enrol/lti/classes/helper.php | helper.enrol_user | public static function enrol_user($tool, $userid) {
global $DB;
// Check if the user enrolment exists.
if (!$DB->record_exists('user_enrolments', array('enrolid' => $tool->enrolid, 'userid' => $userid))) {
// Check if the maximum enrolled limit has been met.
if ($tool->m... | php | public static function enrol_user($tool, $userid) {
global $DB;
// Check if the user enrolment exists.
if (!$DB->record_exists('user_enrolments', array('enrolid' => $tool->enrolid, 'userid' => $userid))) {
// Check if the maximum enrolled limit has been met.
if ($tool->m... | [
"public",
"static",
"function",
"enrol_user",
"(",
"$",
"tool",
",",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
";",
"// Check if the user enrolment exists.",
"if",
"(",
"!",
"$",
"DB",
"->",
"record_exists",
"(",
"'user_enrolments'",
",",
"array",
"(",
"... | Enrol a user in a course.
@param \stdclass $tool The tool object (retrieved using self::get_lti_tool() or self::get_lti_tools())
@param int $userid The user id
@return bool|string returns true if successful, else an error code | [
"Enrol",
"a",
"user",
"in",
"a",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L240-L279 |
215,226 | moodle/moodle | enrol/lti/classes/helper.php | helper.get_lti_tools | public static function get_lti_tools($params = array(), $limitfrom = 0, $limitnum = 0) {
global $DB;
$sql = "SELECT elt.*, e.name, e.courseid, e.status, e.enrolstartdate, e.enrolenddate, e.enrolperiod
FROM {enrol_lti_tools} elt
JOIN {enrol} e
ON e... | php | public static function get_lti_tools($params = array(), $limitfrom = 0, $limitnum = 0) {
global $DB;
$sql = "SELECT elt.*, e.name, e.courseid, e.status, e.enrolstartdate, e.enrolenddate, e.enrolperiod
FROM {enrol_lti_tools} elt
JOIN {enrol} e
ON e... | [
"public",
"static",
"function",
"get_lti_tools",
"(",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitnum",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"SELECT elt.*, e.name, e.courseid, e.status... | Returns the LTI tools requested.
@param array $params The list of SQL params (eg. array('columnname' => value, 'columnname2' => value)).
@param int $limitfrom return a subset of records, starting at this point (optional).
@param int $limitnum return a subset comprising this many records in total
@return array of tools | [
"Returns",
"the",
"LTI",
"tools",
"requested",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L307-L324 |
215,227 | moodle/moodle | enrol/lti/classes/helper.php | helper.count_lti_tools | public static function count_lti_tools($params = array()) {
global $DB;
$sql = "SELECT COUNT(*)
FROM {enrol_lti_tools} elt
JOIN {enrol} e
ON elt.enrolid = e.id";
if ($params) {
$where = "WHERE";
foreach ($params as ... | php | public static function count_lti_tools($params = array()) {
global $DB;
$sql = "SELECT COUNT(*)
FROM {enrol_lti_tools} elt
JOIN {enrol} e
ON elt.enrolid = e.id";
if ($params) {
$where = "WHERE";
foreach ($params as ... | [
"public",
"static",
"function",
"count_lti_tools",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"SELECT COUNT(*)\n FROM {enrol_lti_tools} elt\n JOIN {enrol} e\n ON elt.e... | Returns the number of LTI tools.
@param array $params The list of SQL params (eg. array('columnname' => value, 'columnname2' => value)).
@return int The number of tools | [
"Returns",
"the",
"number",
"of",
"LTI",
"tools",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L332-L348 |
215,228 | moodle/moodle | enrol/lti/classes/helper.php | helper.get_description | public static function get_description($tool) {
global $DB;
$description = '';
$context = \context::instance_by_id($tool->contextid);
if ($context->contextlevel == CONTEXT_COURSE) {
$course = $DB->get_record('course', array('id' => $context->instanceid));
$descrip... | php | public static function get_description($tool) {
global $DB;
$description = '';
$context = \context::instance_by_id($tool->contextid);
if ($context->contextlevel == CONTEXT_COURSE) {
$course = $DB->get_record('course', array('id' => $context->instanceid));
$descrip... | [
"public",
"static",
"function",
"get_description",
"(",
"$",
"tool",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"description",
"=",
"''",
";",
"$",
"context",
"=",
"\\",
"context",
"::",
"instance_by_id",
"(",
"$",
"tool",
"->",
"contextid",
")",
";",
"i... | Returns a description of the course or module that this lti instance points to.
@param \stdClass $tool The lti tool
@return string A description of the tool
@since Moodle 3.2 | [
"Returns",
"a",
"description",
"of",
"the",
"course",
"or",
"module",
"that",
"this",
"lti",
"instance",
"points",
"to",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L422-L436 |
215,229 | moodle/moodle | enrol/lti/classes/helper.php | helper.get_cartridge_url | public static function get_cartridge_url($tool) {
global $CFG;
$url = null;
$id = $tool->id;
$token = self::generate_cartridge_token($tool->id);
if ($CFG->slasharguments) {
$url = new \moodle_url('/enrol/lti/cartridge.php/' . $id . '/' . $token . '/cartridge.xml');
... | php | public static function get_cartridge_url($tool) {
global $CFG;
$url = null;
$id = $tool->id;
$token = self::generate_cartridge_token($tool->id);
if ($CFG->slasharguments) {
$url = new \moodle_url('/enrol/lti/cartridge.php/' . $id . '/' . $token . '/cartridge.xml');
... | [
"public",
"static",
"function",
"get_cartridge_url",
"(",
"$",
"tool",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"url",
"=",
"null",
";",
"$",
"id",
"=",
"$",
"tool",
"->",
"id",
";",
"$",
"token",
"=",
"self",
"::",
"generate_cartridge_token",
"(",
... | Returns the url to the cartridge representing the tool.
If you have slash arguments enabled, this will be a nice url ending in cartridge.xml.
If not it will be a php page with some parameters passed.
@param \stdClass $tool The lti tool
@return string The url to the cartridge representing the tool
@since Moodle 3.2 | [
"Returns",
"the",
"url",
"to",
"the",
"cartridge",
"representing",
"the",
"tool",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L460-L477 |
215,230 | moodle/moodle | enrol/lti/classes/helper.php | helper.get_proxy_url | public static function get_proxy_url($tool) {
global $CFG;
$url = null;
$id = $tool->id;
$token = self::generate_proxy_token($tool->id);
if ($CFG->slasharguments) {
$url = new \moodle_url('/enrol/lti/proxy.php/' . $id . '/' . $token . '/');
} else {
... | php | public static function get_proxy_url($tool) {
global $CFG;
$url = null;
$id = $tool->id;
$token = self::generate_proxy_token($tool->id);
if ($CFG->slasharguments) {
$url = new \moodle_url('/enrol/lti/proxy.php/' . $id . '/' . $token . '/');
} else {
... | [
"public",
"static",
"function",
"get_proxy_url",
"(",
"$",
"tool",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"url",
"=",
"null",
";",
"$",
"id",
"=",
"$",
"tool",
"->",
"id",
";",
"$",
"token",
"=",
"self",
"::",
"generate_proxy_token",
"(",
"$",
"... | Returns the url to the tool proxy registration url.
If you have slash arguments enabled, this will be a nice url ending in cartridge.xml.
If not it will be a php page with some parameters passed.
@param \stdClass $tool The lti tool
@return string The url to the cartridge representing the tool | [
"Returns",
"the",
"url",
"to",
"the",
"tool",
"proxy",
"registration",
"url",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L488-L505 |
215,231 | moodle/moodle | enrol/lti/classes/helper.php | helper.get_cartridge_parameters | protected static function get_cartridge_parameters($toolid) {
global $PAGE, $SITE;
$PAGE->set_context(\context_system::instance());
// Get the tool.
$tool = self::get_lti_tool($toolid);
// Work out the name of the tool.
$title = self::get_name($tool);
$launchurl... | php | protected static function get_cartridge_parameters($toolid) {
global $PAGE, $SITE;
$PAGE->set_context(\context_system::instance());
// Get the tool.
$tool = self::get_lti_tool($toolid);
// Work out the name of the tool.
$title = self::get_name($tool);
$launchurl... | [
"protected",
"static",
"function",
"get_cartridge_parameters",
"(",
"$",
"toolid",
")",
"{",
"global",
"$",
"PAGE",
",",
"$",
"SITE",
";",
"$",
"PAGE",
"->",
"set_context",
"(",
"\\",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"// Get the tool."... | Returns the parameters of the cartridge as an associative array of partial xpath.
@param int $toolid The id of the shared tool
@return array Recursive associative array with partial xpath to be concatenated into an xpath expression
before setting the value.
@since Moodle 3.2 | [
"Returns",
"the",
"parameters",
"of",
"the",
"cartridge",
"as",
"an",
"associative",
"array",
"of",
"partial",
"xpath",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L569-L613 |
215,232 | moodle/moodle | enrol/lti/classes/helper.php | helper.set_xpath | protected static function set_xpath($xpath, $parameters, $prefix = '') {
foreach ($parameters as $key => $value) {
if (is_array($value)) {
self::set_xpath($xpath, $value, $prefix . $key);
} else {
$result = @$xpath->query($prefix . $key);
i... | php | protected static function set_xpath($xpath, $parameters, $prefix = '') {
foreach ($parameters as $key => $value) {
if (is_array($value)) {
self::set_xpath($xpath, $value, $prefix . $key);
} else {
$result = @$xpath->query($prefix . $key);
i... | [
"protected",
"static",
"function",
"set_xpath",
"(",
"$",
"xpath",
",",
"$",
"parameters",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
... | Traverses a recursive associative array, setting the properties of the corresponding
xpath element.
@param \DOMXPath $xpath The xpath with the xml to modify
@param array $parameters The array of xpaths to search through
@param string $prefix The current xpath prefix (gets longer the deeper into the array you go)
@retu... | [
"Traverses",
"a",
"recursive",
"associative",
"array",
"setting",
"the",
"properties",
"of",
"the",
"corresponding",
"xpath",
"element",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L625-L645 |
215,233 | moodle/moodle | enrol/lti/classes/helper.php | helper.create_cartridge | public static function create_cartridge($toolid) {
$cartridge = new \DOMDocument();
$cartridge->load(realpath(__DIR__ . '/../xml/imslticc.xml'));
$xpath = new \DOMXpath($cartridge);
$xpath->registerNamespace('cc', 'http://www.imsglobal.org/xsd/imslticc_v1p0');
$parameters = self:... | php | public static function create_cartridge($toolid) {
$cartridge = new \DOMDocument();
$cartridge->load(realpath(__DIR__ . '/../xml/imslticc.xml'));
$xpath = new \DOMXpath($cartridge);
$xpath->registerNamespace('cc', 'http://www.imsglobal.org/xsd/imslticc_v1p0');
$parameters = self:... | [
"public",
"static",
"function",
"create_cartridge",
"(",
"$",
"toolid",
")",
"{",
"$",
"cartridge",
"=",
"new",
"\\",
"DOMDocument",
"(",
")",
";",
"$",
"cartridge",
"->",
"load",
"(",
"realpath",
"(",
"__DIR__",
".",
"'/../xml/imslticc.xml'",
")",
")",
";... | Create an IMS cartridge for the tool.
@param int $toolid The id of the shared tool
@return string representing the generated cartridge
@since Moodle 3.2 | [
"Create",
"an",
"IMS",
"cartridge",
"for",
"the",
"tool",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/helper.php#L654-L663 |
215,234 | moodle/moodle | lib/spout/src/Spout/Common/Helper/GlobalFunctionsHelper.php | GlobalFunctionsHelper.convertToUseRealPath | protected function convertToUseRealPath($filePath)
{
$realFilePath = $filePath;
if ($this->isZipStream($filePath)) {
if (preg_match('/zip:\/\/(.*)#(.*)/', $filePath, $matches)) {
$documentPath = $matches[1];
$documentInsideZipPath = $matches[2];
... | php | protected function convertToUseRealPath($filePath)
{
$realFilePath = $filePath;
if ($this->isZipStream($filePath)) {
if (preg_match('/zip:\/\/(.*)#(.*)/', $filePath, $matches)) {
$documentPath = $matches[1];
$documentInsideZipPath = $matches[2];
... | [
"protected",
"function",
"convertToUseRealPath",
"(",
"$",
"filePath",
")",
"{",
"$",
"realFilePath",
"=",
"$",
"filePath",
";",
"if",
"(",
"$",
"this",
"->",
"isZipStream",
"(",
"$",
"filePath",
")",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/zip:\\/\\/(.... | Updates the given file path to use a real path.
This is to avoid issues on some Windows setup.
@param string $filePath File path
@return string The file path using a real path | [
"Updates",
"the",
"given",
"file",
"path",
"to",
"use",
"a",
"real",
"path",
".",
"This",
"is",
"to",
"avoid",
"issues",
"on",
"some",
"Windows",
"setup",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Common/Helper/GlobalFunctionsHelper.php#L178-L193 |
215,235 | moodle/moodle | admin/tool/monitor/classes/rule_manager.php | rule_manager.clean_ruledata_form | public static function clean_ruledata_form($mformdata) {
global $USER;
$rule = new \stdClass();
if (!empty($mformdata->ruleid)) {
$rule->id = $mformdata->ruleid;
}
$rule->userid = empty($mformdata->userid) ? $USER->id : $mformdata->userid;
$rule->courseid = $... | php | public static function clean_ruledata_form($mformdata) {
global $USER;
$rule = new \stdClass();
if (!empty($mformdata->ruleid)) {
$rule->id = $mformdata->ruleid;
}
$rule->userid = empty($mformdata->userid) ? $USER->id : $mformdata->userid;
$rule->courseid = $... | [
"public",
"static",
"function",
"clean_ruledata_form",
"(",
"$",
"mformdata",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"rule",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"mformdata",
"->",
"ruleid",
")",
")",
"{... | Clean data submitted by mform.
@param \stdClass $mformdata data to insert as new rule entry.
@return \stdClass Cleaned rule data. | [
"Clean",
"data",
"submitted",
"by",
"mform",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/rule_manager.php#L82-L102 |
215,236 | moodle/moodle | admin/tool/monitor/classes/rule_manager.php | rule_manager.delete_rule | public static function delete_rule($ruleid, $coursecontext = null) {
global $DB;
subscription_manager::remove_all_subscriptions_for_rule($ruleid, $coursecontext);
// Retrieve the rule from the DB before we delete it, so we have a record when we trigger a rule deleted event.
$rule = $DB... | php | public static function delete_rule($ruleid, $coursecontext = null) {
global $DB;
subscription_manager::remove_all_subscriptions_for_rule($ruleid, $coursecontext);
// Retrieve the rule from the DB before we delete it, so we have a record when we trigger a rule deleted event.
$rule = $DB... | [
"public",
"static",
"function",
"delete_rule",
"(",
"$",
"ruleid",
",",
"$",
"coursecontext",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"subscription_manager",
"::",
"remove_all_subscriptions_for_rule",
"(",
"$",
"ruleid",
",",
"$",
"coursecontext",
")",
... | Delete a rule and associated subscriptions, by rule id.
@param int $ruleid id of rule to be deleted.
@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",
"a",
"rule",
"and",
"associated",
"subscriptions",
"by",
"rule",
"id",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/rule_manager.php#L113-L149 |
215,237 | moodle/moodle | admin/tool/monitor/classes/rule_manager.php | rule_manager.get_rule | public static function get_rule($ruleorid) {
global $DB;
if (!is_object($ruleorid)) {
$rule = $DB->get_record('tool_monitor_rules', array('id' => $ruleorid), '*', MUST_EXIST);
} else {
$rule = $ruleorid;
}
return new rule($rule);
} | php | public static function get_rule($ruleorid) {
global $DB;
if (!is_object($ruleorid)) {
$rule = $DB->get_record('tool_monitor_rules', array('id' => $ruleorid), '*', MUST_EXIST);
} else {
$rule = $ruleorid;
}
return new rule($rule);
} | [
"public",
"static",
"function",
"get_rule",
"(",
"$",
"ruleorid",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"is_object",
"(",
"$",
"ruleorid",
")",
")",
"{",
"$",
"rule",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'tool_monitor_rules'",
",",
... | Get an instance of rule class.
@param \stdClass|int $ruleorid A rule object from database or rule id.
@return rule object with rule id. | [
"Get",
"an",
"instance",
"of",
"rule",
"class",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/rule_manager.php#L158-L167 |
215,238 | moodle/moodle | admin/tool/monitor/classes/rule_manager.php | rule_manager.update_rule | public static function update_rule($ruledata) {
global $DB;
if (!self::get_rule($ruledata->id)) {
throw new \coding_exception('Invalid rule ID.');
}
$ruledata->timemodified = time();
$success = $DB->update_record('tool_monitor_rules', $ruledata);
// If succe... | php | public static function update_rule($ruledata) {
global $DB;
if (!self::get_rule($ruledata->id)) {
throw new \coding_exception('Invalid rule ID.');
}
$ruledata->timemodified = time();
$success = $DB->update_record('tool_monitor_rules', $ruledata);
// If succe... | [
"public",
"static",
"function",
"update_rule",
"(",
"$",
"ruledata",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"self",
"::",
"get_rule",
"(",
"$",
"ruledata",
"->",
"id",
")",
")",
"{",
"throw",
"new",
"\\",
"coding_exception",
"(",
"'Invalid... | Update rule data.
@throws \coding_exception if $record->ruleid is invalid.
@param object $ruledata rule data to be updated.
@return bool | [
"Update",
"rule",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/rule_manager.php#L177-L211 |
215,239 | moodle/moodle | admin/tool/monitor/classes/rule_manager.php | rule_manager.get_rules_by_courseid | public static function get_rules_by_courseid($courseid, $limitfrom = 0, $limitto = 0, $includesite = true) {
global $DB;
$select = 'courseid = ?';
$params = array();
$params[] = $courseid;
if ($includesite) {
$select .= ' OR courseid = ?';
$params[] = 0;
... | php | public static function get_rules_by_courseid($courseid, $limitfrom = 0, $limitto = 0, $includesite = true) {
global $DB;
$select = 'courseid = ?';
$params = array();
$params[] = $courseid;
if ($includesite) {
$select .= ' OR courseid = ?';
$params[] = 0;
... | [
"public",
"static",
"function",
"get_rules_by_courseid",
"(",
"$",
"courseid",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitto",
"=",
"0",
",",
"$",
"includesite",
"=",
"true",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"select",
"=",
"'courseid = ?'",... | Get rules by course id.
@param int $courseid course id of the rule.
@param int $limitfrom Limit from which to fetch rules.
@param int $limitto Limit to which rules need to be fetched.
@param bool $includesite Determines whether we return site wide rules or not.
@return array List of rules for the given course id, if... | [
"Get",
"rules",
"by",
"course",
"id",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/rule_manager.php#L223-L237 |
215,240 | moodle/moodle | search/classes/base_block.php | base_block.get_indexing_restrictions | protected function get_indexing_restrictions() {
global $DB;
// This includes completely empty configdata, and also three other values that are
// equivalent to empty:
// - A serialized completely empty object.
// - A serialized object with one field called '0' (string not int) ... | php | protected function get_indexing_restrictions() {
global $DB;
// This includes completely empty configdata, and also three other values that are
// equivalent to empty:
// - A serialized completely empty object.
// - A serialized object with one field called '0' (string not int) ... | [
"protected",
"function",
"get_indexing_restrictions",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"// This includes completely empty configdata, and also three other values that are",
"// equivalent to empty:",
"// - A serialized completely empty object.",
"// - A serialized object with one f... | Returns restrictions on which block_instances rows to return. By default, excludes rows
that have empty configdata.
If no restriction is required, you could return ['', []].
@return array 2-element array of SQL restriction and params for it | [
"Returns",
"restrictions",
"on",
"which",
"block_instances",
"rows",
"to",
"return",
".",
"By",
"default",
"excludes",
"rows",
"that",
"have",
"empty",
"configdata",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/base_block.php#L72-L90 |
215,241 | moodle/moodle | search/classes/base_block.php | base_block.get_document_recordset | public function get_document_recordset($modifiedfrom = 0, \context $context = null) {
global $DB;
// Get context restrictions.
list ($contextjoin, $contextparams) = $this->get_context_restriction_sql($context, 'bi');
// Get custom restrictions for block type.
list ($restriction... | php | public function get_document_recordset($modifiedfrom = 0, \context $context = null) {
global $DB;
// Get context restrictions.
list ($contextjoin, $contextparams) = $this->get_context_restriction_sql($context, 'bi');
// Get custom restrictions for block type.
list ($restriction... | [
"public",
"function",
"get_document_recordset",
"(",
"$",
"modifiedfrom",
"=",
"0",
",",
"\\",
"context",
"$",
"context",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"// Get context restrictions.",
"list",
"(",
"$",
"contextjoin",
",",
"$",
"contextparams... | Gets recordset of all blocks of this type modified since given time within the given context.
See base class for detailed requirements. This implementation includes the key fields
from block_instances.
This can be overridden to do something totally different if the block's data is stored in
other tables.
If there ar... | [
"Gets",
"recordset",
"of",
"all",
"blocks",
"of",
"this",
"type",
"modified",
"since",
"given",
"time",
"within",
"the",
"given",
"context",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/base_block.php#L109-L143 |
215,242 | moodle/moodle | search/classes/base_block.php | base_block.check_access | public function check_access($id) {
$instance = $this->get_block_instance($id, IGNORE_MISSING);
if (!$instance) {
// This generally won't happen because if the block has been deleted then we won't have
// included its context in the search area list, but just in case.
... | php | public function check_access($id) {
$instance = $this->get_block_instance($id, IGNORE_MISSING);
if (!$instance) {
// This generally won't happen because if the block has been deleted then we won't have
// included its context in the search area list, but just in case.
... | [
"public",
"function",
"check_access",
"(",
"$",
"id",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"get_block_instance",
"(",
"$",
"id",
",",
"IGNORE_MISSING",
")",
";",
"if",
"(",
"!",
"$",
"instance",
")",
"{",
"// This generally won't happen because... | Checks access for a document in this search area.
If you override this function for a block, you should call this base class version first
as it will check that the block is still visible to users in a supported location.
@param int $id Document id
@return int manager:ACCESS_xx constant | [
"Checks",
"access",
"for",
"a",
"document",
"in",
"this",
"search",
"area",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/base_block.php#L190-L210 |
215,243 | moodle/moodle | search/classes/base_block.php | base_block.get_block_instance | protected function get_block_instance($id, $strictness = MUST_EXIST) {
global $DB;
$cache = \cache::make_from_params(\cache_store::MODE_REQUEST, 'core_search',
self::CACHE_INSTANCES, [], ['simplekeys' => true]);
$id = (int)$id;
$instance = $cache->get($id);
if (!... | php | protected function get_block_instance($id, $strictness = MUST_EXIST) {
global $DB;
$cache = \cache::make_from_params(\cache_store::MODE_REQUEST, 'core_search',
self::CACHE_INSTANCES, [], ['simplekeys' => true]);
$id = (int)$id;
$instance = $cache->get($id);
if (!... | [
"protected",
"function",
"get_block_instance",
"(",
"$",
"id",
",",
"$",
"strictness",
"=",
"MUST_EXIST",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"cache",
"=",
"\\",
"cache",
"::",
"make_from_params",
"(",
"\\",
"cache_store",
"::",
"MODE_REQUEST",
",",
"... | Gets a block instance with given id.
Returns the fields id, pagetypepattern, subpagepattern from block_instances and also the
cmid (if parent context is an activity module).
@param int $id ID of block instance
@param int $strictness MUST_EXIST or IGNORE_MISSING
@return false|mixed Block instance data (may be false if... | [
"Gets",
"a",
"block",
"instance",
"with",
"given",
"id",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/base_block.php#L239-L259 |
215,244 | moodle/moodle | lib/phpexcel/PHPExcel/Style/Fill.php | PHPExcel_Style_Fill.setStartColor | public function setStartColor(PHPExcel_Style_Color $pValue = null)
{
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
if ($this->isSupervisor) {
$styleArray = $this->getStartColor()->getSty... | php | public function setStartColor(PHPExcel_Style_Color $pValue = null)
{
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
if ($this->isSupervisor) {
$styleArray = $this->getStartColor()->getSty... | [
"public",
"function",
"setStartColor",
"(",
"PHPExcel_Style_Color",
"$",
"pValue",
"=",
"null",
")",
"{",
"// make sure parameter is a real color and not a supervisor",
"$",
"color",
"=",
"$",
"pValue",
"->",
"getIsSupervisor",
"(",
")",
"?",
"$",
"pValue",
"->",
"g... | Set Start Color
@param PHPExcel_Style_Color $pValue
@throws PHPExcel_Exception
@return PHPExcel_Style_Fill | [
"Set",
"Start",
"Color"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Style/Fill.php#L259-L271 |
215,245 | moodle/moodle | search/classes/manager.php | manager.instance | public static function instance($fast = false) {
global $CFG;
// One per request, this should be purged during testing.
if (static::$instance !== null) {
return static::$instance;
}
if (empty($CFG->searchengine)) {
throw new \core_search\engine_exception... | php | public static function instance($fast = false) {
global $CFG;
// One per request, this should be purged during testing.
if (static::$instance !== null) {
return static::$instance;
}
if (empty($CFG->searchengine)) {
throw new \core_search\engine_exception... | [
"public",
"static",
"function",
"instance",
"(",
"$",
"fast",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
";",
"// One per request, this should be purged during testing.",
"if",
"(",
"static",
"::",
"$",
"instance",
"!==",
"null",
")",
"{",
"return",
"static",... | Returns an initialised \core_search instance.
While constructing the instance, checks on the search schema may be carried out. The $fast
parameter provides a way to skip those checks on pages which are used frequently. It has
no effect if an instance has already been constructed in this request.
@see \core_search\eng... | [
"Returns",
"an",
"initialised",
"\\",
"core_search",
"instance",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L189-L239 |
215,246 | moodle/moodle | search/classes/manager.php | manager.get_search_area | public static function get_search_area($areaid) {
// We have them all here.
if (!empty(static::$allsearchareas[$areaid])) {
return static::$allsearchareas[$areaid];
}
$classname = static::get_area_classname($areaid);
if (class_exists($classname) && static::is_searc... | php | public static function get_search_area($areaid) {
// We have them all here.
if (!empty(static::$allsearchareas[$areaid])) {
return static::$allsearchareas[$areaid];
}
$classname = static::get_area_classname($areaid);
if (class_exists($classname) && static::is_searc... | [
"public",
"static",
"function",
"get_search_area",
"(",
"$",
"areaid",
")",
"{",
"// We have them all here.",
"if",
"(",
"!",
"empty",
"(",
"static",
"::",
"$",
"allsearchareas",
"[",
"$",
"areaid",
"]",
")",
")",
"{",
"return",
"static",
"::",
"$",
"allse... | Returns a new area search indexer instance.
@param string $areaid
@return \core_search\base|bool False if the area is not available. | [
"Returns",
"a",
"new",
"area",
"search",
"indexer",
"instance",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L304-L318 |
215,247 | moodle/moodle | search/classes/manager.php | manager.get_search_areas_list | public static function get_search_areas_list($enabled = false) {
// Two different arrays, we don't expect these arrays to be big.
if (static::$allsearchareas !== null) {
if (!$enabled) {
return static::$allsearchareas;
} else {
return static::$ena... | php | public static function get_search_areas_list($enabled = false) {
// Two different arrays, we don't expect these arrays to be big.
if (static::$allsearchareas !== null) {
if (!$enabled) {
return static::$allsearchareas;
} else {
return static::$ena... | [
"public",
"static",
"function",
"get_search_areas_list",
"(",
"$",
"enabled",
"=",
"false",
")",
"{",
"// Two different arrays, we don't expect these arrays to be big.",
"if",
"(",
"static",
"::",
"$",
"allsearchareas",
"!==",
"null",
")",
"{",
"if",
"(",
"!",
"$",
... | Return the list of available search areas.
@param bool $enabled Return only the enabled ones.
@return \core_search\base[] | [
"Return",
"the",
"list",
"of",
"available",
"search",
"areas",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L326-L360 |
215,248 | moodle/moodle | search/classes/manager.php | manager.get_search_area_category_by_name | public static function get_search_area_category_by_name($name) {
if (key_exists($name, self::get_search_area_categories())) {
return self::get_search_area_categories()[$name];
} else {
return self::get_search_area_categories()[self::get_default_area_category_name()];
}
... | php | public static function get_search_area_category_by_name($name) {
if (key_exists($name, self::get_search_area_categories())) {
return self::get_search_area_categories()[$name];
} else {
return self::get_search_area_categories()[self::get_default_area_category_name()];
}
... | [
"public",
"static",
"function",
"get_search_area_category_by_name",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"key_exists",
"(",
"$",
"name",
",",
"self",
"::",
"get_search_area_categories",
"(",
")",
")",
")",
"{",
"return",
"self",
"::",
"get_search_area_categori... | Return search area category instance by category name.
@param string $name Category name. If name is not valid will return default category.
@return \core_search\area_category | [
"Return",
"search",
"area",
"category",
"instance",
"by",
"category",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L369-L375 |
215,249 | moodle/moodle | search/classes/manager.php | manager.get_search_area_categories | public static function get_search_area_categories() {
if (!isset(static::$searchareacategories)) {
$categories = self::get_core_search_area_categories();
// Go through all existing search areas and get categories they are assigned to.
$areacategories = [];
foreac... | php | public static function get_search_area_categories() {
if (!isset(static::$searchareacategories)) {
$categories = self::get_core_search_area_categories();
// Go through all existing search areas and get categories they are assigned to.
$areacategories = [];
foreac... | [
"public",
"static",
"function",
"get_search_area_categories",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"searchareacategories",
")",
")",
"{",
"$",
"categories",
"=",
"self",
"::",
"get_core_search_area_categories",
"(",
")",
";",
"// G... | Return a list of existing search area categories.
@return \core_search\area_category[] | [
"Return",
"a",
"list",
"of",
"existing",
"search",
"area",
"categories",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L382-L431 |
215,250 | moodle/moodle | search/classes/manager.php | manager.get_core_search_area_categories | protected static function get_core_search_area_categories() {
$categories = [];
$categories[self::SEARCH_AREA_CATEGORY_ALL] = new area_category(
self::SEARCH_AREA_CATEGORY_ALL,
get_string('core-all', 'search'),
0,
self::get_search_areas_list(true)
... | php | protected static function get_core_search_area_categories() {
$categories = [];
$categories[self::SEARCH_AREA_CATEGORY_ALL] = new area_category(
self::SEARCH_AREA_CATEGORY_ALL,
get_string('core-all', 'search'),
0,
self::get_search_areas_list(true)
... | [
"protected",
"static",
"function",
"get_core_search_area_categories",
"(",
")",
"{",
"$",
"categories",
"=",
"[",
"]",
";",
"$",
"categories",
"[",
"self",
"::",
"SEARCH_AREA_CATEGORY_ALL",
"]",
"=",
"new",
"area_category",
"(",
"self",
"::",
"SEARCH_AREA_CATEGORY... | Get list of core search area categories.
@return \core_search\area_category[] | [
"Get",
"list",
"of",
"core",
"search",
"area",
"categories",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L438-L473 |
215,251 | moodle/moodle | search/classes/manager.php | manager.get_additional_search_area_categories | protected static function get_additional_search_area_categories() {
$additionalcategories = [];
// Allow plugins to add custom search area categories.
if ($pluginsfunction = get_plugins_with_function('search_area_categories')) {
foreach ($pluginsfunction as $plugintype => $plugins) ... | php | protected static function get_additional_search_area_categories() {
$additionalcategories = [];
// Allow plugins to add custom search area categories.
if ($pluginsfunction = get_plugins_with_function('search_area_categories')) {
foreach ($pluginsfunction as $plugintype => $plugins) ... | [
"protected",
"static",
"function",
"get_additional_search_area_categories",
"(",
")",
"{",
"$",
"additionalcategories",
"=",
"[",
"]",
";",
"// Allow plugins to add custom search area categories.",
"if",
"(",
"$",
"pluginsfunction",
"=",
"get_plugins_with_function",
"(",
"'... | Gets a list of additional search area categories.
@return \core_search\area_category[] | [
"Gets",
"a",
"list",
"of",
"additional",
"search",
"area",
"categories",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L480-L505 |
215,252 | moodle/moodle | search/classes/manager.php | manager.clear_static | public static function clear_static() {
static::$enabledsearchareas = null;
static::$allsearchareas = null;
static::$instance = null;
static::$searchareacategories = null;
base_block::clear_static();
engine::clear_users_cache();
} | php | public static function clear_static() {
static::$enabledsearchareas = null;
static::$allsearchareas = null;
static::$instance = null;
static::$searchareacategories = null;
base_block::clear_static();
engine::clear_users_cache();
} | [
"public",
"static",
"function",
"clear_static",
"(",
")",
"{",
"static",
"::",
"$",
"enabledsearchareas",
"=",
"null",
";",
"static",
"::",
"$",
"allsearchareas",
"=",
"null",
";",
"static",
"::",
"$",
"instance",
"=",
"null",
";",
"static",
"::",
"$",
"... | Clears all static caches.
@return void | [
"Clears",
"all",
"static",
"caches",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L523-L532 |
215,253 | moodle/moodle | search/classes/manager.php | manager.parse_areaid | public static function parse_areaid($areaid) {
$parts = self::extract_areaid_parts($areaid);
if (empty($parts[1])) {
throw new \coding_exception('Trying to parse invalid search area id ' . $areaid);
}
$component = $parts[0];
$area = $parts[1];
if (strpos($c... | php | public static function parse_areaid($areaid) {
$parts = self::extract_areaid_parts($areaid);
if (empty($parts[1])) {
throw new \coding_exception('Trying to parse invalid search area id ' . $areaid);
}
$component = $parts[0];
$area = $parts[1];
if (strpos($c... | [
"public",
"static",
"function",
"parse_areaid",
"(",
"$",
"areaid",
")",
"{",
"$",
"parts",
"=",
"self",
"::",
"extract_areaid_parts",
"(",
"$",
"areaid",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"parts",
"[",
"1",
"]",
")",
")",
"{",
"throw",
"new",
... | Parse a search area id and get plugin name and config name prefix from it.
@param string $areaid Search area id.
@return array Where the first element is a plugin name and the second is config names prefix. | [
"Parse",
"a",
"search",
"area",
"id",
"and",
"get",
"plugin",
"name",
"and",
"config",
"name",
"prefix",
"from",
"it",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L564-L583 |
215,254 | moodle/moodle | search/classes/manager.php | manager.paged_search | public function paged_search(\stdClass $formdata, $pagenum) {
$out = new \stdClass();
if (self::is_search_area_categories_enabled() && !empty($formdata->cat)) {
$cat = self::get_search_area_category_by_name($formdata->cat);
if (empty($formdata->areaids)) {
$formd... | php | public function paged_search(\stdClass $formdata, $pagenum) {
$out = new \stdClass();
if (self::is_search_area_categories_enabled() && !empty($formdata->cat)) {
$cat = self::get_search_area_category_by_name($formdata->cat);
if (empty($formdata->areaids)) {
$formd... | [
"public",
"function",
"paged_search",
"(",
"\\",
"stdClass",
"$",
"formdata",
",",
"$",
"pagenum",
")",
"{",
"$",
"out",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"if",
"(",
"self",
"::",
"is_search_area_categories_enabled",
"(",
")",
"&&",
"!",
"empt... | Returns requested page of documents plus additional information for paging.
This function does not perform any kind of security checking for access, the caller code
should check that the current user have moodle/search:query capability.
If a page is requested that is beyond the last result, the last valid page is ret... | [
"Returns",
"requested",
"page",
"of",
"documents",
"plus",
"additional",
"information",
"for",
"paging",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L855-L905 |
215,255 | moodle/moodle | search/classes/manager.php | manager.search | public function search(\stdClass $formdata, $limit = 0) {
// For Behat testing, the search results can be faked using a special step.
if (defined('BEHAT_SITE_RUNNING')) {
$fakeresult = get_config('core_search', 'behat_fakeresult');
if ($fakeresult) {
// Clear conf... | php | public function search(\stdClass $formdata, $limit = 0) {
// For Behat testing, the search results can be faked using a special step.
if (defined('BEHAT_SITE_RUNNING')) {
$fakeresult = get_config('core_search', 'behat_fakeresult');
if ($fakeresult) {
// Clear conf... | [
"public",
"function",
"search",
"(",
"\\",
"stdClass",
"$",
"formdata",
",",
"$",
"limit",
"=",
"0",
")",
"{",
"// For Behat testing, the search results can be faked using a special step.",
"if",
"(",
"defined",
"(",
"'BEHAT_SITE_RUNNING'",
")",
")",
"{",
"$",
"fake... | Returns documents from the engine based on the data provided.
This function does not perform any kind of security checking, the caller code
should check that the current user have moodle/search:query capability.
It might return the results from the cache instead.
Valid formdata options include:
- q (query text)
- co... | [
"Returns",
"documents",
"from",
"the",
"engine",
"based",
"on",
"the",
"data",
"provided",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L927-L988 |
215,256 | moodle/moodle | search/classes/manager.php | manager.build_limitcourseids | protected function build_limitcourseids(\stdClass $formdata) {
$limitcourseids = false;
if (!empty($formdata->mycoursesonly)) {
$limitcourseids = array_keys($this->get_my_courses(false));
}
if (!empty($formdata->courseids)) {
if (empty($limitcourseids)) {
... | php | protected function build_limitcourseids(\stdClass $formdata) {
$limitcourseids = false;
if (!empty($formdata->mycoursesonly)) {
$limitcourseids = array_keys($this->get_my_courses(false));
}
if (!empty($formdata->courseids)) {
if (empty($limitcourseids)) {
... | [
"protected",
"function",
"build_limitcourseids",
"(",
"\\",
"stdClass",
"$",
"formdata",
")",
"{",
"$",
"limitcourseids",
"=",
"false",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"formdata",
"->",
"mycoursesonly",
")",
")",
"{",
"$",
"limitcourseids",
"=",
"a... | Build a list of course ids to limit the search based on submitted form data.
@param \stdClass $formdata Submitted search form data.
@return array|bool | [
"Build",
"a",
"list",
"of",
"course",
"ids",
"to",
"limit",
"the",
"search",
"based",
"on",
"submitted",
"form",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L997-L1013 |
215,257 | moodle/moodle | search/classes/manager.php | manager.reset_config | public function reset_config($areaid = false) {
if (!empty($areaid)) {
$searchareas = array();
if (!$searchareas[$areaid] = static::get_search_area($areaid)) {
throw new \moodle_exception('errorareanotavailable', 'search', '', $areaid);
}
} else {
... | php | public function reset_config($areaid = false) {
if (!empty($areaid)) {
$searchareas = array();
if (!$searchareas[$areaid] = static::get_search_area($areaid)) {
throw new \moodle_exception('errorareanotavailable', 'search', '', $areaid);
}
} else {
... | [
"public",
"function",
"reset_config",
"(",
"$",
"areaid",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"areaid",
")",
")",
"{",
"$",
"searchareas",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"$",
"searchareas",
"[",
"$",
"areaid",
... | Resets areas config.
@throws \moodle_exception
@param string $areaid
@return void | [
"Resets",
"areas",
"config",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L1335-L1358 |
215,258 | moodle/moodle | search/classes/manager.php | manager.delete_index | public function delete_index($areaid = false) {
if (!empty($areaid)) {
$this->engine->delete($areaid);
$this->reset_config($areaid);
} else {
$this->engine->delete();
$this->reset_config();
}
} | php | public function delete_index($areaid = false) {
if (!empty($areaid)) {
$this->engine->delete($areaid);
$this->reset_config($areaid);
} else {
$this->engine->delete();
$this->reset_config();
}
} | [
"public",
"function",
"delete_index",
"(",
"$",
"areaid",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"areaid",
")",
")",
"{",
"$",
"this",
"->",
"engine",
"->",
"delete",
"(",
"$",
"areaid",
")",
";",
"$",
"this",
"->",
"reset_confi... | Deletes an area's documents or all areas documents.
@param string $areaid The area id or false for all
@return void | [
"Deletes",
"an",
"area",
"s",
"documents",
"or",
"all",
"areas",
"documents",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L1366-L1374 |
215,259 | moodle/moodle | search/classes/manager.php | manager.get_areas_config | public function get_areas_config($searchareas) {
$vars = array('indexingstart', 'indexingend', 'lastindexrun', 'docsignored',
'docsprocessed', 'recordsprocessed', 'partial');
$configsettings = [];
foreach ($searchareas as $searcharea) {
$areaid = $searcharea->get_a... | php | public function get_areas_config($searchareas) {
$vars = array('indexingstart', 'indexingend', 'lastindexrun', 'docsignored',
'docsprocessed', 'recordsprocessed', 'partial');
$configsettings = [];
foreach ($searchareas as $searcharea) {
$areaid = $searcharea->get_a... | [
"public",
"function",
"get_areas_config",
"(",
"$",
"searchareas",
")",
"{",
"$",
"vars",
"=",
"array",
"(",
"'indexingstart'",
",",
"'indexingend'",
",",
"'lastindexrun'",
",",
"'docsignored'",
",",
"'docsprocessed'",
",",
"'recordsprocessed'",
",",
"'partial'",
... | Returns search areas configuration.
@param \core_search\base[] $searchareas
@return \stdClass[] $configsettings | [
"Returns",
"search",
"areas",
"configuration",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L1391-L1423 |
215,260 | moodle/moodle | search/classes/manager.php | manager.trigger_search_results_viewed | public static function trigger_search_results_viewed($other) {
$event = \core\event\search_results_viewed::create([
'context' => \context_system::instance(),
'other' => $other
]);
$event->trigger();
return $event;
} | php | public static function trigger_search_results_viewed($other) {
$event = \core\event\search_results_viewed::create([
'context' => \context_system::instance(),
'other' => $other
]);
$event->trigger();
return $event;
} | [
"public",
"static",
"function",
"trigger_search_results_viewed",
"(",
"$",
"other",
")",
"{",
"$",
"event",
"=",
"\\",
"core",
"\\",
"event",
"\\",
"search_results_viewed",
"::",
"create",
"(",
"[",
"'context'",
"=>",
"\\",
"context_system",
"::",
"instance",
... | Triggers search_results_viewed event
Other data required:
- q: The query string
- page: The page number
- title: Title filter
- areaids: Search areas filter
- courseids: Courses filter
- timestart: Time start filter
- timeend: Time end filter
@since Moodle 3.2
@param array $other Other info for the event.
@return \co... | [
"Triggers",
"search_results_viewed",
"event"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L1441-L1449 |
215,261 | moodle/moodle | search/classes/manager.php | manager.request_index | public static function request_index(\context $context, $areaid = '',
$priority = self::INDEX_PRIORITY_NORMAL) {
global $DB;
// Check through existing requests for this context or any parent context.
list ($contextsql, $contextparams) = $DB->get_in_or_equal(
$context... | php | public static function request_index(\context $context, $areaid = '',
$priority = self::INDEX_PRIORITY_NORMAL) {
global $DB;
// Check through existing requests for this context or any parent context.
list ($contextsql, $contextparams) = $DB->get_in_or_equal(
$context... | [
"public",
"static",
"function",
"request_index",
"(",
"\\",
"context",
"$",
"context",
",",
"$",
"areaid",
"=",
"''",
",",
"$",
"priority",
"=",
"self",
"::",
"INDEX_PRIORITY_NORMAL",
")",
"{",
"global",
"$",
"DB",
";",
"// Check through existing requests for th... | Requests that a specific context is indexed by the scheduled task. The context will be
added to a queue which is processed by the task.
This is used after a restore to ensure that restored items are indexed, even though their
modified time will be older than the latest indexed. It is also used by the 'Gradual reindex'... | [
"Requests",
"that",
"a",
"specific",
"context",
"is",
"indexed",
"by",
"the",
"scheduled",
"task",
".",
"The",
"context",
"will",
"be",
"added",
"to",
"a",
"queue",
"which",
"is",
"processed",
"by",
"the",
"task",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L1477-L1513 |
215,262 | moodle/moodle | search/classes/manager.php | manager.get_index_requests_info | public function get_index_requests_info() {
global $DB;
$result = new \stdClass();
$result->total = $DB->count_records('search_index_requests');
$result->topten = $DB->get_records('search_index_requests', null,
'indexpriority DESC, timerequested, contextid, searcharea',... | php | public function get_index_requests_info() {
global $DB;
$result = new \stdClass();
$result->total = $DB->count_records('search_index_requests');
$result->topten = $DB->get_records('search_index_requests', null,
'indexpriority DESC, timerequested, contextid, searcharea',... | [
"public",
"function",
"get_index_requests_info",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"result",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"result",
"->",
"total",
"=",
"$",
"DB",
"->",
"count_records",
"(",
"'search_index_requests'",
")",
... | Gets information about the request queue, in the form of a plain object suitable for passing
to a template for rendering.
@return \stdClass Information about queued index requests | [
"Gets",
"information",
"about",
"the",
"request",
"queue",
"in",
"the",
"form",
"of",
"a",
"plain",
"object",
"suitable",
"for",
"passing",
"to",
"a",
"template",
"for",
"rendering",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L1604-L1642 |
215,263 | moodle/moodle | search/classes/manager.php | manager.get_default_area_category_name | public static function get_default_area_category_name() {
$default = get_config('core', 'searchdefaultcategory');
if (empty($default)) {
$default = self::SEARCH_AREA_CATEGORY_ALL;
}
if ($default == self::SEARCH_AREA_CATEGORY_ALL && self::should_hide_all_results_category()) ... | php | public static function get_default_area_category_name() {
$default = get_config('core', 'searchdefaultcategory');
if (empty($default)) {
$default = self::SEARCH_AREA_CATEGORY_ALL;
}
if ($default == self::SEARCH_AREA_CATEGORY_ALL && self::should_hide_all_results_category()) ... | [
"public",
"static",
"function",
"get_default_area_category_name",
"(",
")",
"{",
"$",
"default",
"=",
"get_config",
"(",
"'core'",
",",
"'searchdefaultcategory'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"default",
")",
")",
"{",
"$",
"default",
"=",
"self",
... | Returns default search area category name.
@return string | [
"Returns",
"default",
"search",
"area",
"category",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L1681-L1693 |
215,264 | moodle/moodle | search/classes/manager.php | manager.get_all_courses | protected function get_all_courses($limitcourseids) {
global $DB;
if ($limitcourseids) {
list ($coursesql, $courseparams) = $DB->get_in_or_equal($limitcourseids);
$coursesql = 'id ' . $coursesql;
} else {
$coursesql = '';
$courseparams = [];
... | php | protected function get_all_courses($limitcourseids) {
global $DB;
if ($limitcourseids) {
list ($coursesql, $courseparams) = $DB->get_in_or_equal($limitcourseids);
$coursesql = 'id ' . $coursesql;
} else {
$coursesql = '';
$courseparams = [];
... | [
"protected",
"function",
"get_all_courses",
"(",
"$",
"limitcourseids",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"limitcourseids",
")",
"{",
"list",
"(",
"$",
"coursesql",
",",
"$",
"courseparams",
")",
"=",
"$",
"DB",
"->",
"get_in_or_equal",
... | Get a list of all courses limited by ids if required.
@param array|false $limitcourseids An array of course ids to limit the search to. False for no limiting.
@return array | [
"Get",
"a",
"list",
"of",
"all",
"courses",
"limited",
"by",
"ids",
"if",
"required",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L1701-L1716 |
215,265 | moodle/moodle | search/classes/manager.php | manager.clean_up_non_existing_area | public static function clean_up_non_existing_area($areaid) {
global $DB;
if (!empty(self::get_search_area($areaid))) {
throw new \coding_exception("Area $areaid exists. Please use appropriate search area class to manipulate the data.");
}
$parts = self::parse_areaid($areaid... | php | public static function clean_up_non_existing_area($areaid) {
global $DB;
if (!empty(self::get_search_area($areaid))) {
throw new \coding_exception("Area $areaid exists. Please use appropriate search area class to manipulate the data.");
}
$parts = self::parse_areaid($areaid... | [
"public",
"static",
"function",
"clean_up_non_existing_area",
"(",
"$",
"areaid",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"empty",
"(",
"self",
"::",
"get_search_area",
"(",
"$",
"areaid",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"coding_exc... | Cleans up non existing search area.
1. Remove all configs from {config_plugins} table.
2. Delete all related indexed documents.
@param string $areaid Search area id. | [
"Cleans",
"up",
"non",
"existing",
"search",
"area",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/manager.php#L1745-L1764 |
215,266 | moodle/moodle | backup/moodle2/restore_section_task.class.php | restore_section_task.define_settings | protected function define_settings() {
// All the settings related to this activity will include this prefix
$settingprefix = 'section_' . $this->info->sectionid . '_';
// All these are common settings to be shared by all sections
// Define section_included (to decide if the whole tas... | php | protected function define_settings() {
// All the settings related to this activity will include this prefix
$settingprefix = 'section_' . $this->info->sectionid . '_';
// All these are common settings to be shared by all sections
// Define section_included (to decide if the whole tas... | [
"protected",
"function",
"define_settings",
"(",
")",
"{",
"// All the settings related to this activity will include this prefix",
"$",
"settingprefix",
"=",
"'section_'",
".",
"$",
"this",
"->",
"info",
"->",
"sectionid",
".",
"'_'",
";",
"// All these are common settings... | Define the common setting that any restore section will have | [
"Define",
"the",
"common",
"setting",
"that",
"any",
"restore",
"section",
"will",
"have"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/restore_section_task.class.php#L152-L206 |
215,267 | moodle/moodle | grade/export/grade_export_form.php | grade_export_form.get_data | public function get_data() {
global $CFG;
$data = parent::get_data();
if ($data && $this->_customdata['multipledisplaytypes']) {
if (count(array_filter($data->display)) == 0) {
// Ensure that a value was selected as the export plugins expect at least one value.
... | php | public function get_data() {
global $CFG;
$data = parent::get_data();
if ($data && $this->_customdata['multipledisplaytypes']) {
if (count(array_filter($data->display)) == 0) {
// Ensure that a value was selected as the export plugins expect at least one value.
... | [
"public",
"function",
"get_data",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"data",
"=",
"parent",
"::",
"get_data",
"(",
")",
";",
"if",
"(",
"$",
"data",
"&&",
"$",
"this",
"->",
"_customdata",
"[",
"'multipledisplaytypes'",
"]",
")",
"{",
"if... | Overrides the mform get_data method.
Created to force a value since the validation method does not work with multiple checkbox.
@return stdClass form data object. | [
"Overrides",
"the",
"mform",
"get_data",
"method",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/grade_export_form.php#L214-L230 |
215,268 | moodle/moodle | privacy/classes/output/renderer.php | renderer.render_html_page | public function render_html_page(exported_html_page $page) {
$data = $page->export_for_template($this);
return parent::render_from_template('core_privacy/htmlpage', $data);
} | php | public function render_html_page(exported_html_page $page) {
$data = $page->export_for_template($this);
return parent::render_from_template('core_privacy/htmlpage', $data);
} | [
"public",
"function",
"render_html_page",
"(",
"exported_html_page",
"$",
"page",
")",
"{",
"$",
"data",
"=",
"$",
"page",
"->",
"export_for_template",
"(",
"$",
"this",
")",
";",
"return",
"parent",
"::",
"render_from_template",
"(",
"'core_privacy/htmlpage'",
... | Render the html page.
@param html_page $page
@return string | [
"Render",
"the",
"html",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/output/renderer.php#L54-L57 |
215,269 | moodle/moodle | backup/moodle2/backup_plan_builder.class.php | backup_plan_builder.build_activity_plan | static protected function build_activity_plan($controller, $id) {
$plan = $controller->get_plan();
// Add the activity task, responsible for outputting
// all the module related information
try {
$plan->add_task(backup_factory::get_backup_activity_task($controller->get_form... | php | static protected function build_activity_plan($controller, $id) {
$plan = $controller->get_plan();
// Add the activity task, responsible for outputting
// all the module related information
try {
$plan->add_task(backup_factory::get_backup_activity_task($controller->get_form... | [
"static",
"protected",
"function",
"build_activity_plan",
"(",
"$",
"controller",
",",
"$",
"id",
")",
"{",
"$",
"plan",
"=",
"$",
"controller",
"->",
"get_plan",
"(",
")",
";",
"// Add the activity task, responsible for outputting",
"// all the module related informati... | Build one 1-activity backup | [
"Build",
"one",
"1",
"-",
"activity",
"backup"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/backup_plan_builder.class.php#L126-L150 |
215,270 | moodle/moodle | backup/moodle2/backup_plan_builder.class.php | backup_plan_builder.build_section_plan | static protected function build_section_plan($controller, $id) {
$plan = $controller->get_plan();
// Add the section task, responsible for outputting
// all the section related information
$plan->add_task(backup_factory::get_backup_section_task($controller->get_format(), $id));
... | php | static protected function build_section_plan($controller, $id) {
$plan = $controller->get_plan();
// Add the section task, responsible for outputting
// all the section related information
$plan->add_task(backup_factory::get_backup_section_task($controller->get_format(), $id));
... | [
"static",
"protected",
"function",
"build_section_plan",
"(",
"$",
"controller",
",",
"$",
"id",
")",
"{",
"$",
"plan",
"=",
"$",
"controller",
"->",
"get_plan",
"(",
")",
";",
"// Add the section task, responsible for outputting",
"// all the section related informatio... | Build one 1-section backup | [
"Build",
"one",
"1",
"-",
"section",
"backup"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/backup_plan_builder.class.php#L155-L172 |
215,271 | moodle/moodle | backup/moodle2/backup_plan_builder.class.php | backup_plan_builder.build_course_plan | static protected function build_course_plan($controller, $id) {
$plan = $controller->get_plan();
// Add the course task, responsible for outputting
// all the course related information
$plan->add_task(backup_factory::get_backup_course_task($controller->get_format(), $id));
//... | php | static protected function build_course_plan($controller, $id) {
$plan = $controller->get_plan();
// Add the course task, responsible for outputting
// all the course related information
$plan->add_task(backup_factory::get_backup_course_task($controller->get_format(), $id));
//... | [
"static",
"protected",
"function",
"build_course_plan",
"(",
"$",
"controller",
",",
"$",
"id",
")",
"{",
"$",
"plan",
"=",
"$",
"controller",
"->",
"get_plan",
"(",
")",
";",
"// Add the course task, responsible for outputting",
"// all the course related information",... | Build one 1-course backup | [
"Build",
"one",
"1",
"-",
"course",
"backup"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/backup_plan_builder.class.php#L177-L196 |
215,272 | moodle/moodle | lib/classes/output/inplace_editable.php | inplace_editable.set_type_toggle | public function set_type_toggle($options = null) {
if ($options === null) {
$options = array(0, 1);
}
$options = array_values($options);
$idx = array_search($this->value, $options, true);
if ($idx === false) {
throw new \coding_exception('Specified value m... | php | public function set_type_toggle($options = null) {
if ($options === null) {
$options = array(0, 1);
}
$options = array_values($options);
$idx = array_search($this->value, $options, true);
if ($idx === false) {
throw new \coding_exception('Specified value m... | [
"public",
"function",
"set_type_toggle",
"(",
"$",
"options",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"options",
"===",
"null",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"0",
",",
"1",
")",
";",
"}",
"$",
"options",
"=",
"array_values",
"(",
"$",... | Sets the element type to be a toggle
For toggle element $editlabel is not used.
$displayvalue must be specified, it can have text or icons but can not contain html links.
Toggle element can have two or more options.
@param array $options toggle options as simple, non-associative array; defaults to array(0,1)
@return... | [
"Sets",
"the",
"element",
"type",
"to",
"be",
"a",
"toggle"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/output/inplace_editable.php#L144-L158 |
215,273 | moodle/moodle | lib/classes/output/inplace_editable.php | inplace_editable.set_type_select | public function set_type_select($options) {
if (!array_key_exists($this->value, $options)) {
throw new \coding_exception('Options for select element must contain an option for the specified value');
}
if (count($options) < 2) {
$this->editable = false;
}
$... | php | public function set_type_select($options) {
if (!array_key_exists($this->value, $options)) {
throw new \coding_exception('Options for select element must contain an option for the specified value');
}
if (count($options) < 2) {
$this->editable = false;
}
$... | [
"public",
"function",
"set_type_select",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"options",
")",
")",
"{",
"throw",
"new",
"\\",
"coding_exception",
"(",
"'Options for select element must co... | Sets the element type to be a dropdown
For select element specifying $displayvalue is optional, if null it will
be assumed that $displayvalue = $options[$value].
However displayvalue can still be specified if it needs icons and/or
html links.
If only one option specified, the element will not be editable.
@param arr... | [
"Sets",
"the",
"element",
"type",
"to",
"be",
"a",
"dropdown"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/output/inplace_editable.php#L173-L194 |
215,274 | moodle/moodle | lib/classes/output/inplace_editable.php | inplace_editable.set_type_autocomplete | public function set_type_autocomplete($options, $attributes) {
$this->type = 'autocomplete';
$pairedoptions = [];
foreach ($options as $key => $value) {
$pairedoptions[] = [
'key' => $key,
'value' => $value,
];
}
$this->opt... | php | public function set_type_autocomplete($options, $attributes) {
$this->type = 'autocomplete';
$pairedoptions = [];
foreach ($options as $key => $value) {
$pairedoptions[] = [
'key' => $key,
'value' => $value,
];
}
$this->opt... | [
"public",
"function",
"set_type_autocomplete",
"(",
"$",
"options",
",",
"$",
"attributes",
")",
"{",
"$",
"this",
"->",
"type",
"=",
"'autocomplete'",
";",
"$",
"pairedoptions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",... | Sets the element type to be an autocomplete field
@param array $options associative array with dropdown options
@param array $attributes associative array with attributes for autoselect field. See AMD module core/form-autocomplete.
@return self | [
"Sets",
"the",
"element",
"type",
"to",
"be",
"an",
"autocomplete",
"field"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/output/inplace_editable.php#L203-L215 |
215,275 | moodle/moodle | completion/classes/edit_base_form.php | core_completion_edit_base_form.support_views | protected function support_views() {
foreach ($this->get_module_names() as $modname => $modfullname) {
if (!plugin_supports('mod', $modname, FEATURE_COMPLETION_TRACKS_VIEWS, false)) {
return false;
}
}
return true;
} | php | protected function support_views() {
foreach ($this->get_module_names() as $modname => $modfullname) {
if (!plugin_supports('mod', $modname, FEATURE_COMPLETION_TRACKS_VIEWS, false)) {
return false;
}
}
return true;
} | [
"protected",
"function",
"support_views",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_module_names",
"(",
")",
"as",
"$",
"modname",
"=>",
"$",
"modfullname",
")",
"{",
"if",
"(",
"!",
"plugin_supports",
"(",
"'mod'",
",",
"$",
"modname",
",",... | Returns true if all selected modules support tracking view.
@return bool | [
"Returns",
"true",
"if",
"all",
"selected",
"modules",
"support",
"tracking",
"view",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/classes/edit_base_form.php#L58-L65 |
215,276 | moodle/moodle | completion/classes/edit_base_form.php | core_completion_edit_base_form.support_grades | protected function support_grades() {
foreach ($this->get_module_names() as $modname => $modfullname) {
if (!plugin_supports('mod', $modname, FEATURE_GRADE_HAS_GRADE, false)) {
return false;
}
}
return true;
} | php | protected function support_grades() {
foreach ($this->get_module_names() as $modname => $modfullname) {
if (!plugin_supports('mod', $modname, FEATURE_GRADE_HAS_GRADE, false)) {
return false;
}
}
return true;
} | [
"protected",
"function",
"support_grades",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_module_names",
"(",
")",
"as",
"$",
"modname",
"=>",
"$",
"modfullname",
")",
"{",
"if",
"(",
"!",
"plugin_supports",
"(",
"'mod'",
",",
"$",
"modname",
","... | Returns true if all selected modules support grading.
@return bool | [
"Returns",
"true",
"if",
"all",
"selected",
"modules",
"support",
"grading",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/classes/edit_base_form.php#L72-L79 |
215,277 | moodle/moodle | completion/classes/edit_base_form.php | core_completion_edit_base_form.add_custom_completion_rules | protected function add_custom_completion_rules() {
$modnames = array_keys($this->get_module_names());
if (count($modnames) != 1 || !plugin_supports('mod', $modnames[0], FEATURE_COMPLETION_HAS_RULES, false)) {
return [];
}
try {
// Add completion rules from the mo... | php | protected function add_custom_completion_rules() {
$modnames = array_keys($this->get_module_names());
if (count($modnames) != 1 || !plugin_supports('mod', $modnames[0], FEATURE_COMPLETION_HAS_RULES, false)) {
return [];
}
try {
// Add completion rules from the mo... | [
"protected",
"function",
"add_custom_completion_rules",
"(",
")",
"{",
"$",
"modnames",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"get_module_names",
"(",
")",
")",
";",
"if",
"(",
"count",
"(",
"$",
"modnames",
")",
"!=",
"1",
"||",
"!",
"plugin_supports... | If all selected modules are of the same module type, adds custom completion rules from this module type
@return array | [
"If",
"all",
"selected",
"modules",
"are",
"of",
"the",
"same",
"module",
"type",
"adds",
"custom",
"completion",
"rules",
"from",
"this",
"module",
"type"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/classes/edit_base_form.php#L93-L112 |
215,278 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Fetch/Query.php | Horde_Imap_Client_Fetch_Query.headerText | public function headerText(array $opts = array())
{
$id = isset($opts['id'])
? $opts['id']
: 0;
$this->_data[Horde_Imap_Client::FETCH_HEADERTEXT][$id] = $opts;
} | php | public function headerText(array $opts = array())
{
$id = isset($opts['id'])
? $opts['id']
: 0;
$this->_data[Horde_Imap_Client::FETCH_HEADERTEXT][$id] = $opts;
} | [
"public",
"function",
"headerText",
"(",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"$",
"id",
"=",
"isset",
"(",
"$",
"opts",
"[",
"'id'",
"]",
")",
"?",
"$",
"opts",
"[",
"'id'",
"]",
":",
"0",
";",
"$",
"this",
"->",
"_data",
... | Return header text.
Header text is defined only for the base RFC 2822 message or
message/rfc822 parts.
@param array $opts The following options are available:
- id: (string) The MIME ID to obtain the header text for.
DEFAULT: The header text for the base message will be
returned.
- length: (integer) The length of th... | [
"Return",
"header",
"text",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Fetch/Query.php#L69-L75 |
215,279 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Fetch/Query.php | Horde_Imap_Client_Fetch_Query.bodyText | public function bodyText(array $opts = array())
{
$id = isset($opts['id'])
? $opts['id']
: 0;
$this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id] = $opts;
} | php | public function bodyText(array $opts = array())
{
$id = isset($opts['id'])
? $opts['id']
: 0;
$this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id] = $opts;
} | [
"public",
"function",
"bodyText",
"(",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"$",
"id",
"=",
"isset",
"(",
"$",
"opts",
"[",
"'id'",
"]",
")",
"?",
"$",
"opts",
"[",
"'id'",
"]",
":",
"0",
";",
"$",
"this",
"->",
"_data",
"[... | Return body text.
Body text is defined only for the base RFC 2822 message or
message/rfc822 parts.
@param array $opts The following options are available:
- id: (string) The MIME ID to obtain the body text for.
DEFAULT: The body text for the entire message will be
returned.
- length: (integer) The length of the subs... | [
"Return",
"body",
"text",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Fetch/Query.php#L96-L102 |
215,280 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Fetch/Query.php | Horde_Imap_Client_Fetch_Query.headers | public function headers($label, $search, array $opts = array())
{
$this->_data[Horde_Imap_Client::FETCH_HEADERS][$label] = array_merge(
$opts,
array(
'headers' => array_map('strval', $search)
)
);
} | php | public function headers($label, $search, array $opts = array())
{
$this->_data[Horde_Imap_Client::FETCH_HEADERS][$label] = array_merge(
$opts,
array(
'headers' => array_map('strval', $search)
)
);
} | [
"public",
"function",
"headers",
"(",
"$",
"label",
",",
"$",
"search",
",",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_HEADERS",
"]",
"[",
"$",
"label",
"]",
"=",
"array... | Returns RFC 2822 header text that matches a search string.
This header search work only with the base RFC 2822 message or
message/rfc822 parts.
@param string $label A unique label associated with this particular
search. This is how the results are stored.
@param array $search The search string(s) (case-insensitive)... | [
"Returns",
"RFC",
"2822",
"header",
"text",
"that",
"matches",
"a",
"search",
"string",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Fetch/Query.php#L185-L193 |
215,281 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Fetch/Query.php | Horde_Imap_Client_Fetch_Query.remove | public function remove($criteria, $key)
{
if (isset($this->_data[$criteria]) &&
is_array($this->_data[$criteria])) {
unset($this->_data[$criteria][$key]);
if (empty($this->_data[$criteria])) {
unset($this->_data[$criteria]);
}
}
} | php | public function remove($criteria, $key)
{
if (isset($this->_data[$criteria]) &&
is_array($this->_data[$criteria])) {
unset($this->_data[$criteria][$key]);
if (empty($this->_data[$criteria])) {
unset($this->_data[$criteria]);
}
}
} | [
"public",
"function",
"remove",
"(",
"$",
"criteria",
",",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"$",
"criteria",
"]",
")",
"&&",
"is_array",
"(",
"$",
"this",
"->",
"_data",
"[",
"$",
"criteria",
"]",
")... | Remove an entry under a given criteria.
@param integer $criteria Criteria ID.
@param string $key The key to remove. | [
"Remove",
"an",
"entry",
"under",
"a",
"given",
"criteria",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Fetch/Query.php#L280-L289 |
215,282 | moodle/moodle | cache/stores/apcu/addinstanceform.php | cachestore_apcu_addinstance_form.configuration_definition | protected function configuration_definition() {
global $CFG;
$form = $this->_form;
$form->addElement('text', 'prefix', get_string('prefix', 'cachestore_apcu'),
array('maxlength' => 5, 'size' => 5));
$form->addHelpButton('prefix', 'prefix', 'cachestore_apcu');
$form->s... | php | protected function configuration_definition() {
global $CFG;
$form = $this->_form;
$form->addElement('text', 'prefix', get_string('prefix', 'cachestore_apcu'),
array('maxlength' => 5, 'size' => 5));
$form->addHelpButton('prefix', 'prefix', 'cachestore_apcu');
$form->s... | [
"protected",
"function",
"configuration_definition",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"_form",
";",
"$",
"form",
"->",
"addElement",
"(",
"'text'",
",",
"'prefix'",
",",
"get_string",
"(",
"'prefix'",
",",
"'... | Add the desired form elements. | [
"Add",
"the",
"desired",
"form",
"elements",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/apcu/addinstanceform.php#L37-L50 |
215,283 | moodle/moodle | cache/stores/apcu/addinstanceform.php | cachestore_apcu_addinstance_form.configuration_validation | public function configuration_validation($data, $files, array $errors) {
if (empty($errors['prefix'])) {
$factory = cache_factory::instance();
$config = $factory->create_config_instance();
foreach ($config->get_all_stores() as $store) {
if ($store['plugin'] ==... | php | public function configuration_validation($data, $files, array $errors) {
if (empty($errors['prefix'])) {
$factory = cache_factory::instance();
$config = $factory->create_config_instance();
foreach ($config->get_all_stores() as $store) {
if ($store['plugin'] ==... | [
"public",
"function",
"configuration_validation",
"(",
"$",
"data",
",",
"$",
"files",
",",
"array",
"$",
"errors",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"errors",
"[",
"'prefix'",
"]",
")",
")",
"{",
"$",
"factory",
"=",
"cache_factory",
"::",
"inst... | Validates the configuration data.
We need to check that prefix is unique.
@param array $data
@param array $files
@param array $errors
@return array
@throws coding_exception | [
"Validates",
"the",
"configuration",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/apcu/addinstanceform.php#L63-L84 |
215,284 | moodle/moodle | mod/assign/feedback/editpdf/classes/renderer.php | assignfeedback_editpdf_renderer.render_toolbar_button | private function render_toolbar_button($icon, $tool, $accesskey = null, $disabled=false) {
// Build button alt text.
$alttext = new stdClass();
$alttext->tool = get_string($tool, 'assignfeedback_editpdf');
if (!empty($accesskey)) {
$alttext->shortcut = '(Alt/Shift-Alt/Ctrl-O... | php | private function render_toolbar_button($icon, $tool, $accesskey = null, $disabled=false) {
// Build button alt text.
$alttext = new stdClass();
$alttext->tool = get_string($tool, 'assignfeedback_editpdf');
if (!empty($accesskey)) {
$alttext->shortcut = '(Alt/Shift-Alt/Ctrl-O... | [
"private",
"function",
"render_toolbar_button",
"(",
"$",
"icon",
",",
"$",
"tool",
",",
"$",
"accesskey",
"=",
"null",
",",
"$",
"disabled",
"=",
"false",
")",
"{",
"// Build button alt text.",
"$",
"alttext",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
... | Render a single colour button.
@param string $icon - The key for the icon
@param string $tool - The key for the lang string.
@param string $accesskey Optional - The access key for the button.
@param bool $disabled Optional - Is this button disabled.
@return string | [
"Render",
"a",
"single",
"colour",
"button",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/renderer.php#L78-L100 |
215,285 | moodle/moodle | mod/feedback/classes/event/course_module_viewed.php | course_module_viewed.create_from_record | public static function create_from_record($feedback, $cm, $course) {
$event = self::create(array(
'objectid' => $feedback->id,
'context' => \context_module::instance($cm->id),
'anonymous' => ($feedback->anonymous == FEEDBACK_ANONYMOUS_YES),
'other' => array(
... | php | public static function create_from_record($feedback, $cm, $course) {
$event = self::create(array(
'objectid' => $feedback->id,
'context' => \context_module::instance($cm->id),
'anonymous' => ($feedback->anonymous == FEEDBACK_ANONYMOUS_YES),
'other' => array(
... | [
"public",
"static",
"function",
"create_from_record",
"(",
"$",
"feedback",
",",
"$",
"cm",
",",
"$",
"course",
")",
"{",
"$",
"event",
"=",
"self",
"::",
"create",
"(",
"array",
"(",
"'objectid'",
"=>",
"$",
"feedback",
"->",
"id",
",",
"'context'",
"... | Creates an instance from feedback record
@param stdClass $feedback
@param cm_info|stdClass $cm
@param stdClass $course
@return course_module_viewed | [
"Creates",
"an",
"instance",
"from",
"feedback",
"record"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/event/course_module_viewed.php#L61-L74 |
215,286 | moodle/moodle | admin/tool/behat/renderer.php | tool_behat_renderer.render_stepsdefinitions | public function render_stepsdefinitions($stepsdefinitions, $form) {
global $CFG;
require_once($CFG->libdir . '/behat/classes/behat_selectors.php');
$html = $this->generic_info();
// Form.
ob_start();
$form->display();
$html .= ob_get_contents();
ob_end_c... | php | public function render_stepsdefinitions($stepsdefinitions, $form) {
global $CFG;
require_once($CFG->libdir . '/behat/classes/behat_selectors.php');
$html = $this->generic_info();
// Form.
ob_start();
$form->display();
$html .= ob_get_contents();
ob_end_c... | [
"public",
"function",
"render_stepsdefinitions",
"(",
"$",
"stepsdefinitions",
",",
"$",
"form",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/behat/classes/behat_selectors.php'",
")",
";",
"$",
"html",
"=",
"$",... | Renders the list of available steps according to the submitted filters.
@param mixed $stepsdefinitions Available steps array.
@param moodleform $form
@return string HTML code | [
"Renders",
"the",
"list",
"of",
"available",
"steps",
"according",
"to",
"the",
"submitted",
"filters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/behat/renderer.php#L43-L121 |
215,287 | moodle/moodle | admin/tool/behat/renderer.php | tool_behat_renderer.render_error | public function render_error($msg) {
$html = $this->generic_info();
$a = new stdClass();
$a->errormsg = $msg;
$a->behatcommand = behat_command::get_behat_command();
$a->behatinit = 'php admin' . DIRECTORY_SEPARATOR . 'tool' . DIRECTORY_SEPARATOR .
'behat' . DIRECTOR... | php | public function render_error($msg) {
$html = $this->generic_info();
$a = new stdClass();
$a->errormsg = $msg;
$a->behatcommand = behat_command::get_behat_command();
$a->behatinit = 'php admin' . DIRECTORY_SEPARATOR . 'tool' . DIRECTORY_SEPARATOR .
'behat' . DIRECTOR... | [
"public",
"function",
"render_error",
"(",
"$",
"msg",
")",
"{",
"$",
"html",
"=",
"$",
"this",
"->",
"generic_info",
"(",
")",
";",
"$",
"a",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"a",
"->",
"errormsg",
"=",
"$",
"msg",
";",
"$",
"a",
"-... | Renders an error message adding the generic info about the tool purpose and setup.
@param string $msg The error message
@return string HTML | [
"Renders",
"an",
"error",
"message",
"adding",
"the",
"generic",
"info",
"about",
"the",
"tool",
"purpose",
"and",
"setup",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/behat/renderer.php#L129-L149 |
215,288 | moodle/moodle | admin/tool/behat/renderer.php | tool_behat_renderer.generic_info | protected function generic_info() {
$title = get_string('pluginname', 'tool_behat');
// Header.
$html = $this->output->header();
$html .= $this->output->heading($title);
// Info.
$installurl = behat_command::DOCS_URL;
$installlink = html_writer::tag('a', $insta... | php | protected function generic_info() {
$title = get_string('pluginname', 'tool_behat');
// Header.
$html = $this->output->header();
$html .= $this->output->heading($title);
// Info.
$installurl = behat_command::DOCS_URL;
$installlink = html_writer::tag('a', $insta... | [
"protected",
"function",
"generic_info",
"(",
")",
"{",
"$",
"title",
"=",
"get_string",
"(",
"'pluginname'",
",",
"'tool_behat'",
")",
";",
"// Header.",
"$",
"html",
"=",
"$",
"this",
"->",
"output",
"->",
"header",
"(",
")",
";",
"$",
"html",
".=",
... | Generic info about the tool.
@return string | [
"Generic",
"info",
"about",
"the",
"tool",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/behat/renderer.php#L156-L191 |
215,289 | moodle/moodle | mod/forum/classes/existing_subscriber_selector.php | mod_forum_existing_subscriber_selector.find_users | public function find_users($search) {
global $DB;
list($wherecondition, $params) = $this->search_sql($search, 'u');
$params['forumid'] = $this->forumid;
// only active enrolled or everybody on the frontpage
list($esql, $eparams) = get_enrolled_sql($this->context, '', $this->curr... | php | public function find_users($search) {
global $DB;
list($wherecondition, $params) = $this->search_sql($search, 'u');
$params['forumid'] = $this->forumid;
// only active enrolled or everybody on the frontpage
list($esql, $eparams) = get_enrolled_sql($this->context, '', $this->curr... | [
"public",
"function",
"find_users",
"(",
"$",
"search",
")",
"{",
"global",
"$",
"DB",
";",
"list",
"(",
"$",
"wherecondition",
",",
"$",
"params",
")",
"=",
"$",
"this",
"->",
"search_sql",
"(",
"$",
"search",
",",
"'u'",
")",
";",
"$",
"params",
... | Finds all subscribed users
@param string $search
@return array | [
"Finds",
"all",
"subscribed",
"users"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/existing_subscriber_selector.php#L43-L67 |
215,290 | moodle/moodle | lib/behat/classes/behat_command.php | behat_command.get_behat_dir | public static function get_behat_dir($runprocess = 0) {
global $CFG;
// If not set then return empty string.
if (!isset($CFG->behat_dataroot)) {
return "";
}
// If $CFG->behat_parallel_run starts with index 0 and $runprocess for parallel run starts with 1.
i... | php | public static function get_behat_dir($runprocess = 0) {
global $CFG;
// If not set then return empty string.
if (!isset($CFG->behat_dataroot)) {
return "";
}
// If $CFG->behat_parallel_run starts with index 0 and $runprocess for parallel run starts with 1.
i... | [
"public",
"static",
"function",
"get_behat_dir",
"(",
"$",
"runprocess",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
";",
"// If not set then return empty string.",
"if",
"(",
"!",
"isset",
"(",
"$",
"CFG",
"->",
"behat_dataroot",
")",
")",
"{",
"return",
"\"\... | Ensures the behat dir exists in moodledata
@param int $runprocess run process for which behat dir is returned.
@return string Full path | [
"Ensures",
"the",
"behat",
"dir",
"exists",
"in",
"moodledata"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_command.php#L66-L92 |
215,291 | moodle/moodle | lib/behat/classes/behat_command.php | behat_command.get_behat_command | public final static function get_behat_command($custombyterm = false, $parallerun = false, $absolutepath = false) {
$separator = DIRECTORY_SEPARATOR;
$exec = 'behat';
// Cygwin uses linux-style directory separators.
if ($custombyterm && testing_is_cygwin()) {
$separator = '... | php | public final static function get_behat_command($custombyterm = false, $parallerun = false, $absolutepath = false) {
$separator = DIRECTORY_SEPARATOR;
$exec = 'behat';
// Cygwin uses linux-style directory separators.
if ($custombyterm && testing_is_cygwin()) {
$separator = '... | [
"public",
"final",
"static",
"function",
"get_behat_command",
"(",
"$",
"custombyterm",
"=",
"false",
",",
"$",
"parallerun",
"=",
"false",
",",
"$",
"absolutepath",
"=",
"false",
")",
"{",
"$",
"separator",
"=",
"DIRECTORY_SEPARATOR",
";",
"$",
"exec",
"=",... | Returns the executable path
Allows returning a customized command for cygwin when the
command is just displayed, when using exec(), system() and
friends we stay with DIRECTORY_SEPARATOR as they use the
normal cmd.exe (in Windows).
@param bool $custombyterm If the provided command should depend on the terminal where... | [
"Returns",
"the",
"executable",
"path"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_command.php#L107-L139 |
215,292 | moodle/moodle | lib/behat/classes/behat_command.php | behat_command.run | public final static function run($options = '') {
global $CFG;
$currentcwd = getcwd();
chdir($CFG->dirroot);
exec(self::get_behat_command() . ' ' . $options, $output, $code);
chdir($currentcwd);
return array($output, $code);
} | php | public final static function run($options = '') {
global $CFG;
$currentcwd = getcwd();
chdir($CFG->dirroot);
exec(self::get_behat_command() . ' ' . $options, $output, $code);
chdir($currentcwd);
return array($output, $code);
} | [
"public",
"final",
"static",
"function",
"run",
"(",
"$",
"options",
"=",
"''",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"currentcwd",
"=",
"getcwd",
"(",
")",
";",
"chdir",
"(",
"$",
"CFG",
"->",
"dirroot",
")",
";",
"exec",
"(",
"self",
"::",
... | Runs behat command with provided options
Execution continues when the process finishes
@param string $options Defaults to '' so tests would be executed
@return array CLI command outputs [0] => string, [1] => integer | [
"Runs",
"behat",
"command",
"with",
"provided",
"options"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_command.php#L149-L158 |
215,293 | moodle/moodle | lib/behat/classes/behat_command.php | behat_command.behat_setup_problem | public static function behat_setup_problem() {
global $CFG;
// Moodle setting.
if (!self::are_behat_dependencies_installed()) {
// Returning composer error code to avoid conflicts with behat and moodle error codes.
self::output_msg(get_string('errorcomposer', 'tool_beha... | php | public static function behat_setup_problem() {
global $CFG;
// Moodle setting.
if (!self::are_behat_dependencies_installed()) {
// Returning composer error code to avoid conflicts with behat and moodle error codes.
self::output_msg(get_string('errorcomposer', 'tool_beha... | [
"public",
"static",
"function",
"behat_setup_problem",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"// Moodle setting.",
"if",
"(",
"!",
"self",
"::",
"are_behat_dependencies_installed",
"(",
")",
")",
"{",
"// Returning composer error code to avoid conflicts with behat and... | Checks if behat is set up and working
Notifies failures both from CLI and web interface.
It checks behat dependencies have been installed and runs
the behat help command to ensure it works as expected
@return int Error code or 0 if all ok | [
"Checks",
"if",
"behat",
"is",
"set",
"up",
"and",
"working"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_command.php#L170-L229 |
215,294 | moodle/moodle | lib/behat/classes/behat_command.php | behat_command.output_msg | protected static function output_msg($msg) {
global $CFG, $PAGE;
// If we are using the web interface we want pretty messages.
if (!CLI_SCRIPT) {
$renderer = $PAGE->get_renderer('tool_behat');
echo $renderer->render_error($msg);
// Stopping execution.
... | php | protected static function output_msg($msg) {
global $CFG, $PAGE;
// If we are using the web interface we want pretty messages.
if (!CLI_SCRIPT) {
$renderer = $PAGE->get_renderer('tool_behat');
echo $renderer->render_error($msg);
// Stopping execution.
... | [
"protected",
"static",
"function",
"output_msg",
"(",
"$",
"msg",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"PAGE",
";",
"// If we are using the web interface we want pretty messages.",
"if",
"(",
"!",
"CLI_SCRIPT",
")",
"{",
"$",
"renderer",
"=",
"$",
"PAGE",
... | Outputs a message.
Used in CLI + web UI methods. Stops the
execution in web.
@param string $msg
@return void | [
"Outputs",
"a",
"message",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/behat/classes/behat_command.php#L251-L272 |
215,295 | moodle/moodle | webservice/rest/locallib.php | webservice_rest_server.send_response | protected function send_response() {
//Check that the returned values are valid
try {
if ($this->function->returns_desc != null) {
$validatedvalues = external_api::clean_returnvalue($this->function->returns_desc, $this->returns);
} else {
$validat... | php | protected function send_response() {
//Check that the returned values are valid
try {
if ($this->function->returns_desc != null) {
$validatedvalues = external_api::clean_returnvalue($this->function->returns_desc, $this->returns);
} else {
$validat... | [
"protected",
"function",
"send_response",
"(",
")",
"{",
"//Check that the returned values are valid",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"function",
"->",
"returns_desc",
"!=",
"null",
")",
"{",
"$",
"validatedvalues",
"=",
"external_api",
"::",
"clean_ret... | Send the result of function call to the WS client
formatted as XML document. | [
"Send",
"the",
"result",
"of",
"function",
"call",
"to",
"the",
"WS",
"client",
"formatted",
"as",
"XML",
"document",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/webservice/rest/locallib.php#L101-L130 |
215,296 | moodle/moodle | webservice/rest/locallib.php | webservice_rest_server.xmlize_result | protected static function xmlize_result($returns, $desc) {
if ($desc === null) {
return '';
} else if ($desc instanceof external_value) {
if (is_bool($returns)) {
// we want 1/0 instead of true/false here
$returns = (int)$returns;
}
... | php | protected static function xmlize_result($returns, $desc) {
if ($desc === null) {
return '';
} else if ($desc instanceof external_value) {
if (is_bool($returns)) {
// we want 1/0 instead of true/false here
$returns = (int)$returns;
}
... | [
"protected",
"static",
"function",
"xmlize_result",
"(",
"$",
"returns",
",",
"$",
"desc",
")",
"{",
"if",
"(",
"$",
"desc",
"===",
"null",
")",
"{",
"return",
"''",
";",
"}",
"else",
"if",
"(",
"$",
"desc",
"instanceof",
"external_value",
")",
"{",
... | Internal implementation - recursive function producing XML markup.
@param mixed $returns the returned values
@param external_description $desc
@return string | [
"Internal",
"implementation",
"-",
"recursive",
"function",
"producing",
"XML",
"markup",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/webservice/rest/locallib.php#L203-L237 |
215,297 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Format/String.php | Horde_Imap_Client_Data_Format_String.escapeStream | public function escapeStream()
{
if ($this->literal()) {
throw new Horde_Imap_Client_Data_Format_Exception('String requires literal to output.');
}
rewind($this->_data->stream);
$stream = new Horde_Stream_Temp();
$stream->add($this->_data, true);
stream... | php | public function escapeStream()
{
if ($this->literal()) {
throw new Horde_Imap_Client_Data_Format_Exception('String requires literal to output.');
}
rewind($this->_data->stream);
$stream = new Horde_Stream_Temp();
$stream->add($this->_data, true);
stream... | [
"public",
"function",
"escapeStream",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"literal",
"(",
")",
")",
"{",
"throw",
"new",
"Horde_Imap_Client_Data_Format_Exception",
"(",
"'String requires literal to output.'",
")",
";",
"}",
"rewind",
"(",
"$",
"this",
... | Return the escaped string as a stream.
@return resource The IMAP escaped stream. | [
"Return",
"the",
"escaped",
"string",
"as",
"a",
"stream",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Format/String.php#L114-L129 |
215,298 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Format/String.php | Horde_Imap_Client_Data_Format_String.forceLiteral | public function forceLiteral()
{
$this->_filter = $this->_filterParams();
// Keep binary status, if set
$this->_filter->literal = true;
$this->_filter->quoted = false;
} | php | public function forceLiteral()
{
$this->_filter = $this->_filterParams();
// Keep binary status, if set
$this->_filter->literal = true;
$this->_filter->quoted = false;
} | [
"public",
"function",
"forceLiteral",
"(",
")",
"{",
"$",
"this",
"->",
"_filter",
"=",
"$",
"this",
"->",
"_filterParams",
"(",
")",
";",
"// Keep binary status, if set",
"$",
"this",
"->",
"_filter",
"->",
"literal",
"=",
"true",
";",
"$",
"this",
"->",
... | Force item to be output as a literal. | [
"Force",
"item",
"to",
"be",
"output",
"as",
"a",
"literal",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Format/String.php#L166-L172 |
215,299 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Format/String.php | Horde_Imap_Client_Data_Format_String.forceBinary | public function forceBinary()
{
$this->_filter = $this->_filterParams();
$this->_filter->binary = true;
$this->_filter->literal = true;
$this->_filter->quoted = false;
} | php | public function forceBinary()
{
$this->_filter = $this->_filterParams();
$this->_filter->binary = true;
$this->_filter->literal = true;
$this->_filter->quoted = false;
} | [
"public",
"function",
"forceBinary",
"(",
")",
"{",
"$",
"this",
"->",
"_filter",
"=",
"$",
"this",
"->",
"_filterParams",
"(",
")",
";",
"$",
"this",
"->",
"_filter",
"->",
"binary",
"=",
"true",
";",
"$",
"this",
"->",
"_filter",
"->",
"literal",
"... | Force item to be output as a binary literal. | [
"Force",
"item",
"to",
"be",
"output",
"as",
"a",
"binary",
"literal",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Format/String.php#L187-L193 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.