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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
213,600 | moodle/moodle | mod/assign/feedback/editpdf/classes/page_editor.php | page_editor.get_annotation | public static function get_annotation($annotationid) {
global $DB;
$record = $DB->get_record('assignfeedback_editpdf_annot', array('id'=>$annotationid), '*', IGNORE_MISSING);
if ($record) {
return new annotation($record);
}
return false;
} | php | public static function get_annotation($annotationid) {
global $DB;
$record = $DB->get_record('assignfeedback_editpdf_annot', array('id'=>$annotationid), '*', IGNORE_MISSING);
if ($record) {
return new annotation($record);
}
return false;
} | [
"public",
"static",
"function",
"get_annotation",
"(",
"$",
"annotationid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"record",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'assignfeedback_editpdf_annot'",
",",
"array",
"(",
"'id'",
"=>",
"$",
"annotationid",
")... | Get a single annotation by id.
@param int $annotationid
@return annotation or false | [
"Get",
"a",
"single",
"annotation",
"by",
"id",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/page_editor.php#L188-L196 |
213,601 | moodle/moodle | mod/assign/feedback/editpdf/classes/page_editor.php | page_editor.release_drafts | public static function release_drafts($gradeid) {
global $DB;
// Delete the previous non-draft annotations and comments.
$DB->delete_records('assignfeedback_editpdf_cmnt', array('gradeid'=>$gradeid, 'draft'=>0));
$DB->delete_records('assignfeedback_editpdf_annot', array('gradeid'=>$grad... | php | public static function release_drafts($gradeid) {
global $DB;
// Delete the previous non-draft annotations and comments.
$DB->delete_records('assignfeedback_editpdf_cmnt', array('gradeid'=>$gradeid, 'draft'=>0));
$DB->delete_records('assignfeedback_editpdf_annot', array('gradeid'=>$grad... | [
"public",
"static",
"function",
"release_drafts",
"(",
"$",
"gradeid",
")",
"{",
"global",
"$",
"DB",
";",
"// Delete the previous non-draft annotations and comments.",
"$",
"DB",
"->",
"delete_records",
"(",
"'assignfeedback_editpdf_cmnt'",
",",
"array",
"(",
"'gradeid... | Release the draft comments and annotations to students.
@param int $gradeid
@return bool | [
"Release",
"the",
"draft",
"comments",
"and",
"annotations",
"to",
"students",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/page_editor.php#L217-L239 |
213,602 | moodle/moodle | mod/assign/feedback/editpdf/classes/page_editor.php | page_editor.has_annotations_or_comments | public static function has_annotations_or_comments($gradeid, $includedraft) {
global $DB;
$params = array('gradeid'=>$gradeid);
if (!$includedraft) {
$params['draft'] = 0;
}
if ($DB->count_records('assignfeedback_editpdf_cmnt', $params)) {
return true;
... | php | public static function has_annotations_or_comments($gradeid, $includedraft) {
global $DB;
$params = array('gradeid'=>$gradeid);
if (!$includedraft) {
$params['draft'] = 0;
}
if ($DB->count_records('assignfeedback_editpdf_cmnt', $params)) {
return true;
... | [
"public",
"static",
"function",
"has_annotations_or_comments",
"(",
"$",
"gradeid",
",",
"$",
"includedraft",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"array",
"(",
"'gradeid'",
"=>",
"$",
"gradeid",
")",
";",
"if",
"(",
"!",
"$",
"include... | Has annotations or comments.
@param int $gradeid
@return bool | [
"Has",
"annotations",
"or",
"comments",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/page_editor.php#L246-L259 |
213,603 | moodle/moodle | mod/assign/feedback/editpdf/classes/page_editor.php | page_editor.add_annotation | public static function add_annotation(annotation $annotation) {
global $DB;
$annotation->id = null;
return $DB->insert_record('assignfeedback_editpdf_annot', $annotation);
} | php | public static function add_annotation(annotation $annotation) {
global $DB;
$annotation->id = null;
return $DB->insert_record('assignfeedback_editpdf_annot', $annotation);
} | [
"public",
"static",
"function",
"add_annotation",
"(",
"annotation",
"$",
"annotation",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"annotation",
"->",
"id",
"=",
"null",
";",
"return",
"$",
"DB",
"->",
"insert_record",
"(",
"'assignfeedback_editpdf_annot'",
",",... | Add a annotation to a page.
@param annotation $annotation
@return bool | [
"Add",
"a",
"annotation",
"to",
"a",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/page_editor.php#L295-L300 |
213,604 | moodle/moodle | mod/assign/feedback/editpdf/classes/page_editor.php | page_editor.copy_drafts_from_to | public static function copy_drafts_from_to($assignment, $grade, $sourceuserid) {
global $DB;
// Delete any existing annotations and comments from current user.
$DB->delete_records('assignfeedback_editpdf_annot', array('gradeid' => $grade->id));
$DB->delete_records('assignfeedback_editpd... | php | public static function copy_drafts_from_to($assignment, $grade, $sourceuserid) {
global $DB;
// Delete any existing annotations and comments from current user.
$DB->delete_records('assignfeedback_editpdf_annot', array('gradeid' => $grade->id));
$DB->delete_records('assignfeedback_editpd... | [
"public",
"static",
"function",
"copy_drafts_from_to",
"(",
"$",
"assignment",
",",
"$",
"grade",
",",
"$",
"sourceuserid",
")",
"{",
"global",
"$",
"DB",
";",
"// Delete any existing annotations and comments from current user.",
"$",
"DB",
"->",
"delete_records",
"("... | Copy annotations, comments, pages, and other required content from the source user to the current group member
being procssed when using applytoall.
@param int|\assign $assignment
@param stdClass $grade
@param int $sourceuserid
@return bool | [
"Copy",
"annotations",
"comments",
"pages",
"and",
"other",
"required",
"content",
"from",
"the",
"source",
"user",
"to",
"the",
"current",
"group",
"member",
"being",
"procssed",
"when",
"using",
"applytoall",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/page_editor.php#L322-L354 |
213,605 | moodle/moodle | mod/assign/feedback/editpdf/classes/page_editor.php | page_editor.replace_files_from_to | public static function replace_files_from_to($fs, $contextid, $sourceitemid, $itemid, $area, $includesubdirs = false) {
$component = 'assignfeedback_editpdf';
// Remove the existing files within this area.
$fs->delete_area_files($contextid, $component, $area, $itemid);
// Copy the files... | php | public static function replace_files_from_to($fs, $contextid, $sourceitemid, $itemid, $area, $includesubdirs = false) {
$component = 'assignfeedback_editpdf';
// Remove the existing files within this area.
$fs->delete_area_files($contextid, $component, $area, $itemid);
// Copy the files... | [
"public",
"static",
"function",
"replace_files_from_to",
"(",
"$",
"fs",
",",
"$",
"contextid",
",",
"$",
"sourceitemid",
",",
"$",
"itemid",
",",
"$",
"area",
",",
"$",
"includesubdirs",
"=",
"false",
")",
"{",
"$",
"component",
"=",
"'assignfeedback_editpd... | Replace the area files in the specified area with those in the source item id.
@param \file_storage $fs The file storage class
@param int $contextid The ID of the context for the assignment.
@param int $sourceitemid The itemid to copy from - typically the source grade id.
@param int $itemid The itemid to copy to - typ... | [
"Replace",
"the",
"area",
"files",
"in",
"the",
"specified",
"area",
"with",
"those",
"in",
"the",
"source",
"item",
"id",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/page_editor.php#L366-L381 |
213,606 | moodle/moodle | mod/assign/feedback/editpdf/classes/page_editor.php | page_editor.delete_draft_content | public static function delete_draft_content($gradeid) {
global $DB;
$conditions = array('gradeid' => $gradeid, 'draft' => 1);
$result = $DB->delete_records('assignfeedback_editpdf_annot', $conditions);
$result = $result && $DB->delete_records('assignfeedback_editpdf_cmnt', $conditions);
... | php | public static function delete_draft_content($gradeid) {
global $DB;
$conditions = array('gradeid' => $gradeid, 'draft' => 1);
$result = $DB->delete_records('assignfeedback_editpdf_annot', $conditions);
$result = $result && $DB->delete_records('assignfeedback_editpdf_cmnt', $conditions);
... | [
"public",
"static",
"function",
"delete_draft_content",
"(",
"$",
"gradeid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"conditions",
"=",
"array",
"(",
"'gradeid'",
"=>",
"$",
"gradeid",
",",
"'draft'",
"=>",
"1",
")",
";",
"$",
"result",
"=",
"$",
"DB"... | Delete the draft annotations and comments.
This is intended to be used when the version of the PDF has changed and the annotations
might not be relevant any more, therefore we should delete them.
@param int $gradeid The grade ID.
@return bool | [
"Delete",
"the",
"draft",
"annotations",
"and",
"comments",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/page_editor.php#L392-L398 |
213,607 | moodle/moodle | mod/assign/feedback/editpdf/classes/page_editor.php | page_editor.set_page_rotation | public static function set_page_rotation($gradeid, $pageno, $isrotated, $pathnamehash, $degree = 0) {
global $DB;
$oldrecord = self::get_page_rotation($gradeid, $pageno);
if ($oldrecord == null) {
$record = new \stdClass();
$record->gradeid = $gradeid;
$record... | php | public static function set_page_rotation($gradeid, $pageno, $isrotated, $pathnamehash, $degree = 0) {
global $DB;
$oldrecord = self::get_page_rotation($gradeid, $pageno);
if ($oldrecord == null) {
$record = new \stdClass();
$record->gradeid = $gradeid;
$record... | [
"public",
"static",
"function",
"set_page_rotation",
"(",
"$",
"gradeid",
",",
"$",
"pageno",
",",
"$",
"isrotated",
",",
"$",
"pathnamehash",
",",
"$",
"degree",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"oldrecord",
"=",
"self",
"::",
"get_p... | Set page rotation value.
@param int $gradeid grade id.
@param int $pageno page number.
@param bool $isrotated whether the page is rotated or not.
@param string $pathnamehash path name hash
@param int $degree rotation degree.
@throws \dml_exception | [
"Set",
"page",
"rotation",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/page_editor.php#L409-L426 |
213,608 | moodle/moodle | mod/assign/feedback/editpdf/classes/page_editor.php | page_editor.get_page_rotation | public static function get_page_rotation($gradeid, $pageno) {
global $DB;
$result = $DB->get_record('assignfeedback_editpdf_rot', array('gradeid' => $gradeid, 'pageno' => $pageno));
return $result;
} | php | public static function get_page_rotation($gradeid, $pageno) {
global $DB;
$result = $DB->get_record('assignfeedback_editpdf_rot', array('gradeid' => $gradeid, 'pageno' => $pageno));
return $result;
} | [
"public",
"static",
"function",
"get_page_rotation",
"(",
"$",
"gradeid",
",",
"$",
"pageno",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"result",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'assignfeedback_editpdf_rot'",
",",
"array",
"(",
"'gradeid'",
"=>",
... | Get Page Rotation Value.
@param int $gradeid grade id.
@param int $pageno page number.
@return mixed
@throws \dml_exception | [
"Get",
"Page",
"Rotation",
"Value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/page_editor.php#L435-L439 |
213,609 | moodle/moodle | analytics/classes/local/analyser/base.php | base.get_static_data | public function get_static_data() {
// Delegates all processing to the analysis.
$result = new \core_analytics\local\analysis\result_array($this->get_modelid(), false, $this->get_options());
$analysis = new \core_analytics\analysis($this, false, $result);
$analysis->run();
return... | php | public function get_static_data() {
// Delegates all processing to the analysis.
$result = new \core_analytics\local\analysis\result_array($this->get_modelid(), false, $this->get_options());
$analysis = new \core_analytics\analysis($this, false, $result);
$analysis->run();
return... | [
"public",
"function",
"get_static_data",
"(",
")",
"{",
"// Delegates all processing to the analysis.",
"$",
"result",
"=",
"new",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"analysis",
"\\",
"result_array",
"(",
"$",
"this",
"->",
"get_modelid",
"(",
")",
",",
... | Returns indicator calculations as an array.
@return array | [
"Returns",
"indicator",
"calculations",
"as",
"an",
"array",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/local/analyser/base.php#L279-L285 |
213,610 | moodle/moodle | analytics/classes/local/analyser/base.php | base.check_indicators_requirements | protected function check_indicators_requirements() {
foreach ($this->indicators as $indicator) {
$missingrequired = $this->check_indicator_requirements($indicator);
if ($missingrequired !== true) {
throw new \core_analytics\requirements_exception(get_class($indicator) . ... | php | protected function check_indicators_requirements() {
foreach ($this->indicators as $indicator) {
$missingrequired = $this->check_indicator_requirements($indicator);
if ($missingrequired !== true) {
throw new \core_analytics\requirements_exception(get_class($indicator) . ... | [
"protected",
"function",
"check_indicators_requirements",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"indicators",
"as",
"$",
"indicator",
")",
"{",
"$",
"missingrequired",
"=",
"$",
"this",
"->",
"check_indicator_requirements",
"(",
"$",
"indicator",
")"... | Checks if the analyser satisfies all the model indicators requirements.
@throws \core_analytics\requirements_exception
@return void | [
"Checks",
"if",
"the",
"analyser",
"satisfies",
"all",
"the",
"model",
"indicators",
"requirements",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/local/analyser/base.php#L293-L302 |
213,611 | moodle/moodle | analytics/classes/local/analyser/base.php | base.check_indicator_requirements | public function check_indicator_requirements(\core_analytics\local\indicator\base $indicator) {
$providedsampledata = $this->provided_sample_data();
$requiredsampledata = $indicator::required_sample_data();
if (empty($requiredsampledata)) {
// The indicator does not need any sample... | php | public function check_indicator_requirements(\core_analytics\local\indicator\base $indicator) {
$providedsampledata = $this->provided_sample_data();
$requiredsampledata = $indicator::required_sample_data();
if (empty($requiredsampledata)) {
// The indicator does not need any sample... | [
"public",
"function",
"check_indicator_requirements",
"(",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"indicator",
"\\",
"base",
"$",
"indicator",
")",
"{",
"$",
"providedsampledata",
"=",
"$",
"this",
"->",
"provided_sample_data",
"(",
")",
";",
"$",
"require... | Checks that this analyser satisfies the provided indicator requirements.
@param \core_analytics\local\indicator\base $indicator
@return true|string[] True if all good, missing requirements list otherwise | [
"Checks",
"that",
"this",
"analyser",
"satisfies",
"the",
"provided",
"indicator",
"requirements",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/local/analyser/base.php#L310-L326 |
213,612 | moodle/moodle | analytics/classes/local/analyser/base.php | base.get_iterator_sql | protected function get_iterator_sql(string $tablename, int $contextlevel, ?string $action = null, ?string $tablealias = null) {
if (!$tablealias) {
$tablealias = 'analysable';
}
$params = ['contextlevel' => $contextlevel, 'modelid' => $this->get_modelid()];
$select = $table... | php | protected function get_iterator_sql(string $tablename, int $contextlevel, ?string $action = null, ?string $tablealias = null) {
if (!$tablealias) {
$tablealias = 'analysable';
}
$params = ['contextlevel' => $contextlevel, 'modelid' => $this->get_modelid()];
$select = $table... | [
"protected",
"function",
"get_iterator_sql",
"(",
"string",
"$",
"tablename",
",",
"int",
"$",
"contextlevel",
",",
"?",
"string",
"$",
"action",
"=",
"null",
",",
"?",
"string",
"$",
"tablealias",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"tablealias"... | Get the sql of a default implementation of the iterator.
This method only works for analysers that return analysable elements which ids map to a context instance ids.
@param string $tablename The name of the table
@param int $contextlevel The context level of the analysable
@param string|null $acti... | [
"Get",
"the",
"sql",
"of",
"a",
"default",
"implementation",
"of",
"the",
"iterator",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/local/analyser/base.php#L419-L447 |
213,613 | moodle/moodle | analytics/classes/local/analyser/base.php | base.order_sql | protected function order_sql(?string $fieldname = null, string $order = 'ASC', ?string $tablealias = null) {
if (!$tablealias) {
$tablealias = 'analysable';
}
if ($order != 'ASC' && $order != 'DESC') {
throw new \coding_exception('The order can only be ASC or DESC');
... | php | protected function order_sql(?string $fieldname = null, string $order = 'ASC', ?string $tablealias = null) {
if (!$tablealias) {
$tablealias = 'analysable';
}
if ($order != 'ASC' && $order != 'DESC') {
throw new \coding_exception('The order can only be ASC or DESC');
... | [
"protected",
"function",
"order_sql",
"(",
"?",
"string",
"$",
"fieldname",
"=",
"null",
",",
"string",
"$",
"order",
"=",
"'ASC'",
",",
"?",
"string",
"$",
"tablealias",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"tablealias",
")",
"{",
"$",
"table... | Returns the order by clause.
@param string|null $fieldname The field name
@param string $order 'ASC' or 'DESC'
@param string|null $tablealias The table alias of the field
@return string | [
"Returns",
"the",
"order",
"by",
"clause",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/local/analyser/base.php#L457-L473 |
213,614 | moodle/moodle | user/classes/analytics/target/upcoming_activities_due.php | upcoming_activities_due.calculate_sample | protected function calculate_sample($sampleid, \core_analytics\analysable $analysable, $starttime = false, $endtime = false) {
$activitiesdueindicator = $this->retrieve('\core_course\analytics\indicator\activities_due', $sampleid);
if ($activitiesdueindicator == \core_course\analytics\indicator\activit... | php | protected function calculate_sample($sampleid, \core_analytics\analysable $analysable, $starttime = false, $endtime = false) {
$activitiesdueindicator = $this->retrieve('\core_course\analytics\indicator\activities_due', $sampleid);
if ($activitiesdueindicator == \core_course\analytics\indicator\activit... | [
"protected",
"function",
"calculate_sample",
"(",
"$",
"sampleid",
",",
"\\",
"core_analytics",
"\\",
"analysable",
"$",
"analysable",
",",
"$",
"starttime",
"=",
"false",
",",
"$",
"endtime",
"=",
"false",
")",
"{",
"$",
"activitiesdueindicator",
"=",
"$",
... | Calculation based on activities due indicator.
@param int $sampleid
@param \core_analytics\analysable $analysable
@param int $starttime
@param int $endtime
@return float | [
"Calculation",
"based",
"on",
"activities",
"due",
"indicator",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/classes/analytics/target/upcoming_activities_due.php#L144-L151 |
213,615 | moodle/moodle | user/classes/analytics/target/upcoming_activities_due.php | upcoming_activities_due.prediction_actions | public function prediction_actions(\core_analytics\prediction $prediction, $includedetailsaction = false,
$isinsightuser = false) {
global $CFG, $USER;
$parentactions = parent::prediction_actions($prediction, $includedetailsaction);
if (!$isinsightuser && $USER->id != $prediction->... | php | public function prediction_actions(\core_analytics\prediction $prediction, $includedetailsaction = false,
$isinsightuser = false) {
global $CFG, $USER;
$parentactions = parent::prediction_actions($prediction, $includedetailsaction);
if (!$isinsightuser && $USER->id != $prediction->... | [
"public",
"function",
"prediction_actions",
"(",
"\\",
"core_analytics",
"\\",
"prediction",
"$",
"prediction",
",",
"$",
"includedetailsaction",
"=",
"false",
",",
"$",
"isinsightuser",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"$... | Adds a view upcoming events action.
@param \core_analytics\prediction $prediction
@param mixed $includedetailsaction
@param bool $isinsightuser
@return \core_analytics\prediction_action[] | [
"Adds",
"a",
"view",
"upcoming",
"events",
"action",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/classes/analytics/target/upcoming_activities_due.php#L161-L178 |
213,616 | moodle/moodle | course/classes/external/course_summary_exporter.php | course_summary_exporter.get_course_image | public static function get_course_image($course) {
global $CFG;
$courseinlist = new \core_course_list_element($course);
foreach ($courseinlist->get_course_overviewfiles() as $file) {
if ($file->is_valid_image()) {
$pathcomponents = [
'/pluginfile.p... | php | public static function get_course_image($course) {
global $CFG;
$courseinlist = new \core_course_list_element($course);
foreach ($courseinlist->get_course_overviewfiles() as $file) {
if ($file->is_valid_image()) {
$pathcomponents = [
'/pluginfile.p... | [
"public",
"static",
"function",
"get_course_image",
"(",
"$",
"course",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"courseinlist",
"=",
"new",
"\\",
"core_course_list_element",
"(",
"$",
"course",
")",
";",
"foreach",
"(",
"$",
"courseinlist",
"->",
"get_cour... | Get the course image if added to course.
@param object $course
@return string url of course image | [
"Get",
"the",
"course",
"image",
"if",
"added",
"to",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/classes/external/course_summary_exporter.php#L167-L183 |
213,617 | moodle/moodle | course/classes/external/course_summary_exporter.php | course_summary_exporter.get_course_pattern | public static function get_course_pattern($course) {
$color = self::coursecolor($course->id);
$pattern = new \core_geopattern();
$pattern->setColor($color);
$pattern->patternbyid($course->id);
return $pattern->datauri();
} | php | public static function get_course_pattern($course) {
$color = self::coursecolor($course->id);
$pattern = new \core_geopattern();
$pattern->setColor($color);
$pattern->patternbyid($course->id);
return $pattern->datauri();
} | [
"public",
"static",
"function",
"get_course_pattern",
"(",
"$",
"course",
")",
"{",
"$",
"color",
"=",
"self",
"::",
"coursecolor",
"(",
"$",
"course",
"->",
"id",
")",
";",
"$",
"pattern",
"=",
"new",
"\\",
"core_geopattern",
"(",
")",
";",
"$",
"patt... | Get the course pattern datauri.
The datauri is an encoded svg that can be passed as a url.
@param object $course
@return string datauri | [
"Get",
"the",
"course",
"pattern",
"datauri",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/classes/external/course_summary_exporter.php#L192-L198 |
213,618 | moodle/moodle | mod/quiz/report/grading/report.php | quiz_grading_report.list_questions_url | protected function list_questions_url($includeauto = null) {
$url = $this->base_url();
$url->params($this->viewoptions);
if (!is_null($includeauto)) {
$url->param('includeauto', $includeauto);
}
return $url;
} | php | protected function list_questions_url($includeauto = null) {
$url = $this->base_url();
$url->params($this->viewoptions);
if (!is_null($includeauto)) {
$url->param('includeauto', $includeauto);
}
return $url;
} | [
"protected",
"function",
"list_questions_url",
"(",
"$",
"includeauto",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"base_url",
"(",
")",
";",
"$",
"url",
"->",
"params",
"(",
"$",
"this",
"->",
"viewoptions",
")",
";",
"if",
"(",
"!",... | Get the URL of the front page of the report that lists all the questions.
@param $includeauto if not given, use the current setting, otherwise,
force a paricular value of includeauto in the URL.
@return string the URL. | [
"Get",
"the",
"URL",
"of",
"the",
"front",
"page",
"of",
"the",
"report",
"that",
"lists",
"all",
"the",
"questions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/grading/report.php#L226-L236 |
213,619 | moodle/moodle | mod/quiz/report/grading/report.php | quiz_grading_report.get_question_heading | protected function get_question_heading($attempt, $shownames, $showidnumbers) {
$a = new stdClass();
$a->attempt = $attempt->attempt;
$a->fullname = fullname($attempt);
$a->idnumber = $attempt->idnumber;
$showidnumbers = $showidnumbers && !empty($attempt->idnumber);
if ... | php | protected function get_question_heading($attempt, $shownames, $showidnumbers) {
$a = new stdClass();
$a->attempt = $attempt->attempt;
$a->fullname = fullname($attempt);
$a->idnumber = $attempt->idnumber;
$showidnumbers = $showidnumbers && !empty($attempt->idnumber);
if ... | [
"protected",
"function",
"get_question_heading",
"(",
"$",
"attempt",
",",
"$",
"shownames",
",",
"$",
"showidnumbers",
")",
"{",
"$",
"a",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"a",
"->",
"attempt",
"=",
"$",
"attempt",
"->",
"attempt",
";",
"$"... | Get question heading.
@param object $attempt an instance of quiz_attempt.
@param bool $shownames True to show the question name.
@param bool $showidnumbers True to show the question id number.
@return string The string text for the question heading.
@throws coding_exception | [
"Get",
"question",
"heading",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/grading/report.php#L584-L602 |
213,620 | moodle/moodle | lib/form/text.php | MoodleQuickForm_text.getFrozenHtml | function getFrozenHtml()
{
$attributes = array('readonly' => 'readonly');
$this->updateAttributes($attributes);
return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />' . $this->_getPersistantData();
} | php | function getFrozenHtml()
{
$attributes = array('readonly' => 'readonly');
$this->updateAttributes($attributes);
return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />' . $this->_getPersistantData();
} | [
"function",
"getFrozenHtml",
"(",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
"'readonly'",
"=>",
"'readonly'",
")",
";",
"$",
"this",
"->",
"updateAttributes",
"(",
"$",
"attributes",
")",
";",
"return",
"$",
"this",
"->",
"_getTabs",
"(",
")",
".",... | Returns the html to be used when the element is frozen
@since Moodle 2.4
@return string Frozen html | [
"Returns",
"the",
"html",
"to",
"be",
"used",
"when",
"the",
"element",
"is",
"frozen"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/text.php#L103-L108 |
213,621 | moodle/moodle | cache/classes/config.php | cache_config.get_config_file_path | protected static function get_config_file_path() {
global $CFG;
if (!empty($CFG->altcacheconfigpath)) {
$path = $CFG->altcacheconfigpath;
if (is_dir($path) && is_writable($path)) {
// Its a writable directory, thats fine.
return $path.'/cacheconfig... | php | protected static function get_config_file_path() {
global $CFG;
if (!empty($CFG->altcacheconfigpath)) {
$path = $CFG->altcacheconfigpath;
if (is_dir($path) && is_writable($path)) {
// Its a writable directory, thats fine.
return $path.'/cacheconfig... | [
"protected",
"static",
"function",
"get_config_file_path",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"altcacheconfigpath",
")",
")",
"{",
"$",
"path",
"=",
"$",
"CFG",
"->",
"altcacheconfigpath",
";",
"if",... | Returns the expected path to the configuration file.
@return string The absolute path | [
"Returns",
"the",
"expected",
"path",
"to",
"the",
"configuration",
"file",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/config.php#L112-L126 |
213,622 | moodle/moodle | cache/classes/config.php | cache_config.include_configuration | protected function include_configuration() {
$configuration = array();
// We need to allow for late static bindings to allow for class path mudling happending for unit tests.
$cachefile = static::get_config_file_path();
if (!file_exists($cachefile)) {
throw new cache_excepti... | php | protected function include_configuration() {
$configuration = array();
// We need to allow for late static bindings to allow for class path mudling happending for unit tests.
$cachefile = static::get_config_file_path();
if (!file_exists($cachefile)) {
throw new cache_excepti... | [
"protected",
"function",
"include_configuration",
"(",
")",
"{",
"$",
"configuration",
"=",
"array",
"(",
")",
";",
"// We need to allow for late static bindings to allow for class path mudling happending for unit tests.",
"$",
"cachefile",
"=",
"static",
"::",
"get_config_file... | Includes the configuration file and makes sure it contains the expected bits.
You need to ensure that the config file exists before this is called.
@return array
@throws cache_exception | [
"Includes",
"the",
"configuration",
"file",
"and",
"makes",
"sure",
"it",
"contains",
"the",
"expected",
"bits",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/config.php#L325-L358 |
213,623 | moodle/moodle | cache/classes/config.php | cache_config.get_definition_by_id | public function get_definition_by_id($id) {
if (array_key_exists($id, $this->configdefinitions)) {
return $this->configdefinitions[$id];
}
return false;
} | php | public function get_definition_by_id($id) {
if (array_key_exists($id, $this->configdefinitions)) {
return $this->configdefinitions[$id];
}
return false;
} | [
"public",
"function",
"get_definition_by_id",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"id",
",",
"$",
"this",
"->",
"configdefinitions",
")",
")",
"{",
"return",
"$",
"this",
"->",
"configdefinitions",
"[",
"$",
"id",
"]",
";",... | Gets a definition from the config given its name.
@param string $id
@return bool | [
"Gets",
"a",
"definition",
"from",
"the",
"config",
"given",
"its",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/config.php#L382-L387 |
213,624 | moodle/moodle | cache/classes/config.php | cache_config.get_definitions_by_store | public function get_definitions_by_store($storename) {
$definitions = array();
// This function was accidentally made static at some stage in the past.
// It was converted to an instance method but to be backwards compatible
// we must step around this in code.
if (!isset($this)... | php | public function get_definitions_by_store($storename) {
$definitions = array();
// This function was accidentally made static at some stage in the past.
// It was converted to an instance method but to be backwards compatible
// we must step around this in code.
if (!isset($this)... | [
"public",
"function",
"get_definitions_by_store",
"(",
"$",
"storename",
")",
"{",
"$",
"definitions",
"=",
"array",
"(",
")",
";",
"// This function was accidentally made static at some stage in the past.",
"// It was converted to an instance method but to be backwards compatible",
... | Returns the definitions mapped into the given store name.
@param string $storename
@return array Associative array of definitions, id=>definition | [
"Returns",
"the",
"definitions",
"mapped",
"into",
"the",
"given",
"store",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/config.php#L404-L459 |
213,625 | moodle/moodle | cache/classes/config.php | cache_config.get_stores | public function get_stores($mode, $requirements = 0) {
$stores = array();
foreach ($this->configstores as $name => $store) {
// If the mode is supported and all of the requirements are provided features.
if (($store['modes'] & $mode) && ($store['features'] & $requirements) === $r... | php | public function get_stores($mode, $requirements = 0) {
$stores = array();
foreach ($this->configstores as $name => $store) {
// If the mode is supported and all of the requirements are provided features.
if (($store['modes'] & $mode) && ($store['features'] & $requirements) === $r... | [
"public",
"function",
"get_stores",
"(",
"$",
"mode",
",",
"$",
"requirements",
"=",
"0",
")",
"{",
"$",
"stores",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"configstores",
"as",
"$",
"name",
"=>",
"$",
"store",
")",
"{",
"// ... | Returns all of the stores that are suitable for the given mode and requirements.
@param int $mode One of cache_store::MODE_*
@param int $requirements The requirements of the cache as a binary flag
@return array An array of suitable stores. | [
"Returns",
"all",
"of",
"the",
"stores",
"that",
"are",
"suitable",
"for",
"the",
"given",
"mode",
"and",
"requirements",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/config.php#L468-L477 |
213,626 | moodle/moodle | cache/classes/config.php | cache_config.get_stores_for_definition | public function get_stores_for_definition(cache_definition $definition) {
// Check if MUC has been disabled.
$factory = cache_factory::instance();
if ($factory->stores_disabled()) {
// Yip its been disabled.
// To facilitate this we are going to always return an empty arr... | php | public function get_stores_for_definition(cache_definition $definition) {
// Check if MUC has been disabled.
$factory = cache_factory::instance();
if ($factory->stores_disabled()) {
// Yip its been disabled.
// To facilitate this we are going to always return an empty arr... | [
"public",
"function",
"get_stores_for_definition",
"(",
"cache_definition",
"$",
"definition",
")",
"{",
"// Check if MUC has been disabled.",
"$",
"factory",
"=",
"cache_factory",
"::",
"instance",
"(",
")",
";",
"if",
"(",
"$",
"factory",
"->",
"stores_disabled",
... | Gets all of the stores that are to be used for the given definition.
@param cache_definition $definition
@return array | [
"Gets",
"all",
"of",
"the",
"stores",
"that",
"are",
"to",
"be",
"used",
"for",
"the",
"given",
"definition",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/config.php#L485-L533 |
213,627 | moodle/moodle | cache/classes/config.php | cache_config.get_lock_for_store | public function get_lock_for_store($storename) {
if (array_key_exists($storename, $this->configstores)) {
if (array_key_exists($this->configstores[$storename]['lock'], $this->configlocks)) {
$lock = $this->configstores[$storename]['lock'];
return $this->configlocks[$l... | php | public function get_lock_for_store($storename) {
if (array_key_exists($storename, $this->configstores)) {
if (array_key_exists($this->configstores[$storename]['lock'], $this->configlocks)) {
$lock = $this->configstores[$storename]['lock'];
return $this->configlocks[$l... | [
"public",
"function",
"get_lock_for_store",
"(",
"$",
"storename",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"storename",
",",
"$",
"this",
"->",
"configstores",
")",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"this",
"->",
"configstores",
... | Returns the lock store configuration to use with a given store.
@param string $storename
@return array
@throws cache_exception | [
"Returns",
"the",
"lock",
"store",
"configuration",
"to",
"use",
"with",
"a",
"given",
"store",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/config.php#L573-L581 |
213,628 | moodle/moodle | message/output/popup/message_output_popup.php | message_output_popup.send_message | public function send_message($eventdata) {
global $DB;
// Prevent users from getting popup notifications from themselves (happens with forum notifications).
if ($eventdata->userfrom->id != $eventdata->userto->id && $eventdata->notification) {
if (!$DB->record_exists('message_popup_n... | php | public function send_message($eventdata) {
global $DB;
// Prevent users from getting popup notifications from themselves (happens with forum notifications).
if ($eventdata->userfrom->id != $eventdata->userto->id && $eventdata->notification) {
if (!$DB->record_exists('message_popup_n... | [
"public",
"function",
"send_message",
"(",
"$",
"eventdata",
")",
"{",
"global",
"$",
"DB",
";",
"// Prevent users from getting popup notifications from themselves (happens with forum notifications).",
"if",
"(",
"$",
"eventdata",
"->",
"userfrom",
"->",
"id",
"!=",
"$",
... | Adds notifications to the 'message_popup_notifications' table if applicable.
The reason for this is because we may not want to show all notifications in the notification popover. This
can happen if the popup processor was disabled when the notification was sent. If the processor is disabled this
function is never call... | [
"Adds",
"notifications",
"to",
"the",
"message_popup_notifications",
"table",
"if",
"applicable",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/output/popup/message_output_popup.php#L48-L62 |
213,629 | moodle/moodle | lib/jabber/XMPP/Log.php | XMPPHP_Log.log | public function log($msg, $runlevel = self::LEVEL_INFO) {
$time = time();
#$this->data[] = array($this->runlevel, $msg, $time);
if($this->printout and $runlevel <= $this->runlevel) {
$this->writeLine($msg, $runlevel, $time);
}
} | php | public function log($msg, $runlevel = self::LEVEL_INFO) {
$time = time();
#$this->data[] = array($this->runlevel, $msg, $time);
if($this->printout and $runlevel <= $this->runlevel) {
$this->writeLine($msg, $runlevel, $time);
}
} | [
"public",
"function",
"log",
"(",
"$",
"msg",
",",
"$",
"runlevel",
"=",
"self",
"::",
"LEVEL_INFO",
")",
"{",
"$",
"time",
"=",
"time",
"(",
")",
";",
"#$this->data[] = array($this->runlevel, $msg, $time);",
"if",
"(",
"$",
"this",
"->",
"printout",
"and",
... | Add a message to the log data array
If printout in this instance is set to true, directly output the message
@param string $msg
@param integer $runlevel | [
"Add",
"a",
"message",
"to",
"the",
"log",
"data",
"array",
"If",
"printout",
"in",
"this",
"instance",
"is",
"set",
"to",
"true",
"directly",
"output",
"the",
"message"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/jabber/XMPP/Log.php#L85-L91 |
213,630 | moodle/moodle | auth/cas/CAS/CAS/Request/AbstractRequest.php | CAS_Request_AbstractRequest.addCookie | public function addCookie ($name, $value)
{
if ($this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has already been sent cannot '.__METHOD__
);
}
$this->cookies[$name] = $value;
} | php | public function addCookie ($name, $value)
{
if ($this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has already been sent cannot '.__METHOD__
);
}
$this->cookies[$name] = $value;
} | [
"public",
"function",
"addCookie",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sent",
")",
"{",
"throw",
"new",
"CAS_OutOfSequenceException",
"(",
"'Request has already been sent cannot '",
".",
"__METHOD__",
")",
";",
"}",
... | Add a cookie to the request.
@param string $name Name of entry
@param string $value value of entry
@return void
@throws CAS_OutOfSequenceException If called after the Request has been sent. | [
"Add",
"a",
"cookie",
"to",
"the",
"request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/Request/AbstractRequest.php#L88-L97 |
213,631 | moodle/moodle | auth/cas/CAS/CAS/Request/AbstractRequest.php | CAS_Request_AbstractRequest.addHeaders | public function addHeaders (array $headers)
{
if ($this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has already been sent cannot '.__METHOD__
);
}
$this->headers = array_merge($this->headers, $headers);
} | php | public function addHeaders (array $headers)
{
if ($this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has already been sent cannot '.__METHOD__
);
}
$this->headers = array_merge($this->headers, $headers);
} | [
"public",
"function",
"addHeaders",
"(",
"array",
"$",
"headers",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sent",
")",
"{",
"throw",
"new",
"CAS_OutOfSequenceException",
"(",
"'Request has already been sent cannot '",
".",
"__METHOD__",
")",
";",
"}",
"$",
"t... | Add an array of header strings to the request.
@param array $headers headers to add
@return void
@throws CAS_OutOfSequenceException If called after the Request has been sent. | [
"Add",
"an",
"array",
"of",
"header",
"strings",
"to",
"the",
"request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/Request/AbstractRequest.php#L147-L156 |
213,632 | moodle/moodle | auth/cas/CAS/CAS/Request/AbstractRequest.php | CAS_Request_AbstractRequest.setPostBody | public function setPostBody ($body)
{
if ($this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has already been sent cannot '.__METHOD__
);
}
if (!$this->isPost) {
throw new CAS_OutOfSequenceException(
'Cannot add ... | php | public function setPostBody ($body)
{
if ($this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has already been sent cannot '.__METHOD__
);
}
if (!$this->isPost) {
throw new CAS_OutOfSequenceException(
'Cannot add ... | [
"public",
"function",
"setPostBody",
"(",
"$",
"body",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sent",
")",
"{",
"throw",
"new",
"CAS_OutOfSequenceException",
"(",
"'Request has already been sent cannot '",
".",
"__METHOD__",
")",
";",
"}",
"if",
"(",
"!",
... | Add a POST body to the request
@param string $body body to add
@return void
@throws CAS_OutOfSequenceException If called after the Request has been sent. | [
"Add",
"a",
"POST",
"body",
"to",
"the",
"request"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/Request/AbstractRequest.php#L183-L197 |
213,633 | moodle/moodle | auth/cas/CAS/CAS/Request/AbstractRequest.php | CAS_Request_AbstractRequest.setSslCaCert | public function setSslCaCert ($caCertPath,$validate_cn=true)
{
if ($this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has already been sent cannot '.__METHOD__
);
}
$this->caCertPath = $caCertPath;
$this->validateCN = $validate_cn;
... | php | public function setSslCaCert ($caCertPath,$validate_cn=true)
{
if ($this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has already been sent cannot '.__METHOD__
);
}
$this->caCertPath = $caCertPath;
$this->validateCN = $validate_cn;
... | [
"public",
"function",
"setSslCaCert",
"(",
"$",
"caCertPath",
",",
"$",
"validate_cn",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sent",
")",
"{",
"throw",
"new",
"CAS_OutOfSequenceException",
"(",
"'Request has already been sent cannot '",
".",
"__M... | Specify the path to an SSL CA certificate to validate the server with.
@param string $caCertPath path to cert
@param bool $validate_cn valdiate CN of certificate
@return void
@throws CAS_OutOfSequenceException If called after the Request has been sent. | [
"Specify",
"the",
"path",
"to",
"an",
"SSL",
"CA",
"certificate",
"to",
"validate",
"the",
"server",
"with",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/Request/AbstractRequest.php#L208-L217 |
213,634 | moodle/moodle | auth/cas/CAS/CAS/Request/AbstractRequest.php | CAS_Request_AbstractRequest.getResponseStatusCode | public function getResponseStatusCode ()
{
if (!$this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has not been sent yet. Cannot '.__METHOD__
);
}
if (!preg_match(
'/HTTP\/[0-9.]+\s+([0-9]+)\s*(.*)/',
$this->_respon... | php | public function getResponseStatusCode ()
{
if (!$this->_sent) {
throw new CAS_OutOfSequenceException(
'Request has not been sent yet. Cannot '.__METHOD__
);
}
if (!preg_match(
'/HTTP\/[0-9.]+\s+([0-9]+)\s*(.*)/',
$this->_respon... | [
"public",
"function",
"getResponseStatusCode",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_sent",
")",
"{",
"throw",
"new",
"CAS_OutOfSequenceException",
"(",
"'Request has not been sent yet. Cannot '",
".",
"__METHOD__",
")",
";",
"}",
"if",
"(",
"!",
... | Answer HTTP status code of the response
@return int
@throws CAS_OutOfSequenceException If called before the Request has been sent. | [
"Answer",
"HTTP",
"status",
"code",
"of",
"the",
"response"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/Request/AbstractRequest.php#L326-L345 |
213,635 | moodle/moodle | enrol/meta/classes/observer.php | enrol_meta_observer.user_enrolment_created | public static function user_enrolment_created(\core\event\user_enrolment_created $event) {
if (!enrol_is_enabled('meta')) {
// No more enrolments for disabled plugins.
return true;
}
if ($event->other['enrol'] === 'meta') {
// Prevent circular dependencies - ... | php | public static function user_enrolment_created(\core\event\user_enrolment_created $event) {
if (!enrol_is_enabled('meta')) {
// No more enrolments for disabled plugins.
return true;
}
if ($event->other['enrol'] === 'meta') {
// Prevent circular dependencies - ... | [
"public",
"static",
"function",
"user_enrolment_created",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"user_enrolment_created",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"enrol_is_enabled",
"(",
"'meta'",
")",
")",
"{",
"// No more enrolments for disabled plugins.",
"retu... | Triggered via user_enrolment_created event.
@param \core\event\user_enrolment_created $event
@return bool true on success. | [
"Triggered",
"via",
"user_enrolment_created",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/meta/classes/observer.php#L44-L57 |
213,636 | moodle/moodle | enrol/meta/classes/observer.php | enrol_meta_observer.role_unassigned | public static function role_unassigned(\core\event\role_unassigned $event) {
if (!enrol_is_enabled('meta')) {
// All roles are removed via cron automatically.
return true;
}
// Prevent circular dependencies - we can not sync meta roles recursively.
if ($event->ot... | php | public static function role_unassigned(\core\event\role_unassigned $event) {
if (!enrol_is_enabled('meta')) {
// All roles are removed via cron automatically.
return true;
}
// Prevent circular dependencies - we can not sync meta roles recursively.
if ($event->ot... | [
"public",
"static",
"function",
"role_unassigned",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"role_unassigned",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"enrol_is_enabled",
"(",
"'meta'",
")",
")",
"{",
"// All roles are removed via cron automatically.",
"return",
"t... | Triggered via role_unassigned event.
@param \core\event\role_unassigned $event
@return bool true on success | [
"Triggered",
"via",
"role_unassigned",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/meta/classes/observer.php#L138-L160 |
213,637 | moodle/moodle | enrol/meta/classes/observer.php | enrol_meta_observer.course_deleted | public static function course_deleted(\core\event\course_deleted $event) {
global $DB;
if (!enrol_is_enabled('meta')) {
// This is slow, let enrol_meta_sync() deal with disabled plugin.
return true;
}
// Does anything want to sync with this parent?
if (!... | php | public static function course_deleted(\core\event\course_deleted $event) {
global $DB;
if (!enrol_is_enabled('meta')) {
// This is slow, let enrol_meta_sync() deal with disabled plugin.
return true;
}
// Does anything want to sync with this parent?
if (!... | [
"public",
"static",
"function",
"course_deleted",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"course_deleted",
"$",
"event",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"enrol_is_enabled",
"(",
"'meta'",
")",
")",
"{",
"// This is slow, let enrol_meta_syn... | Triggered via course_deleted event.
@param \core\event\course_deleted $event
@return bool true on success | [
"Triggered",
"via",
"course_deleted",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/meta/classes/observer.php#L168-L206 |
213,638 | moodle/moodle | enrol/meta/classes/observer.php | enrol_meta_observer.enrol_instance_updated | public static function enrol_instance_updated(\core\event\enrol_instance_updated $event) {
global $DB;
if (!enrol_is_enabled('meta')) {
// This is slow, let enrol_meta_sync() deal with disabled plugin.
return true;
}
// Does anything want to sync with this paren... | php | public static function enrol_instance_updated(\core\event\enrol_instance_updated $event) {
global $DB;
if (!enrol_is_enabled('meta')) {
// This is slow, let enrol_meta_sync() deal with disabled plugin.
return true;
}
// Does anything want to sync with this paren... | [
"public",
"static",
"function",
"enrol_instance_updated",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"enrol_instance_updated",
"$",
"event",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"enrol_is_enabled",
"(",
"'meta'",
")",
")",
"{",
"// This is slow, le... | Triggered via enrol_instance_updated event.
@param \core\event\enrol_instance_updated $event
@return boolean | [
"Triggered",
"via",
"enrol_instance_updated",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/meta/classes/observer.php#L214-L232 |
213,639 | moodle/moodle | badges/criteria/award_criteria_overall.php | award_criteria_overall.review | public function review($userid, $filtered = false) {
global $DB;
$sql = "SELECT bc.*, bcm.critid, bcm.userid, bcm.datemet
FROM {badge_criteria} bc
LEFT JOIN {badge_criteria_met} bcm
ON bc.id = bcm.critid AND bcm.userid = :userid
WHERE ... | php | public function review($userid, $filtered = false) {
global $DB;
$sql = "SELECT bc.*, bcm.critid, bcm.userid, bcm.datemet
FROM {badge_criteria} bc
LEFT JOIN {badge_criteria_met} bcm
ON bc.id = bcm.critid AND bcm.userid = :userid
WHERE ... | [
"public",
"function",
"review",
"(",
"$",
"userid",
",",
"$",
"filtered",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"SELECT bc.*, bcm.critid, bcm.userid, bcm.datemet\n FROM {badge_criteria} bc\n LEFT JOIN {badge_criteri... | Review this criteria and decide if it has been completed
Overall criteria review should be called only from other criteria handlers.
@param int $userid User whose criteria completion needs to be reviewed.
@param bool $filtered An additional parameter indicating that user list
has been reduced and some expensive checks... | [
"Review",
"this",
"criteria",
"and",
"decide",
"if",
"it",
"has",
"been",
"completed",
"Overall",
"criteria",
"review",
"should",
"be",
"called",
"only",
"from",
"other",
"criteria",
"handlers",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/criteria/award_criteria_overall.php#L106-L143 |
213,640 | moodle/moodle | badges/criteria/award_criteria_overall.php | award_criteria_overall.save | public function save($params = array()) {
global $DB;
// Sort out criteria description.
// If it is coming from the form editor, it is an array of (text, format).
$description = '';
$descriptionformat = FORMAT_HTML;
if (isset($params['description']['text'])) {
... | php | public function save($params = array()) {
global $DB;
// Sort out criteria description.
// If it is coming from the form editor, it is an array of (text, format).
$description = '';
$descriptionformat = FORMAT_HTML;
if (isset($params['description']['text'])) {
... | [
"public",
"function",
"save",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"DB",
";",
"// Sort out criteria description.",
"// If it is coming from the form editor, it is an array of (text, format).",
"$",
"description",
"=",
"''",
";",
"$",
"d... | Saves overall badge criteria description.
@param array $params Values from the form or any other array. | [
"Saves",
"overall",
"badge",
"criteria",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/criteria/award_criteria_overall.php#L176-L203 |
213,641 | moodle/moodle | lib/classes/external/exporter.php | exporter.get_format_parameters | final protected function get_format_parameters($property) {
$parameters = [
'component' => null,
'filearea' => null,
'itemid' => null,
'options' => [],
'striplinks' => true,
];
$candidate = 'get_format_parameters_for_' . $property;
... | php | final protected function get_format_parameters($property) {
$parameters = [
'component' => null,
'filearea' => null,
'itemid' => null,
'options' => [],
'striplinks' => true,
];
$candidate = 'get_format_parameters_for_' . $property;
... | [
"final",
"protected",
"function",
"get_format_parameters",
"(",
"$",
"property",
")",
"{",
"$",
"parameters",
"=",
"[",
"'component'",
"=>",
"null",
",",
"'filearea'",
"=>",
"null",
",",
"'itemid'",
"=>",
"null",
",",
"'options'",
"=>",
"[",
"]",
",",
"'st... | Get the format parameters.
This method returns the parameters to use with the functions external_format_text(), and
external_format_string(). To override the default parameters, you can define a protected method
called 'get_format_parameters_for_<propertyName>'. For example, 'get_format_parameters_for_description',
if... | [
"Get",
"the",
"format",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/external/exporter.php#L203-L231 |
213,642 | moodle/moodle | lib/classes/external/exporter.php | exporter.format_properties | final public static function format_properties($properties) {
foreach ($properties as $property => $definition) {
// Ensures that null is set to its default.
if (!isset($definition['null'])) {
$properties[$property]['null'] = NULL_NOT_ALLOWED;
}
if... | php | final public static function format_properties($properties) {
foreach ($properties as $property => $definition) {
// Ensures that null is set to its default.
if (!isset($definition['null'])) {
$properties[$property]['null'] = NULL_NOT_ALLOWED;
}
if... | [
"final",
"public",
"static",
"function",
"format_properties",
"(",
"$",
"properties",
")",
"{",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"property",
"=>",
"$",
"definition",
")",
"{",
"// Ensures that null is set to its default.",
"if",
"(",
"!",
"isset",
"... | Recursively formats a given property definition with the default fields required.
@param array $properties List of properties to format
@return array Formatted array | [
"Recursively",
"formats",
"a",
"given",
"property",
"definition",
"with",
"the",
"default",
"fields",
"required",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/external/exporter.php#L275-L291 |
213,643 | moodle/moodle | lib/classes/external/exporter.php | exporter.get_context_structure | final protected static function get_context_structure() {
return array(
'contextid' => new external_value(PARAM_INT, 'The context id', VALUE_OPTIONAL),
'contextlevel' => new external_value(PARAM_ALPHA, 'The context level', VALUE_OPTIONAL),
'instanceid' => new external_value(P... | php | final protected static function get_context_structure() {
return array(
'contextid' => new external_value(PARAM_INT, 'The context id', VALUE_OPTIONAL),
'contextlevel' => new external_value(PARAM_ALPHA, 'The context level', VALUE_OPTIONAL),
'instanceid' => new external_value(P... | [
"final",
"protected",
"static",
"function",
"get_context_structure",
"(",
")",
"{",
"return",
"array",
"(",
"'contextid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The context id'",
",",
"VALUE_OPTIONAL",
")",
",",
"'contextlevel'",
"=>",
"new",
"ex... | Get the context structure.
@return external_single_structure | [
"Get",
"the",
"context",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/external/exporter.php#L396-L402 |
213,644 | moodle/moodle | lib/classes/external/exporter.php | exporter.get_format_field | final protected static function get_format_field($definitions, $property) {
$formatproperty = $property . 'format';
if (($definitions[$property]['type'] == PARAM_RAW || $definitions[$property]['type'] == PARAM_CLEANHTML)
&& isset($definitions[$formatproperty])
&& $definit... | php | final protected static function get_format_field($definitions, $property) {
$formatproperty = $property . 'format';
if (($definitions[$property]['type'] == PARAM_RAW || $definitions[$property]['type'] == PARAM_CLEANHTML)
&& isset($definitions[$formatproperty])
&& $definit... | [
"final",
"protected",
"static",
"function",
"get_format_field",
"(",
"$",
"definitions",
",",
"$",
"property",
")",
"{",
"$",
"formatproperty",
"=",
"$",
"property",
".",
"'format'",
";",
"if",
"(",
"(",
"$",
"definitions",
"[",
"$",
"property",
"]",
"[",
... | Get the format field name.
@param array $definitions List of properties definitions.
@param string $property The name of the property that may have a format field.
@return bool|string False, or the name of the format property. | [
"Get",
"the",
"format",
"field",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/external/exporter.php#L411-L419 |
213,645 | moodle/moodle | lib/classes/external/exporter.php | exporter.get_format_structure | final protected static function get_format_structure($property, $definition, $required = VALUE_REQUIRED) {
if (array_key_exists('default', $definition)) {
$required = VALUE_DEFAULT;
}
return new external_format_value($property, $required);
} | php | final protected static function get_format_structure($property, $definition, $required = VALUE_REQUIRED) {
if (array_key_exists('default', $definition)) {
$required = VALUE_DEFAULT;
}
return new external_format_value($property, $required);
} | [
"final",
"protected",
"static",
"function",
"get_format_structure",
"(",
"$",
"property",
",",
"$",
"definition",
",",
"$",
"required",
"=",
"VALUE_REQUIRED",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'default'",
",",
"$",
"definition",
")",
")",
"{",
"... | Get the format structure.
@param string $property The name of the property on which the format applies.
@param array $definition The definition of the format property.
@param int $required Constant VALUE_*.
@return external_format_value | [
"Get",
"the",
"format",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/external/exporter.php#L429-L434 |
213,646 | moodle/moodle | lib/classes/external/exporter.php | exporter.get_create_structure | final public static function get_create_structure() {
$properties = self::properties_definition();
$returns = array();
foreach ($properties as $property => $definition) {
if ($property == 'id') {
// The can not be set on create.
continue;
... | php | final public static function get_create_structure() {
$properties = self::properties_definition();
$returns = array();
foreach ($properties as $property => $definition) {
if ($property == 'id') {
// The can not be set on create.
continue;
... | [
"final",
"public",
"static",
"function",
"get_create_structure",
"(",
")",
"{",
"$",
"properties",
"=",
"self",
"::",
"properties_definition",
"(",
")",
";",
"$",
"returns",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"proper... | Returns the create structure.
@return external_single_structure | [
"Returns",
"the",
"create",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/external/exporter.php#L441-L487 |
213,647 | moodle/moodle | lib/classes/external/exporter.php | exporter.get_update_structure | final public static function get_update_structure() {
$properties = self::properties_definition();
$returns = array();
foreach ($properties as $property => $definition) {
if (isset($returns[$property]) && substr($property, -6) === 'format') {
// We've already treated... | php | final public static function get_update_structure() {
$properties = self::properties_definition();
$returns = array();
foreach ($properties as $property => $definition) {
if (isset($returns[$property]) && substr($property, -6) === 'format') {
// We've already treated... | [
"final",
"public",
"static",
"function",
"get_update_structure",
"(",
")",
"{",
"$",
"properties",
"=",
"self",
"::",
"properties_definition",
"(",
")",
";",
"$",
"returns",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"proper... | Returns the update structure.
This structure can never be included at the top level for an external function signature
because it contains optional parameters.
@return external_single_structure | [
"Returns",
"the",
"update",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/external/exporter.php#L565-L604 |
213,648 | moodle/moodle | mod/scorm/report/graphs/classes/report.php | report.get_data | protected function get_data($scoid, $allowedlist = []) {
global $DB;
$data = array_fill(0, self::BANDS, 0);
if (empty($allowedlist)) {
return $data;
}
list($usql, $params) = $DB->get_in_or_equal($allowedlist);
$params[] = $scoid;
// Construct the SQL... | php | protected function get_data($scoid, $allowedlist = []) {
global $DB;
$data = array_fill(0, self::BANDS, 0);
if (empty($allowedlist)) {
return $data;
}
list($usql, $params) = $DB->get_in_or_equal($allowedlist);
$params[] = $scoid;
// Construct the SQL... | [
"protected",
"function",
"get_data",
"(",
"$",
"scoid",
",",
"$",
"allowedlist",
"=",
"[",
"]",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"data",
"=",
"array_fill",
"(",
"0",
",",
"self",
"::",
"BANDS",
",",
"0",
")",
";",
"if",
"(",
"empty",
"(",... | Get the data for the report.
@param int $scoid The sco ID.
@param array $allowedlist The list of user IDs allowed to be displayed.
@return array of data indexed per bar. | [
"Get",
"the",
"data",
"for",
"the",
"report",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/scorm/report/graphs/classes/report.php#L56-L125 |
213,649 | moodle/moodle | mod/scorm/report/graphs/classes/report.php | report.display | public function display($scorm, $cm, $course, $download) {
global $DB, $OUTPUT, $PAGE;
$contextmodule = context_module::instance($cm->id);
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used.
groups_print_activity_menu($cm, new moodle_url($PAGE->url));... | php | public function display($scorm, $cm, $course, $download) {
global $DB, $OUTPUT, $PAGE;
$contextmodule = context_module::instance($cm->id);
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used.
groups_print_activity_menu($cm, new moodle_url($PAGE->url));... | [
"public",
"function",
"display",
"(",
"$",
"scorm",
",",
"$",
"cm",
",",
"$",
"course",
",",
"$",
"download",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"OUTPUT",
",",
"$",
"PAGE",
";",
"$",
"contextmodule",
"=",
"context_module",
"::",
"instance",
"("... | Displays the full report.
@param \stdClass $scorm full SCORM object
@param \stdClass $cm - full course_module object
@param \stdClass $course - full course object
@param string $download - type of download being requested
@return void | [
"Displays",
"the",
"full",
"report",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/scorm/report/graphs/classes/report.php#L136-L183 |
213,650 | moodle/moodle | group/externallib.php | core_group_external.get_groups | public static function get_groups($groupids) {
$params = self::validate_parameters(self::get_groups_parameters(), array('groupids'=>$groupids));
$groups = array();
foreach ($params['groupids'] as $groupid) {
// validate params
$group = groups_get_group($groupid, 'id, cou... | php | public static function get_groups($groupids) {
$params = self::validate_parameters(self::get_groups_parameters(), array('groupids'=>$groupids));
$groups = array();
foreach ($params['groupids'] as $groupid) {
// validate params
$group = groups_get_group($groupid, 'id, cou... | [
"public",
"static",
"function",
"get_groups",
"(",
"$",
"groupids",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_groups_parameters",
"(",
")",
",",
"array",
"(",
"'groupids'",
"=>",
"$",
"groupids",
")",
")",
"... | Get groups definition specified by ids
@param array $groupids arrays of group ids
@return array of group objects (id, courseid, name, enrolmentkey)
@since Moodle 2.2 | [
"Get",
"groups",
"definition",
"specified",
"by",
"ids"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L170-L198 |
213,651 | moodle/moodle | group/externallib.php | core_group_external.get_course_groups | public static function get_course_groups($courseid) {
$params = self::validate_parameters(self::get_course_groups_parameters(), array('courseid'=>$courseid));
// now security checks
$context = context_course::instance($params['courseid'], IGNORE_MISSING);
try {
self::validat... | php | public static function get_course_groups($courseid) {
$params = self::validate_parameters(self::get_course_groups_parameters(), array('courseid'=>$courseid));
// now security checks
$context = context_course::instance($params['courseid'], IGNORE_MISSING);
try {
self::validat... | [
"public",
"static",
"function",
"get_course_groups",
"(",
"$",
"courseid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_course_groups_parameters",
"(",
")",
",",
"array",
"(",
"'courseid'",
"=>",
"$",
"courseid",
"... | Get all groups in the specified course
@param int $courseid id of course
@return array of group objects (id, courseid, name, enrolmentkey)
@since Moodle 2.2 | [
"Get",
"all",
"groups",
"in",
"the",
"specified",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L243-L270 |
213,652 | moodle/moodle | group/externallib.php | core_group_external.get_group_members | public static function get_group_members($groupids) {
$members = array();
$params = self::validate_parameters(self::get_group_members_parameters(), array('groupids'=>$groupids));
foreach ($params['groupids'] as $groupid) {
// validate params
$group = groups_get_group($g... | php | public static function get_group_members($groupids) {
$members = array();
$params = self::validate_parameters(self::get_group_members_parameters(), array('groupids'=>$groupids));
foreach ($params['groupids'] as $groupid) {
// validate params
$group = groups_get_group($g... | [
"public",
"static",
"function",
"get_group_members",
"(",
"$",
"groupids",
")",
"{",
"$",
"members",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_group_members_parameters",
"(",
")",
",",
"arra... | Return all members for a group
@param array $groupids array of group ids
@return array with group id keys containing arrays of user ids
@since Moodle 2.2 | [
"Return",
"all",
"members",
"for",
"a",
"group"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L380-L406 |
213,653 | moodle/moodle | group/externallib.php | core_group_external.add_group_members | public static function add_group_members($members) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
$params = self::validate_parameters(self::add_group_members_parameters(), array('members'=>$members));
$transaction = $DB->start_delegated_transaction();
foreach ... | php | public static function add_group_members($members) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
$params = self::validate_parameters(self::add_group_members_parameters(), array('members'=>$members));
$transaction = $DB->start_delegated_transaction();
foreach ... | [
"public",
"static",
"function",
"add_group_members",
"(",
"$",
"members",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"\"$CFG->dirroot/group/lib.php\"",
")",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self... | Add group members
@param array $members of arrays with keys userid, groupid
@since Moodle 2.2 | [
"Add",
"group",
"members"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L453-L490 |
213,654 | moodle/moodle | group/externallib.php | core_group_external.delete_group_members | public static function delete_group_members($members) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
$params = self::validate_parameters(self::delete_group_members_parameters(), array('members'=>$members));
$transaction = $DB->start_delegated_transaction();
f... | php | public static function delete_group_members($members) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
$params = self::validate_parameters(self::delete_group_members_parameters(), array('members'=>$members));
$transaction = $DB->start_delegated_transaction();
f... | [
"public",
"static",
"function",
"delete_group_members",
"(",
"$",
"members",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"\"$CFG->dirroot/group/lib.php\"",
")",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"s... | Delete group members
@param array $members of arrays with keys userid, groupid
@since Moodle 2.2 | [
"Delete",
"group",
"members"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L530-L565 |
213,655 | moodle/moodle | group/externallib.php | core_group_external.get_groupings | public static function get_groupings($groupingids, $returngroups = false) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
require_once("$CFG->libdir/filelib.php");
$params = self::validate_parameters(self::get_groupings_parameters(),
... | php | public static function get_groupings($groupingids, $returngroups = false) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
require_once("$CFG->libdir/filelib.php");
$params = self::validate_parameters(self::get_groupings_parameters(),
... | [
"public",
"static",
"function",
"get_groupings",
"(",
"$",
"groupingids",
",",
"$",
"returngroups",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"\"$CFG->dirroot/group/lib.php\"",
")",
";",
"require_once",
"(",
"\"$CF... | Get groupings definition specified by ids
@param array $groupingids arrays of grouping ids
@param boolean $returngroups return the associated groups if true. The default is false.
@return array of grouping objects (id, courseid, name)
@since Moodle 2.3 | [
"Get",
"groupings",
"definition",
"specified",
"by",
"ids"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L789-L847 |
213,656 | moodle/moodle | group/externallib.php | core_group_external.get_course_groupings | public static function get_course_groupings($courseid) {
global $CFG;
require_once("$CFG->dirroot/group/lib.php");
require_once("$CFG->libdir/filelib.php");
$params = self::validate_parameters(self::get_course_groupings_parameters(), array('courseid'=>$courseid));
// Now securi... | php | public static function get_course_groupings($courseid) {
global $CFG;
require_once("$CFG->dirroot/group/lib.php");
require_once("$CFG->libdir/filelib.php");
$params = self::validate_parameters(self::get_course_groupings_parameters(), array('courseid'=>$courseid));
// Now securi... | [
"public",
"static",
"function",
"get_course_groupings",
"(",
"$",
"courseid",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"\"$CFG->dirroot/group/lib.php\"",
")",
";",
"require_once",
"(",
"\"$CFG->libdir/filelib.php\"",
")",
";",
"$",
"params",
"=",
... | Get all groupings in the specified course
@param int $courseid id of course
@return array of grouping objects (id, courseid, name, enrolmentkey)
@since Moodle 2.3 | [
"Get",
"all",
"groupings",
"in",
"the",
"specified",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L904-L935 |
213,657 | moodle/moodle | group/externallib.php | core_group_external.assign_grouping | public static function assign_grouping($assignments) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
$params = self::validate_parameters(self::assign_grouping_parameters(), array('assignments'=>$assignments));
$transaction = $DB->start_delegated_transaction();
... | php | public static function assign_grouping($assignments) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
$params = self::validate_parameters(self::assign_grouping_parameters(), array('assignments'=>$assignments));
$transaction = $DB->start_delegated_transaction();
... | [
"public",
"static",
"function",
"assign_grouping",
"(",
"$",
"assignments",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"\"$CFG->dirroot/group/lib.php\"",
")",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"se... | Assign a group to a grouping
@param array $assignments of arrays with keys groupid, groupingid
@return void
@since Moodle 2.3 | [
"Assign",
"a",
"group",
"to",
"a",
"grouping"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L1050-L1086 |
213,658 | moodle/moodle | group/externallib.php | core_group_external.unassign_grouping | public static function unassign_grouping($unassignments) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
$params = self::validate_parameters(self::unassign_grouping_parameters(), array('unassignments'=>$unassignments));
$transaction = $DB->start_delegated_transaction()... | php | public static function unassign_grouping($unassignments) {
global $CFG, $DB;
require_once("$CFG->dirroot/group/lib.php");
$params = self::validate_parameters(self::unassign_grouping_parameters(), array('unassignments'=>$unassignments));
$transaction = $DB->start_delegated_transaction()... | [
"public",
"static",
"function",
"unassign_grouping",
"(",
"$",
"unassignments",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"\"$CFG->dirroot/group/lib.php\"",
")",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
... | Unassign a group from a grouping
@param array $unassignments of arrays with keys groupid, groupingid
@return void
@since Moodle 2.3 | [
"Unassign",
"a",
"group",
"from",
"a",
"grouping"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L1126-L1162 |
213,659 | moodle/moodle | group/externallib.php | core_group_external.get_course_user_groups | public static function get_course_user_groups($courseid = 0, $userid = 0, $groupingid = 0) {
global $USER;
// Warnings array, it can be empty at the end but is mandatory.
$warnings = array();
$params = array(
'courseid' => $courseid,
'userid' => $userid,
... | php | public static function get_course_user_groups($courseid = 0, $userid = 0, $groupingid = 0) {
global $USER;
// Warnings array, it can be empty at the end but is mandatory.
$warnings = array();
$params = array(
'courseid' => $courseid,
'userid' => $userid,
... | [
"public",
"static",
"function",
"get_course_user_groups",
"(",
"$",
"courseid",
"=",
"0",
",",
"$",
"userid",
"=",
"0",
",",
"$",
"groupingid",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
";",
"// Warnings array, it can be empty at the end but is mandatory.",
"$",
... | Get all groups in the specified course for the specified user.
@throws moodle_exception
@param int $courseid id of course.
@param int $userid id of user.
@param int $groupingid optional returns only groups in the specified grouping.
@return array of group objects (id, name, description, format) and possible warnings.
... | [
"Get",
"all",
"groups",
"in",
"the",
"specified",
"course",
"for",
"the",
"specified",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L1201-L1279 |
213,660 | moodle/moodle | group/externallib.php | core_group_external.group_description | public static function group_description() {
return new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'group record id'),
'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
'description' => n... | php | public static function group_description() {
return new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'group record id'),
'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
'description' => n... | [
"public",
"static",
"function",
"group_description",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'group record id'",
")",
",",
"'name'",
"=>",
"new",
"external_value... | Create group return value description.
@return external_single_structure The group description | [
"Create",
"group",
"return",
"value",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L1301-L1312 |
213,661 | moodle/moodle | group/externallib.php | core_group_external.get_activity_allowed_groups | public static function get_activity_allowed_groups($cmid, $userid = 0) {
global $USER;
// Warnings array, it can be empty at the end but is mandatory.
$warnings = array();
$params = array(
'cmid' => $cmid,
'userid' => $userid
);
$params = self::v... | php | public static function get_activity_allowed_groups($cmid, $userid = 0) {
global $USER;
// Warnings array, it can be empty at the end but is mandatory.
$warnings = array();
$params = array(
'cmid' => $cmid,
'userid' => $userid
);
$params = self::v... | [
"public",
"static",
"function",
"get_activity_allowed_groups",
"(",
"$",
"cmid",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
";",
"// Warnings array, it can be empty at the end but is mandatory.",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$... | Gets a list of groups that the user is allowed to access within the specified activity.
@throws moodle_exception
@param int $cmid course module id
@param int $userid id of user.
@return array of group objects (id, name, description, format) and possible warnings.
@since Moodle 3.0 | [
"Gets",
"a",
"list",
"of",
"groups",
"that",
"the",
"user",
"is",
"allowed",
"to",
"access",
"within",
"the",
"specified",
"activity",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L1338-L1404 |
213,662 | moodle/moodle | group/externallib.php | core_group_external.get_activity_groupmode | public static function get_activity_groupmode($cmid) {
global $USER;
// Warnings array, it can be empty at the end but is mandatory.
$warnings = array();
$params = array(
'cmid' => $cmid
);
$params = self::validate_parameters(self::get_activity_groupmode_par... | php | public static function get_activity_groupmode($cmid) {
global $USER;
// Warnings array, it can be empty at the end but is mandatory.
$warnings = array();
$params = array(
'cmid' => $cmid
);
$params = self::validate_parameters(self::get_activity_groupmode_par... | [
"public",
"static",
"function",
"get_activity_groupmode",
"(",
"$",
"cmid",
")",
"{",
"global",
"$",
"USER",
";",
"// Warnings array, it can be empty at the end but is mandatory.",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'c... | Returns effective groupmode used in a given activity.
@throws moodle_exception
@param int $cmid course module id.
@return array containing the group mode and possible warnings.
@since Moodle 3.0
@throws moodle_exception | [
"Returns",
"effective",
"groupmode",
"used",
"in",
"a",
"given",
"activity",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/group/externallib.php#L1446-L1471 |
213,663 | moodle/moodle | lib/horde/framework/Horde/Support/Backtrace.php | Horde_Support_Backtrace._createFromThrowable | protected function _createFromThrowable($e)
{
$this->backtrace = $e->getTrace();
if ($previous = $e->getPrevious()) {
$backtrace = new self($previous);
$this->backtrace = array_merge($backtrace->backtrace,
$this->backtrace);
... | php | protected function _createFromThrowable($e)
{
$this->backtrace = $e->getTrace();
if ($previous = $e->getPrevious()) {
$backtrace = new self($previous);
$this->backtrace = array_merge($backtrace->backtrace,
$this->backtrace);
... | [
"protected",
"function",
"_createFromThrowable",
"(",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"backtrace",
"=",
"$",
"e",
"->",
"getTrace",
"(",
")",
";",
"if",
"(",
"$",
"previous",
"=",
"$",
"e",
"->",
"getPrevious",
"(",
")",
")",
"{",
"$",
"back... | Wraps an error object's backtrace.
@todo Merge with createFromThrowable with PHP 7.
@param Throwable $e The error to wrap. | [
"Wraps",
"an",
"error",
"object",
"s",
"backtrace",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Support/Backtrace.php#L82-L90 |
213,664 | moodle/moodle | lib/horde/framework/Horde/Support/Backtrace.php | Horde_Support_Backtrace.getContext | public function getContext($nestingLevel)
{
if (!isset($this->backtrace[$nestingLevel])) {
throw new Horde_Exception('Unknown nesting level');
}
return $this->backtrace[$nestingLevel];
} | php | public function getContext($nestingLevel)
{
if (!isset($this->backtrace[$nestingLevel])) {
throw new Horde_Exception('Unknown nesting level');
}
return $this->backtrace[$nestingLevel];
} | [
"public",
"function",
"getContext",
"(",
"$",
"nestingLevel",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"backtrace",
"[",
"$",
"nestingLevel",
"]",
")",
")",
"{",
"throw",
"new",
"Horde_Exception",
"(",
"'Unknown nesting level'",
")",
";",... | Returns the context at a specific nesting level.
@param integer $nestingLevel 0 == current level, 1 == caller, and so on
@return array The requested context. | [
"Returns",
"the",
"context",
"at",
"a",
"specific",
"nesting",
"level",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Support/Backtrace.php#L121-L127 |
213,665 | moodle/moodle | report/log/classes/table_log.php | report_log_table_log.get_user_fullname | protected function get_user_fullname($userid) {
global $DB;
if (empty($userid)) {
return false;
}
if (!empty($this->userfullnames[$userid])) {
return $this->userfullnames[$userid];
}
// We already looked for the user and it does not exist.
... | php | protected function get_user_fullname($userid) {
global $DB;
if (empty($userid)) {
return false;
}
if (!empty($this->userfullnames[$userid])) {
return $this->userfullnames[$userid];
}
// We already looked for the user and it does not exist.
... | [
"protected",
"function",
"get_user_fullname",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"empty",
"(",
"$",
"userid",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"userfullnames"... | Gets the user full name.
This function is useful because, in the unlikely case that the user is
not already loaded in $this->userfullnames it will fetch it from db.
@since Moodle 2.9
@param int $userid
@return string|false | [
"Gets",
"the",
"user",
"full",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/log/classes/table_log.php#L110-L135 |
213,666 | moodle/moodle | report/log/classes/table_log.php | report_log_table_log.col_time | public function col_time($event) {
if (empty($this->download)) {
$dateformat = get_string('strftimedatetime', 'core_langconfig');
} else {
$dateformat = get_string('strftimedatetimeshort', 'core_langconfig');
}
return userdate($event->timecreated, $dateformat);
... | php | public function col_time($event) {
if (empty($this->download)) {
$dateformat = get_string('strftimedatetime', 'core_langconfig');
} else {
$dateformat = get_string('strftimedatetimeshort', 'core_langconfig');
}
return userdate($event->timecreated, $dateformat);
... | [
"public",
"function",
"col_time",
"(",
"$",
"event",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"download",
")",
")",
"{",
"$",
"dateformat",
"=",
"get_string",
"(",
"'strftimedatetime'",
",",
"'core_langconfig'",
")",
";",
"}",
"else",
"{",
... | Generate the time column.
@param stdClass $event event data.
@return string HTML for the time column | [
"Generate",
"the",
"time",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/log/classes/table_log.php#L143-L151 |
213,667 | moodle/moodle | report/log/classes/table_log.php | report_log_table_log.col_component | public function col_component($event) {
// Component.
$componentname = $event->component;
if (($event->component === 'core') || ($event->component === 'legacy')) {
return get_string('coresystem');
} else if (get_string_manager()->string_exists('pluginname', $event->component... | php | public function col_component($event) {
// Component.
$componentname = $event->component;
if (($event->component === 'core') || ($event->component === 'legacy')) {
return get_string('coresystem');
} else if (get_string_manager()->string_exists('pluginname', $event->component... | [
"public",
"function",
"col_component",
"(",
"$",
"event",
")",
"{",
"// Component.",
"$",
"componentname",
"=",
"$",
"event",
"->",
"component",
";",
"if",
"(",
"(",
"$",
"event",
"->",
"component",
"===",
"'core'",
")",
"||",
"(",
"$",
"event",
"->",
... | Generate the component column.
@param stdClass $event event data.
@return string HTML for the component column | [
"Generate",
"the",
"component",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/log/classes/table_log.php#L256-L266 |
213,668 | moodle/moodle | report/log/classes/table_log.php | report_log_table_log.action_link | protected function action_link(moodle_url $url, $text, $name = 'popup') {
global $OUTPUT;
$link = new action_link($url, $text, new popup_action('click', $url, $name, array('height' => 440, 'width' => 700)));
return $OUTPUT->render($link);
} | php | protected function action_link(moodle_url $url, $text, $name = 'popup') {
global $OUTPUT;
$link = new action_link($url, $text, new popup_action('click', $url, $name, array('height' => 440, 'width' => 700)));
return $OUTPUT->render($link);
} | [
"protected",
"function",
"action_link",
"(",
"moodle_url",
"$",
"url",
",",
"$",
"text",
",",
"$",
"name",
"=",
"'popup'",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"link",
"=",
"new",
"action_link",
"(",
"$",
"url",
",",
"$",
"text",
",",
"new",
... | Method to create a link with popup action.
@param moodle_url $url The url to open.
@param string $text Anchor text for the link.
@param string $name Name of the popup window.
@return string html to use. | [
"Method",
"to",
"create",
"a",
"link",
"with",
"popup",
"action",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/log/classes/table_log.php#L341-L345 |
213,669 | moodle/moodle | report/log/classes/table_log.php | report_log_table_log.get_action_sql | public function get_action_sql() {
global $DB;
// In new logs we have a field to pick, and in legacy try get this from action.
if ($this->filterparams->logreader instanceof logstore_legacy\log\store) {
$action = $this->get_legacy_crud_action($this->filterparams->action);
... | php | public function get_action_sql() {
global $DB;
// In new logs we have a field to pick, and in legacy try get this from action.
if ($this->filterparams->logreader instanceof logstore_legacy\log\store) {
$action = $this->get_legacy_crud_action($this->filterparams->action);
... | [
"public",
"function",
"get_action_sql",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"// In new logs we have a field to pick, and in legacy try get this from action.",
"if",
"(",
"$",
"this",
"->",
"filterparams",
"->",
"logreader",
"instanceof",
"logstore_legacy",
"\\",
"log... | Helper function which is used by build logs to get action sql and param.
@return array sql and param for action. | [
"Helper",
"function",
"which",
"is",
"used",
"by",
"build",
"logs",
"to",
"get",
"action",
"sql",
"and",
"param",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/log/classes/table_log.php#L368-L393 |
213,670 | moodle/moodle | report/log/classes/table_log.php | report_log_table_log.get_cm_sql | public function get_cm_sql() {
$joins = array();
$params = array();
if ($this->filterparams->logreader instanceof logstore_legacy\log\store) {
// The legacy store doesn't support context level.
$joins[] = "cmid = :cmid";
$params['cmid'] = $this->filterparams-... | php | public function get_cm_sql() {
$joins = array();
$params = array();
if ($this->filterparams->logreader instanceof logstore_legacy\log\store) {
// The legacy store doesn't support context level.
$joins[] = "cmid = :cmid";
$params['cmid'] = $this->filterparams-... | [
"public",
"function",
"get_cm_sql",
"(",
")",
"{",
"$",
"joins",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"filterparams",
"->",
"logreader",
"instanceof",
"logstore_legacy",
"\\",
"log",
"\\... | Helper function which is used by build logs to get course module sql and param.
@return array sql and param for action. | [
"Helper",
"function",
"which",
"is",
"used",
"by",
"build",
"logs",
"to",
"get",
"course",
"module",
"sql",
"and",
"param",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/log/classes/table_log.php#L400-L417 |
213,671 | moodle/moodle | report/log/classes/table_log.php | report_log_table_log.update_users_used | protected function update_users_used() {
global $DB;
$this->userfullnames = array();
$userids = array();
// For each event cache full username.
// Get list of userids which will be shown in log report.
foreach ($this->rawdata as $event) {
$logextra = $event-... | php | protected function update_users_used() {
global $DB;
$this->userfullnames = array();
$userids = array();
// For each event cache full username.
// Get list of userids which will be shown in log report.
foreach ($this->rawdata as $event) {
$logextra = $event-... | [
"protected",
"function",
"update_users_used",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"this",
"->",
"userfullnames",
"=",
"array",
"(",
")",
";",
"$",
"userids",
"=",
"array",
"(",
")",
";",
"// For each event cache full username.",
"// Get list of userids... | Helper function to create list of user fullnames shown in log report.
This will update $this->userfullnames array with userfullname,
which will be used to render logs in table.
@since Moodle 2.9
@return void | [
"Helper",
"function",
"to",
"create",
"list",
"of",
"user",
"fullnames",
"shown",
"in",
"log",
"report",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/log/classes/table_log.php#L560-L598 |
213,672 | moodle/moodle | repository/skydrive/microsoftliveapi.php | microsoft_skydrive.post | public function post($url, $params = '', $options = array()) {
return parent::post($url, format_postdata_for_curlcall($params), $options);
} | php | public function post($url, $params = '', $options = array()) {
return parent::post($url, format_postdata_for_curlcall($params), $options);
} | [
"public",
"function",
"post",
"(",
"$",
"url",
",",
"$",
"params",
"=",
"''",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"return",
"parent",
"::",
"post",
"(",
"$",
"url",
",",
"format_postdata_for_curlcall",
"(",
"$",
"params",
")",
",",... | Post request.
Overridden to convert the data to a string, else curl will set the wrong headers.
@param string $url The URL.
@param array|string $params The parameters.
@param array $options The options.
@return bool | [
"Post",
"request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/skydrive/microsoftliveapi.php#L89-L91 |
213,673 | moodle/moodle | repository/skydrive/microsoftliveapi.php | microsoft_skydrive.download_file | public function download_file($id, $path) {
$url = self::API."/${id}/content";
// Microsoft live redirects to the real download location..
$this->setopt(array('CURLOPT_FOLLOWLOCATION' => true, 'CURLOPT_MAXREDIRS' => 3));
$content = $this->get($url);
file_put_contents($path, $cont... | php | public function download_file($id, $path) {
$url = self::API."/${id}/content";
// Microsoft live redirects to the real download location..
$this->setopt(array('CURLOPT_FOLLOWLOCATION' => true, 'CURLOPT_MAXREDIRS' => 3));
$content = $this->get($url);
file_put_contents($path, $cont... | [
"public",
"function",
"download_file",
"(",
"$",
"id",
",",
"$",
"path",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"API",
".",
"\"/${id}/content\"",
";",
"// Microsoft live redirects to the real download location..",
"$",
"this",
"->",
"setopt",
"(",
"array",
"("... | Downloads a file to a file from skydrive using authenticated request
@param string $id id of file
@param string $path path to save file to
@return array stucture for repository download_file | [
"Downloads",
"a",
"file",
"to",
"a",
"file",
"from",
"skydrive",
"using",
"authenticated",
"request"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/skydrive/microsoftliveapi.php#L100-L107 |
213,674 | moodle/moodle | repository/skydrive/microsoftliveapi.php | microsoft_skydrive.get_folder_name | public function get_folder_name($folderid) {
if (empty($folderid)) {
throw new coding_exception('Empty folderid passed to get_folder_name');
}
// Cache based on oauthtoken and folderid.
$cachekey = $this->folder_cache_key($folderid);
if ($foldername = $this->foldern... | php | public function get_folder_name($folderid) {
if (empty($folderid)) {
throw new coding_exception('Empty folderid passed to get_folder_name');
}
// Cache based on oauthtoken and folderid.
$cachekey = $this->folder_cache_key($folderid);
if ($foldername = $this->foldern... | [
"public",
"function",
"get_folder_name",
"(",
"$",
"folderid",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"folderid",
")",
")",
"{",
"throw",
"new",
"coding_exception",
"(",
"'Empty folderid passed to get_folder_name'",
")",
";",
"}",
"// Cache based on oauthtoken and ... | Returns a folder name property for a given folderid.
@param string $folderid the folder id which is passed
@return mixed folder name or false in case of error | [
"Returns",
"a",
"folder",
"name",
"property",
"for",
"a",
"given",
"folderid",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/skydrive/microsoftliveapi.php#L115-L136 |
213,675 | moodle/moodle | mod/assign/submission/comments/classes/privacy/provider.php | provider.get_context_for_userid_within_submission | public static function get_context_for_userid_within_submission(int $userid, contextlist $contextlist) {
$sql = "SELECT contextid
FROM {comments}
WHERE component = :component
AND commentarea = :commentarea
AND userid = :userid";
... | php | public static function get_context_for_userid_within_submission(int $userid, contextlist $contextlist) {
$sql = "SELECT contextid
FROM {comments}
WHERE component = :component
AND commentarea = :commentarea
AND userid = :userid";
... | [
"public",
"static",
"function",
"get_context_for_userid_within_submission",
"(",
"int",
"$",
"userid",
",",
"contextlist",
"$",
"contextlist",
")",
"{",
"$",
"sql",
"=",
"\"SELECT contextid\n FROM {comments}\n WHERE component = :component\n ... | It is possible to make a comment as a teacher without creating an entry in the submission table, so this is required
to find those entries.
@param int $userid The user ID that we are finding contexts for.
@param contextlist $contextlist A context list to add sql and params to for contexts. | [
"It",
"is",
"possible",
"to",
"make",
"a",
"comment",
"as",
"a",
"teacher",
"without",
"creating",
"an",
"entry",
"in",
"the",
"submission",
"table",
"so",
"this",
"is",
"required",
"to",
"find",
"those",
"entries",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/submission/comments/classes/privacy/provider.php#L66-L74 |
213,676 | moodle/moodle | mod/assign/submission/comments/classes/privacy/provider.php | provider.get_student_user_ids | public static function get_student_user_ids(\mod_assign\privacy\useridlist $useridlist) {
$params = ['assignid' => $useridlist->get_assignid(), 'commentuserid' => $useridlist->get_teacherid(),
'commentuserid2' => $useridlist->get_teacherid()];
$sql = "SELECT DISTINCT c.userid AS id
... | php | public static function get_student_user_ids(\mod_assign\privacy\useridlist $useridlist) {
$params = ['assignid' => $useridlist->get_assignid(), 'commentuserid' => $useridlist->get_teacherid(),
'commentuserid2' => $useridlist->get_teacherid()];
$sql = "SELECT DISTINCT c.userid AS id
... | [
"public",
"static",
"function",
"get_student_user_ids",
"(",
"\\",
"mod_assign",
"\\",
"privacy",
"\\",
"useridlist",
"$",
"useridlist",
")",
"{",
"$",
"params",
"=",
"[",
"'assignid'",
"=>",
"$",
"useridlist",
"->",
"get_assignid",
"(",
")",
",",
"'commentuse... | Due to the fact that we can't rely on the queries in the mod_assign provider we have to add some additional sql.
@param \mod_assign\privacy\useridlist $useridlist An object for obtaining user IDs of students. | [
"Due",
"to",
"the",
"fact",
"that",
"we",
"can",
"t",
"rely",
"on",
"the",
"queries",
"in",
"the",
"mod_assign",
"provider",
"we",
"have",
"to",
"add",
"some",
"additional",
"sql",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/submission/comments/classes/privacy/provider.php#L81-L92 |
213,677 | moodle/moodle | mod/assign/submission/comments/classes/privacy/provider.php | provider.get_userids_from_context | public static function get_userids_from_context(\core_privacy\local\request\userlist $userlist) {
$context = $userlist->get_context();
if ($context->contextlevel != CONTEXT_MODULE) {
return;
}
comments_provider::get_users_in_context_from_sql($userlist, 'c', 'assignsubmission_... | php | public static function get_userids_from_context(\core_privacy\local\request\userlist $userlist) {
$context = $userlist->get_context();
if ($context->contextlevel != CONTEXT_MODULE) {
return;
}
comments_provider::get_users_in_context_from_sql($userlist, 'c', 'assignsubmission_... | [
"public",
"static",
"function",
"get_userids_from_context",
"(",
"\\",
"core_privacy",
"\\",
"local",
"\\",
"request",
"\\",
"userlist",
"$",
"userlist",
")",
"{",
"$",
"context",
"=",
"$",
"userlist",
"->",
"get_context",
"(",
")",
";",
"if",
"(",
"$",
"c... | If you have tables that contain userids and you can generate entries in your tables without creating an
entry in the assign_submission table then please fill in this method.
@param \core_privacy\local\request\userlist $userlist The userlist object | [
"If",
"you",
"have",
"tables",
"that",
"contain",
"userids",
"and",
"you",
"can",
"generate",
"entries",
"in",
"your",
"tables",
"without",
"creating",
"an",
"entry",
"in",
"the",
"assign_submission",
"table",
"then",
"please",
"fill",
"in",
"this",
"method",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/submission/comments/classes/privacy/provider.php#L100-L107 |
213,678 | moodle/moodle | course/classes/search/customfield.php | customfield.get_document_recordset | public function get_document_recordset($modifiedfrom = 0, \context $context = null) {
global $DB;
list ($contextjoin, $contextparams) = $this->get_course_level_context_restriction_sql($context, 'c', SQL_PARAMS_NAMED);
if ($contextjoin === null) {
return null;
}
$fie... | php | public function get_document_recordset($modifiedfrom = 0, \context $context = null) {
global $DB;
list ($contextjoin, $contextparams) = $this->get_course_level_context_restriction_sql($context, 'c', SQL_PARAMS_NAMED);
if ($contextjoin === null) {
return null;
}
$fie... | [
"public",
"function",
"get_document_recordset",
"(",
"$",
"modifiedfrom",
"=",
"0",
",",
"\\",
"context",
"$",
"context",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"list",
"(",
"$",
"contextjoin",
",",
"$",
"contextparams",
")",
"=",
"$",
"this",
... | Returns recordset containing required data for indexing
course custom fields.
@param int $modifiedfrom timestamp
@param \context|null $context Restriction context
@return \moodle_recordset|null Recordset or null if no change possible | [
"Returns",
"recordset",
"containing",
"required",
"data",
"for",
"indexing",
"course",
"custom",
"fields",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/classes/search/customfield.php#L57-L83 |
213,679 | moodle/moodle | availability/classes/frontend.php | frontend.include_all_javascript | public static function include_all_javascript($course, \cm_info $cm = null,
\section_info $section = null) {
global $PAGE;
// Prepare array of required YUI modules. It is bad for performance to
// make multiple yui_module calls, so we group all the plugin modules
// into a s... | php | public static function include_all_javascript($course, \cm_info $cm = null,
\section_info $section = null) {
global $PAGE;
// Prepare array of required YUI modules. It is bad for performance to
// make multiple yui_module calls, so we group all the plugin modules
// into a s... | [
"public",
"static",
"function",
"include_all_javascript",
"(",
"$",
"course",
",",
"\\",
"cm_info",
"$",
"cm",
"=",
"null",
",",
"\\",
"section_info",
"$",
"section",
"=",
"null",
")",
"{",
"global",
"$",
"PAGE",
";",
"// Prepare array of required YUI modules. I... | Includes JavaScript for the main system and all plugins.
@param \stdClass $course Course object
@param \cm_info $cm Course-module currently being edited (null if none)
@param \section_info $section Section currently being edited (null if none) | [
"Includes",
"JavaScript",
"for",
"the",
"main",
"system",
"and",
"all",
"plugins",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/frontend.php#L102-L156 |
213,680 | moodle/moodle | availability/classes/frontend.php | frontend.report_validation_errors | public static function report_validation_errors(array $data, array &$errors) {
// Empty value is allowed!
if ($data['availabilityconditionsjson'] === '') {
return;
}
// Decode value.
$decoded = json_decode($data['availabilityconditionsjson']);
if (!$decoded) ... | php | public static function report_validation_errors(array $data, array &$errors) {
// Empty value is allowed!
if ($data['availabilityconditionsjson'] === '') {
return;
}
// Decode value.
$decoded = json_decode($data['availabilityconditionsjson']);
if (!$decoded) ... | [
"public",
"static",
"function",
"report_validation_errors",
"(",
"array",
"$",
"data",
",",
"array",
"&",
"$",
"errors",
")",
"{",
"// Empty value is allowed!",
"if",
"(",
"$",
"data",
"[",
"'availabilityconditionsjson'",
"]",
"===",
"''",
")",
"{",
"return",
... | For use within forms, reports any validation errors from the availability
field.
@param array $data Form data fields
@param array $errors Error array | [
"For",
"use",
"within",
"forms",
"reports",
"any",
"validation",
"errors",
"from",
"the",
"availability",
"field",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/frontend.php#L165-L188 |
213,681 | moodle/moodle | availability/classes/frontend.php | frontend.convert_associative_array_for_js | protected static function convert_associative_array_for_js(array $inarray,
$keyname, $valuename) {
$result = array();
foreach ($inarray as $key => $value) {
$result[] = (object)array($keyname => $key, $valuename => $value);
}
return $result;
} | php | protected static function convert_associative_array_for_js(array $inarray,
$keyname, $valuename) {
$result = array();
foreach ($inarray as $key => $value) {
$result[] = (object)array($keyname => $key, $valuename => $value);
}
return $result;
} | [
"protected",
"static",
"function",
"convert_associative_array_for_js",
"(",
"array",
"$",
"inarray",
",",
"$",
"keyname",
",",
"$",
"valuename",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"inarray",
"as",
"$",
"key",
"=>",
... | Converts an associative array into an array of objects with two fields.
This is necessary because JavaScript associative arrays/objects are not
ordered (at least officially according to the language specification).
@param array $inarray Associative array key => value
@param string $keyname Name to use for key in resu... | [
"Converts",
"an",
"associative",
"array",
"into",
"an",
"array",
"of",
"objects",
"with",
"two",
"fields",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/frontend.php#L201-L208 |
213,682 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.combine_pdfs | public function combine_pdfs($pdflist, $outfilename) {
raise_memory_limit(MEMORY_EXTRA);
$olddebug = error_reporting(0);
$this->setPageUnit('pt');
$this->setPrintHeader(false);
$this->setPrintFooter(false);
$this->scale = 72.0 / 100.0;
// Use font supporting the... | php | public function combine_pdfs($pdflist, $outfilename) {
raise_memory_limit(MEMORY_EXTRA);
$olddebug = error_reporting(0);
$this->setPageUnit('pt');
$this->setPrintHeader(false);
$this->setPrintFooter(false);
$this->scale = 72.0 / 100.0;
// Use font supporting the... | [
"public",
"function",
"combine_pdfs",
"(",
"$",
"pdflist",
",",
"$",
"outfilename",
")",
"{",
"raise_memory_limit",
"(",
"MEMORY_EXTRA",
")",
";",
"$",
"olddebug",
"=",
"error_reporting",
"(",
"0",
")",
";",
"$",
"this",
"->",
"setPageUnit",
"(",
"'pt'",
"... | Combine the given PDF files into a single PDF. Optionally add a coversheet and coversheet fields.
@param string[] $pdflist the filenames of the files to combine
@param string $outfilename the filename to write to
@return int the number of pages in the combined PDF | [
"Combine",
"the",
"given",
"PDF",
"files",
"into",
"a",
"single",
"PDF",
".",
"Optionally",
"add",
"a",
"coversheet",
"and",
"coversheet",
"fields",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L98-L125 |
213,683 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.load_pdf | public function load_pdf($filename) {
raise_memory_limit(MEMORY_EXTRA);
$olddebug = error_reporting(0);
$this->setPageUnit('pt');
$this->scale = 72.0 / 100.0;
$this->SetFont($this->get_export_font_name(), '', 16.0 * $this->scale, '', true);
$this->SetFillColor(255, 255, ... | php | public function load_pdf($filename) {
raise_memory_limit(MEMORY_EXTRA);
$olddebug = error_reporting(0);
$this->setPageUnit('pt');
$this->scale = 72.0 / 100.0;
$this->SetFont($this->get_export_font_name(), '', 16.0 * $this->scale, '', true);
$this->SetFillColor(255, 255, ... | [
"public",
"function",
"load_pdf",
"(",
"$",
"filename",
")",
"{",
"raise_memory_limit",
"(",
"MEMORY_EXTRA",
")",
";",
"$",
"olddebug",
"=",
"error_reporting",
"(",
"0",
")",
";",
"$",
"this",
"->",
"setPageUnit",
"(",
"'pt'",
")",
";",
"$",
"this",
"->"... | Load the specified PDF and set the initial output configuration
Used when processing comments and outputting a new PDF
@param string $filename the path to the PDF to load
@return int the number of pages in the PDF | [
"Load",
"the",
"specified",
"PDF",
"and",
"set",
"the",
"initial",
"output",
"configuration",
"Used",
"when",
"processing",
"comments",
"and",
"outputting",
"a",
"new",
"PDF"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L149-L167 |
213,684 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.copy_page | public function copy_page() {
if (!$this->filename) {
return false;
}
if ($this->currentpage>=$this->pagecount) {
return false;
}
$this->currentpage++;
$this->create_page_from_source($this->currentpage);
return true;
} | php | public function copy_page() {
if (!$this->filename) {
return false;
}
if ($this->currentpage>=$this->pagecount) {
return false;
}
$this->currentpage++;
$this->create_page_from_source($this->currentpage);
return true;
} | [
"public",
"function",
"copy_page",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"filename",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"currentpage",
">=",
"$",
"this",
"->",
"pagecount",
")",
"{",
"return",
"false",
... | Copy the next page from the source file and set it as the current page
@return bool true if successful | [
"Copy",
"the",
"next",
"page",
"from",
"the",
"source",
"file",
"and",
"set",
"it",
"as",
"the",
"current",
"page"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L191-L201 |
213,685 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.create_page_from_source | protected function create_page_from_source($pageno) {
// Get the size (and deduce the orientation) of the next page.
$template = $this->importPage($pageno);
$size = $this->getTemplateSize($template);
$orientation = 'P';
if ($size['w'] > $size['h']) {
$orientation = 'L... | php | protected function create_page_from_source($pageno) {
// Get the size (and deduce the orientation) of the next page.
$template = $this->importPage($pageno);
$size = $this->getTemplateSize($template);
$orientation = 'P';
if ($size['w'] > $size['h']) {
$orientation = 'L... | [
"protected",
"function",
"create_page_from_source",
"(",
"$",
"pageno",
")",
"{",
"// Get the size (and deduce the orientation) of the next page.",
"$",
"template",
"=",
"$",
"this",
"->",
"importPage",
"(",
"$",
"pageno",
")",
";",
"$",
"size",
"=",
"$",
"this",
... | Create a page from a source PDF.
@param int $pageno | [
"Create",
"a",
"page",
"from",
"a",
"source",
"PDF",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L208-L222 |
213,686 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.append_comments | public function append_comments($allcomments) {
if (!$this->filename) {
return false;
}
$this->SetFontSize(12 * $this->scale);
$this->SetMargins(100 * $this->scale, 120 * $this->scale, -1, true);
$this->SetAutoPageBreak(true, 100 * $this->scale);
$this->setHe... | php | public function append_comments($allcomments) {
if (!$this->filename) {
return false;
}
$this->SetFontSize(12 * $this->scale);
$this->SetMargins(100 * $this->scale, 120 * $this->scale, -1, true);
$this->SetAutoPageBreak(true, 100 * $this->scale);
$this->setHe... | [
"public",
"function",
"append_comments",
"(",
"$",
"allcomments",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"filename",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"SetFontSize",
"(",
"12",
"*",
"$",
"this",
"->",
"scale",
")",
";",
... | Append all comments to the end of the document.
@param array $allcomments All comments, indexed by page number (starting at 0).
@return array|bool An array of links to comments, or false. | [
"Append",
"all",
"comments",
"to",
"the",
"end",
"of",
"the",
"document",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L240-L277 |
213,687 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.add_comment_marker | public function add_comment_marker($pageno, $index, $x, $y, $link, $colour = 'yellow') {
if (!$this->filename) {
return false;
}
$fill = '';
$fillopacity = 0.9;
switch ($colour) {
case 'red':
$fill = 'rgb(249, 181, 179)';
b... | php | public function add_comment_marker($pageno, $index, $x, $y, $link, $colour = 'yellow') {
if (!$this->filename) {
return false;
}
$fill = '';
$fillopacity = 0.9;
switch ($colour) {
case 'red':
$fill = 'rgb(249, 181, 179)';
b... | [
"public",
"function",
"add_comment_marker",
"(",
"$",
"pageno",
",",
"$",
"index",
",",
"$",
"x",
",",
"$",
"y",
",",
"$",
"link",
",",
"$",
"colour",
"=",
"'yellow'",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"filename",
")",
"{",
"return",
"... | Add a comment marker to the specified page.
@param int $pageno The page number to add markers to (starting at 0).
@param int $index The comment index.
@param int $x The x-coordinate of the marker (in pixels).
@param int $y The y-coordinate of the marker (in pixels).
@param int $link The link identifier pointing to the... | [
"Add",
"a",
"comment",
"marker",
"to",
"the",
"specified",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L290-L335 |
213,688 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.add_comment | public function add_comment($text, $x, $y, $width, $colour = 'yellow') {
if (!$this->filename) {
return false;
}
$this->SetDrawColor(51, 51, 51);
switch ($colour) {
case 'red':
$this->SetFillColor(249, 181, 179);
break;
... | php | public function add_comment($text, $x, $y, $width, $colour = 'yellow') {
if (!$this->filename) {
return false;
}
$this->SetDrawColor(51, 51, 51);
switch ($colour) {
case 'red':
$this->SetFillColor(249, 181, 179);
break;
... | [
"public",
"function",
"add_comment",
"(",
"$",
"text",
",",
"$",
"x",
",",
"$",
"y",
",",
"$",
"width",
",",
"$",
"colour",
"=",
"'yellow'",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"filename",
")",
"{",
"return",
"false",
";",
"}",
"$",
"t... | Add a comment to the current page
@param string $text the text of the comment
@param int $x the x-coordinate of the comment (in pixels)
@param int $y the y-coordinate of the comment (in pixels)
@param int $width the width of the comment (in pixels)
@param string $colour optional the background colour of the comment (re... | [
"Add",
"a",
"comment",
"to",
"the",
"current",
"page"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L346-L385 |
213,689 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.get_image | public function get_image($pageno) {
global $CFG;
if (!$this->filename) {
throw new \coding_exception('Attempting to generate a page image without first setting the PDF filename');
}
if (!$this->imagefolder) {
throw new \coding_exception('Attempting to generate ... | php | public function get_image($pageno) {
global $CFG;
if (!$this->filename) {
throw new \coding_exception('Attempting to generate a page image without first setting the PDF filename');
}
if (!$this->imagefolder) {
throw new \coding_exception('Attempting to generate ... | [
"public",
"function",
"get_image",
"(",
"$",
"pageno",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"filename",
")",
"{",
"throw",
"new",
"\\",
"coding_exception",
"(",
"'Attempting to generate a page image without first setting the PDF ... | Generate an image of the specified page in the PDF
@param int $pageno the page to generate the image of
@throws \moodle_exception
@throws \coding_exception
@return string the filename of the generated image | [
"Generate",
"an",
"image",
"of",
"the",
"specified",
"page",
"in",
"the",
"PDF"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L540-L588 |
213,690 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.get_error_image | public static function get_error_image($errorimagefolder, $pageno) {
global $CFG;
$errorfile = $CFG->dirroot . self::BLANK_PDF;
if (!file_exists($errorfile)) {
throw new \coding_exception("Blank PDF not found", "File path" . $errorfile);
}
$tmperrorimagefolder = mak... | php | public static function get_error_image($errorimagefolder, $pageno) {
global $CFG;
$errorfile = $CFG->dirroot . self::BLANK_PDF;
if (!file_exists($errorfile)) {
throw new \coding_exception("Blank PDF not found", "File path" . $errorfile);
}
$tmperrorimagefolder = mak... | [
"public",
"static",
"function",
"get_error_image",
"(",
"$",
"errorimagefolder",
",",
"$",
"pageno",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"errorfile",
"=",
"$",
"CFG",
"->",
"dirroot",
".",
"self",
"::",
"BLANK_PDF",
";",
"if",
"(",
"!",
"file_exist... | Generate an localised error image for the given pagenumber.
@param string $errorimagefolder path of the folder where error image needs to be created.
@param int $pageno page number for which error image needs to be created.
@return string File name
@throws \coding_exception | [
"Generate",
"an",
"localised",
"error",
"image",
"for",
"the",
"given",
"pagenumber",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L671-L697 |
213,691 | moodle/moodle | mod/assign/feedback/editpdf/classes/pdf.php | pdf.add_image_page | public function add_image_page($imagestoredfile) {
$imageinfo = $imagestoredfile->get_imageinfo();
$imagecontent = $imagestoredfile->get_content();
$this->currentpage++;
$template = $this->importPage($this->currentpage);
$size = $this->getTemplateSize($template);
if ($im... | php | public function add_image_page($imagestoredfile) {
$imageinfo = $imagestoredfile->get_imageinfo();
$imagecontent = $imagestoredfile->get_content();
$this->currentpage++;
$template = $this->importPage($this->currentpage);
$size = $this->getTemplateSize($template);
if ($im... | [
"public",
"function",
"add_image_page",
"(",
"$",
"imagestoredfile",
")",
"{",
"$",
"imageinfo",
"=",
"$",
"imagestoredfile",
"->",
"get_imageinfo",
"(",
")",
";",
"$",
"imagecontent",
"=",
"$",
"imagestoredfile",
"->",
"get_content",
"(",
")",
";",
"$",
"th... | This function add an image file to PDF page.
@param \stored_file $imagestoredfile Image file to be added | [
"This",
"function",
"add",
"an",
"image",
"file",
"to",
"PDF",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/pdf.php#L778-L812 |
213,692 | moodle/moodle | course/classes/deletecategory_form.php | core_course_deletecategory_form.validation | public function validation($data, $files) {
$errors = parent::validation($data, $files);
if (empty($data['fulldelete']) && empty($data['newparent'])) {
// When they have chosen the move option, they must specify a destination.
$errors['newparent'] = get_string('required');
... | php | public function validation($data, $files) {
$errors = parent::validation($data, $files);
if (empty($data['fulldelete']) && empty($data['newparent'])) {
// When they have chosen the move option, they must specify a destination.
$errors['newparent'] = get_string('required');
... | [
"public",
"function",
"validation",
"(",
"$",
"data",
",",
"$",
"files",
")",
"{",
"$",
"errors",
"=",
"parent",
"::",
"validation",
"(",
"$",
"data",
",",
"$",
"files",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"'fulldelete'",
"]",
")",... | Perform some extra moodle validation.
@param array $data
@param array $files
@return array An array of errors. | [
"Perform",
"some",
"extra",
"moodle",
"validation",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/classes/deletecategory_form.php#L129-L141 |
213,693 | moodle/moodle | login/forgot_password_form.php | login_forgot_password_form.definition | function definition() {
global $USER;
$mform = $this->_form;
$mform->setDisableShortforms(true);
$mform->addElement('header', 'searchbyusername', get_string('searchbyusername'), '');
$purpose = user_edit_map_field_purpose($USER->id, 'username');
$mform->addElement('... | php | function definition() {
global $USER;
$mform = $this->_form;
$mform->setDisableShortforms(true);
$mform->addElement('header', 'searchbyusername', get_string('searchbyusername'), '');
$purpose = user_edit_map_field_purpose($USER->id, 'username');
$mform->addElement('... | [
"function",
"definition",
"(",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"mform",
"=",
"$",
"this",
"->",
"_form",
";",
"$",
"mform",
"->",
"setDisableShortforms",
"(",
"true",
")",
";",
"$",
"mform",
"->",
"addElement",
"(",
"'header'",
",",
"'search... | Define the forgot password form. | [
"Define",
"the",
"forgot",
"password",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/login/forgot_password_form.php#L43-L66 |
213,694 | moodle/moodle | login/forgot_password_form.php | login_forgot_password_form.validation | function validation($data, $files) {
$errors = parent::validation($data, $files);
$errors += core_login_validate_forgot_password_data($data);
return $errors;
} | php | function validation($data, $files) {
$errors = parent::validation($data, $files);
$errors += core_login_validate_forgot_password_data($data);
return $errors;
} | [
"function",
"validation",
"(",
"$",
"data",
",",
"$",
"files",
")",
"{",
"$",
"errors",
"=",
"parent",
"::",
"validation",
"(",
"$",
"data",
",",
"$",
"files",
")",
";",
"$",
"errors",
"+=",
"core_login_validate_forgot_password_data",
"(",
"$",
"data",
"... | Validate user input from the forgot password form.
@param array $data array of submitted form fields.
@param array $files submitted with the form.
@return array errors occuring during validation. | [
"Validate",
"user",
"input",
"from",
"the",
"forgot",
"password",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/login/forgot_password_form.php#L74-L80 |
213,695 | moodle/moodle | lib/form/duration.php | MoodleQuickForm_duration.get_units | public function get_units() {
if (is_null($this->_units)) {
$this->_units = array(
604800 => get_string('weeks'),
86400 => get_string('days'),
3600 => get_string('hours'),
60 => get_string('minutes'),
1 => get_string('se... | php | public function get_units() {
if (is_null($this->_units)) {
$this->_units = array(
604800 => get_string('weeks'),
86400 => get_string('days'),
3600 => get_string('hours'),
60 => get_string('minutes'),
1 => get_string('se... | [
"public",
"function",
"get_units",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_units",
")",
")",
"{",
"$",
"this",
"->",
"_units",
"=",
"array",
"(",
"604800",
"=>",
"get_string",
"(",
"'weeks'",
")",
",",
"86400",
"=>",
"get_strin... | Returns time associative array of unit length.
@return array unit length in seconds => string unit name. | [
"Returns",
"time",
"associative",
"array",
"of",
"unit",
"length",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/duration.php#L102-L113 |
213,696 | moodle/moodle | lib/form/duration.php | MoodleQuickForm_duration._createElements | function _createElements() {
$attributes = $this->getAttributes();
if (is_null($attributes)) {
$attributes = array();
}
if (!isset($attributes['size'])) {
$attributes['size'] = 3;
}
$this->_elements = array();
// E_STRICT creating elements ... | php | function _createElements() {
$attributes = $this->getAttributes();
if (is_null($attributes)) {
$attributes = array();
}
if (!isset($attributes['size'])) {
$attributes['size'] = 3;
}
$this->_elements = array();
// E_STRICT creating elements ... | [
"function",
"_createElements",
"(",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"getAttributes",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"attributes",
")",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"}",
"if",
"(",
"!... | Override of standard quickforms method to create this element. | [
"Override",
"of",
"standard",
"quickforms",
"method",
"to",
"create",
"this",
"element",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/duration.php#L137-L161 |
213,697 | moodle/moodle | lib/form/duration.php | MoodleQuickForm_duration.toHtml | function toHtml() {
include_once('HTML/QuickForm/Renderer/Default.php');
$renderer = new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate('{element}');
parent::accept($renderer);
return $renderer->toHtml();
} | php | function toHtml() {
include_once('HTML/QuickForm/Renderer/Default.php');
$renderer = new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate('{element}');
parent::accept($renderer);
return $renderer->toHtml();
} | [
"function",
"toHtml",
"(",
")",
"{",
"include_once",
"(",
"'HTML/QuickForm/Renderer/Default.php'",
")",
";",
"$",
"renderer",
"=",
"new",
"HTML_QuickForm_Renderer_Default",
"(",
")",
";",
"$",
"renderer",
"->",
"setElementTemplate",
"(",
"'{element}'",
")",
";",
"... | Returns HTML for advchecbox form element.
@return string | [
"Returns",
"HTML",
"for",
"advchecbox",
"form",
"element",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/duration.php#L220-L226 |
213,698 | moodle/moodle | lib/form/duration.php | MoodleQuickForm_duration.exportValue | function exportValue(&$submitValues, $notused = false) {
// Get the values from all the child elements.
$valuearray = array();
foreach ($this->_elements as $element) {
$thisexport = $element->exportValue($submitValues[$this->getName()], true);
if (!is_null($thisexport)) {... | php | function exportValue(&$submitValues, $notused = false) {
// Get the values from all the child elements.
$valuearray = array();
foreach ($this->_elements as $element) {
$thisexport = $element->exportValue($submitValues[$this->getName()], true);
if (!is_null($thisexport)) {... | [
"function",
"exportValue",
"(",
"&",
"$",
"submitValues",
",",
"$",
"notused",
"=",
"false",
")",
"{",
"// Get the values from all the child elements.",
"$",
"valuearray",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_elements",
"as",
"$",
... | Output a timestamp. Give it the name of the group.
Override of standard quickforms method.
@param array $submitValues
@param bool $notused Not used.
@return array field name => value. The value is the time interval in seconds. | [
"Output",
"a",
"timestamp",
".",
"Give",
"it",
"the",
"name",
"of",
"the",
"group",
".",
"Override",
"of",
"standard",
"quickforms",
"method",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/duration.php#L247-L265 |
213,699 | moodle/moodle | mod/lesson/pagetypes/essay.php | lesson_page_type_essay.extract_useranswer | static public function extract_useranswer($useranswer) {
$essayinfo = unserialize($useranswer);
if (!isset($essayinfo->responseformat)) {
$essayinfo->response = text_to_html($essayinfo->response, false, false);
$essayinfo->responseformat = FORMAT_HTML;
}
return $e... | php | static public function extract_useranswer($useranswer) {
$essayinfo = unserialize($useranswer);
if (!isset($essayinfo->responseformat)) {
$essayinfo->response = text_to_html($essayinfo->response, false, false);
$essayinfo->responseformat = FORMAT_HTML;
}
return $e... | [
"static",
"public",
"function",
"extract_useranswer",
"(",
"$",
"useranswer",
")",
"{",
"$",
"essayinfo",
"=",
"unserialize",
"(",
"$",
"useranswer",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"essayinfo",
"->",
"responseformat",
")",
")",
"{",
"$",
"e... | Unserialize attempt useranswer and add missing responseformat if needed
for compatibility with old records.
@param string $useranswer serialized object
@return object | [
"Unserialize",
"attempt",
"useranswer",
"and",
"add",
"missing",
"responseformat",
"if",
"needed",
"for",
"compatibility",
"with",
"old",
"records",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/pagetypes/essay.php#L58-L65 |
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.