id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
215,400 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.from_db_records | protected function from_db_records(array $results) {
$entityfactory = $this->get_entity_factory();
return array_map(function(array $result) use ($entityfactory) {
[
'discussion' => $discussion,
'firstpost' => $firstpost,
'firstpostauthor' => $... | php | protected function from_db_records(array $results) {
$entityfactory = $this->get_entity_factory();
return array_map(function(array $result) use ($entityfactory) {
[
'discussion' => $discussion,
'firstpost' => $firstpost,
'firstpostauthor' => $... | [
"protected",
"function",
"from_db_records",
"(",
"array",
"$",
"results",
")",
"{",
"$",
"entityfactory",
"=",
"$",
"this",
"->",
"get_entity_factory",
"(",
")",
";",
"return",
"array_map",
"(",
"function",
"(",
"array",
"$",
"result",
")",
"use",
"(",
"$"... | Convert the DB records into discussion list entities.
@param array $results The DB records
@return discussion_list[] | [
"Convert",
"the",
"DB",
"records",
"into",
"discussion",
"list",
"entities",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L203-L220 |
215,401 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.get_keyfield | protected function get_keyfield(?int $sortmethod) : string {
switch ($sortmethod) {
case self::SORTORDER_CREATED_DESC:
case self::SORTORDER_CREATED_ASC:
return 'fp.created';
case self::SORTORDER_REPLIES_DESC:
case self::SORTORDER_REPLIES_ASC:
... | php | protected function get_keyfield(?int $sortmethod) : string {
switch ($sortmethod) {
case self::SORTORDER_CREATED_DESC:
case self::SORTORDER_CREATED_ASC:
return 'fp.created';
case self::SORTORDER_REPLIES_DESC:
case self::SORTORDER_REPLIES_ASC:
... | [
"protected",
"function",
"get_keyfield",
"(",
"?",
"int",
"$",
"sortmethod",
")",
":",
"string",
"{",
"switch",
"(",
"$",
"sortmethod",
")",
"{",
"case",
"self",
"::",
"SORTORDER_CREATED_DESC",
":",
"case",
"self",
"::",
"SORTORDER_CREATED_ASC",
":",
"return",... | Get the field to sort by.
@param int|null $sortmethod
@return string | [
"Get",
"the",
"field",
"to",
"sort",
"by",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L228-L245 |
215,402 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.get_sort_direction | protected function get_sort_direction(?int $sortmethod) : string {
switch ($sortmethod) {
case self::SORTORDER_LASTPOST_ASC:
case self::SORTORDER_CREATED_ASC:
case self::SORTORDER_REPLIES_ASC:
return "ASC";
case self::SORTORDER_LASTPOST_DESC:
... | php | protected function get_sort_direction(?int $sortmethod) : string {
switch ($sortmethod) {
case self::SORTORDER_LASTPOST_ASC:
case self::SORTORDER_CREATED_ASC:
case self::SORTORDER_REPLIES_ASC:
return "ASC";
case self::SORTORDER_LASTPOST_DESC:
... | [
"protected",
"function",
"get_sort_direction",
"(",
"?",
"int",
"$",
"sortmethod",
")",
":",
"string",
"{",
"switch",
"(",
"$",
"sortmethod",
")",
"{",
"case",
"self",
"::",
"SORTORDER_LASTPOST_ASC",
":",
"case",
"self",
"::",
"SORTORDER_CREATED_ASC",
":",
"ca... | Get the sort direction.
@param int|null $sortmethod
@return string | [
"Get",
"the",
"sort",
"direction",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L253-L266 |
215,403 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.get_sort_order | private function get_sort_order(?int $sortmethod, bool $includefavourites = true) : string {
$alias = $this->get_table_alias();
// TODO consider user favourites...
$keyfield = $this->get_keyfield($sortmethod);
$direction = $this->get_sort_direction($sortmethod);
$favouritesort ... | php | private function get_sort_order(?int $sortmethod, bool $includefavourites = true) : string {
$alias = $this->get_table_alias();
// TODO consider user favourites...
$keyfield = $this->get_keyfield($sortmethod);
$direction = $this->get_sort_direction($sortmethod);
$favouritesort ... | [
"private",
"function",
"get_sort_order",
"(",
"?",
"int",
"$",
"sortmethod",
",",
"bool",
"$",
"includefavourites",
"=",
"true",
")",
":",
"string",
"{",
"$",
"alias",
"=",
"$",
"this",
"->",
"get_table_alias",
"(",
")",
";",
"// TODO consider user favourites.... | Get the sort order SQL for a sort method.
@param int|null $sortmethod
@param bool|null $includefavourites
@return string | [
"Get",
"the",
"sort",
"order",
"SQL",
"for",
"a",
"sort",
"method",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L275-L297 |
215,404 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.get_hidden_post_sql | protected function get_hidden_post_sql(bool $includehiddendiscussions, ?int $includepostsforuser) {
$wheresql = '';
$params = [];
if (!$includehiddendiscussions) {
$now = time();
$wheresql = " AND ((d.timestart <= :timestart AND (d.timeend = 0 OR d.timeend > :timeend))";
... | php | protected function get_hidden_post_sql(bool $includehiddendiscussions, ?int $includepostsforuser) {
$wheresql = '';
$params = [];
if (!$includehiddendiscussions) {
$now = time();
$wheresql = " AND ((d.timestart <= :timestart AND (d.timeend = 0 OR d.timeend > :timeend))";
... | [
"protected",
"function",
"get_hidden_post_sql",
"(",
"bool",
"$",
"includehiddendiscussions",
",",
"?",
"int",
"$",
"includepostsforuser",
")",
"{",
"$",
"wheresql",
"=",
"''",
";",
"$",
"params",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"includehiddendiscus... | Fetch any required SQL to respect timed posts.
@param bool $includehiddendiscussions Whether to include hidden discussions or not
@param int|null $includepostsforuser Which user to include posts for, if any
@return array The SQL and parameters to include | [
"Fetch",
"any",
"required",
"SQL",
"to",
"respect",
"timed",
"posts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L306-L325 |
215,405 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.get_from_forum_id | public function get_from_forum_id(
int $forumid,
bool $includehiddendiscussions,
?int $includepostsforuser,
?int $sortorder,
int $limit,
int $offset
) {
$alias = $this->get_table_alias();
$wheresql = "{$alias}.forum = :forumid";
[
'... | php | public function get_from_forum_id(
int $forumid,
bool $includehiddendiscussions,
?int $includepostsforuser,
?int $sortorder,
int $limit,
int $offset
) {
$alias = $this->get_table_alias();
$wheresql = "{$alias}.forum = :forumid";
[
'... | [
"public",
"function",
"get_from_forum_id",
"(",
"int",
"$",
"forumid",
",",
"bool",
"$",
"includehiddendiscussions",
",",
"?",
"int",
"$",
"includepostsforuser",
",",
"?",
"int",
"$",
"sortorder",
",",
"int",
"$",
"limit",
",",
"int",
"$",
"offset",
")",
"... | Get each discussion, first post, first and last post author for the given forum, considering timed posts, and
pagination.
@param int $forumid The forum to fetch the discussion set for
@param bool $includehiddendiscussions Whether to include hidden discussions or not
@param int|null $includepost... | [
"Get",
"each",
"discussion",
"first",
"post",
"first",
"and",
"last",
"post",
"author",
"for",
"the",
"given",
"forum",
"considering",
"timed",
"posts",
"and",
"pagination",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L339-L365 |
215,406 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.get_from_forum_id_and_group_id | public function get_from_forum_id_and_group_id(
int $forumid,
array $groupids,
bool $includehiddendiscussions,
?int $includepostsforuser,
?int $sortorder,
int $limit,
int $offset
) {
$alias = $this->get_table_alias();
$wheresql = "{$alias}.for... | php | public function get_from_forum_id_and_group_id(
int $forumid,
array $groupids,
bool $includehiddendiscussions,
?int $includepostsforuser,
?int $sortorder,
int $limit,
int $offset
) {
$alias = $this->get_table_alias();
$wheresql = "{$alias}.for... | [
"public",
"function",
"get_from_forum_id_and_group_id",
"(",
"int",
"$",
"forumid",
",",
"array",
"$",
"groupids",
",",
"bool",
"$",
"includehiddendiscussions",
",",
"?",
"int",
"$",
"includepostsforuser",
",",
"?",
"int",
"$",
"sortorder",
",",
"int",
"$",
"l... | Get each discussion, first post, first and last post author for the given forum, and the set of groups to display
considering timed posts, and pagination.
@param int $forumid The forum to fetch the discussion set for
@param int[] $groupids The list of real groups to filter on
@param bool $in... | [
"Get",
"each",
"discussion",
"first",
"post",
"first",
"and",
"last",
"post",
"author",
"for",
"the",
"given",
"forum",
"and",
"the",
"set",
"of",
"groups",
"to",
"display",
"considering",
"timed",
"posts",
"and",
"pagination",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L380-L417 |
215,407 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.get_total_discussion_count_from_forum_id | public function get_total_discussion_count_from_forum_id(
int $forumid,
bool $includehiddendiscussions,
?int $includepostsforuser
) {
$alias = $this->get_table_alias();
$wheresql = "{$alias}.forum = :forumid";
[
'wheresql' => $hiddensql,
'par... | php | public function get_total_discussion_count_from_forum_id(
int $forumid,
bool $includehiddendiscussions,
?int $includepostsforuser
) {
$alias = $this->get_table_alias();
$wheresql = "{$alias}.forum = :forumid";
[
'wheresql' => $hiddensql,
'par... | [
"public",
"function",
"get_total_discussion_count_from_forum_id",
"(",
"int",
"$",
"forumid",
",",
"bool",
"$",
"includehiddendiscussions",
",",
"?",
"int",
"$",
"includepostsforuser",
")",
"{",
"$",
"alias",
"=",
"$",
"this",
"->",
"get_table_alias",
"(",
")",
... | Count the number of discussions in the forum.
@param int $forumid Id of the forum to count discussions in
@param bool $includehiddendiscussions Include hidden dicussions in the count?
@param int|null $includepostsforuser Include discussions created by this user in the count
(only works if not including hidden discussi... | [
"Count",
"the",
"number",
"of",
"discussions",
"in",
"the",
"forum",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L428-L448 |
215,408 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.get_total_discussion_count_from_forum_id_and_group_id | public function get_total_discussion_count_from_forum_id_and_group_id(
int $forumid,
array $groupids,
bool $includehiddendiscussions,
?int $includepostsforuser
) {
$alias = $this->get_table_alias();
$wheresql = "{$alias}.forum = :forumid AND ";
$groupparams =... | php | public function get_total_discussion_count_from_forum_id_and_group_id(
int $forumid,
array $groupids,
bool $includehiddendiscussions,
?int $includepostsforuser
) {
$alias = $this->get_table_alias();
$wheresql = "{$alias}.forum = :forumid AND ";
$groupparams =... | [
"public",
"function",
"get_total_discussion_count_from_forum_id_and_group_id",
"(",
"int",
"$",
"forumid",
",",
"array",
"$",
"groupids",
",",
"bool",
"$",
"includehiddendiscussions",
",",
"?",
"int",
"$",
"includepostsforuser",
")",
"{",
"$",
"alias",
"=",
"$",
"... | Count the number of discussions in all groups and the list of groups provided.
@param int $forumid Id of the forum to count discussions in
@param int[] $groupids List of group ids to include in the count (discussions in all groups will always be counted)
@param bool $includehiddendiscussions Include hidden dicussions ... | [
"Count",
"the",
"number",
"of",
"discussions",
"in",
"all",
"groups",
"and",
"the",
"list",
"of",
"groups",
"provided",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L460-L489 |
215,409 | moodle/moodle | mod/forum/classes/local/vaults/discussion_list.php | discussion_list.get_favourite_sql | private function get_favourite_sql(int $userid): array {
$usercontext = \context_user::instance($userid);
$alias = $this->get_table_alias();
$ufservice = \core_favourites\service_factory::get_service_for_user_context($usercontext);
list($favsql, $favparams) = $ufservice->get_join_sql_by... | php | private function get_favourite_sql(int $userid): array {
$usercontext = \context_user::instance($userid);
$alias = $this->get_table_alias();
$ufservice = \core_favourites\service_factory::get_service_for_user_context($usercontext);
list($favsql, $favparams) = $ufservice->get_join_sql_by... | [
"private",
"function",
"get_favourite_sql",
"(",
"int",
"$",
"userid",
")",
":",
"array",
"{",
"$",
"usercontext",
"=",
"\\",
"context_user",
"::",
"instance",
"(",
"$",
"userid",
")",
";",
"$",
"alias",
"=",
"$",
"this",
"->",
"get_table_alias",
"(",
")... | Get the standard favouriting sql.
@param int $userid The ID of the user we are getting the sql for
@return [$sql, $params] An array comprising of the sql and any associated params | [
"Get",
"the",
"standard",
"favouriting",
"sql",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L497-L506 |
215,410 | moodle/moodle | lib/classes/date.php | core_date.get_list_of_timezones | public static function get_list_of_timezones($currentvalue = null, $include99 = false) {
self::init_zones();
// Localise first.
$timezones = array();
foreach (self::$goodzones as $tzkey => $ignored) {
$timezones[$tzkey] = self::get_localised_timezone($tzkey);
}
... | php | public static function get_list_of_timezones($currentvalue = null, $include99 = false) {
self::init_zones();
// Localise first.
$timezones = array();
foreach (self::$goodzones as $tzkey => $ignored) {
$timezones[$tzkey] = self::get_localised_timezone($tzkey);
}
... | [
"public",
"static",
"function",
"get_list_of_timezones",
"(",
"$",
"currentvalue",
"=",
"null",
",",
"$",
"include99",
"=",
"false",
")",
"{",
"self",
"::",
"init_zones",
"(",
")",
";",
"// Localise first.",
"$",
"timezones",
"=",
"array",
"(",
")",
";",
"... | Returns a localised list of timezones.
@param string $currentvalue
@param bool $include99 should the server timezone info be included?
@return array | [
"Returns",
"a",
"localised",
"list",
"of",
"timezones",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/date.php#L54-L88 |
215,411 | moodle/moodle | lib/classes/date.php | core_date.get_localised_timezone | public static function get_localised_timezone($tz) {
if ($tz == 99) {
$tz = self::get_server_timezone();
$tz = self::get_localised_timezone($tz);
return get_string('timezoneserver', 'core_admin', $tz);
}
if (get_string_manager()->string_exists(strtolower($tz)... | php | public static function get_localised_timezone($tz) {
if ($tz == 99) {
$tz = self::get_server_timezone();
$tz = self::get_localised_timezone($tz);
return get_string('timezoneserver', 'core_admin', $tz);
}
if (get_string_manager()->string_exists(strtolower($tz)... | [
"public",
"static",
"function",
"get_localised_timezone",
"(",
"$",
"tz",
")",
"{",
"if",
"(",
"$",
"tz",
"==",
"99",
")",
"{",
"$",
"tz",
"=",
"self",
"::",
"get_server_timezone",
"(",
")",
";",
"$",
"tz",
"=",
"self",
"::",
"get_localised_timezone",
... | Returns localised timezone name.
@param string $tz
@return string | [
"Returns",
"localised",
"timezone",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/date.php#L95-L112 |
215,412 | moodle/moodle | lib/classes/date.php | core_date.get_server_timezone | public static function get_server_timezone() {
global $CFG;
if (!isset($CFG->timezone) or $CFG->timezone == 99 or $CFG->timezone === '') {
return self::get_default_php_timezone();
}
return self::normalise_timezone($CFG->timezone);
} | php | public static function get_server_timezone() {
global $CFG;
if (!isset($CFG->timezone) or $CFG->timezone == 99 or $CFG->timezone === '') {
return self::get_default_php_timezone();
}
return self::normalise_timezone($CFG->timezone);
} | [
"public",
"static",
"function",
"get_server_timezone",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"CFG",
"->",
"timezone",
")",
"or",
"$",
"CFG",
"->",
"timezone",
"==",
"99",
"or",
"$",
"CFG",
"->",
"timezone",
"===... | Returns server timezone.
@return string normalised timezone name compatible with PHP | [
"Returns",
"server",
"timezone",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/date.php#L170-L178 |
215,413 | moodle/moodle | lib/classes/date.php | core_date.get_user_timezone | public static function get_user_timezone($userorforcedtz = null) {
global $USER, $CFG;
if ($userorforcedtz instanceof DateTimeZone) {
return $userorforcedtz->getName();
}
if (isset($userorforcedtz) and !is_object($userorforcedtz) and $userorforcedtz != 99) {
// ... | php | public static function get_user_timezone($userorforcedtz = null) {
global $USER, $CFG;
if ($userorforcedtz instanceof DateTimeZone) {
return $userorforcedtz->getName();
}
if (isset($userorforcedtz) and !is_object($userorforcedtz) and $userorforcedtz != 99) {
// ... | [
"public",
"static",
"function",
"get_user_timezone",
"(",
"$",
"userorforcedtz",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"CFG",
";",
"if",
"(",
"$",
"userorforcedtz",
"instanceof",
"DateTimeZone",
")",
"{",
"return",
"$",
"userorforcedtz",
"-... | Returns user timezone.
Ideally the parameter should be a real user record,
unfortunately the legacy code is using 99 for both server
and default value.
Example of using legacy API:
// Date for other user via legacy API.
$datestr = userdate($time, core_date::get_user_timezone($user));
The coding style rules in Moodle... | [
"Returns",
"user",
"timezone",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/date.php#L237-L273 |
215,414 | moodle/moodle | grade/report/singleview/classes/local/screen/user.php | user.options | public function options() {
$result = array();
foreach ($this->items as $itemid => $item) {
$result[$itemid] = $item->get_name();
}
return $result;
} | php | public function options() {
$result = array();
foreach ($this->items as $itemid => $item) {
$result[$itemid] = $item->get_name();
}
return $result;
} | [
"public",
"function",
"options",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"itemid",
"=>",
"$",
"item",
")",
"{",
"$",
"result",
"[",
"$",
"itemid",
"]",
"=",
"$",
"item",
... | Convert the list of items to a list of options.
@return array | [
"Convert",
"the",
"list",
"of",
"items",
"to",
"a",
"list",
"of",
"options",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/screen/user.php#L77-L83 |
215,415 | moodle/moodle | grade/report/singleview/classes/local/screen/user.php | user.init | public function init($selfitemisempty = false) {
global $DB;
if (!$selfitemisempty) {
$validusers = $this->load_users();
if (!isset($validusers[$this->itemid])) {
// If the passed user id is not valid, show the first user from the list instead.
$t... | php | public function init($selfitemisempty = false) {
global $DB;
if (!$selfitemisempty) {
$validusers = $this->load_users();
if (!isset($validusers[$this->itemid])) {
// If the passed user id is not valid, show the first user from the list instead.
$t... | [
"public",
"function",
"init",
"(",
"$",
"selfitemisempty",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"$",
"selfitemisempty",
")",
"{",
"$",
"validusers",
"=",
"$",
"this",
"->",
"load_users",
"(",
")",
";",
"if",
"(",
"!",
"... | Init the screen
@param bool $selfitemisempty Have we selected an item yet? | [
"Init",
"the",
"screen"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/screen/user.php#L99-L132 |
215,416 | moodle/moodle | grade/report/singleview/classes/local/screen/user.php | user.original_headers | public function original_headers() {
return array(
'', // For filter icon.
get_string('assessmentname', 'gradereport_singleview'),
get_string('gradecategory', 'grades'),
get_string('range', 'grades'),
get_string('grade', 'grades'),
get_stri... | php | public function original_headers() {
return array(
'', // For filter icon.
get_string('assessmentname', 'gradereport_singleview'),
get_string('gradecategory', 'grades'),
get_string('range', 'grades'),
get_string('grade', 'grades'),
get_stri... | [
"public",
"function",
"original_headers",
"(",
")",
"{",
"return",
"array",
"(",
"''",
",",
"// For filter icon.",
"get_string",
"(",
"'assessmentname'",
",",
"'gradereport_singleview'",
")",
",",
"get_string",
"(",
"'gradecategory'",
",",
"'grades'",
")",
",",
"g... | Get the list of headers for the table.
@return array List of headers | [
"Get",
"the",
"list",
"of",
"headers",
"for",
"the",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/screen/user.php#L139-L150 |
215,417 | moodle/moodle | grade/report/singleview/classes/local/screen/user.php | user.format_line | public function format_line($item) {
global $OUTPUT;
$grade = $this->fetch_grade_or_default($item, $this->item->id);
$lockicon = '';
$lockeditem = $lockeditemgrade = 0;
if (!empty($grade->locked)) {
$lockeditem = 1;
}
if (!empty($grade->grade_item->l... | php | public function format_line($item) {
global $OUTPUT;
$grade = $this->fetch_grade_or_default($item, $this->item->id);
$lockicon = '';
$lockeditem = $lockeditemgrade = 0;
if (!empty($grade->locked)) {
$lockeditem = 1;
}
if (!empty($grade->grade_item->l... | [
"public",
"function",
"format_line",
"(",
"$",
"item",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"grade",
"=",
"$",
"this",
"->",
"fetch_grade_or_default",
"(",
"$",
"item",
",",
"$",
"this",
"->",
"item",
"->",
"id",
")",
";",
"$",
"lockicon",
"=... | Format each row of the table.
@param grade_item $item
@return string | [
"Format",
"each",
"row",
"of",
"the",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/screen/user.php#L158-L221 |
215,418 | moodle/moodle | grade/report/singleview/classes/local/screen/user.php | user.category | private function category($item) {
global $DB;
if (empty($item->categoryid)) {
if ($item->itemtype == 'course') {
return $this->course->fullname;
}
$params = array('id' => $item->iteminstance);
$elem = $DB->get_record('grade_categories',... | php | private function category($item) {
global $DB;
if (empty($item->categoryid)) {
if ($item->itemtype == 'course') {
return $this->course->fullname;
}
$params = array('id' => $item->iteminstance);
$elem = $DB->get_record('grade_categories',... | [
"private",
"function",
"category",
"(",
"$",
"item",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"empty",
"(",
"$",
"item",
"->",
"categoryid",
")",
")",
"{",
"if",
"(",
"$",
"item",
"->",
"itemtype",
"==",
"'course'",
")",
"{",
"return",
"$",
... | Helper to get the category for an item.
@param grade_item $item
@return grade_category | [
"Helper",
"to",
"get",
"the",
"category",
"for",
"an",
"item",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/screen/user.php#L240-L262 |
215,419 | moodle/moodle | grade/report/singleview/classes/local/screen/user.php | user.process | public function process($data) {
$bulk = new bulk_insert($this->item);
// Bulk insert messages the data to be passed in
// ie: for all grades of empty grades apply the specified value.
if ($bulk->is_applied($data)) {
$filter = $bulk->get_type($data);
$insertvalue ... | php | public function process($data) {
$bulk = new bulk_insert($this->item);
// Bulk insert messages the data to be passed in
// ie: for all grades of empty grades apply the specified value.
if ($bulk->is_applied($data)) {
$filter = $bulk->get_type($data);
$insertvalue ... | [
"public",
"function",
"process",
"(",
"$",
"data",
")",
"{",
"$",
"bulk",
"=",
"new",
"bulk_insert",
"(",
"$",
"this",
"->",
"item",
")",
";",
"// Bulk insert messages the data to be passed in",
"// ie: for all grades of empty grades apply the specified value.",
"if",
"... | Process the data from the form.
@param array $data
@return array of warnings | [
"Process",
"the",
"data",
"from",
"the",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/screen/user.php#L322-L389 |
215,420 | moodle/moodle | mod/quiz/backup/moodle2/backup_quiz_activity_task.class.php | backup_quiz_activity_task.define_my_steps | protected function define_my_steps() {
// Generate the quiz.xml file containing all the quiz information
// and annotating used questions.
$this->add_step(new backup_quiz_activity_structure_step('quiz_structure', 'quiz.xml'));
// Note: Following steps must be present
// in all ... | php | protected function define_my_steps() {
// Generate the quiz.xml file containing all the quiz information
// and annotating used questions.
$this->add_step(new backup_quiz_activity_structure_step('quiz_structure', 'quiz.xml'));
// Note: Following steps must be present
// in all ... | [
"protected",
"function",
"define_my_steps",
"(",
")",
"{",
"// Generate the quiz.xml file containing all the quiz information",
"// and annotating used questions.",
"$",
"this",
"->",
"add_step",
"(",
"new",
"backup_quiz_activity_structure_step",
"(",
"'quiz_structure'",
",",
"'q... | Defines backup steps to store the instance data and required questions | [
"Defines",
"backup",
"steps",
"to",
"store",
"the",
"instance",
"data",
"and",
"required",
"questions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/backup/moodle2/backup_quiz_activity_task.class.php#L47-L65 |
215,421 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.bulkWrite | public function bulkWrite(array $operations, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new BulkWrite($this->databaseName, $this->collectionName, $operations, $options);
$server = $this-... | php | public function bulkWrite(array $operations, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new BulkWrite($this->databaseName, $this->collectionName, $operations, $options);
$server = $this-... | [
"public",
"function",
"bulkWrite",
"(",
"array",
"$",
"operations",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'writeConcern'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'writeConcern'",
... | Executes multiple write operations.
@see BulkWrite::__construct() for supported options
@param array[] $operations List of write operations
@param array $options Command options
@return BulkWriteResult
@throws UnsupportedException if options are not supported by the selected server
@throws InvalidArgumentExceptio... | [
"Executes",
"multiple",
"write",
"operations",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L237-L247 |
215,422 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.createIndex | public function createIndex($key, array $options = [])
{
$commandOptionKeys = ['maxTimeMS' => 1, 'session' => 1, 'writeConcern' => 1];
$indexOptions = array_diff_key($options, $commandOptionKeys);
$commandOptions = array_intersect_key($options, $commandOptionKeys);
return current($t... | php | public function createIndex($key, array $options = [])
{
$commandOptionKeys = ['maxTimeMS' => 1, 'session' => 1, 'writeConcern' => 1];
$indexOptions = array_diff_key($options, $commandOptionKeys);
$commandOptions = array_intersect_key($options, $commandOptionKeys);
return current($t... | [
"public",
"function",
"createIndex",
"(",
"$",
"key",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"commandOptionKeys",
"=",
"[",
"'maxTimeMS'",
"=>",
"1",
",",
"'session'",
"=>",
"1",
",",
"'writeConcern'",
"=>",
"1",
"]",
";",
"$",
"... | Create a single index for the collection.
@see Collection::createIndexes()
@see CreateIndexes::__construct() for supported command options
@param array|object $key Document containing fields mapped to values,
which denote order or an index type
@param array $options Index and command options
@return string ... | [
"Create",
"a",
"single",
"index",
"for",
"the",
"collection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L322-L329 |
215,423 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.createIndexes | public function createIndexes(array $indexes, array $options = [])
{
$server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) {
... | php | public function createIndexes(array $indexes, array $options = [])
{
$server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) {
... | [
"public",
"function",
"createIndexes",
"(",
"array",
"$",
"indexes",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"server",
"=",
"$",
"this",
"->",
"manager",
"->",
"selectServer",
"(",
"new",
"ReadPreference",
"(",
"ReadPreference",
"::",
... | Create one or more indexes for the collection.
Each element in the $indexes array must have a "key" document, which
contains fields mapped to an order or type. Other options may follow.
For example:
$indexes = [
// Create a unique index on the "username" field
[ 'key' => [ 'username' => 1 ], 'unique' => true ],
// Cr... | [
"Create",
"one",
"or",
"more",
"indexes",
"for",
"the",
"collection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L358-L369 |
215,424 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.deleteMany | public function deleteMany($filter, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new DeleteMany($this->databaseName, $this->collectionName, $filter, $options);
$server = $this->manager->se... | php | public function deleteMany($filter, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new DeleteMany($this->databaseName, $this->collectionName, $filter, $options);
$server = $this->manager->se... | [
"public",
"function",
"deleteMany",
"(",
"$",
"filter",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'writeConcern'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'writeConcern'",
"]",
"=",
... | Deletes all documents matching the filter.
@see DeleteMany::__construct() for supported options
@see http://docs.mongodb.org/manual/reference/command/delete/
@param array|object $filter Query by which to delete documents
@param array $options Command options
@return DeleteResult
@throws UnsupportedException if... | [
"Deletes",
"all",
"documents",
"matching",
"the",
"filter",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L383-L393 |
215,425 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.deleteOne | public function deleteOne($filter, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new DeleteOne($this->databaseName, $this->collectionName, $filter, $options);
$server = $this->manager->sele... | php | public function deleteOne($filter, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new DeleteOne($this->databaseName, $this->collectionName, $filter, $options);
$server = $this->manager->sele... | [
"public",
"function",
"deleteOne",
"(",
"$",
"filter",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'writeConcern'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'writeConcern'",
"]",
"=",
... | Deletes at most one document matching the filter.
@see DeleteOne::__construct() for supported options
@see http://docs.mongodb.org/manual/reference/command/delete/
@param array|object $filter Query by which to delete documents
@param array $options Command options
@return DeleteResult
@throws UnsupportedExcept... | [
"Deletes",
"at",
"most",
"one",
"document",
"matching",
"the",
"filter",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L407-L417 |
215,426 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.explain | public function explain(Explainable $explainable, array $options = [])
{
if ( ! isset($options['readPreference'])) {
$options['readPreference'] = $this->readPreference;
}
if ( ! isset($options['typeMap'])) {
$options['typeMap'] = $this->typeMap;
}
$s... | php | public function explain(Explainable $explainable, array $options = [])
{
if ( ! isset($options['readPreference'])) {
$options['readPreference'] = $this->readPreference;
}
if ( ! isset($options['typeMap'])) {
$options['typeMap'] = $this->typeMap;
}
$s... | [
"public",
"function",
"explain",
"(",
"Explainable",
"$",
"explainable",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'readPreference'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'readPrefer... | Explains explainable commands.
@see Explain::__construct() for supported options
@see http://docs.mongodb.org/manual/reference/command/explain/
@param Explainable $explainable Command on which to run explain
@param array $options Additional options
@return array|object
@throws UnsupportedException if expla... | [
"Explains",
"explainable",
"commands",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L577-L592 |
215,427 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.find | public function find($filter = [], array $options = [])
{
if ( ! isset($options['readPreference'])) {
$options['readPreference'] = $this->readPreference;
}
$server = $this->manager->selectServer($options['readPreference']);
if ( ! isset($options['readConcern']) && \Mong... | php | public function find($filter = [], array $options = [])
{
if ( ! isset($options['readPreference'])) {
$options['readPreference'] = $this->readPreference;
}
$server = $this->manager->selectServer($options['readPreference']);
if ( ! isset($options['readConcern']) && \Mong... | [
"public",
"function",
"find",
"(",
"$",
"filter",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'readPreference'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'readPreference... | Finds documents matching the query.
@see Find::__construct() for supported options
@see http://docs.mongodb.org/manual/core/read-operations-introduction/
@param array|object $filter Query by which to filter documents
@param array $options Additional options
@return Cursor
@throws UnsupportedException if option... | [
"Finds",
"documents",
"matching",
"the",
"query",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L606-L625 |
215,428 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.findOneAndReplace | public function findOneAndReplace($filter, $replacement, array $options = [])
{
$server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForFindAndModifyWriteConcern)... | php | public function findOneAndReplace($filter, $replacement, array $options = [])
{
$server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForFindAndModifyWriteConcern)... | [
"public",
"function",
"findOneAndReplace",
"(",
"$",
"filter",
",",
"$",
"replacement",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"server",
"=",
"$",
"this",
"->",
"manager",
"->",
"selectServer",
"(",
"new",
"ReadPreference",
"(",
"Rea... | Finds a single document and replaces it, returning either the original or
the replaced document.
The document to return may be null if no document matched the filter. By
default, the original document is returned. Specify
FindOneAndReplace::RETURN_DOCUMENT_AFTER for the "returnDocument" option
to return the updated do... | [
"Finds",
"a",
"single",
"document",
"and",
"replaces",
"it",
"returning",
"either",
"the",
"original",
"or",
"the",
"replaced",
"document",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L712-L727 |
215,429 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.listIndexes | public function listIndexes(array $options = [])
{
$operation = new ListIndexes($this->databaseName, $this->collectionName, $options);
$server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
return $operation->execute($server);
} | php | public function listIndexes(array $options = [])
{
$operation = new ListIndexes($this->databaseName, $this->collectionName, $options);
$server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
return $operation->execute($server);
} | [
"public",
"function",
"listIndexes",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"operation",
"=",
"new",
"ListIndexes",
"(",
"$",
"this",
"->",
"databaseName",
",",
"$",
"this",
"->",
"collectionName",
",",
"$",
"options",
")",
";",
"$... | Returns information for all indexes for the collection.
@see ListIndexes::__construct() for supported options
@return IndexInfoIterator
@throws InvalidArgumentException for parameter/option parsing errors
@throws DriverRuntimeException for other driver errors (e.g. connection errors) | [
"Returns",
"information",
"for",
"all",
"indexes",
"for",
"the",
"collection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L903-L909 |
215,430 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.replaceOne | public function replaceOne($filter, $replacement, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new ReplaceOne($this->databaseName, $this->collectionName, $filter, $replacement, $options);
... | php | public function replaceOne($filter, $replacement, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new ReplaceOne($this->databaseName, $this->collectionName, $filter, $replacement, $options);
... | [
"public",
"function",
"replaceOne",
"(",
"$",
"filter",
",",
"$",
"replacement",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'writeConcern'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'... | Replaces at most one document matching the filter.
@see ReplaceOne::__construct() for supported options
@see http://docs.mongodb.org/manual/reference/command/update/
@param array|object $filter Query by which to filter documents
@param array|object $replacement Replacement document
@param array $options ... | [
"Replaces",
"at",
"most",
"one",
"document",
"matching",
"the",
"filter",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L974-L984 |
215,431 | moodle/moodle | cache/stores/mongodb/MongoDB/Collection.php | Collection.updateMany | public function updateMany($filter, $update, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new UpdateMany($this->databaseName, $this->collectionName, $filter, $update, $options);
$server = ... | php | public function updateMany($filter, $update, array $options = [])
{
if ( ! isset($options['writeConcern'])) {
$options['writeConcern'] = $this->writeConcern;
}
$operation = new UpdateMany($this->databaseName, $this->collectionName, $filter, $update, $options);
$server = ... | [
"public",
"function",
"updateMany",
"(",
"$",
"filter",
",",
"$",
"update",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'writeConcern'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'write... | Updates all documents matching the filter.
@see UpdateMany::__construct() for supported options
@see http://docs.mongodb.org/manual/reference/command/update/
@param array|object $filter Query by which to filter documents
@param array|object $update Update to apply to the matched documents
@param array $option... | [
"Updates",
"all",
"documents",
"matching",
"the",
"filter",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Collection.php#L999-L1009 |
215,432 | moodle/moodle | lib/ltiprovider/src/ToolProvider/ToolProxy.php | ToolProxy.initialize | public function initialize()
{
$this->id = null;
$this->recordId = null;
$this->toolProxy = null;
$this->created = null;
$this->updated = null;
} | php | public function initialize()
{
$this->id = null;
$this->recordId = null;
$this->toolProxy = null;
$this->created = null;
$this->updated = null;
} | [
"public",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"null",
";",
"$",
"this",
"->",
"recordId",
"=",
"null",
";",
"$",
"this",
"->",
"toolProxy",
"=",
"null",
";",
"$",
"this",
"->",
"created",
"=",
"null",
";",
"$",
... | Initialise the tool proxy. | [
"Initialise",
"the",
"tool",
"proxy",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/ToolProxy.php#L80-L89 |
215,433 | moodle/moodle | lib/ltiprovider/src/ToolProvider/ToolProxy.php | ToolProxy.load | private function load($id)
{
$this->initialize();
$this->id = $id;
$ok = $this->dataConnector->loadToolProxy($this);
if (!$ok) {
$this->enabled = $autoEnable;
}
return $ok;
} | php | private function load($id)
{
$this->initialize();
$this->id = $id;
$ok = $this->dataConnector->loadToolProxy($this);
if (!$ok) {
$this->enabled = $autoEnable;
}
return $ok;
} | [
"private",
"function",
"load",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
")",
";",
"$",
"this",
"->",
"id",
"=",
"$",
"id",
";",
"$",
"ok",
"=",
"$",
"this",
"->",
"dataConnector",
"->",
"loadToolProxy",
"(",
"$",
"this",
")... | Load the tool proxy from the database.
@param string $id The tool proxy id value
@return boolean True if the tool proxy was successfully loaded | [
"Load",
"the",
"tool",
"proxy",
"from",
"the",
"database",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/ToolProxy.php#L180-L192 |
215,434 | moodle/moodle | cache/stores/mongodb/lib.php | cachestore_mongodb.get_supported_features | public static function get_supported_features(array $configuration = array()) {
$supports = self::SUPPORTS_DATA_GUARANTEE + self::DEREFERENCES_OBJECTS;
if (array_key_exists('extendedmode', $configuration) && $configuration['extendedmode']) {
$supports += self::SUPPORTS_MULTIPLE_IDENTIFIERS;
... | php | public static function get_supported_features(array $configuration = array()) {
$supports = self::SUPPORTS_DATA_GUARANTEE + self::DEREFERENCES_OBJECTS;
if (array_key_exists('extendedmode', $configuration) && $configuration['extendedmode']) {
$supports += self::SUPPORTS_MULTIPLE_IDENTIFIERS;
... | [
"public",
"static",
"function",
"get_supported_features",
"(",
"array",
"$",
"configuration",
"=",
"array",
"(",
")",
")",
"{",
"$",
"supports",
"=",
"self",
"::",
"SUPPORTS_DATA_GUARANTEE",
"+",
"self",
"::",
"DEREFERENCES_OBJECTS",
";",
"if",
"(",
"array_key_e... | Returns the supported features.
@param array $configuration
@return int | [
"Returns",
"the",
"supported",
"features",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/lib.php#L169-L175 |
215,435 | moodle/moodle | cache/stores/mongodb/lib.php | cachestore_mongodb.initialise | public function initialise(cache_definition $definition) {
if ($this->is_initialised()) {
throw new coding_exception('This mongodb instance has already been initialised.');
}
$this->database = $this->connection->selectDatabase($this->databasename);
$this->definitionhash = 'm'... | php | public function initialise(cache_definition $definition) {
if ($this->is_initialised()) {
throw new coding_exception('This mongodb instance has already been initialised.');
}
$this->database = $this->connection->selectDatabase($this->databasename);
$this->definitionhash = 'm'... | [
"public",
"function",
"initialise",
"(",
"cache_definition",
"$",
"definition",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_initialised",
"(",
")",
")",
"{",
"throw",
"new",
"coding_exception",
"(",
"'This mongodb instance has already been initialised.'",
")",
";",
... | Initialises the store instance for use.
Once this has been done the cache is all set to be used.
@param cache_definition $definition
@throws coding_exception | [
"Initialises",
"the",
"store",
"instance",
"for",
"use",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/lib.php#L194-L210 |
215,436 | moodle/moodle | cache/stores/mongodb/lib.php | cachestore_mongodb.config_get_configuration_array | public static function config_get_configuration_array($data) {
$return = array(
'server' => $data->server,
'database' => $data->database,
'extendedmode' => (!empty($data->extendedmode))
);
if (!empty($data->username)) {
$return['username'] = $data-... | php | public static function config_get_configuration_array($data) {
$return = array(
'server' => $data->server,
'database' => $data->database,
'extendedmode' => (!empty($data->extendedmode))
);
if (!empty($data->username)) {
$return['username'] = $data-... | [
"public",
"static",
"function",
"config_get_configuration_array",
"(",
"$",
"data",
")",
"{",
"$",
"return",
"=",
"array",
"(",
"'server'",
"=>",
"$",
"data",
"->",
"server",
",",
"'database'",
"=>",
"$",
"data",
"->",
"database",
",",
"'extendedmode'",
"=>"... | Takes the object from the add instance store and creates a configuration array that can be used to initialise an instance.
@param stdClass $data
@return array | [
"Takes",
"the",
"object",
"from",
"the",
"add",
"instance",
"store",
"and",
"creates",
"a",
"configuration",
"array",
"that",
"can",
"be",
"used",
"to",
"initialise",
"an",
"instance",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/lib.php#L420-L443 |
215,437 | moodle/moodle | availability/condition/date/classes/condition.php | condition.get_either_description | protected function get_either_description($not, $standalone) {
$direction = $this->get_logical_direction($not);
$midnight = self::is_midnight($this->time);
$midnighttag = $midnight ? '_date' : '';
$satag = $standalone ? 'short_' : 'full_';
switch ($direction) {
case s... | php | protected function get_either_description($not, $standalone) {
$direction = $this->get_logical_direction($not);
$midnight = self::is_midnight($this->time);
$midnighttag = $midnight ? '_date' : '';
$satag = $standalone ? 'short_' : 'full_';
switch ($direction) {
case s... | [
"protected",
"function",
"get_either_description",
"(",
"$",
"not",
",",
"$",
"standalone",
")",
"{",
"$",
"direction",
"=",
"$",
"this",
"->",
"get_logical_direction",
"(",
"$",
"not",
")",
";",
"$",
"midnight",
"=",
"self",
"::",
"is_midnight",
"(",
"$",... | Shows the description using the different lang strings for the standalone
version or the full one.
@param bool $not True if NOT is in force
@param bool $standalone True to use standalone lang strings | [
"Shows",
"the",
"description",
"using",
"the",
"different",
"lang",
"strings",
"for",
"the",
"standalone",
"version",
"or",
"the",
"full",
"one",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/condition/date/classes/condition.php#L152-L165 |
215,438 | moodle/moodle | availability/condition/date/classes/condition.php | condition.show_time | protected function show_time($time, $dateonly, $until = false) {
// For 'until' dates that are at midnight, e.g. midnight 5 March, it
// is better to word the text as 'until end 4 March'.
$daybefore = false;
if ($until && $dateonly) {
$daybefore = true;
$time = st... | php | protected function show_time($time, $dateonly, $until = false) {
// For 'until' dates that are at midnight, e.g. midnight 5 March, it
// is better to word the text as 'until end 4 March'.
$daybefore = false;
if ($until && $dateonly) {
$daybefore = true;
$time = st... | [
"protected",
"function",
"show_time",
"(",
"$",
"time",
",",
"$",
"dateonly",
",",
"$",
"until",
"=",
"false",
")",
"{",
"// For 'until' dates that are at midnight, e.g. midnight 5 March, it",
"// is better to word the text as 'until end 4 March'.",
"$",
"daybefore",
"=",
"... | Shows a time either as a date or a full date and time, according to
user's timezone.
@param int $time Time
@param bool $dateonly If true, uses date only
@param bool $until If true, and if using date only, shows previous date
@return string Date | [
"Shows",
"a",
"time",
"either",
"as",
"a",
"date",
"or",
"a",
"full",
"date",
"and",
"time",
"according",
"to",
"user",
"s",
"timezone",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/condition/date/classes/condition.php#L204-L214 |
215,439 | moodle/moodle | availability/condition/date/classes/condition.php | condition.update_all_dates | public static function update_all_dates($courseid, $timeshift) {
global $DB;
$modinfo = get_fast_modinfo($courseid);
$anychanged = false;
// Adjust dates from all course modules.
foreach ($modinfo->cms as $cm) {
if (!$cm->availability) {
continue;
... | php | public static function update_all_dates($courseid, $timeshift) {
global $DB;
$modinfo = get_fast_modinfo($courseid);
$anychanged = false;
// Adjust dates from all course modules.
foreach ($modinfo->cms as $cm) {
if (!$cm->availability) {
continue;
... | [
"public",
"static",
"function",
"update_all_dates",
"(",
"$",
"courseid",
",",
"$",
"timeshift",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"modinfo",
"=",
"get_fast_modinfo",
"(",
"$",
"courseid",
")",
";",
"$",
"anychanged",
"=",
"false",
";",
"// Adjust d... | Changes all date restrictions on a course by the specified shift amount.
Used by the course reset feature.
@param int $courseid Course id
@param int $timeshift Offset in seconds | [
"Changes",
"all",
"date",
"restrictions",
"on",
"a",
"course",
"by",
"the",
"specified",
"shift",
"amount",
".",
"Used",
"by",
"the",
"course",
"reset",
"feature",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/condition/date/classes/condition.php#L245-L304 |
215,440 | moodle/moodle | lib/google/src/Google/Service/Webmasters.php | Google_Service_Webmasters_Searchanalytics_Resource.query | public function query($siteUrl, Google_Service_Webmasters_SearchAnalyticsQueryRequest $postBody, $optParams = array())
{
$params = array('siteUrl' => $siteUrl, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
return $this->call('query', array($params), "Google_Service_Webmasters_Searc... | php | public function query($siteUrl, Google_Service_Webmasters_SearchAnalyticsQueryRequest $postBody, $optParams = array())
{
$params = array('siteUrl' => $siteUrl, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
return $this->call('query', array($params), "Google_Service_Webmasters_Searc... | [
"public",
"function",
"query",
"(",
"$",
"siteUrl",
",",
"Google_Service_Webmasters_SearchAnalyticsQueryRequest",
"$",
"postBody",
",",
"$",
"optParams",
"=",
"array",
"(",
")",
")",
"{",
"$",
"params",
"=",
"array",
"(",
"'siteUrl'",
"=>",
"$",
"siteUrl",
","... | Query your data with filters and parameters that you define. Returns zero or
more rows grouped by the row keys that you define. You must define a date
range of one or more days.
When date is one of the group by values, any days without data are omitted
from the result list. If you need to know which days have data, is... | [
"Query",
"your",
"data",
"with",
"filters",
"and",
"parameters",
"that",
"you",
"define",
".",
"Returns",
"zero",
"or",
"more",
"rows",
"grouped",
"by",
"the",
"row",
"keys",
"that",
"you",
"define",
".",
"You",
"must",
"define",
"a",
"date",
"range",
"o... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Service/Webmasters.php#L336-L341 |
215,441 | moodle/moodle | mod/quiz/report/attemptsreport_table.php | quiz_attempts_report_table.col_picture | public function col_picture($attempt) {
global $OUTPUT;
$user = new stdClass();
$additionalfields = explode(',', user_picture::fields());
$user = username_load_fields_from_object($user, $attempt, null, $additionalfields);
$user->id = $attempt->userid;
return $OUTPUT->user... | php | public function col_picture($attempt) {
global $OUTPUT;
$user = new stdClass();
$additionalfields = explode(',', user_picture::fields());
$user = username_load_fields_from_object($user, $attempt, null, $additionalfields);
$user->id = $attempt->userid;
return $OUTPUT->user... | [
"public",
"function",
"col_picture",
"(",
"$",
"attempt",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"user",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"additionalfields",
"=",
"explode",
"(",
"','",
",",
"user_picture",
"::",
"fields",
"(",
")",
")... | Generate the display of the user's picture column.
@param object $attempt the table row being output.
@return string HTML content to go inside the td. | [
"Generate",
"the",
"display",
"of",
"the",
"user",
"s",
"picture",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/attemptsreport_table.php#L123-L130 |
215,442 | moodle/moodle | mod/quiz/report/attemptsreport_table.php | quiz_attempts_report_table.col_fullname | public function col_fullname($attempt) {
$html = parent::col_fullname($attempt);
if ($this->is_downloading() || empty($attempt->attempt)) {
return $html;
}
return $html . html_writer::empty_tag('br') . html_writer::link(
new moodle_url('/mod/quiz/review.php',... | php | public function col_fullname($attempt) {
$html = parent::col_fullname($attempt);
if ($this->is_downloading() || empty($attempt->attempt)) {
return $html;
}
return $html . html_writer::empty_tag('br') . html_writer::link(
new moodle_url('/mod/quiz/review.php',... | [
"public",
"function",
"col_fullname",
"(",
"$",
"attempt",
")",
"{",
"$",
"html",
"=",
"parent",
"::",
"col_fullname",
"(",
"$",
"attempt",
")",
";",
"if",
"(",
"$",
"this",
"->",
"is_downloading",
"(",
")",
"||",
"empty",
"(",
"$",
"attempt",
"->",
... | Generate the display of the user's full name column.
@param object $attempt the table row being output.
@return string HTML content to go inside the td. | [
"Generate",
"the",
"display",
"of",
"the",
"user",
"s",
"full",
"name",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/attemptsreport_table.php#L137-L146 |
215,443 | moodle/moodle | mod/quiz/report/attemptsreport_table.php | quiz_attempts_report_table.col_timefinish | public function col_timefinish($attempt) {
if ($attempt->attempt && $attempt->timefinish) {
return userdate($attempt->timefinish, $this->strtimeformat);
} else {
return '-';
}
} | php | public function col_timefinish($attempt) {
if ($attempt->attempt && $attempt->timefinish) {
return userdate($attempt->timefinish, $this->strtimeformat);
} else {
return '-';
}
} | [
"public",
"function",
"col_timefinish",
"(",
"$",
"attempt",
")",
"{",
"if",
"(",
"$",
"attempt",
"->",
"attempt",
"&&",
"$",
"attempt",
"->",
"timefinish",
")",
"{",
"return",
"userdate",
"(",
"$",
"attempt",
"->",
"timefinish",
",",
"$",
"this",
"->",
... | Generate the display of the finish time column.
@param object $attempt the table row being output.
@return string HTML content to go inside the td. | [
"Generate",
"the",
"display",
"of",
"the",
"finish",
"time",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/attemptsreport_table.php#L179-L185 |
215,444 | moodle/moodle | mod/quiz/report/attemptsreport_table.php | quiz_attempts_report_table.col_feedbacktext | public function col_feedbacktext($attempt) {
if ($attempt->state != quiz_attempt::FINISHED) {
return '-';
}
$feedback = quiz_report_feedback_for_grade(
quiz_rescale_grade($attempt->sumgrades, $this->quiz, false),
$this->quiz->id, $this->context);
... | php | public function col_feedbacktext($attempt) {
if ($attempt->state != quiz_attempt::FINISHED) {
return '-';
}
$feedback = quiz_report_feedback_for_grade(
quiz_rescale_grade($attempt->sumgrades, $this->quiz, false),
$this->quiz->id, $this->context);
... | [
"public",
"function",
"col_feedbacktext",
"(",
"$",
"attempt",
")",
"{",
"if",
"(",
"$",
"attempt",
"->",
"state",
"!=",
"quiz_attempt",
"::",
"FINISHED",
")",
"{",
"return",
"'-'",
";",
"}",
"$",
"feedback",
"=",
"quiz_report_feedback_for_grade",
"(",
"quiz... | Generate the display of the feedback column.
@param object $attempt the table row being output.
@return string HTML content to go inside the td. | [
"Generate",
"the",
"display",
"of",
"the",
"feedback",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/attemptsreport_table.php#L205-L219 |
215,445 | moodle/moodle | mod/quiz/report/attemptsreport_table.php | quiz_attempts_report_table.make_review_link | public function make_review_link($data, $attempt, $slot) {
global $OUTPUT;
$flag = '';
if ($this->is_flagged($attempt->usageid, $slot)) {
$flag = $OUTPUT->pix_icon('i/flagged', get_string('flagged', 'question'),
'moodle', array('class' => 'questionflag'));
... | php | public function make_review_link($data, $attempt, $slot) {
global $OUTPUT;
$flag = '';
if ($this->is_flagged($attempt->usageid, $slot)) {
$flag = $OUTPUT->pix_icon('i/flagged', get_string('flagged', 'question'),
'moodle', array('class' => 'questionflag'));
... | [
"public",
"function",
"make_review_link",
"(",
"$",
"data",
",",
"$",
"attempt",
",",
"$",
"slot",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"flag",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"is_flagged",
"(",
"$",
"attempt",
"->",
"usageid",
... | Make a link to review an individual question in a popup window.
@param string $data HTML fragment. The text to make into the link.
@param object $attempt data for the row of the table being output.
@param int $slot the number used to identify this question within this usage. | [
"Make",
"a",
"link",
"to",
"review",
"an",
"individual",
"question",
"in",
"a",
"popup",
"window",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/attemptsreport_table.php#L236-L265 |
215,446 | moodle/moodle | mod/quiz/report/attemptsreport_table.php | quiz_attempts_report_table.base_sql | public function base_sql(\core\dml\sql_join $allowedstudentsjoins) {
global $DB;
// Please note this uniqueid column is not the same as quiza.uniqueid.
$fields = 'DISTINCT ' . $DB->sql_concat('u.id', "'#'", 'COALESCE(quiza.attempt, 0)') . ' AS uniqueid,';
if ($this->qmsubselect) {
... | php | public function base_sql(\core\dml\sql_join $allowedstudentsjoins) {
global $DB;
// Please note this uniqueid column is not the same as quiza.uniqueid.
$fields = 'DISTINCT ' . $DB->sql_concat('u.id', "'#'", 'COALESCE(quiza.attempt, 0)') . ' AS uniqueid,';
if ($this->qmsubselect) {
... | [
"public",
"function",
"base_sql",
"(",
"\\",
"core",
"\\",
"dml",
"\\",
"sql_join",
"$",
"allowedstudentsjoins",
")",
"{",
"global",
"$",
"DB",
";",
"// Please note this uniqueid column is not the same as quiza.uniqueid.",
"$",
"fields",
"=",
"'DISTINCT '",
".",
"$",
... | Contruct all the parts of the main database query.
@param \core\dml\sql_join $allowedstudentsjoins (joins, wheres, params) defines allowed users for the report.
@return array with 4 elements ($fields, $from, $where, $params) that can be used to
build the actual database query. | [
"Contruct",
"all",
"the",
"parts",
"of",
"the",
"main",
"database",
"query",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/attemptsreport_table.php#L389-L468 |
215,447 | moodle/moodle | mod/quiz/report/attemptsreport_table.php | quiz_attempts_report_table.get_qubaids_condition | protected function get_qubaids_condition() {
if (is_null($this->rawdata)) {
throw new coding_exception(
'Cannot call get_qubaids_condition until the main data has been loaded.');
}
if ($this->is_downloading()) {
// We want usages for all attempts.
... | php | protected function get_qubaids_condition() {
if (is_null($this->rawdata)) {
throw new coding_exception(
'Cannot call get_qubaids_condition until the main data has been loaded.');
}
if ($this->is_downloading()) {
// We want usages for all attempts.
... | [
"protected",
"function",
"get_qubaids_condition",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"rawdata",
")",
")",
"{",
"throw",
"new",
"coding_exception",
"(",
"'Cannot call get_qubaids_condition until the main data has been loaded.'",
")",
";",
"}",... | Get an appropriate qubaid_condition for loading more data about the
attempts we are displaying.
@return qubaid_condition | [
"Get",
"an",
"appropriate",
"qubaid_condition",
"for",
"loading",
"more",
"data",
"about",
"the",
"attempts",
"we",
"are",
"displaying",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/attemptsreport_table.php#L539-L563 |
215,448 | moodle/moodle | mod/scorm/report/basic/classes/privacy/provider.php | provider.get_and_export_user_preference | protected static function get_and_export_user_preference(int $userid, string $userpreference, $transform = false) {
$prefvalue = get_user_preferences($userpreference, null, $userid);
if ($prefvalue !== null) {
if ($transform) {
$transformedvalue = transform::yesno($prefvalue)... | php | protected static function get_and_export_user_preference(int $userid, string $userpreference, $transform = false) {
$prefvalue = get_user_preferences($userpreference, null, $userid);
if ($prefvalue !== null) {
if ($transform) {
$transformedvalue = transform::yesno($prefvalue)... | [
"protected",
"static",
"function",
"get_and_export_user_preference",
"(",
"int",
"$",
"userid",
",",
"string",
"$",
"userpreference",
",",
"$",
"transform",
"=",
"false",
")",
"{",
"$",
"prefvalue",
"=",
"get_user_preferences",
"(",
"$",
"userpreference",
",",
"... | Get and export a user preference.
@param int $userid The userid of the user whose data is to be exported.
@param string $userpreference The user preference to export.
@param boolean $transform If true, transform value to yesno. | [
"Get",
"and",
"export",
"a",
"user",
"preference",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/scorm/report/basic/classes/privacy/provider.php#L76-L91 |
215,449 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/Find.php | Find.createCommandDocument | private function createCommandDocument()
{
$cmd = ['find' => $this->collectionName, 'filter' => (object) $this->filter];
$options = $this->createQueryOptions();
if (empty($options)) {
return $cmd;
}
// maxAwaitTimeMS is a Query level option so should not be con... | php | private function createCommandDocument()
{
$cmd = ['find' => $this->collectionName, 'filter' => (object) $this->filter];
$options = $this->createQueryOptions();
if (empty($options)) {
return $cmd;
}
// maxAwaitTimeMS is a Query level option so should not be con... | [
"private",
"function",
"createCommandDocument",
"(",
")",
"{",
"$",
"cmd",
"=",
"[",
"'find'",
"=>",
"$",
"this",
"->",
"collectionName",
",",
"'filter'",
"=>",
"(",
"object",
")",
"$",
"this",
"->",
"filter",
"]",
";",
"$",
"options",
"=",
"$",
"this"... | Construct a command document for Find | [
"Construct",
"a",
"command",
"document",
"for",
"Find"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/Find.php#L316-L351 |
215,450 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/Find.php | Find.createQueryOptions | private function createQueryOptions()
{
$options = [];
if (isset($this->options['cursorType'])) {
if ($this->options['cursorType'] === self::TAILABLE) {
$options['tailable'] = true;
}
if ($this->options['cursorType'] === self::TAILABLE_AWAIT) {
... | php | private function createQueryOptions()
{
$options = [];
if (isset($this->options['cursorType'])) {
if ($this->options['cursorType'] === self::TAILABLE) {
$options['tailable'] = true;
}
if ($this->options['cursorType'] === self::TAILABLE_AWAIT) {
... | [
"private",
"function",
"createQueryOptions",
"(",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'cursorType'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'cursorType... | Create options for the find query.
Note that these are separate from the options for executing the command,
which are created in createExecuteOptions().
@return array | [
"Create",
"options",
"for",
"the",
"find",
"query",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/Find.php#L382-L415 |
215,451 | moodle/moodle | enrol/guest/lib.php | enrol_guest_plugin.enrol_user | public function enrol_user(stdClass $instance, $userid, $roleid = null, $timestart = 0, $timeend = 0, $status = null, $recovergrades = null) {
// no real enrolments here!
return;
} | php | public function enrol_user(stdClass $instance, $userid, $roleid = null, $timestart = 0, $timeend = 0, $status = null, $recovergrades = null) {
// no real enrolments here!
return;
} | [
"public",
"function",
"enrol_user",
"(",
"stdClass",
"$",
"instance",
",",
"$",
"userid",
",",
"$",
"roleid",
"=",
"null",
",",
"$",
"timestart",
"=",
"0",
",",
"$",
"timeend",
"=",
"0",
",",
"$",
"status",
"=",
"null",
",",
"$",
"recovergrades",
"="... | Enrol a user using a given enrolment instance.
@param stdClass $instance
@param int $userid
@param null $roleid
@param int $timestart
@param int $timeend
@param null $status
@param null $recovergrades | [
"Enrol",
"a",
"user",
"using",
"a",
"given",
"enrolment",
"instance",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/guest/lib.php#L71-L74 |
215,452 | moodle/moodle | enrol/guest/lib.php | enrol_guest_plugin.try_guestaccess | public function try_guestaccess(stdClass $instance) {
global $USER, $CFG;
$allow = false;
if ($instance->password === '') {
$allow = true;
} else if (isset($USER->enrol_guest_passwords[$instance->id])) { // this is a hack, ideally we should not add stuff to $USER...
... | php | public function try_guestaccess(stdClass $instance) {
global $USER, $CFG;
$allow = false;
if ($instance->password === '') {
$allow = true;
} else if (isset($USER->enrol_guest_passwords[$instance->id])) { // this is a hack, ideally we should not add stuff to $USER...
... | [
"public",
"function",
"try_guestaccess",
"(",
"stdClass",
"$",
"instance",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"CFG",
";",
"$",
"allow",
"=",
"false",
";",
"if",
"(",
"$",
"instance",
"->",
"password",
"===",
"''",
")",
"{",
"$",
"allow",
"=",... | Attempt to automatically gain temporary guest access to course,
calling code has to make sure the plugin and instance are active.
@param stdClass $instance course enrol instance
@return bool|int false means no guest access, integer means end of cached time | [
"Attempt",
"to",
"automatically",
"gain",
"temporary",
"guest",
"access",
"to",
"course",
"calling",
"code",
"has",
"to",
"make",
"sure",
"the",
"plugin",
"and",
"instance",
"are",
"active",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/guest/lib.php#L94-L116 |
215,453 | moodle/moodle | lib/spout/src/Spout/Writer/ODS/Writer.php | Writer.openWriter | protected function openWriter()
{
$tempFolder = ($this->tempFolder) ? : sys_get_temp_dir();
$this->book = new Workbook($tempFolder, $this->shouldCreateNewSheetsAutomatically, $this->defaultRowStyle);
$this->book->addNewSheetAndMakeItCurrent();
} | php | protected function openWriter()
{
$tempFolder = ($this->tempFolder) ? : sys_get_temp_dir();
$this->book = new Workbook($tempFolder, $this->shouldCreateNewSheetsAutomatically, $this->defaultRowStyle);
$this->book->addNewSheetAndMakeItCurrent();
} | [
"protected",
"function",
"openWriter",
"(",
")",
"{",
"$",
"tempFolder",
"=",
"(",
"$",
"this",
"->",
"tempFolder",
")",
"?",
":",
"sys_get_temp_dir",
"(",
")",
";",
"$",
"this",
"->",
"book",
"=",
"new",
"Workbook",
"(",
"$",
"tempFolder",
",",
"$",
... | Configures the write and sets the current sheet pointer to a new sheet.
@return void
@throws \Box\Spout\Common\Exception\IOException If unable to open the file for writing | [
"Configures",
"the",
"write",
"and",
"sets",
"the",
"current",
"sheet",
"pointer",
"to",
"a",
"new",
"sheet",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/ODS/Writer.php#L49-L54 |
215,454 | moodle/moodle | lib/spout/src/Spout/Writer/ODS/Writer.php | Writer.addRowToWriter | protected function addRowToWriter(array $dataRow, $style)
{
$this->throwIfBookIsNotAvailable();
$this->book->addRowToCurrentWorksheet($dataRow, $style);
} | php | protected function addRowToWriter(array $dataRow, $style)
{
$this->throwIfBookIsNotAvailable();
$this->book->addRowToCurrentWorksheet($dataRow, $style);
} | [
"protected",
"function",
"addRowToWriter",
"(",
"array",
"$",
"dataRow",
",",
"$",
"style",
")",
"{",
"$",
"this",
"->",
"throwIfBookIsNotAvailable",
"(",
")",
";",
"$",
"this",
"->",
"book",
"->",
"addRowToCurrentWorksheet",
"(",
"$",
"dataRow",
",",
"$",
... | Adds data to the currently opened writer.
If shouldCreateNewSheetsAutomatically option is set to true, it will handle pagination
with the creation of new worksheets if one worksheet has reached its maximum capicity.
@param array $dataRow Array containing data to be written.
Example $dataRow = ['data1', 1234, null, '',... | [
"Adds",
"data",
"to",
"the",
"currently",
"opened",
"writer",
".",
"If",
"shouldCreateNewSheetsAutomatically",
"option",
"is",
"set",
"to",
"true",
"it",
"will",
"handle",
"pagination",
"with",
"the",
"creation",
"of",
"new",
"worksheets",
"if",
"one",
"workshee... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/ODS/Writer.php#L76-L80 |
215,455 | moodle/moodle | lib/ltiprovider/src/ToolProvider/ToolConsumer.php | ToolConsumer.save | public function save()
{
$ok = $this->dataConnector->saveToolConsumer($this);
if ($ok) {
$this->settingsChanged = false;
}
return $ok;
} | php | public function save()
{
$ok = $this->dataConnector->saveToolConsumer($this);
if ($ok) {
$this->settingsChanged = false;
}
return $ok;
} | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"ok",
"=",
"$",
"this",
"->",
"dataConnector",
"->",
"saveToolConsumer",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
"ok",
")",
"{",
"$",
"this",
"->",
"settingsChanged",
"=",
"false",
";",
"}",
"re... | Save the tool consumer to the database.
@return boolean True if the object was successfully saved | [
"Save",
"the",
"tool",
"consumer",
"to",
"the",
"database",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/ToolConsumer.php#L226-L236 |
215,456 | moodle/moodle | lib/ltiprovider/src/ToolProvider/ToolConsumer.php | ToolConsumer.setToolSettings | public function setToolSettings($settings = array())
{
$url = $this->getSetting('custom_system_setting_url');
$service = new Service\ToolSettings($this, $url);
$response = $service->set($settings);
return $response;
} | php | public function setToolSettings($settings = array())
{
$url = $this->getSetting('custom_system_setting_url');
$service = new Service\ToolSettings($this, $url);
$response = $service->set($settings);
return $response;
} | [
"public",
"function",
"setToolSettings",
"(",
"$",
"settings",
"=",
"array",
"(",
")",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getSetting",
"(",
"'custom_system_setting_url'",
")",
";",
"$",
"service",
"=",
"new",
"Service",
"\\",
"ToolSettings",
"(... | Perform a Tool Settings service request.
@param array $settings An associative array of settings (optional, default is none)
@return boolean True if action was successful, otherwise false | [
"Perform",
"a",
"Tool",
"Settings",
"service",
"request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/ToolConsumer.php#L455-L464 |
215,457 | moodle/moodle | lib/ltiprovider/src/ToolProvider/ToolConsumer.php | ToolConsumer.addSignature | public static function addSignature($endpoint, $consumerKey, $consumerSecret, $data, $method = 'POST', $type = null)
{
$params = array();
if (is_array($data)) {
$params = $data;
}
// Check for query parameters which need to be included in the signature
$queryParams = arr... | php | public static function addSignature($endpoint, $consumerKey, $consumerSecret, $data, $method = 'POST', $type = null)
{
$params = array();
if (is_array($data)) {
$params = $data;
}
// Check for query parameters which need to be included in the signature
$queryParams = arr... | [
"public",
"static",
"function",
"addSignature",
"(",
"$",
"endpoint",
",",
"$",
"consumerKey",
",",
"$",
"consumerSecret",
",",
"$",
"data",
",",
"$",
"method",
"=",
"'POST'",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"array",
"(",
... | Add the OAuth signature to an array of message parameters or to a header string.
@return mixed Array of signed message parameters or header string | [
"Add",
"the",
"OAuth",
"signature",
"to",
"an",
"array",
"of",
"message",
"parameters",
"or",
"to",
"a",
"header",
"string",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/ToolConsumer.php#L520-L575 |
215,458 | moodle/moodle | lib/ltiprovider/src/ToolProvider/ToolConsumer.php | ToolConsumer.doServiceRequest | public function doServiceRequest($service, $method, $format, $data)
{
$header = ToolConsumer::addSignature($service->endpoint, $this->getKey(), $this->secret, $data, $method, $format);
// Connect to tool consumer
$http = new HTTPMessage($service->endpoint, $method, $data, $header);
// Parse JSON r... | php | public function doServiceRequest($service, $method, $format, $data)
{
$header = ToolConsumer::addSignature($service->endpoint, $this->getKey(), $this->secret, $data, $method, $format);
// Connect to tool consumer
$http = new HTTPMessage($service->endpoint, $method, $data, $header);
// Parse JSON r... | [
"public",
"function",
"doServiceRequest",
"(",
"$",
"service",
",",
"$",
"method",
",",
"$",
"format",
",",
"$",
"data",
")",
"{",
"$",
"header",
"=",
"ToolConsumer",
"::",
"addSignature",
"(",
"$",
"service",
"->",
"endpoint",
",",
"$",
"this",
"->",
... | Perform a service request
@param object $service Service object to be executed
@param string $method HTTP action
@param string $format Media type
@param mixed $data Array of parameters or body string
@return HTTPMessage HTTP object containing request and response details | [
"Perform",
"a",
"service",
"request"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/ToolConsumer.php#L587-L602 |
215,459 | moodle/moodle | lib/ltiprovider/src/ToolProvider/ToolConsumer.php | ToolConsumer.fromRecordId | public static function fromRecordId($id, $dataConnector)
{
$toolConsumer = new ToolConsumer(null, $dataConnector);
$toolConsumer->initialize();
$toolConsumer->setRecordId($id);
if (!$dataConnector->loadToolConsumer($toolConsumer)) {
$toolConsumer->initialize();
... | php | public static function fromRecordId($id, $dataConnector)
{
$toolConsumer = new ToolConsumer(null, $dataConnector);
$toolConsumer->initialize();
$toolConsumer->setRecordId($id);
if (!$dataConnector->loadToolConsumer($toolConsumer)) {
$toolConsumer->initialize();
... | [
"public",
"static",
"function",
"fromRecordId",
"(",
"$",
"id",
",",
"$",
"dataConnector",
")",
"{",
"$",
"toolConsumer",
"=",
"new",
"ToolConsumer",
"(",
"null",
",",
"$",
"dataConnector",
")",
";",
"$",
"toolConsumer",
"->",
"initialize",
"(",
")",
";",
... | Load the tool consumer from the database by its record ID.
@param string $id The consumer key record ID
@param DataConnector $dataConnector Database connection object
@return object ToolConsumer The tool consumer object | [
"Load",
"the",
"tool",
"consumer",
"from",
"the",
"database",
"by",
"its",
"record",
"ID",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/ToolConsumer.php#L612-L625 |
215,460 | moodle/moodle | lib/mustache/src/Mustache/Loader/ArrayLoader.php | Mustache_Loader_ArrayLoader.load | public function load($name)
{
if (!isset($this->templates[$name])) {
throw new Mustache_Exception_UnknownTemplateException($name);
}
return $this->templates[$name];
} | php | public function load($name)
{
if (!isset($this->templates[$name])) {
throw new Mustache_Exception_UnknownTemplateException($name);
}
return $this->templates[$name];
} | [
"public",
"function",
"load",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"templates",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"Mustache_Exception_UnknownTemplateException",
"(",
"$",
"name",
")",
";",
"}"... | Load a Template.
@throws Mustache_Exception_UnknownTemplateException If a template file is not found
@param string $name
@return string Mustache Template source | [
"Load",
"a",
"Template",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/Loader/ArrayLoader.php#L50-L57 |
215,461 | moodle/moodle | grade/report/singleview/classes/local/ui/finalgrade.php | finalgrade.get_value | public function get_value() {
$this->label = $this->grade->grade_item->itemname;
$val = $this->grade->finalgrade;
if ($this->grade->grade_item->scaleid) {
return $val ? (int)$val : -1;
} else {
return $val ? format_float($val, $this->grade->grade_item->get_decima... | php | public function get_value() {
$this->label = $this->grade->grade_item->itemname;
$val = $this->grade->finalgrade;
if ($this->grade->grade_item->scaleid) {
return $val ? (int)$val : -1;
} else {
return $val ? format_float($val, $this->grade->grade_item->get_decima... | [
"public",
"function",
"get_value",
"(",
")",
"{",
"$",
"this",
"->",
"label",
"=",
"$",
"this",
"->",
"grade",
"->",
"grade_item",
"->",
"itemname",
";",
"$",
"val",
"=",
"$",
"this",
"->",
"grade",
"->",
"finalgrade",
";",
"if",
"(",
"$",
"this",
... | Get the value for this input.
@return string The value based on the grade_grade. | [
"Get",
"the",
"value",
"for",
"this",
"input",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/ui/finalgrade.php#L47-L56 |
215,462 | moodle/moodle | grade/report/singleview/classes/local/ui/finalgrade.php | finalgrade.determine_format | public function determine_format() {
if ($this->grade->grade_item->load_scale()) {
$scale = $this->grade->grade_item->load_scale();
$options = array(-1 => get_string('nograde'));
foreach ($scale->scale_items as $i => $name) {
$options[$i + 1] = $name;
... | php | public function determine_format() {
if ($this->grade->grade_item->load_scale()) {
$scale = $this->grade->grade_item->load_scale();
$options = array(-1 => get_string('nograde'));
foreach ($scale->scale_items as $i => $name) {
$options[$i + 1] = $name;
... | [
"public",
"function",
"determine_format",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"grade",
"->",
"grade_item",
"->",
"load_scale",
"(",
")",
")",
"{",
"$",
"scale",
"=",
"$",
"this",
"->",
"grade",
"->",
"grade_item",
"->",
"load_scale",
"(",
")",... | Create the element for this column.
@return element | [
"Create",
"the",
"element",
"for",
"this",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/ui/finalgrade.php#L102-L127 |
215,463 | moodle/moodle | grade/report/singleview/classes/local/ui/finalgrade.php | finalgrade.set | public function set($value) {
global $DB;
$userid = $this->grade->userid;
$gradeitem = $this->grade->grade_item;
$feedback = false;
$feedbackformat = false;
if ($gradeitem->gradetype == GRADE_TYPE_SCALE) {
if ($value == -1) {
$finalgrade = nu... | php | public function set($value) {
global $DB;
$userid = $this->grade->userid;
$gradeitem = $this->grade->grade_item;
$feedback = false;
$feedbackformat = false;
if ($gradeitem->gradetype == GRADE_TYPE_SCALE) {
if ($value == -1) {
$finalgrade = nu... | [
"public",
"function",
"set",
"(",
"$",
"value",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"userid",
"=",
"$",
"this",
"->",
"grade",
"->",
"userid",
";",
"$",
"gradeitem",
"=",
"$",
"this",
"->",
"grade",
"->",
"grade_item",
";",
"$",
"feedback",
"=... | Save the altered value for this field.
@param string $value The new value.
@return string Any error string | [
"Save",
"the",
"altered",
"value",
"for",
"this",
"field",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/ui/finalgrade.php#L135-L179 |
215,464 | moodle/moodle | question/type/numerical/edit_numerical_form.php | qtype_numerical_edit_form.add_unit_options | protected function add_unit_options($mform) {
$mform->addElement('header', 'unithandling',
get_string('unithandling', 'qtype_numerical'));
$unitoptions = array(
qtype_numerical::UNITNONE => get_string('onlynumerical', 'qtype_numerical'),
qtype_numerical::UNI... | php | protected function add_unit_options($mform) {
$mform->addElement('header', 'unithandling',
get_string('unithandling', 'qtype_numerical'));
$unitoptions = array(
qtype_numerical::UNITNONE => get_string('onlynumerical', 'qtype_numerical'),
qtype_numerical::UNI... | [
"protected",
"function",
"add_unit_options",
"(",
"$",
"mform",
")",
"{",
"$",
"mform",
"->",
"addElement",
"(",
"'header'",
",",
"'unithandling'",
",",
"get_string",
"(",
"'unithandling'",
",",
"'qtype_numerical'",
")",
")",
";",
"$",
"unitoptions",
"=",
"arr... | Add the unit handling options to the form.
@param object $mform the form being built. | [
"Add",
"the",
"unit",
"handling",
"options",
"to",
"the",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/numerical/edit_numerical_form.php#L79-L133 |
215,465 | moodle/moodle | question/type/numerical/edit_numerical_form.php | qtype_numerical_edit_form.add_unit_fields | protected function add_unit_fields($mform) {
$mform->addElement('header', 'unithdr',
get_string('units', 'qtype_numerical'), '');
$unitfields = array($mform->createElement('group', 'units',
get_string('unitx', 'qtype_numerical'), $this->unit_group($mform), null, fal... | php | protected function add_unit_fields($mform) {
$mform->addElement('header', 'unithdr',
get_string('units', 'qtype_numerical'), '');
$unitfields = array($mform->createElement('group', 'units',
get_string('unitx', 'qtype_numerical'), $this->unit_group($mform), null, fal... | [
"protected",
"function",
"add_unit_fields",
"(",
"$",
"mform",
")",
"{",
"$",
"mform",
"->",
"addElement",
"(",
"'header'",
",",
"'unithdr'",
",",
"get_string",
"(",
"'units'",
",",
"'qtype_numerical'",
")",
",",
"''",
")",
";",
"$",
"unitfields",
"=",
"ar... | Add the input areas for each unit.
@param object $mform the form being built. | [
"Add",
"the",
"input",
"areas",
"for",
"each",
"unit",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/numerical/edit_numerical_form.php#L139-L176 |
215,466 | moodle/moodle | question/type/numerical/edit_numerical_form.php | qtype_numerical_edit_form.unit_group | protected function unit_group($mform) {
$grouparray = array();
$grouparray[] = $mform->createElement('text', 'unit', get_string('unit', 'qtype_numerical'), array('size'=>10));
$grouparray[] = $mform->createElement('float', 'multiplier',
get_string('multiplier', 'qtype_numerical')... | php | protected function unit_group($mform) {
$grouparray = array();
$grouparray[] = $mform->createElement('text', 'unit', get_string('unit', 'qtype_numerical'), array('size'=>10));
$grouparray[] = $mform->createElement('float', 'multiplier',
get_string('multiplier', 'qtype_numerical')... | [
"protected",
"function",
"unit_group",
"(",
"$",
"mform",
")",
"{",
"$",
"grouparray",
"=",
"array",
"(",
")",
";",
"$",
"grouparray",
"[",
"]",
"=",
"$",
"mform",
"->",
"createElement",
"(",
"'text'",
",",
"'unit'",
",",
"get_string",
"(",
"'unit'",
"... | Get the form fields needed to edit one unit.
@param MoodleQuickForm $mform the form being built.
@return array of form fields. | [
"Get",
"the",
"form",
"fields",
"needed",
"to",
"edit",
"one",
"unit",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/numerical/edit_numerical_form.php#L183-L190 |
215,467 | moodle/moodle | backup/cc/cc_lib/cc_organization.php | cc_organization.add_item | public function add_item(cc_i_item &$item) {
if (is_null($this->itemlist)) {
$this->itemlist = array();
}
$this->itemlist[$item->identifier] = $item;
} | php | public function add_item(cc_i_item &$item) {
if (is_null($this->itemlist)) {
$this->itemlist = array();
}
$this->itemlist[$item->identifier] = $item;
} | [
"public",
"function",
"add_item",
"(",
"cc_i_item",
"&",
"$",
"item",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"itemlist",
")",
")",
"{",
"$",
"this",
"->",
"itemlist",
"=",
"array",
"(",
")",
";",
"}",
"$",
"this",
"->",
"itemlist",... | Add one Item into the Organization
@param cc_i_item $item | [
"Add",
"one",
"Item",
"into",
"the",
"Organization"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/cc/cc_lib/cc_organization.php#L60-L65 |
215,468 | moodle/moodle | backup/cc/cc_lib/cc_organization.php | cc_organization.add_new_item | public function add_new_item($title='') {
$nitem = new cc_item();
$nitem->title = $title;
$this->add_item($nitem);
return $nitem;
} | php | public function add_new_item($title='') {
$nitem = new cc_item();
$nitem->title = $title;
$this->add_item($nitem);
return $nitem;
} | [
"public",
"function",
"add_new_item",
"(",
"$",
"title",
"=",
"''",
")",
"{",
"$",
"nitem",
"=",
"new",
"cc_item",
"(",
")",
";",
"$",
"nitem",
"->",
"title",
"=",
"$",
"title",
";",
"$",
"this",
"->",
"add_item",
"(",
"$",
"nitem",
")",
";",
"re... | Add new Item into the Organization
@param string $title
@return cc_i_item | [
"Add",
"new",
"Item",
"into",
"the",
"Organization"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/cc/cc_lib/cc_organization.php#L73-L78 |
215,469 | moodle/moodle | backup/cc/cc_lib/cc_organization.php | cc_item.add_child_item | public function add_child_item(cc_i_item &$item) {
if (is_null($this->childitems)) {
$this->childitems = array();
}
$this->childitems[$item->identifier] = $item;
} | php | public function add_child_item(cc_i_item &$item) {
if (is_null($this->childitems)) {
$this->childitems = array();
}
$this->childitems[$item->identifier] = $item;
} | [
"public",
"function",
"add_child_item",
"(",
"cc_i_item",
"&",
"$",
"item",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"childitems",
")",
")",
"{",
"$",
"this",
"->",
"childitems",
"=",
"array",
"(",
")",
";",
"}",
"$",
"this",
"->",
"... | Add one Child Item
@param cc_i_item $item | [
"Add",
"one",
"Child",
"Item"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/cc/cc_lib/cc_organization.php#L201-L206 |
215,470 | moodle/moodle | backup/cc/cc_lib/cc_organization.php | cc_item.add_new_child_item | public function add_new_child_item($title='') {
$sc = new cc_item();
$sc->title = $title;
$this->add_child_item($sc);
return $sc;
} | php | public function add_new_child_item($title='') {
$sc = new cc_item();
$sc->title = $title;
$this->add_child_item($sc);
return $sc;
} | [
"public",
"function",
"add_new_child_item",
"(",
"$",
"title",
"=",
"''",
")",
"{",
"$",
"sc",
"=",
"new",
"cc_item",
"(",
")",
";",
"$",
"sc",
"->",
"title",
"=",
"$",
"title",
";",
"$",
"this",
"->",
"add_child_item",
"(",
"$",
"sc",
")",
";",
... | Add new child Item
@param string $title
@return cc_i_item | [
"Add",
"new",
"child",
"Item"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/cc/cc_lib/cc_organization.php#L215-L220 |
215,471 | moodle/moodle | lib/grade/grade_scale.php | grade_scale.delete | public function delete($source=null) {
global $DB;
// Trigger the scale deleted event.
if (!empty($this->standard)) {
$eventcontext = context_system::instance();
} else {
if (!empty($this->courseid)) {
$eventcontext = context_course::instance($thi... | php | public function delete($source=null) {
global $DB;
// Trigger the scale deleted event.
if (!empty($this->standard)) {
$eventcontext = context_system::instance();
} else {
if (!empty($this->courseid)) {
$eventcontext = context_course::instance($thi... | [
"public",
"function",
"delete",
"(",
"$",
"source",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"// Trigger the scale deleted event.",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"standard",
")",
")",
"{",
"$",
"eventcontext",
"=",
"context_syste... | Deletes this scale from the database.
@param string $source from where was the object deleted (mod/forum, manual, etc.)
@return bool success | [
"Deletes",
"this",
"scale",
"from",
"the",
"database",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_scale.php#L180-L208 |
215,472 | moodle/moodle | lib/grade/grade_scale.php | grade_scale.get_name | public function get_name() {
// Grade scales can be created at site or course context, so set the filter context appropriately.
$context = empty($this->courseid) ? context_system::instance() : context_course::instance($this->courseid);
return format_string($this->name, false, ['context' => $cont... | php | public function get_name() {
// Grade scales can be created at site or course context, so set the filter context appropriately.
$context = empty($this->courseid) ? context_system::instance() : context_course::instance($this->courseid);
return format_string($this->name, false, ['context' => $cont... | [
"public",
"function",
"get_name",
"(",
")",
"{",
"// Grade scales can be created at site or course context, so set the filter context appropriately.",
"$",
"context",
"=",
"empty",
"(",
"$",
"this",
"->",
"courseid",
")",
"?",
"context_system",
"::",
"instance",
"(",
")",... | Returns the most descriptive field for this object. This is a standard method used
when we do not know the exact type of an object.
@return string name | [
"Returns",
"the",
"most",
"descriptive",
"field",
"for",
"this",
"object",
".",
"This",
"is",
"a",
"standard",
"method",
"used",
"when",
"we",
"do",
"not",
"know",
"the",
"exact",
"type",
"of",
"an",
"object",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_scale.php#L216-L220 |
215,473 | moodle/moodle | lib/grade/grade_scale.php | grade_scale.is_used | public function is_used() {
global $DB;
global $CFG;
// count grade items excluding the
$params = array($this->id);
$sql = "SELECT COUNT(id) FROM {grade_items} WHERE scaleid = ? AND outcomeid IS NULL";
if ($DB->count_records_sql($sql, $params)) {
return true;... | php | public function is_used() {
global $DB;
global $CFG;
// count grade items excluding the
$params = array($this->id);
$sql = "SELECT COUNT(id) FROM {grade_items} WHERE scaleid = ? AND outcomeid IS NULL";
if ($DB->count_records_sql($sql, $params)) {
return true;... | [
"public",
"function",
"is_used",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"global",
"$",
"CFG",
";",
"// count grade items excluding the",
"$",
"params",
"=",
"array",
"(",
"$",
"this",
"->",
"id",
")",
";",
"$",
"sql",
"=",
"\"SELECT COUNT(id) FROM {grade_i... | Returns if scale used anywhere - activities, grade items, outcomes, etc.
@return bool | [
"Returns",
"if",
"scale",
"used",
"anywhere",
"-",
"activities",
"grade",
"items",
"outcomes",
"etc",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_scale.php#L340-L373 |
215,474 | moodle/moodle | lib/grade/grade_scale.php | grade_scale.get_description | public function get_description() {
global $CFG;
require_once($CFG->libdir . '/filelib.php');
$systemcontext = context_system::instance();
$options = new stdClass;
$options->noclean = true;
$description = file_rewrite_pluginfile_urls($this->description, 'pluginfile.php',... | php | public function get_description() {
global $CFG;
require_once($CFG->libdir . '/filelib.php');
$systemcontext = context_system::instance();
$options = new stdClass;
$options->noclean = true;
$description = file_rewrite_pluginfile_urls($this->description, 'pluginfile.php',... | [
"public",
"function",
"get_description",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/filelib.php'",
")",
";",
"$",
"systemcontext",
"=",
"context_system",
"::",
"instance",
"(",
")",
";",
"$",
"options... | Returns the formatted grade description with URLs converted
@return string | [
"Returns",
"the",
"formatted",
"grade",
"description",
"with",
"URLs",
"converted"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_scale.php#L380-L389 |
215,475 | moodle/moodle | enrol/mnet/enrol.php | enrol_mnet_mnetservice_enrol.available_courses | public function available_courses() {
global $CFG, $DB;
require_once($CFG->libdir.'/filelib.php');
if (!$client = get_mnet_remote_client()) {
die('Callable via XML-RPC only');
}
// we call our id as 'remoteid' because it will be sent to the peer
// the colum... | php | public function available_courses() {
global $CFG, $DB;
require_once($CFG->libdir.'/filelib.php');
if (!$client = get_mnet_remote_client()) {
die('Callable via XML-RPC only');
}
// we call our id as 'remoteid' because it will be sent to the peer
// the colum... | [
"public",
"function",
"available_courses",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/filelib.php'",
")",
";",
"if",
"(",
"!",
"$",
"client",
"=",
"get_mnet_remote_client",
"(",
")",... | Returns list of courses that we offer to the caller for remote enrolment of their users
Since Moodle 2.0, courses are made available for MNet peers by creating an instance
of enrol_mnet plugin for the course. Hidden courses are not returned. If there are two
instances - one specific for the host and one for 'All hosts... | [
"Returns",
"list",
"of",
"courses",
"that",
"we",
"offer",
"to",
"the",
"caller",
"for",
"remote",
"enrolment",
"of",
"their",
"users"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/mnet/enrol.php#L58-L98 |
215,476 | moodle/moodle | enrol/mnet/enrol.php | enrol_mnet_mnetservice_enrol.enrol_user | public function enrol_user(array $userdata, $courseid) {
global $CFG, $DB;
require_once(__DIR__.'/lib.php');
if (!$client = get_mnet_remote_client()) {
die('Callable via XML-RPC only');
}
if (empty($userdata['username'])) {
throw new mnet_server_exceptio... | php | public function enrol_user(array $userdata, $courseid) {
global $CFG, $DB;
require_once(__DIR__.'/lib.php');
if (!$client = get_mnet_remote_client()) {
die('Callable via XML-RPC only');
}
if (empty($userdata['username'])) {
throw new mnet_server_exceptio... | [
"public",
"function",
"enrol_user",
"(",
"array",
"$",
"userdata",
",",
"$",
"courseid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"__DIR__",
".",
"'/lib.php'",
")",
";",
"if",
"(",
"!",
"$",
"client",
"=",
"get_mnet_rem... | Enrol remote user to our course
If we do not have local record for the remote user in our database,
it gets created here.
@uses mnet_remote_client Callable via XML-RPC only
@param array $userdata user details {@see mnet_fields_to_import()}
@param int $courseid our local course id
@return bool true if the enrolment ha... | [
"Enrol",
"remote",
"user",
"to",
"our",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/mnet/enrol.php#L126-L196 |
215,477 | moodle/moodle | enrol/mnet/enrol.php | enrol_mnet_mnetservice_enrol.unenrol_user | public function unenrol_user($username, $courseid) {
global $CFG, $DB;
if (!$client = get_mnet_remote_client()) {
die('Callable via XML-RPC only');
}
$user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$client->id));
if ($user === false) {
... | php | public function unenrol_user($username, $courseid) {
global $CFG, $DB;
if (!$client = get_mnet_remote_client()) {
die('Callable via XML-RPC only');
}
$user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$client->id));
if ($user === false) {
... | [
"public",
"function",
"unenrol_user",
"(",
"$",
"username",
",",
"$",
"courseid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"if",
"(",
"!",
"$",
"client",
"=",
"get_mnet_remote_client",
"(",
")",
")",
"{",
"die",
"(",
"'Callable via XML-RPC on... | Unenrol remote user from our course
Only users enrolled via enrol_mnet plugin can be unenrolled remotely. If the
remote user is enrolled into the local course via some other enrol plugin
(enrol_manual for example), the remote host can't touch such enrolment. Please
do not report this behaviour as bug, it is a feature ... | [
"Unenrol",
"remote",
"user",
"from",
"our",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/mnet/enrol.php#L211-L289 |
215,478 | moodle/moodle | enrol/mnet/enrol.php | enrol_mnet_mnetservice_enrol.course_enrolments | public function course_enrolments($courseid, $roles=null) {
global $DB, $CFG;
if (!$client = get_mnet_remote_client()) {
die('Callable via XML-RPC only');
}
$sql = "SELECT u.username, r.shortname, r.name, e.enrol, ue.timemodified
FROM {user_enrolments} ue
... | php | public function course_enrolments($courseid, $roles=null) {
global $DB, $CFG;
if (!$client = get_mnet_remote_client()) {
die('Callable via XML-RPC only');
}
$sql = "SELECT u.username, r.shortname, r.name, e.enrol, ue.timemodified
FROM {user_enrolments} ue
... | [
"public",
"function",
"course_enrolments",
"(",
"$",
"courseid",
",",
"$",
"roles",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"CFG",
";",
"if",
"(",
"!",
"$",
"client",
"=",
"get_mnet_remote_client",
"(",
")",
")",
"{",
"die",
"(",
"'Call... | Returns a list of users from the client server who are enrolled in our course
Suitable instance of enrol_mnet must be created in the course. This method will not
return any information about the enrolments in courses that are not available for
remote enrolment, even if their users are enrolled into them via other plug... | [
"Returns",
"a",
"list",
"of",
"users",
"from",
"the",
"client",
"server",
"who",
"are",
"enrolled",
"in",
"our",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/mnet/enrol.php#L314-L356 |
215,479 | moodle/moodle | question/classes/statistics/responses/analysis_for_actual_response.php | analysis_for_actual_response.increment_count | public function increment_count($try = 0) {
$this->totalcount++;
if ($try != 0) {
if ($try > analyser::MAX_TRY_COUNTED) {
$try = analyser::MAX_TRY_COUNTED;
}
if (!isset($this->trycount[$try])) {
$this->trycount[$try] = 0;
}
... | php | public function increment_count($try = 0) {
$this->totalcount++;
if ($try != 0) {
if ($try > analyser::MAX_TRY_COUNTED) {
$try = analyser::MAX_TRY_COUNTED;
}
if (!isset($this->trycount[$try])) {
$this->trycount[$try] = 0;
}
... | [
"public",
"function",
"increment_count",
"(",
"$",
"try",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"totalcount",
"++",
";",
"if",
"(",
"$",
"try",
"!=",
"0",
")",
"{",
"if",
"(",
"$",
"try",
">",
"analyser",
"::",
"MAX_TRY_COUNTED",
")",
"{",
"$",
... | Used to count the occurrences of response sub parts.
@param int $try the try number, or 0 if only keeping one count, not a count for each try. | [
"Used",
"to",
"count",
"the",
"occurrences",
"of",
"response",
"sub",
"parts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/statistics/responses/analysis_for_actual_response.php#L80-L92 |
215,480 | moodle/moodle | question/classes/statistics/responses/analysis_for_actual_response.php | analysis_for_actual_response.set_count | public function set_count($try, $count) {
$this->totalcount = $this->totalcount + $count;
$this->trycount[$try] = $count;
} | php | public function set_count($try, $count) {
$this->totalcount = $this->totalcount + $count;
$this->trycount[$try] = $count;
} | [
"public",
"function",
"set_count",
"(",
"$",
"try",
",",
"$",
"count",
")",
"{",
"$",
"this",
"->",
"totalcount",
"=",
"$",
"this",
"->",
"totalcount",
"+",
"$",
"count",
";",
"$",
"this",
"->",
"trycount",
"[",
"$",
"try",
"]",
"=",
"$",
"count",
... | Used to set the count of occurrences of response sub parts, when loading count from cache.
@param int $try the try number, or 0 if only keeping one count, not a count for each try.
@param int $count | [
"Used",
"to",
"set",
"the",
"count",
"of",
"occurrences",
"of",
"response",
"sub",
"parts",
"when",
"loading",
"count",
"from",
"cache",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/statistics/responses/analysis_for_actual_response.php#L100-L103 |
215,481 | moodle/moodle | question/classes/statistics/responses/analysis_for_actual_response.php | analysis_for_actual_response.data_for_question_response_table | public function data_for_question_response_table($partid, $modelresponse) {
$rowdata = new \stdClass();
$rowdata->part = $partid;
$rowdata->responseclass = $modelresponse;
$rowdata->response = $this->response;
$rowdata->fraction = $this->fraction;
$rowdata->totalcount = $... | php | public function data_for_question_response_table($partid, $modelresponse) {
$rowdata = new \stdClass();
$rowdata->part = $partid;
$rowdata->responseclass = $modelresponse;
$rowdata->response = $this->response;
$rowdata->fraction = $this->fraction;
$rowdata->totalcount = $... | [
"public",
"function",
"data_for_question_response_table",
"(",
"$",
"partid",
",",
"$",
"modelresponse",
")",
"{",
"$",
"rowdata",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"rowdata",
"->",
"part",
"=",
"$",
"partid",
";",
"$",
"rowdata",
"->",
"... | Returns an object with a property for each column of the question response analysis table.
@param string $partid
@param string $modelresponse
@return object | [
"Returns",
"an",
"object",
"with",
"a",
"property",
"for",
"each",
"column",
"of",
"the",
"question",
"response",
"analysis",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/statistics/responses/analysis_for_actual_response.php#L156-L165 |
215,482 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_edit_step_link | public static function get_edit_step_link($tourid, $stepid = null, $targettype = null) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
if ($stepid) {
$link->param('action', manager::ACTION_EDITSTEP);
$link->param('id', $stepid);
} else {
$li... | php | public static function get_edit_step_link($tourid, $stepid = null, $targettype = null) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
if ($stepid) {
$link->param('action', manager::ACTION_EDITSTEP);
$link->param('id', $stepid);
} else {
$li... | [
"public",
"static",
"function",
"get_edit_step_link",
"(",
"$",
"tourid",
",",
"$",
"stepid",
"=",
"null",
",",
"$",
"targettype",
"=",
"null",
")",
"{",
"$",
"link",
"=",
"new",
"\\",
"moodle_url",
"(",
"'/admin/tool/usertours/configure.php'",
")",
";",
"if... | Get the link to edit the step.
If no stepid is specified, then a link to create a new step is provided. The $targettype must be specified in this case.
@param int $tourid The tour that the step belongs to.
@param int $stepid The step ID.
@param int $targettype The type of step.
@return mood... | [
"Get",
"the",
"link",
"to",
"edit",
"the",
"step",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L63-L75 |
215,483 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_move_tour_link | public static function get_move_tour_link($tourid, $direction = self::MOVE_DOWN) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
$link->param('action', manager::ACTION_MOVETOUR);
$link->param('id', $tourid);
$link->param('direction', $direction);
$link->param('... | php | public static function get_move_tour_link($tourid, $direction = self::MOVE_DOWN) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
$link->param('action', manager::ACTION_MOVETOUR);
$link->param('id', $tourid);
$link->param('direction', $direction);
$link->param('... | [
"public",
"static",
"function",
"get_move_tour_link",
"(",
"$",
"tourid",
",",
"$",
"direction",
"=",
"self",
"::",
"MOVE_DOWN",
")",
"{",
"$",
"link",
"=",
"new",
"\\",
"moodle_url",
"(",
"'/admin/tool/usertours/configure.php'",
")",
";",
"$",
"link",
"->",
... | Get the link to move the tour.
@param int $tourid The tour ID.
@param int $direction The direction to move in
@return moodle_url | [
"Get",
"the",
"link",
"to",
"move",
"the",
"tour",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L85-L94 |
215,484 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_move_step_link | public static function get_move_step_link($stepid, $direction = self::MOVE_DOWN) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
$link->param('action', manager::ACTION_MOVESTEP);
$link->param('id', $stepid);
$link->param('direction', $direction);
$link->param('... | php | public static function get_move_step_link($stepid, $direction = self::MOVE_DOWN) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
$link->param('action', manager::ACTION_MOVESTEP);
$link->param('id', $stepid);
$link->param('direction', $direction);
$link->param('... | [
"public",
"static",
"function",
"get_move_step_link",
"(",
"$",
"stepid",
",",
"$",
"direction",
"=",
"self",
"::",
"MOVE_DOWN",
")",
"{",
"$",
"link",
"=",
"new",
"\\",
"moodle_url",
"(",
"'/admin/tool/usertours/configure.php'",
")",
";",
"$",
"link",
"->",
... | Get the link to move the step.
@param int $stepid The step ID.
@param int $direction The direction to move in
@return moodle_url | [
"Get",
"the",
"link",
"to",
"move",
"the",
"step",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L104-L113 |
215,485 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_new_step_link | public static function get_new_step_link($tourid, $targettype = null) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
$link->param('action', manager::ACTION_NEWSTEP);
$link->param('tourid', $tourid);
$link->param('targettype', $targettype);
return $link;
} | php | public static function get_new_step_link($tourid, $targettype = null) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
$link->param('action', manager::ACTION_NEWSTEP);
$link->param('tourid', $tourid);
$link->param('targettype', $targettype);
return $link;
} | [
"public",
"static",
"function",
"get_new_step_link",
"(",
"$",
"tourid",
",",
"$",
"targettype",
"=",
"null",
")",
"{",
"$",
"link",
"=",
"new",
"\\",
"moodle_url",
"(",
"'/admin/tool/usertours/configure.php'",
")",
";",
"$",
"link",
"->",
"param",
"(",
"'ac... | Get the link ot create a new step.
@param int $tourid The ID of the tour to attach this step to.
@param int $targettype The type of target.
@return moodle_url The required URL. | [
"Get",
"the",
"link",
"ot",
"create",
"a",
"new",
"step",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L123-L130 |
215,486 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_edit_tour_link | public static function get_edit_tour_link($tourid = null) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
if ($tourid) {
$link->param('action', manager::ACTION_EDITTOUR);
$link->param('id', $tourid);
} else {
$link->param('action', manager::... | php | public static function get_edit_tour_link($tourid = null) {
$link = new \moodle_url('/admin/tool/usertours/configure.php');
if ($tourid) {
$link->param('action', manager::ACTION_EDITTOUR);
$link->param('id', $tourid);
} else {
$link->param('action', manager::... | [
"public",
"static",
"function",
"get_edit_tour_link",
"(",
"$",
"tourid",
"=",
"null",
")",
"{",
"$",
"link",
"=",
"new",
"\\",
"moodle_url",
"(",
"'/admin/tool/usertours/configure.php'",
")",
";",
"if",
"(",
"$",
"tourid",
")",
"{",
"$",
"link",
"->",
"pa... | Get the link used to edit the tour.
@param int $tourid The ID of the tour to edit.
@return moodle_url The URL. | [
"Get",
"the",
"link",
"used",
"to",
"edit",
"the",
"tour",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L165-L176 |
215,487 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.format_icon_link | public static function format_icon_link($url, $icon, $alt, $iconcomponent = 'moodle', $options = array()) {
global $OUTPUT;
return $OUTPUT->action_icon(
$url,
new \pix_icon($icon, $alt, $iconcomponent, [
'title' => $alt,
]),
... | php | public static function format_icon_link($url, $icon, $alt, $iconcomponent = 'moodle', $options = array()) {
global $OUTPUT;
return $OUTPUT->action_icon(
$url,
new \pix_icon($icon, $alt, $iconcomponent, [
'title' => $alt,
]),
... | [
"public",
"static",
"function",
"format_icon_link",
"(",
"$",
"url",
",",
"$",
"icon",
",",
"$",
"alt",
",",
"$",
"iconcomponent",
"=",
"'moodle'",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"return",
"$",
"O... | Get a filler icon for display in the actions column of a table.
@param string $url The URL for the icon.
@param string $icon The icon identifier.
@param string $alt The alt text for the icon.
@param string $iconcomponent The icon component.
@param array ... | [
"Get",
"a",
"filler",
"icon",
"for",
"display",
"in",
"the",
"actions",
"column",
"of",
"a",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L242-L254 |
215,488 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.render_tourname_inplace_editable | public static function render_tourname_inplace_editable(tour $tour) {
return new \core\output\inplace_editable(
'tool_usertours',
'tourname',
$tour->get_id(),
true,
\html_writer::link(
$tour->get_view_link(),
... | php | public static function render_tourname_inplace_editable(tour $tour) {
return new \core\output\inplace_editable(
'tool_usertours',
'tourname',
$tour->get_id(),
true,
\html_writer::link(
$tour->get_view_link(),
... | [
"public",
"static",
"function",
"render_tourname_inplace_editable",
"(",
"tour",
"$",
"tour",
")",
"{",
"return",
"new",
"\\",
"core",
"\\",
"output",
"\\",
"inplace_editable",
"(",
"'tool_usertours'",
",",
"'tourname'",
",",
"$",
"tour",
"->",
"get_id",
"(",
... | Render the inplace editable used to edit the tour name.
@param tour $tour The tour to edit.
@return string | [
"Render",
"the",
"inplace",
"editable",
"used",
"to",
"edit",
"the",
"tour",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L291-L303 |
215,489 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.render_tourdescription_inplace_editable | public static function render_tourdescription_inplace_editable(tour $tour) {
return new \core\output\inplace_editable(
'tool_usertours',
'tourdescription',
$tour->get_id(),
true,
$tour->get_description(),
$tour->get_... | php | public static function render_tourdescription_inplace_editable(tour $tour) {
return new \core\output\inplace_editable(
'tool_usertours',
'tourdescription',
$tour->get_id(),
true,
$tour->get_description(),
$tour->get_... | [
"public",
"static",
"function",
"render_tourdescription_inplace_editable",
"(",
"tour",
"$",
"tour",
")",
"{",
"return",
"new",
"\\",
"core",
"\\",
"output",
"\\",
"inplace_editable",
"(",
"'tool_usertours'",
",",
"'tourdescription'",
",",
"$",
"tour",
"->",
"get_... | Render the inplace editable used to edit the tour description.
@param tour $tour The tour to edit.
@return string | [
"Render",
"the",
"inplace",
"editable",
"used",
"to",
"edit",
"the",
"tour",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L311-L320 |
215,490 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.render_tourenabled_inplace_editable | public static function render_tourenabled_inplace_editable(tour $tour) {
global $OUTPUT;
if ($tour->is_enabled()) {
$icon = 't/hide';
$alt = get_string('disable');
$value = 1;
} else {
$icon = 't/show';
$alt = get_string('enable');
... | php | public static function render_tourenabled_inplace_editable(tour $tour) {
global $OUTPUT;
if ($tour->is_enabled()) {
$icon = 't/hide';
$alt = get_string('disable');
$value = 1;
} else {
$icon = 't/show';
$alt = get_string('enable');
... | [
"public",
"static",
"function",
"render_tourenabled_inplace_editable",
"(",
"tour",
"$",
"tour",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"if",
"(",
"$",
"tour",
"->",
"is_enabled",
"(",
")",
")",
"{",
"$",
"icon",
"=",
"'t/hide'",
";",
"$",
"alt",
"=",
... | Render the inplace editable used to edit the tour enable state.
@param tour $tour The tour to edit.
@return string | [
"Render",
"the",
"inplace",
"editable",
"used",
"to",
"edit",
"the",
"tour",
"enable",
"state",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L328-L354 |
215,491 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.render_stepname_inplace_editable | public static function render_stepname_inplace_editable(step $step) {
$title = format_text(step::get_string_from_input($step->get_title()), FORMAT_HTML);
return new \core\output\inplace_editable(
'tool_usertours',
'stepname',
$step->get_id(),
... | php | public static function render_stepname_inplace_editable(step $step) {
$title = format_text(step::get_string_from_input($step->get_title()), FORMAT_HTML);
return new \core\output\inplace_editable(
'tool_usertours',
'stepname',
$step->get_id(),
... | [
"public",
"static",
"function",
"render_stepname_inplace_editable",
"(",
"step",
"$",
"step",
")",
"{",
"$",
"title",
"=",
"format_text",
"(",
"step",
"::",
"get_string_from_input",
"(",
"$",
"step",
"->",
"get_title",
"(",
")",
")",
",",
"FORMAT_HTML",
")",
... | Render the inplace editable used to edit the step name.
@param step $step The step to edit.
@return string | [
"Render",
"the",
"inplace",
"editable",
"used",
"to",
"edit",
"the",
"step",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L362-L376 |
215,492 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_tours | public static function get_tours() {
global $DB;
$tours = $DB->get_records('tool_usertours_tours', array(), 'sortorder ASC');
$return = [];
foreach ($tours as $tour) {
$return[$tour->id] = tour::load_from_record($tour);
}
return $return;
} | php | public static function get_tours() {
global $DB;
$tours = $DB->get_records('tool_usertours_tours', array(), 'sortorder ASC');
$return = [];
foreach ($tours as $tour) {
$return[$tour->id] = tour::load_from_record($tour);
}
return $return;
} | [
"public",
"static",
"function",
"get_tours",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"tours",
"=",
"$",
"DB",
"->",
"get_records",
"(",
"'tool_usertours_tours'",
",",
"array",
"(",
")",
",",
"'sortorder ASC'",
")",
";",
"$",
"return",
"=",
"[",
"... | Get all of the tours.
@return stdClass[] | [
"Get",
"all",
"of",
"the",
"tours",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L383-L392 |
215,493 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_tour_from_sortorder | public static function get_tour_from_sortorder($sortorder) {
global $DB;
$tour = $DB->get_record('tool_usertours_tours', array('sortorder' => $sortorder));
return tour::load_from_record($tour);
} | php | public static function get_tour_from_sortorder($sortorder) {
global $DB;
$tour = $DB->get_record('tool_usertours_tours', array('sortorder' => $sortorder));
return tour::load_from_record($tour);
} | [
"public",
"static",
"function",
"get_tour_from_sortorder",
"(",
"$",
"sortorder",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"tour",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'tool_usertours_tours'",
",",
"array",
"(",
"'sortorder'",
"=>",
"$",
"sortorder",
")... | Fetch the tour with the specified sortorder.
@param int $sortorder The sortorder of the tour.
@return tour | [
"Fetch",
"the",
"tour",
"with",
"the",
"specified",
"sortorder",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L410-L415 |
215,494 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.reset_tour_sortorder | public static function reset_tour_sortorder() {
global $DB;
$tours = $DB->get_records('tool_usertours_tours', null, 'sortorder ASC, pathmatch DESC', 'id, sortorder');
$index = 0;
foreach ($tours as $tour) {
if ($tour->sortorder != $index) {
$DB->set_field('to... | php | public static function reset_tour_sortorder() {
global $DB;
$tours = $DB->get_records('tool_usertours_tours', null, 'sortorder ASC, pathmatch DESC', 'id, sortorder');
$index = 0;
foreach ($tours as $tour) {
if ($tour->sortorder != $index) {
$DB->set_field('to... | [
"public",
"static",
"function",
"reset_tour_sortorder",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"tours",
"=",
"$",
"DB",
"->",
"get_records",
"(",
"'tool_usertours_tours'",
",",
"null",
",",
"'sortorder ASC, pathmatch DESC'",
",",
"'id, sortorder'",
")",
"... | Reset the sortorder for all tours. | [
"Reset",
"the",
"sortorder",
"for",
"all",
"tours",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L431-L447 |
215,495 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_steps | public static function get_steps($tourid) {
$steps = cache::get_stepdata($tourid);
$return = [];
foreach ($steps as $step) {
$return[$step->id] = step::load_from_record($step);
}
return $return;
} | php | public static function get_steps($tourid) {
$steps = cache::get_stepdata($tourid);
$return = [];
foreach ($steps as $step) {
$return[$step->id] = step::load_from_record($step);
}
return $return;
} | [
"public",
"static",
"function",
"get_steps",
"(",
"$",
"tourid",
")",
"{",
"$",
"steps",
"=",
"cache",
"::",
"get_stepdata",
"(",
"$",
"tourid",
")",
";",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"steps",
"as",
"$",
"step",
")",
"{",... | Get all of the steps in the tour.
@param int $tourid The tour that the step belongs to.
@return stdClass[] | [
"Get",
"all",
"of",
"the",
"steps",
"in",
"the",
"tour",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L456-L464 |
215,496 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_step_from_sortorder | public static function get_step_from_sortorder($tourid, $sortorder) {
global $DB;
$step = $DB->get_record('tool_usertours_steps', array('tourid' => $tourid, 'sortorder' => $sortorder));
return step::load_from_record($step);
} | php | public static function get_step_from_sortorder($tourid, $sortorder) {
global $DB;
$step = $DB->get_record('tool_usertours_steps', array('tourid' => $tourid, 'sortorder' => $sortorder));
return step::load_from_record($step);
} | [
"public",
"static",
"function",
"get_step_from_sortorder",
"(",
"$",
"tourid",
",",
"$",
"sortorder",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"step",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'tool_usertours_steps'",
",",
"array",
"(",
"'tourid'",
"=>",
"... | Fetch the step with the specified sortorder.
@param int $tourid The tour that the step belongs to.
@param int $sortorder The sortorder of the step.
@return step | [
"Fetch",
"the",
"step",
"with",
"the",
"specified",
"sortorder",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L483-L488 |
215,497 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.bootstrap | public static function bootstrap() {
global $PAGE;
if (!isloggedin() || isguestuser()) {
return;
}
if (in_array($PAGE->pagelayout, ['maintenance', 'print', 'redirect'])) {
// Do not try to show user tours inside iframe, in maintenance mode,
// when p... | php | public static function bootstrap() {
global $PAGE;
if (!isloggedin() || isguestuser()) {
return;
}
if (in_array($PAGE->pagelayout, ['maintenance', 'print', 'redirect'])) {
// Do not try to show user tours inside iframe, in maintenance mode,
// when p... | [
"public",
"static",
"function",
"bootstrap",
"(",
")",
"{",
"global",
"$",
"PAGE",
";",
"if",
"(",
"!",
"isloggedin",
"(",
")",
"||",
"isguestuser",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"in_array",
"(",
"$",
"PAGE",
"->",
"pagelayout",
... | Handle addition of the tour into the current page. | [
"Handle",
"addition",
"of",
"the",
"tour",
"into",
"the",
"current",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L493-L518 |
215,498 | moodle/moodle | admin/tool/usertours/classes/helper.php | helper.get_all_filters | public static function get_all_filters() {
$filters = \core_component::get_component_classes_in_namespace('tool_usertours', 'local\filter');
$filters = array_keys($filters);
$filters = array_filter($filters, function($filterclass) {
$rc = new \ReflectionClass($filterclass);
... | php | public static function get_all_filters() {
$filters = \core_component::get_component_classes_in_namespace('tool_usertours', 'local\filter');
$filters = array_keys($filters);
$filters = array_filter($filters, function($filterclass) {
$rc = new \ReflectionClass($filterclass);
... | [
"public",
"static",
"function",
"get_all_filters",
"(",
")",
"{",
"$",
"filters",
"=",
"\\",
"core_component",
"::",
"get_component_classes_in_namespace",
"(",
"'tool_usertours'",
",",
"'local\\filter'",
")",
";",
"$",
"filters",
"=",
"array_keys",
"(",
"$",
"filt... | Get a list of all possible filters.
@return array | [
"Get",
"a",
"list",
"of",
"all",
"possible",
"filters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/helper.php#L536-L546 |
215,499 | moodle/moodle | message/classes/task/migrate_message_data.php | migrate_message_data.execute | public function execute() {
global $DB;
$userid = $this->get_custom_data()->userid;
// Get the user's preference.
$hasbeenmigrated = get_user_preferences('core_message_migrate_data', false, $userid);
if (!$hasbeenmigrated) {
// To determine if we should update the ... | php | public function execute() {
global $DB;
$userid = $this->get_custom_data()->userid;
// Get the user's preference.
$hasbeenmigrated = get_user_preferences('core_message_migrate_data', false, $userid);
if (!$hasbeenmigrated) {
// To determine if we should update the ... | [
"public",
"function",
"execute",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"userid",
"=",
"$",
"this",
"->",
"get_custom_data",
"(",
")",
"->",
"userid",
";",
"// Get the user's preference.",
"$",
"hasbeenmigrated",
"=",
"get_user_preferences",
"(",
"'core... | Run the migration task. | [
"Run",
"the",
"migration",
"task",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/task/migrate_message_data.php#L41-L113 |
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.