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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
211,800 | moodle/moodle | mod/forum/locallib.php | forum_portfolio_caller.prepare_post_leap2a | private function prepare_post_leap2a(portfolio_format_leap2a_writer $leapwriter, $post, $posthtml) {
$entry = new portfolio_format_leap2a_entry('forumpost' . $post->id, $post->subject, 'resource', $posthtml);
$entry->published = $post->created;
$entry->updated = $post->modified;
$entry-... | php | private function prepare_post_leap2a(portfolio_format_leap2a_writer $leapwriter, $post, $posthtml) {
$entry = new portfolio_format_leap2a_entry('forumpost' . $post->id, $post->subject, 'resource', $posthtml);
$entry->published = $post->created;
$entry->updated = $post->modified;
$entry-... | [
"private",
"function",
"prepare_post_leap2a",
"(",
"portfolio_format_leap2a_writer",
"$",
"leapwriter",
",",
"$",
"post",
",",
"$",
"posthtml",
")",
"{",
"$",
"entry",
"=",
"new",
"portfolio_format_leap2a_entry",
"(",
"'forumpost'",
".",
"$",
"post",
"->",
"id",
... | helper function to add a leap2a entry element
that corresponds to a single forum post,
including any attachments
the entry/ies are added directly to the leapwriter, which is passed by ref
@param portfolio_format_leap2a_writer $leapwriter writer object to add entries to
@param object $post ... | [
"helper",
"function",
"to",
"add",
"a",
"leap2a",
"entry",
"element",
"that",
"corresponds",
"to",
"a",
"single",
"forum",
"post",
"including",
"any",
"attachments"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/locallib.php#L256-L267 |
211,801 | moodle/moodle | mod/forum/locallib.php | forum_portfolio_caller.prepare_post | private function prepare_post($post, $fileoutputextras=null) {
global $DB;
static $users;
if (empty($users)) {
$users = array($this->user->id => $this->user);
}
if (!array_key_exists($post->userid, $users)) {
$users[$post->userid] = $DB->get_record('user',... | php | private function prepare_post($post, $fileoutputextras=null) {
global $DB;
static $users;
if (empty($users)) {
$users = array($this->user->id => $this->user);
}
if (!array_key_exists($post->userid, $users)) {
$users[$post->userid] = $DB->get_record('user',... | [
"private",
"function",
"prepare_post",
"(",
"$",
"post",
",",
"$",
"fileoutputextras",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"static",
"$",
"users",
";",
"if",
"(",
"empty",
"(",
"$",
"users",
")",
")",
"{",
"$",
"users",
"=",
"array",
"... | this is a very cut down version of what is in forum_make_mail_post
@global object
@param int $post
@return string | [
"this",
"is",
"a",
"very",
"cut",
"down",
"version",
"of",
"what",
"is",
"in",
"forum_make_mail_post"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/locallib.php#L295-L351 |
211,802 | moodle/moodle | auth/nologin/auth.php | auth_plugin_nologin.get_password_change_info | public function get_password_change_info(stdClass $user) : array {
$site = get_site();
$data = new stdClass();
$data->firstname = $user->firstname;
$data->lastname = $user->lastname;
$data->username = $user->username;
$data->sitename = format_string($site->fullname);
... | php | public function get_password_change_info(stdClass $user) : array {
$site = get_site();
$data = new stdClass();
$data->firstname = $user->firstname;
$data->lastname = $user->lastname;
$data->username = $user->username;
$data->sitename = format_string($site->fullname);
... | [
"public",
"function",
"get_password_change_info",
"(",
"stdClass",
"$",
"user",
")",
":",
"array",
"{",
"$",
"site",
"=",
"get_site",
"(",
")",
";",
"$",
"data",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"data",
"->",
"firstname",
"=",
"$",
"user",
... | Returns information on how the specified user can change their password.
User accounts with authentication type set to nologin are disabled accounts.
They cannot change their password.
@param stdClass $user A user object
@return string[] An array of strings with keys subject and message | [
"Returns",
"information",
"on",
"how",
"the",
"specified",
"user",
"can",
"change",
"their",
"password",
".",
"User",
"accounts",
"with",
"authentication",
"type",
"set",
"to",
"nologin",
"are",
"disabled",
"accounts",
".",
"They",
"cannot",
"change",
"their",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/nologin/auth.php#L115-L132 |
211,803 | moodle/moodle | availability/classes/tree.php | tree.get_logic_flags | public function get_logic_flags($not) {
// Work out which type of logic to use for the group.
switch($this->op) {
case self::OP_AND:
case self::OP_OR:
$negative = false;
break;
case self::OP_NOT_AND:
case self::OP_NOT_OR:
... | php | public function get_logic_flags($not) {
// Work out which type of logic to use for the group.
switch($this->op) {
case self::OP_AND:
case self::OP_OR:
$negative = false;
break;
case self::OP_NOT_AND:
case self::OP_NOT_OR:
... | [
"public",
"function",
"get_logic_flags",
"(",
"$",
"not",
")",
"{",
"// Work out which type of logic to use for the group.",
"switch",
"(",
"$",
"this",
"->",
"op",
")",
"{",
"case",
"self",
"::",
"OP_AND",
":",
"case",
"self",
"::",
"OP_OR",
":",
"$",
"negati... | Converts the operator for the tree into two flags used for computing
the result.
The 2 flags are $innernot (whether to set $not when calling for children)
and $andoperator (whether to use AND or OR operator to combine children).
@param bool $not Not flag passed to this tree
@return array Array of the 2 flags ($innern... | [
"Converts",
"the",
"operator",
"for",
"the",
"tree",
"into",
"two",
"flags",
"used",
"for",
"computing",
"the",
"result",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/tree.php#L579-L616 |
211,804 | moodle/moodle | availability/classes/tree.php | tree.recursive_get_all_children | protected function recursive_get_all_children($classname, array &$result) {
foreach ($this->children as $child) {
if (is_a($child, $classname)) {
$result[] = $child;
}
if ($child instanceof tree) {
$child->recursive_get_all_children($classname,... | php | protected function recursive_get_all_children($classname, array &$result) {
foreach ($this->children as $child) {
if (is_a($child, $classname)) {
$result[] = $child;
}
if ($child instanceof tree) {
$child->recursive_get_all_children($classname,... | [
"protected",
"function",
"recursive_get_all_children",
"(",
"$",
"classname",
",",
"array",
"&",
"$",
"result",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"children",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"child",
",",
"$",
"clas... | Internal function that implements get_all_children efficiently.
@param string $classname Full class name e.g. core_availability\condition
@param array $result Output array of nodes | [
"Internal",
"function",
"that",
"implements",
"get_all_children",
"efficiently",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/tree.php#L664-L673 |
211,805 | moodle/moodle | availability/classes/tree.php | tree.get_nested_json | public static function get_nested_json(array $children, $op = self::OP_AND) {
// Check $op and work out its type.
switch($op) {
case self::OP_AND:
case self::OP_NOT_OR:
case self::OP_OR:
case self::OP_NOT_AND:
break;
default:
... | php | public static function get_nested_json(array $children, $op = self::OP_AND) {
// Check $op and work out its type.
switch($op) {
case self::OP_AND:
case self::OP_NOT_OR:
case self::OP_OR:
case self::OP_NOT_AND:
break;
default:
... | [
"public",
"static",
"function",
"get_nested_json",
"(",
"array",
"$",
"children",
",",
"$",
"op",
"=",
"self",
"::",
"OP_AND",
")",
"{",
"// Check $op and work out its type.",
"switch",
"(",
"$",
"op",
")",
"{",
"case",
"self",
"::",
"OP_AND",
":",
"case",
... | Returns a JSON object which corresponds to a tree.
Intended for unit testing, as normally the JSON values are constructed
by JavaScript code.
This function generates 'nested' (i.e. not root-level) trees.
@param array $children Array of JSON objects from component children
@param string $op Operator (tree::OP_xx)
@re... | [
"Returns",
"a",
"JSON",
"object",
"which",
"corresponds",
"to",
"a",
"tree",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/tree.php#L716-L734 |
211,806 | moodle/moodle | availability/classes/tree.php | tree.get_root_json | public static function get_root_json(array $children, $op = self::OP_AND, $show = true) {
// Get the basic object.
$result = self::get_nested_json($children, $op);
// Check $op type.
switch($op) {
case self::OP_AND:
case self::OP_NOT_OR:
$multish... | php | public static function get_root_json(array $children, $op = self::OP_AND, $show = true) {
// Get the basic object.
$result = self::get_nested_json($children, $op);
// Check $op type.
switch($op) {
case self::OP_AND:
case self::OP_NOT_OR:
$multish... | [
"public",
"static",
"function",
"get_root_json",
"(",
"array",
"$",
"children",
",",
"$",
"op",
"=",
"self",
"::",
"OP_AND",
",",
"$",
"show",
"=",
"true",
")",
"{",
"// Get the basic object.",
"$",
"result",
"=",
"self",
"::",
"get_nested_json",
"(",
"$",... | Returns a JSON object which corresponds to a tree at root level.
Intended for unit testing, as normally the JSON values are constructed
by JavaScript code.
The $show parameter can be a boolean for all OP_xx options. For OP_AND
and OP_NOT_OR where you have individual show options, you can specify
a boolean (same for a... | [
"Returns",
"a",
"JSON",
"object",
"which",
"corresponds",
"to",
"a",
"tree",
"at",
"root",
"level",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/tree.php#L752-L796 |
211,807 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/ListIndexes.php | ListIndexes.executeCommand | private function executeCommand(Server $server)
{
$cmd = ['listIndexes' => $this->collectionName];
if (isset($this->options['maxTimeMS'])) {
$cmd['maxTimeMS'] = $this->options['maxTimeMS'];
}
try {
$cursor = $server->executeCommand($this->databaseName, new C... | php | private function executeCommand(Server $server)
{
$cmd = ['listIndexes' => $this->collectionName];
if (isset($this->options['maxTimeMS'])) {
$cmd['maxTimeMS'] = $this->options['maxTimeMS'];
}
try {
$cursor = $server->executeCommand($this->databaseName, new C... | [
"private",
"function",
"executeCommand",
"(",
"Server",
"$",
"server",
")",
"{",
"$",
"cmd",
"=",
"[",
"'listIndexes'",
"=>",
"$",
"this",
"->",
"collectionName",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'maxTimeMS'",
"]",
... | Returns information for all indexes for this collection using the
listIndexes command.
@param Server $server
@return IndexInfoIteratorIterator
@throws DriverRuntimeException for other driver errors (e.g. connection errors) | [
"Returns",
"information",
"for",
"all",
"indexes",
"for",
"this",
"collection",
"using",
"the",
"listIndexes",
"command",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/ListIndexes.php#L120-L145 |
211,808 | moodle/moodle | lib/outputfactories.php | renderer_factory_base.get_target_suffix | protected function get_target_suffix($target) {
if (empty($target) || $target === RENDERER_TARGET_MAINTENANCE) {
// If the target hasn't been specified we need to guess the defaults.
// We also override the target with the default if the maintenance target has been provided.
... | php | protected function get_target_suffix($target) {
if (empty($target) || $target === RENDERER_TARGET_MAINTENANCE) {
// If the target hasn't been specified we need to guess the defaults.
// We also override the target with the default if the maintenance target has been provided.
... | [
"protected",
"function",
"get_target_suffix",
"(",
"$",
"target",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"target",
")",
"||",
"$",
"target",
"===",
"RENDERER_TARGET_MAINTENANCE",
")",
"{",
"// If the target hasn't been specified we need to guess the defaults.",
"// We ... | Returns suffix of renderer class expected for given target.
@param string $target one of the renderer target constants, target is guessed if null used
@return array two element array, first element is target, second the target suffix string | [
"Returns",
"suffix",
"of",
"renderer",
"class",
"expected",
"for",
"given",
"target",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/outputfactories.php#L135-L159 |
211,809 | moodle/moodle | lib/outputfactories.php | renderer_factory_base.standard_renderer_classnames | protected function standard_renderer_classnames($component, $subtype = null) {
global $CFG; // Needed in included files.
$classnames = array();
// Standardize component name ala frankenstyle.
list($plugin, $type) = core_component::normalize_component($component);
if ($type === n... | php | protected function standard_renderer_classnames($component, $subtype = null) {
global $CFG; // Needed in included files.
$classnames = array();
// Standardize component name ala frankenstyle.
list($plugin, $type) = core_component::normalize_component($component);
if ($type === n... | [
"protected",
"function",
"standard_renderer_classnames",
"(",
"$",
"component",
",",
"$",
"subtype",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"// Needed in included files.",
"$",
"classnames",
"=",
"array",
"(",
")",
";",
"// Standardize component name ala ... | For a given module name, return the possible class names
that defines the renderer interface for that module.
Newer auto-loaded class names are returned as well as the old style _renderable classnames.
Also, if it exists, include the renderer.php file for that module, so
the class definition of the default renderer h... | [
"For",
"a",
"given",
"module",
"name",
"return",
"the",
"possible",
"class",
"names",
"that",
"defines",
"the",
"renderer",
"interface",
"for",
"that",
"module",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/outputfactories.php#L182-L278 |
211,810 | moodle/moodle | mnet/service/enrol/locallib.php | mnetservice_enrol.get_remote_subscribers | public function get_remote_subscribers() {
global $DB;
if (is_null($this->cachesubscribers)) {
$sql = "SELECT DISTINCT h.id, h.name AS hostname, h.wwwroot AS hosturl,
a.display_name AS appname
FROM {mnet_host} h
JOIN {mn... | php | public function get_remote_subscribers() {
global $DB;
if (is_null($this->cachesubscribers)) {
$sql = "SELECT DISTINCT h.id, h.name AS hostname, h.wwwroot AS hosturl,
a.display_name AS appname
FROM {mnet_host} h
JOIN {mn... | [
"public",
"function",
"get_remote_subscribers",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"cachesubscribers",
")",
")",
"{",
"$",
"sql",
"=",
"\"SELECT DISTINCT h.id, h.name AS hostname, h.wwwroot AS hosturl,\n ... | Returns a list of remote servers that can enrol their users into our courses
We must publish MNet service 'mnet_enrol' for the peers to allow them to enrol
their users into our courses.
@todo once the MNet core is refactored this may be part of a parent class
@todo the name of the service should be changed to the nam... | [
"Returns",
"a",
"list",
"of",
"remote",
"servers",
"that",
"can",
"enrol",
"their",
"users",
"into",
"our",
"courses"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/service/enrol/locallib.php#L93-L110 |
211,811 | moodle/moodle | mnet/service/enrol/locallib.php | mnetservice_enrol.get_remote_publishers | public function get_remote_publishers() {
global $DB;
if (is_null($this->cachepublishers)) {
$sql = "SELECT DISTINCT h.id, h.name AS hostname, h.wwwroot AS hosturl,
a.display_name AS appname
FROM {mnet_host} h
JOIN {mnet... | php | public function get_remote_publishers() {
global $DB;
if (is_null($this->cachepublishers)) {
$sql = "SELECT DISTINCT h.id, h.name AS hostname, h.wwwroot AS hosturl,
a.display_name AS appname
FROM {mnet_host} h
JOIN {mnet... | [
"public",
"function",
"get_remote_publishers",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"cachepublishers",
")",
")",
"{",
"$",
"sql",
"=",
"\"SELECT DISTINCT h.id, h.name AS hostname, h.wwwroot AS hosturl,\n ... | Returns a list of remote servers that offer their courses for our users
We must subscribe MNet service 'mnet_enrol' for the peers to allow our users to enrol
into their courses.
@todo once the MNet core is refactored this may be part of a parent class
@todo the name of the service should be changed to the name of thi... | [
"Returns",
"a",
"list",
"of",
"remote",
"servers",
"that",
"offer",
"their",
"courses",
"for",
"our",
"users"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/service/enrol/locallib.php#L122-L139 |
211,812 | moodle/moodle | mnet/service/enrol/locallib.php | mnetservice_enrol.req_enrol_user | public function req_enrol_user(stdclass $user, stdclass $remotecourse) {
global $CFG, $DB;
require_once($CFG->dirroot.'/mnet/xmlrpc/client.php');
$peer = new mnet_peer();
$peer->set_id($remotecourse->hostid);
$request = new mnet_xmlrpc_client();
$request->set_method('en... | php | public function req_enrol_user(stdclass $user, stdclass $remotecourse) {
global $CFG, $DB;
require_once($CFG->dirroot.'/mnet/xmlrpc/client.php');
$peer = new mnet_peer();
$peer->set_id($remotecourse->hostid);
$request = new mnet_xmlrpc_client();
$request->set_method('en... | [
"public",
"function",
"req_enrol_user",
"(",
"stdclass",
"$",
"user",
",",
"stdclass",
"$",
"remotecourse",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mnet/xmlrpc/client.php'",
")",
";",
"... | Send request to enrol our user to the remote course
Updates our remote enrolments cache if the enrolment was successful.
@uses mnet_xmlrpc_client Invokes XML-RPC request
@param object $user our user
@param object $remotecourse record from mnetservice_enrol_courses table
@return true|string true if success, error mess... | [
"Send",
"request",
"to",
"enrol",
"our",
"user",
"to",
"the",
"remote",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/service/enrol/locallib.php#L367-L399 |
211,813 | moodle/moodle | mnet/service/enrol/locallib.php | mnetservice_enrol.req_unenrol_user | public function req_unenrol_user(stdclass $user, stdclass $remotecourse) {
global $CFG, $DB;
require_once($CFG->dirroot.'/mnet/xmlrpc/client.php');
$peer = new mnet_peer();
$peer->set_id($remotecourse->hostid);
$request = new mnet_xmlrpc_client();
$request->set_method('... | php | public function req_unenrol_user(stdclass $user, stdclass $remotecourse) {
global $CFG, $DB;
require_once($CFG->dirroot.'/mnet/xmlrpc/client.php');
$peer = new mnet_peer();
$peer->set_id($remotecourse->hostid);
$request = new mnet_xmlrpc_client();
$request->set_method('... | [
"public",
"function",
"req_unenrol_user",
"(",
"stdclass",
"$",
"user",
",",
"stdclass",
"$",
"remotecourse",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mnet/xmlrpc/client.php'",
")",
";",
... | Send request to unenrol our user from the remote course
Updates our remote enrolments cache if the unenrolment was successful.
@uses mnet_xmlrpc_client Invokes XML-RPC request
@param object $user our user
@param object $remotecourse record from mnetservice_enrol_courses table
@return true|string true if success, erro... | [
"Send",
"request",
"to",
"unenrol",
"our",
"user",
"from",
"the",
"remote",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/service/enrol/locallib.php#L411-L437 |
211,814 | moodle/moodle | mnet/service/enrol/locallib.php | mnetservice_enrol_potential_users_selector.find_users | public function find_users($search) {
global $CFG, $DB;
$systemcontext = context_system::instance();
$userids = get_users_by_capability($systemcontext, 'moodle/site:mnetlogintoremote', 'u.id');
if (empty($userids)) {
return array();
}
list($usql, $uparams) ... | php | public function find_users($search) {
global $CFG, $DB;
$systemcontext = context_system::instance();
$userids = get_users_by_capability($systemcontext, 'moodle/site:mnetlogintoremote', 'u.id');
if (empty($userids)) {
return array();
}
list($usql, $uparams) ... | [
"public",
"function",
"find_users",
"(",
"$",
"search",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"$",
"systemcontext",
"=",
"context_system",
"::",
"instance",
"(",
")",
";",
"$",
"userids",
"=",
"get_users_by_capability",
"(",
"$",
"systemcont... | Find our users who could be enrolled into the remote course
Our users must have 'moodle/site:mnetlogintoremote' capability assigned.
Remote users, guests, deleted and not confirmed users are not returned.
@param string $search
@return array | [
"Find",
"our",
"users",
"who",
"could",
"be",
"enrolled",
"into",
"the",
"remote",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/service/enrol/locallib.php#L552-L605 |
211,815 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Language.php | HTMLPurifier_Language.getErrorName | public function getErrorName($int)
{
if (!$this->_loaded) {
$this->load();
}
if (!isset($this->errorNames[$int])) {
return "[Error: $int]";
}
return $this->errorNames[$int];
} | php | public function getErrorName($int)
{
if (!$this->_loaded) {
$this->load();
}
if (!isset($this->errorNames[$int])) {
return "[Error: $int]";
}
return $this->errorNames[$int];
} | [
"public",
"function",
"getErrorName",
"(",
"$",
"int",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_loaded",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"errorNames",
"[",
"$",
"in... | Retrieves a localised error name.
@param int $int error number, corresponding to PHP's error reporting
@return string localised message | [
"Retrieves",
"a",
"localised",
"error",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Language.php#L107-L116 |
211,816 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Language.php | HTMLPurifier_Language.listify | public function listify($array)
{
$sep = $this->getMessage('Item separator');
$sep_last = $this->getMessage('Item separator last');
$ret = '';
for ($i = 0, $c = count($array); $i < $c; $i++) {
if ($i == 0) {
} elseif ($i + 1 < $c) {
$ret .... | php | public function listify($array)
{
$sep = $this->getMessage('Item separator');
$sep_last = $this->getMessage('Item separator last');
$ret = '';
for ($i = 0, $c = count($array); $i < $c; $i++) {
if ($i == 0) {
} elseif ($i + 1 < $c) {
$ret .... | [
"public",
"function",
"listify",
"(",
"$",
"array",
")",
"{",
"$",
"sep",
"=",
"$",
"this",
"->",
"getMessage",
"(",
"'Item separator'",
")",
";",
"$",
"sep_last",
"=",
"$",
"this",
"->",
"getMessage",
"(",
"'Item separator last'",
")",
";",
"$",
"ret",
... | Converts an array list into a string readable representation
@param array $array
@return string | [
"Converts",
"an",
"array",
"list",
"into",
"a",
"string",
"readable",
"representation"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Language.php#L123-L138 |
211,817 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Language.php | HTMLPurifier_Language.formatMessage | public function formatMessage($key, $args = array())
{
if (!$this->_loaded) {
$this->load();
}
if (!isset($this->messages[$key])) {
return "[$key]";
}
$raw = $this->messages[$key];
$subst = array();
$generator = false;
foreach (... | php | public function formatMessage($key, $args = array())
{
if (!$this->_loaded) {
$this->load();
}
if (!isset($this->messages[$key])) {
return "[$key]";
}
$raw = $this->messages[$key];
$subst = array();
$generator = false;
foreach (... | [
"public",
"function",
"formatMessage",
"(",
"$",
"key",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_loaded",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"... | Formats a localised message with passed parameters
@param string $key string identifier of message
@param array $args Parameters to substitute in
@return string localised message
@todo Implement conditionals? Right now, some messages make
reference to line numbers, but those aren't always available | [
"Formats",
"a",
"localised",
"message",
"with",
"passed",
"parameters"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Language.php#L148-L201 |
211,818 | moodle/moodle | privacy/classes/local/request/contextlist.php | contextlist.add_from_sql | public function add_from_sql(string $sql, array $params) : contextlist {
global $DB;
$fields = \context_helper::get_preload_record_columns_sql('ctx');
if ($fieldname = $this->guess_id_field_from_sql($sql)) {
if (is_numeric($fieldname)) {
$wrapper = "
... | php | public function add_from_sql(string $sql, array $params) : contextlist {
global $DB;
$fields = \context_helper::get_preload_record_columns_sql('ctx');
if ($fieldname = $this->guess_id_field_from_sql($sql)) {
if (is_numeric($fieldname)) {
$wrapper = "
... | [
"public",
"function",
"add_from_sql",
"(",
"string",
"$",
"sql",
",",
"array",
"$",
"params",
")",
":",
"contextlist",
"{",
"global",
"$",
"DB",
";",
"$",
"fields",
"=",
"\\",
"context_helper",
"::",
"get_preload_record_columns_sql",
"(",
"'ctx'",
")",
";",
... | Add a set of contexts from SQL.
The SQL should only return a list of context IDs.
@param string $sql The SQL which will fetch the list of * context IDs
@param array $params The set of SQL parameters
@return $this | [
"Add",
"a",
"set",
"of",
"contexts",
"from",
"SQL",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/contextlist.php#L46-L83 |
211,819 | moodle/moodle | privacy/classes/local/request/contextlist.php | contextlist.add_user_context | public function add_user_context(int $userid) : contextlist {
$sql = "SELECT DISTINCT ctx.id
FROM {context} ctx
WHERE ctx.contextlevel = :contextlevel
AND ctx.instanceid = :instanceid";
return $this->add_from_sql($sql, ['contextlevel' => CONTEXT_USER... | php | public function add_user_context(int $userid) : contextlist {
$sql = "SELECT DISTINCT ctx.id
FROM {context} ctx
WHERE ctx.contextlevel = :contextlevel
AND ctx.instanceid = :instanceid";
return $this->add_from_sql($sql, ['contextlevel' => CONTEXT_USER... | [
"public",
"function",
"add_user_context",
"(",
"int",
"$",
"userid",
")",
":",
"contextlist",
"{",
"$",
"sql",
"=",
"\"SELECT DISTINCT ctx.id\n FROM {context} ctx\n WHERE ctx.contextlevel = :contextlevel\n AND ctx.instanceid = :instancei... | Adds the user context for a given user.
@param int $userid
@return $this | [
"Adds",
"the",
"user",
"context",
"for",
"a",
"given",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/contextlist.php#L100-L106 |
211,820 | moodle/moodle | privacy/classes/local/request/contextlist.php | contextlist.add_user_contexts | public function add_user_contexts(array $userids) : contextlist {
global $DB;
list($useridsql, $useridparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED);
$sql = "SELECT DISTINCT ctx.id
FROM {context} ctx
WHERE ctx.contextlevel = :contextlevel
... | php | public function add_user_contexts(array $userids) : contextlist {
global $DB;
list($useridsql, $useridparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED);
$sql = "SELECT DISTINCT ctx.id
FROM {context} ctx
WHERE ctx.contextlevel = :contextlevel
... | [
"public",
"function",
"add_user_contexts",
"(",
"array",
"$",
"userids",
")",
":",
"contextlist",
"{",
"global",
"$",
"DB",
";",
"list",
"(",
"$",
"useridsql",
",",
"$",
"useridparams",
")",
"=",
"$",
"DB",
"->",
"get_in_or_equal",
"(",
"$",
"userids",
"... | Adds the user contexts for given users.
@param array $userids
@return $this | [
"Adds",
"the",
"user",
"contexts",
"for",
"given",
"users",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/contextlist.php#L114-L123 |
211,821 | moodle/moodle | privacy/classes/local/request/contextlist.php | contextlist.guess_id_field_from_sql | protected function guess_id_field_from_sql(string $sql) : string {
// We are not interested in any subquery/view/conditions for the purpose of this method, so
// let's reduce the query to the interesting parts by recursively cleaning all
// contents within parenthesis. If there are problems (nul... | php | protected function guess_id_field_from_sql(string $sql) : string {
// We are not interested in any subquery/view/conditions for the purpose of this method, so
// let's reduce the query to the interesting parts by recursively cleaning all
// contents within parenthesis. If there are problems (nul... | [
"protected",
"function",
"guess_id_field_from_sql",
"(",
"string",
"$",
"sql",
")",
":",
"string",
"{",
"// We are not interested in any subquery/view/conditions for the purpose of this method, so",
"// let's reduce the query to the interesting parts by recursively cleaning all",
"// conte... | Guess the name of the contextid field from the supplied SQL.
@param string $sql The SQL to guess from
@return string The field name or a numeric value representing the context id | [
"Guess",
"the",
"name",
"of",
"the",
"contextid",
"field",
"from",
"the",
"supplied",
"SQL",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/contextlist.php#L140-L189 |
211,822 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.delete_reference | public function delete_reference() {
global $DB;
if (!$this->is_external_file()) {
throw new coding_exception('An attempt to unlink a non-reference file.');
}
$transaction = $DB->start_delegated_transaction();
// Are we the only one referring to the original file? ... | php | public function delete_reference() {
global $DB;
if (!$this->is_external_file()) {
throw new coding_exception('An attempt to unlink a non-reference file.');
}
$transaction = $DB->start_delegated_transaction();
// Are we the only one referring to the original file? ... | [
"public",
"function",
"delete_reference",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"is_external_file",
"(",
")",
")",
"{",
"throw",
"new",
"coding_exception",
"(",
"'An attempt to unlink a non-reference file.'",
")",
";",
"}"... | Unlink the stored file from the referenced file
This methods destroys the link to the record in files_reference table. This effectively
turns the stored file from being an alias to a plain copy. However, the caller has
to make sure that the actual file's content has beed synced prior to calling this method. | [
"Unlink",
"the",
"stored",
"file",
"from",
"the",
"referenced",
"file"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L319-L350 |
211,823 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.delete | public function delete() {
global $DB;
if ($this->is_directory()) {
// Directories can not be referenced, just delete the record.
$DB->delete_records('files', array('id'=>$this->file_record->id));
} else {
$transaction = $DB->start_delegated_transaction();
... | php | public function delete() {
global $DB;
if ($this->is_directory()) {
// Directories can not be referenced, just delete the record.
$DB->delete_records('files', array('id'=>$this->file_record->id));
} else {
$transaction = $DB->start_delegated_transaction();
... | [
"public",
"function",
"delete",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"this",
"->",
"is_directory",
"(",
")",
")",
"{",
"// Directories can not be referenced, just delete the record.",
"$",
"DB",
"->",
"delete_records",
"(",
"'files'",
",",
... | Delete file from files table.
The content of files stored in sha1 pool is reclaimed
later - the occupied disk space is reclaimed much later.
@return bool always true or exception if error occurred | [
"Delete",
"file",
"from",
"files",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L373-L415 |
211,824 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.copy_content_to_temp | public function copy_content_to_temp($dir = 'files', $fileprefix = 'tempup_') {
$tempfile = false;
if (!$dir = make_temp_directory($dir)) {
return false;
}
if (!$tempfile = tempnam($dir, $fileprefix)) {
return false;
}
if (!$this->copy_content_to($... | php | public function copy_content_to_temp($dir = 'files', $fileprefix = 'tempup_') {
$tempfile = false;
if (!$dir = make_temp_directory($dir)) {
return false;
}
if (!$tempfile = tempnam($dir, $fileprefix)) {
return false;
}
if (!$this->copy_content_to($... | [
"public",
"function",
"copy_content_to_temp",
"(",
"$",
"dir",
"=",
"'files'",
",",
"$",
"fileprefix",
"=",
"'tempup_'",
")",
"{",
"$",
"tempfile",
"=",
"false",
";",
"if",
"(",
"!",
"$",
"dir",
"=",
"make_temp_directory",
"(",
"$",
"dir",
")",
")",
"{... | Copy content of file to temporary folder and returns file path
@param string $dir name of the temporary directory
@param string $fileprefix prefix of temporary file.
@return string|bool path of temporary file or false. | [
"Copy",
"content",
"of",
"file",
"to",
"temporary",
"folder",
"and",
"returns",
"file",
"path"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L473-L487 |
211,825 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.is_valid_image | public function is_valid_image() {
$mimetype = $this->get_mimetype();
if (!file_mimetype_in_typegroup($mimetype, 'web_image')) {
return false;
}
if (!$info = $this->get_imageinfo()) {
return false;
}
if ($info['mimetype'] !== $mimetype) {
... | php | public function is_valid_image() {
$mimetype = $this->get_mimetype();
if (!file_mimetype_in_typegroup($mimetype, 'web_image')) {
return false;
}
if (!$info = $this->get_imageinfo()) {
return false;
}
if ($info['mimetype'] !== $mimetype) {
... | [
"public",
"function",
"is_valid_image",
"(",
")",
"{",
"$",
"mimetype",
"=",
"$",
"this",
"->",
"get_mimetype",
"(",
")",
";",
"if",
"(",
"!",
"file_mimetype_in_typegroup",
"(",
"$",
"mimetype",
",",
"'web_image'",
")",
")",
"{",
"return",
"false",
";",
... | Verifies the file is a valid web image - gif, png and jpeg only.
It should be ok to serve this image from server without any other security workarounds.
@return bool true if file ok | [
"Verifies",
"the",
"file",
"is",
"a",
"valid",
"web",
"image",
"-",
"gif",
"png",
"and",
"jpeg",
"only",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L572-L585 |
211,826 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.get_parent_directory | public function get_parent_directory() {
if ($this->file_record->filepath === '/' and $this->file_record->filename === '.') {
//root dir does not have parent
return null;
}
if ($this->file_record->filename !== '.') {
return $this->fs->create_directory($this->... | php | public function get_parent_directory() {
if ($this->file_record->filepath === '/' and $this->file_record->filename === '.') {
//root dir does not have parent
return null;
}
if ($this->file_record->filename !== '.') {
return $this->fs->create_directory($this->... | [
"public",
"function",
"get_parent_directory",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"file_record",
"->",
"filepath",
"===",
"'/'",
"and",
"$",
"this",
"->",
"file_record",
"->",
"filename",
"===",
"'.'",
")",
"{",
"//root dir does not have parent",
"ret... | Returns parent directory, creates missing parents if needed.
@return stored_file | [
"Returns",
"parent",
"directory",
"creates",
"missing",
"parents",
"if",
"needed",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L592-L610 |
211,827 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.set_sortorder | public function set_sortorder($sortorder) {
$oldorder = $this->file_record->sortorder;
$filerecord = new stdClass;
$filerecord->sortorder = $sortorder;
$this->update($filerecord);
if (!$this->is_directory()) {
// Callback for file sort order change.
if ($p... | php | public function set_sortorder($sortorder) {
$oldorder = $this->file_record->sortorder;
$filerecord = new stdClass;
$filerecord->sortorder = $sortorder;
$this->update($filerecord);
if (!$this->is_directory()) {
// Callback for file sort order change.
if ($p... | [
"public",
"function",
"set_sortorder",
"(",
"$",
"sortorder",
")",
"{",
"$",
"oldorder",
"=",
"$",
"this",
"->",
"file_record",
"->",
"sortorder",
";",
"$",
"filerecord",
"=",
"new",
"stdClass",
";",
"$",
"filerecord",
"->",
"sortorder",
"=",
"$",
"sortord... | Set file sort order
@param int $sortorder
@return int | [
"Set",
"file",
"sort",
"order"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L879-L894 |
211,828 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.set_synchronized | public function set_synchronized($contenthash, $filesize, $status = 0, $timemodified = null) {
if (!$this->is_external_file()) {
return;
}
$now = time();
if ($contenthash === null) {
$contenthash = $this->file_record->contenthash;
}
if ($contenthas... | php | public function set_synchronized($contenthash, $filesize, $status = 0, $timemodified = null) {
if (!$this->is_external_file()) {
return;
}
$now = time();
if ($contenthash === null) {
$contenthash = $this->file_record->contenthash;
}
if ($contenthas... | [
"public",
"function",
"set_synchronized",
"(",
"$",
"contenthash",
",",
"$",
"filesize",
",",
"$",
"status",
"=",
"0",
",",
"$",
"timemodified",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"is_external_file",
"(",
")",
")",
"{",
"return",... | Called after reference-file has been synchronized with the repository
We update contenthash, filesize and status in files table if changed
and we always update lastsync in files_reference table
@param null|string $contenthash if set to null contenthash is not changed
@param int $filesize new size of the file
@param i... | [
"Called",
"after",
"reference",
"-",
"file",
"has",
"been",
"synchronized",
"with",
"the",
"repository"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L982-L1006 |
211,829 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.send_file | public function send_file($lifetime, $filter, $forcedownload, $options) {
$this->repository->send_file($this, $lifetime, $filter, $forcedownload, $options);
} | php | public function send_file($lifetime, $filter, $forcedownload, $options) {
$this->repository->send_file($this, $lifetime, $filter, $forcedownload, $options);
} | [
"public",
"function",
"send_file",
"(",
"$",
"lifetime",
",",
"$",
"filter",
",",
"$",
"forcedownload",
",",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"repository",
"->",
"send_file",
"(",
"$",
"this",
",",
"$",
"lifetime",
",",
"$",
"filter",
",",
... | Send file references
@param int $lifetime Number of seconds before the file should expire from caches (default 24 hours)
@param int $filter 0 (default)=no filtering, 1=all files, 2=html files only
@param bool $forcedownload If true (default false), forces download of file rather than view in browser/plugin
@param arra... | [
"Send",
"file",
"references"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L1023-L1025 |
211,830 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.generate_image_thumbnail | public function generate_image_thumbnail($width, $height) {
global $CFG;
require_once($CFG->libdir . '/gdlib.php');
if (empty($width) or empty($height)) {
return false;
}
$content = $this->get_content();
// Fetch the image information for this image.
... | php | public function generate_image_thumbnail($width, $height) {
global $CFG;
require_once($CFG->libdir . '/gdlib.php');
if (empty($width) or empty($height)) {
return false;
}
$content = $this->get_content();
// Fetch the image information for this image.
... | [
"public",
"function",
"generate_image_thumbnail",
"(",
"$",
"width",
",",
"$",
"height",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/gdlib.php'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"width",
")",
"o... | Generates a thumbnail for this stored_file.
If the GD library has at least version 2 and PNG support is available, the returned data
is the content of a transparent PNG file containing the thumbnail. Otherwise, the function
returns contents of a JPEG file with black background containing the thumbnail.
@param int $... | [
"Generates",
"a",
"thumbnail",
"for",
"this",
"stored_file",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L1065-L1086 |
211,831 | moodle/moodle | lib/filestorage/stored_file.php | stored_file.resize_image | public function resize_image($width, $height) {
global $CFG;
require_once($CFG->libdir . '/gdlib.php');
$content = $this->get_content();
// Fetch the image information for this image.
$imageinfo = @getimagesizefromstring($content);
if (empty($imageinfo)) {
r... | php | public function resize_image($width, $height) {
global $CFG;
require_once($CFG->libdir . '/gdlib.php');
$content = $this->get_content();
// Fetch the image information for this image.
$imageinfo = @getimagesizefromstring($content);
if (empty($imageinfo)) {
r... | [
"public",
"function",
"resize_image",
"(",
"$",
"width",
",",
"$",
"height",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/gdlib.php'",
")",
";",
"$",
"content",
"=",
"$",
"this",
"->",
"get_content",
"("... | Generate a resized image for this stored_file.
@param int|null $width The desired width, or null to only use the height.
@param int|null $height The desired height, or null to only use the width.
@return string|false False when a problem occurs, else the image data. | [
"Generate",
"a",
"resized",
"image",
"for",
"this",
"stored_file",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filestorage/stored_file.php#L1095-L1112 |
211,832 | moodle/moodle | completion/criteria/completion_criteria_role.php | completion_criteria_role.get_title | public function get_title() {
global $DB;
$role = $DB->get_record('role', array('id' => $this->role));
if (!$role) {
return '['.get_string('roleidnotfound', 'completion', $this->role).']';
}
return role_get_name($role, context_course::instance($this->course));
} | php | public function get_title() {
global $DB;
$role = $DB->get_record('role', array('id' => $this->role));
if (!$role) {
return '['.get_string('roleidnotfound', 'completion', $this->role).']';
}
return role_get_name($role, context_course::instance($this->course));
} | [
"public",
"function",
"get_title",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"role",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'role'",
",",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"role",
")",
")",
";",
"if",
"(",
"!",
"$",
"role",
... | Return criteria title for display in reports
@return string | [
"Return",
"criteria",
"title",
"for",
"display",
"in",
"reports"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/criteria/completion_criteria_role.php#L123-L130 |
211,833 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/Delete.php | Delete.createDeleteOptions | private function createDeleteOptions()
{
$deleteOptions = ['limit' => $this->limit];
if (isset($this->options['collation'])) {
$deleteOptions['collation'] = (object) $this->options['collation'];
}
return $deleteOptions;
} | php | private function createDeleteOptions()
{
$deleteOptions = ['limit' => $this->limit];
if (isset($this->options['collation'])) {
$deleteOptions['collation'] = (object) $this->options['collation'];
}
return $deleteOptions;
} | [
"private",
"function",
"createDeleteOptions",
"(",
")",
"{",
"$",
"deleteOptions",
"=",
"[",
"'limit'",
"=>",
"$",
"this",
"->",
"limit",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'collation'",
"]",
")",
")",
"{",
"$",
"d... | Create options for the delete command.
Note that these options are different from the bulk write options, which
are created in createExecuteOptions().
@return array | [
"Create",
"options",
"for",
"the",
"delete",
"command",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/Delete.php#L147-L156 |
211,834 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/Delete.php | Delete.createExecuteOptions | private function createExecuteOptions()
{
$options = [];
if (isset($this->options['session'])) {
$options['session'] = $this->options['session'];
}
if (isset($this->options['writeConcern'])) {
$options['writeConcern'] = $this->options['writeConcern'];
... | php | private function createExecuteOptions()
{
$options = [];
if (isset($this->options['session'])) {
$options['session'] = $this->options['session'];
}
if (isset($this->options['writeConcern'])) {
$options['writeConcern'] = $this->options['writeConcern'];
... | [
"private",
"function",
"createExecuteOptions",
"(",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'session'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'session'",
"]",
"=",
"$",
"this",
... | Create options for executing the bulk write.
@see http://php.net/manual/en/mongodb-driver-server.executebulkwrite.php
@return array | [
"Create",
"options",
"for",
"executing",
"the",
"bulk",
"write",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/Delete.php#L164-L177 |
211,835 | moodle/moodle | competency/classes/template_cohort.php | template_cohort.get_missing_plans | public static function get_missing_plans($templateid, $cohortid, $unlinkedaremissing = false) {
global $DB;
$skipsql = '';
$skipparams = array();
if (!$unlinkedaremissing) {
$skipsql = 'OR p.origtemplateid = :origtemplateid';
$skipparams = array('origtemplateid' ... | php | public static function get_missing_plans($templateid, $cohortid, $unlinkedaremissing = false) {
global $DB;
$skipsql = '';
$skipparams = array();
if (!$unlinkedaremissing) {
$skipsql = 'OR p.origtemplateid = :origtemplateid';
$skipparams = array('origtemplateid' ... | [
"public",
"static",
"function",
"get_missing_plans",
"(",
"$",
"templateid",
",",
"$",
"cohortid",
",",
"$",
"unlinkedaremissing",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"skipsql",
"=",
"''",
";",
"$",
"skipparams",
"=",
"array",
"(",
")"... | Return an array of user IDs for which the plans are missing.
Plans are considered as missing when a member of a cohort does not have a plan created.
When the parameter $unlinkedaremissing is set to false, plans that were unlinked from
their template will be ignored so that we do not recreate unlinked plans endlessly.
... | [
"Return",
"an",
"array",
"of",
"user",
"IDs",
"for",
"which",
"the",
"plans",
"are",
"missing",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/template_cohort.php#L102-L123 |
211,836 | moodle/moodle | competency/classes/template_cohort.php | template_cohort.get_relations_by_templateid | public static function get_relations_by_templateid($templateid) {
global $DB;
$params = array(
'templateid' => $templateid
);
$relations = array();
$records = $DB->get_records(self::TABLE, $params);
foreach ($records as $record) {
$relations[] = ... | php | public static function get_relations_by_templateid($templateid) {
global $DB;
$params = array(
'templateid' => $templateid
);
$relations = array();
$records = $DB->get_records(self::TABLE, $params);
foreach ($records as $record) {
$relations[] = ... | [
"public",
"static",
"function",
"get_relations_by_templateid",
"(",
"$",
"templateid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"array",
"(",
"'templateid'",
"=>",
"$",
"templateid",
")",
";",
"$",
"relations",
"=",
"array",
"(",
")",
";",
... | Get a relations by templateid.
This does not perform any validation on the data passed. If the relation exists in the database
then it is loaded in a the model, if not then it is up to the developer to save the model.
@param int $templateid
@return template_cohort[] array of template cohort | [
"Get",
"a",
"relations",
"by",
"templateid",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/template_cohort.php#L160-L174 |
211,837 | moodle/moodle | competency/classes/template_cohort.php | template_cohort.get_all_missing_plans | public static function get_all_missing_plans($lastruntime = 0, $unlinkedaremissing = false) {
global $DB;
$planwhereclause = " WHERE (p.id is NULL
AND (cm.timeadded >= :lastruntime1
OR tc.timecreated >= :lastruntime3
... | php | public static function get_all_missing_plans($lastruntime = 0, $unlinkedaremissing = false) {
global $DB;
$planwhereclause = " WHERE (p.id is NULL
AND (cm.timeadded >= :lastruntime1
OR tc.timecreated >= :lastruntime3
... | [
"public",
"static",
"function",
"get_all_missing_plans",
"(",
"$",
"lastruntime",
"=",
"0",
",",
"$",
"unlinkedaremissing",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"planwhereclause",
"=",
"\" WHERE (p.id is NULL\n AND (cm.tim... | Return an array of templates persistent with their missing userids.
Note that only cohorts associated with visible templates are considered,
as well as only templates with a due date in the future, or no due date.
@param int $lastruntime The last time the Cohort ssync task ran.
@param bool $unlinkedaremissing When t... | [
"Return",
"an",
"array",
"of",
"templates",
"persistent",
"with",
"their",
"missing",
"userids",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/template_cohort.php#L189-L232 |
211,838 | moodle/moodle | admin/tool/dataprivacy/classes/purpose_override.php | purpose_override.get_overrides_for_purpose | public static function get_overrides_for_purpose(purpose $purpose) : array {
$cache = \cache::make('tool_dataprivacy', 'purpose_overrides');
$overrides = [];
$alldata = $cache->get($purpose->get('id'));
if (false === $alldata) {
$tocache = [];
foreach (self::get_... | php | public static function get_overrides_for_purpose(purpose $purpose) : array {
$cache = \cache::make('tool_dataprivacy', 'purpose_overrides');
$overrides = [];
$alldata = $cache->get($purpose->get('id'));
if (false === $alldata) {
$tocache = [];
foreach (self::get_... | [
"public",
"static",
"function",
"get_overrides_for_purpose",
"(",
"purpose",
"$",
"purpose",
")",
":",
"array",
"{",
"$",
"cache",
"=",
"\\",
"cache",
"::",
"make",
"(",
"'tool_dataprivacy'",
",",
"'purpose_overrides'",
")",
";",
"$",
"overrides",
"=",
"[",
... | Get all role overrides for the purpose.
@param purpose $purpose
@return array | [
"Get",
"all",
"role",
"overrides",
"for",
"the",
"purpose",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/purpose_override.php#L91-L111 |
211,839 | moodle/moodle | lib/simplepie/library/SimplePie/Cache/Memcached.php | SimplePie_Cache_Memcached.setData | private function setData($data) {
if ($data !== false) {
$this->cache->set($this->name . '_mtime', time(), (int)$this->options['extras']['timeout']);
return $this->cache->set($this->name, $data, (int)$this->options['extras']['timeout']);
}
return false;
} | php | private function setData($data) {
if ($data !== false) {
$this->cache->set($this->name . '_mtime', time(), (int)$this->options['extras']['timeout']);
return $this->cache->set($this->name, $data, (int)$this->options['extras']['timeout']);
}
return false;
} | [
"private",
"function",
"setData",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"!==",
"false",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"set",
"(",
"$",
"this",
"->",
"name",
".",
"'_mtime'",
",",
"time",
"(",
")",
",",
"(",
"int",
")... | Set the last modified time and data to Memcached
@return bool Success status | [
"Set",
"the",
"last",
"modified",
"time",
"and",
"data",
"to",
"Memcached"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/simplepie/library/SimplePie/Cache/Memcached.php#L157-L165 |
211,840 | moodle/moodle | message/output/jabber/message_output_jabber.php | message_output_jabber.send_message | function send_message($eventdata){
global $CFG;
// Skip any messaging of suspended and deleted users.
if ($eventdata->userto->auth === 'nologin' or $eventdata->userto->suspended or $eventdata->userto->deleted) {
return true;
}
if (!empty($CFG->noemailever)) {
... | php | function send_message($eventdata){
global $CFG;
// Skip any messaging of suspended and deleted users.
if ($eventdata->userto->auth === 'nologin' or $eventdata->userto->suspended or $eventdata->userto->deleted) {
return true;
}
if (!empty($CFG->noemailever)) {
... | [
"function",
"send_message",
"(",
"$",
"eventdata",
")",
"{",
"global",
"$",
"CFG",
";",
"// Skip any messaging of suspended and deleted users.",
"if",
"(",
"$",
"eventdata",
"->",
"userto",
"->",
"auth",
"===",
"'nologin'",
"or",
"$",
"eventdata",
"->",
"userto",
... | Processes the message and sends a notification via jabber
@param stdClass $eventdata the event data submitted by the message sender plus $eventdata->savedmessageid
@return true if ok, false if error | [
"Processes",
"the",
"message",
"and",
"sends",
"a",
"notification",
"via",
"jabber"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/output/jabber/message_output_jabber.php#L43-L96 |
211,841 | moodle/moodle | message/output/jabber/message_output_jabber.php | message_output_jabber.is_system_configured | function is_system_configured() {
global $CFG;
return (!empty($CFG->jabberhost) && !empty($CFG->jabberport) && !empty($CFG->jabberusername) && !empty($CFG->jabberpassword));
} | php | function is_system_configured() {
global $CFG;
return (!empty($CFG->jabberhost) && !empty($CFG->jabberport) && !empty($CFG->jabberusername) && !empty($CFG->jabberpassword));
} | [
"function",
"is_system_configured",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"return",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"jabberhost",
")",
"&&",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"jabberport",
")",
"&&",
"!",
"empty",
"(",
"$",
"CFG",
... | Tests whether the Jabber settings have been configured
@return boolean true if Jabber is configured | [
"Tests",
"whether",
"the",
"Jabber",
"settings",
"have",
"been",
"configured"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/output/jabber/message_output_jabber.php#L139-L142 |
211,842 | moodle/moodle | message/output/jabber/message_output_jabber.php | message_output_jabber.is_user_configured | function is_user_configured($user = null) {
global $USER;
if (is_null($user)) {
$user = $USER;
}
return (bool)get_user_preferences('message_processor_jabber_jabberid', null, $user->id);
} | php | function is_user_configured($user = null) {
global $USER;
if (is_null($user)) {
$user = $USER;
}
return (bool)get_user_preferences('message_processor_jabber_jabberid', null, $user->id);
} | [
"function",
"is_user_configured",
"(",
"$",
"user",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
";",
"if",
"(",
"is_null",
"(",
"$",
"user",
")",
")",
"{",
"$",
"user",
"=",
"$",
"USER",
";",
"}",
"return",
"(",
"bool",
")",
"get_user_preferences",... | Tests whether the Jabber settings have been configured on user level
@param object $user the user object, defaults to $USER.
@return bool has the user made all the necessary settings
in their profile to allow this plugin to be used. | [
"Tests",
"whether",
"the",
"Jabber",
"settings",
"have",
"been",
"configured",
"on",
"user",
"level"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/output/jabber/message_output_jabber.php#L150-L157 |
211,843 | moodle/moodle | lib/classes/form/persistent.php | persistent.after_definition | protected function after_definition() {
parent::after_definition();
$mform = $this->_form;
$class = static::$persistentclass;
$properties = $class::properties_definition();
foreach ($mform->_elements as $element) {
$name = $element->getName();
if (isset... | php | protected function after_definition() {
parent::after_definition();
$mform = $this->_form;
$class = static::$persistentclass;
$properties = $class::properties_definition();
foreach ($mform->_elements as $element) {
$name = $element->getName();
if (isset... | [
"protected",
"function",
"after_definition",
"(",
")",
"{",
"parent",
"::",
"after_definition",
"(",
")",
";",
"$",
"mform",
"=",
"$",
"this",
"->",
"_form",
";",
"$",
"class",
"=",
"static",
"::",
"$",
"persistentclass",
";",
"$",
"properties",
"=",
"$"... | After definition hook.
Automatically try to set the types of simple fields using the persistent properties definition.
This only applies to hidden, text and url types. Groups are also ignored as they are most likely custom.
@return void | [
"After",
"definition",
"hook",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/form/persistent.php#L146-L175 |
211,844 | moodle/moodle | lib/classes/form/persistent.php | persistent.get_data | public function get_data() {
$data = parent::get_data();
if (is_object($data)) {
foreach (static::$fieldstoremove as $field) {
unset($data->{$field});
}
$data = static::convert_fields($data);
// Ensure that the ID is set.
$data... | php | public function get_data() {
$data = parent::get_data();
if (is_object($data)) {
foreach (static::$fieldstoremove as $field) {
unset($data->{$field});
}
$data = static::convert_fields($data);
// Ensure that the ID is set.
$data... | [
"public",
"function",
"get_data",
"(",
")",
"{",
"$",
"data",
"=",
"parent",
"::",
"get_data",
"(",
")",
";",
"if",
"(",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"static",
"::",
"$",
"fieldstoremove",
"as",
"$",
"field",
")",
"... | Get form data.
Conveniently removes non-desired properties and add the ID property.
@return object|null | [
"Get",
"form",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/form/persistent.php#L254-L266 |
211,845 | moodle/moodle | lib/classes/form/persistent.php | persistent.get_submitted_data | public function get_submitted_data() {
$data = parent::get_submitted_data();
if (is_object($data)) {
foreach (static::$fieldstoremove as $field) {
unset($data->{$field});
}
$data = static::convert_fields($data);
}
return $data;
} | php | public function get_submitted_data() {
$data = parent::get_submitted_data();
if (is_object($data)) {
foreach (static::$fieldstoremove as $field) {
unset($data->{$field});
}
$data = static::convert_fields($data);
}
return $data;
} | [
"public",
"function",
"get_submitted_data",
"(",
")",
"{",
"$",
"data",
"=",
"parent",
"::",
"get_submitted_data",
"(",
")",
";",
"if",
"(",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"static",
"::",
"$",
"fieldstoremove",
"as",
"$",
... | Get the submitted form data.
Conveniently removes non-desired properties.
@return object|null | [
"Get",
"the",
"submitted",
"form",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/form/persistent.php#L284-L293 |
211,846 | moodle/moodle | competency/classes/user_competency_plan.php | user_competency_plan.create_relation | public static function create_relation($userid, $competencyid, $planid) {
$relation = new user_competency_plan(0, (object) array('userid' => $userid, 'competencyid' => $competencyid,
'planid' => $planid));
return $relation;
} | php | public static function create_relation($userid, $competencyid, $planid) {
$relation = new user_competency_plan(0, (object) array('userid' => $userid, 'competencyid' => $competencyid,
'planid' => $planid));
return $relation;
} | [
"public",
"static",
"function",
"create_relation",
"(",
"$",
"userid",
",",
"$",
"competencyid",
",",
"$",
"planid",
")",
"{",
"$",
"relation",
"=",
"new",
"user_competency_plan",
"(",
"0",
",",
"(",
"object",
")",
"array",
"(",
"'userid'",
"=>",
"$",
"u... | Create a new user_competency_plan object.
Note, this is intended to be used to create a blank relation, for instance when
the record was not found in the database. This does not save the model.
@param int $userid The user ID.
@param int $competencyid The competency ID.
@param int $planid The plan ID.
@return \core_co... | [
"Create",
"a",
"new",
"user_competency_plan",
"object",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency_plan.php#L170-L174 |
211,847 | moodle/moodle | competency/classes/user_competency_plan.php | user_competency_plan.list_competencies | public static function list_competencies($planid, $userid) {
global $DB;
$sql = 'SELECT c.*
FROM {' . competency::TABLE . '} c
JOIN {' . self::TABLE . '} ucp
ON ucp.competencyid = c.id
AND ucp.userid = :userid
W... | php | public static function list_competencies($planid, $userid) {
global $DB;
$sql = 'SELECT c.*
FROM {' . competency::TABLE . '} c
JOIN {' . self::TABLE . '} ucp
ON ucp.competencyid = c.id
AND ucp.userid = :userid
W... | [
"public",
"static",
"function",
"list_competencies",
"(",
"$",
"planid",
",",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"'SELECT c.*\n FROM {'",
".",
"competency",
"::",
"TABLE",
".",
"'} c\n JOIN {'",
".... | List the competencies in this plan.
@param int $planid The plan ID
@param int $userid The user ID
@return competency[] | [
"List",
"the",
"competencies",
"in",
"this",
"plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency_plan.php#L183-L204 |
211,848 | moodle/moodle | competency/classes/user_competency_plan.php | user_competency_plan.get_competency_by_planid | public static function get_competency_by_planid($planid, $competencyid) {
global $DB;
$sql = "SELECT c.*
FROM {" . self::TABLE . "} ucp
JOIN {" . competency::TABLE . "} c
ON c.id = ucp.competencyid
WHERE ucp.planid = ?
... | php | public static function get_competency_by_planid($planid, $competencyid) {
global $DB;
$sql = "SELECT c.*
FROM {" . self::TABLE . "} ucp
JOIN {" . competency::TABLE . "} c
ON c.id = ucp.competencyid
WHERE ucp.planid = ?
... | [
"public",
"static",
"function",
"get_competency_by_planid",
"(",
"$",
"planid",
",",
"$",
"competencyid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"SELECT c.*\n FROM {\"",
".",
"self",
"::",
"TABLE",
".",
"\"} ucp\n JO... | Fetch a competency by plan ID.
@param int $id The plan ID.
@return competency | [
"Fetch",
"a",
"competency",
"by",
"plan",
"ID",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency_plan.php#L212-L228 |
211,849 | moodle/moodle | competency/classes/user_competency_plan.php | user_competency_plan.has_records_for_competencies | public static function has_records_for_competencies($competencyids) {
global $DB;
list($insql, $params) = $DB->get_in_or_equal($competencyids, SQL_PARAMS_NAMED);
return self::record_exists_select("competencyid $insql", $params);
} | php | public static function has_records_for_competencies($competencyids) {
global $DB;
list($insql, $params) = $DB->get_in_or_equal($competencyids, SQL_PARAMS_NAMED);
return self::record_exists_select("competencyid $insql", $params);
} | [
"public",
"static",
"function",
"has_records_for_competencies",
"(",
"$",
"competencyids",
")",
"{",
"global",
"$",
"DB",
";",
"list",
"(",
"$",
"insql",
",",
"$",
"params",
")",
"=",
"$",
"DB",
"->",
"get_in_or_equal",
"(",
"$",
"competencyids",
",",
"SQL... | Check if user competency plan has records for competencies.
@param array $competencyids The competences IDs
@return boolean | [
"Check",
"if",
"user",
"competency",
"plan",
"has",
"records",
"for",
"competencies",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency_plan.php#L301-L305 |
211,850 | moodle/moodle | competency/classes/user_competency_plan.php | user_competency_plan.count_records_for_template | public static function count_records_for_template($templateid, $proficiency=null) {
global $DB;
$params = array('templateid' => $templateid);
$sql = 'SELECT ' . " COUNT('x') " .
'FROM {' . self::TABLE . '} ucp
JOIN {' . plan::TABLE . '} p
O... | php | public static function count_records_for_template($templateid, $proficiency=null) {
global $DB;
$params = array('templateid' => $templateid);
$sql = 'SELECT ' . " COUNT('x') " .
'FROM {' . self::TABLE . '} ucp
JOIN {' . plan::TABLE . '} p
O... | [
"public",
"static",
"function",
"count_records_for_template",
"(",
"$",
"templateid",
",",
"$",
"proficiency",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"array",
"(",
"'templateid'",
"=>",
"$",
"templateid",
")",
";",
"$",
"sql",... | Count the number of records matching a specific template, optionally filtered by proficient values.
@param int $templateid
@param mixed $proficiency - If true - filter by proficiency, if false filter by not proficient, if null - do not filter.
@return int | [
"Count",
"the",
"number",
"of",
"records",
"matching",
"a",
"specific",
"template",
"optionally",
"filtered",
"by",
"proficient",
"values",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency_plan.php#L314-L332 |
211,851 | moodle/moodle | lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php | PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer.getOPT | public function getOPT($property)
{
if (isset($this->OPT[$property])) {
return $this->OPT[$property];
}
return null;
} | php | public function getOPT($property)
{
if (isset($this->OPT[$property])) {
return $this->OPT[$property];
}
return null;
} | [
"public",
"function",
"getOPT",
"(",
"$",
"property",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"OPT",
"[",
"$",
"property",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"OPT",
"[",
"$",
"property",
"]",
";",
"}",
"return",
"null"... | Get an option for the Shape Group Container
@param int $property The number specifies the option
@return mixed | [
"Get",
"an",
"option",
"for",
"the",
"Shape",
"Group",
"Container"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php#L231-L237 |
211,852 | moodle/moodle | lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php | PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer.getNestingLevel | public function getNestingLevel()
{
$nestingLevel = 0;
$parent = $this->getParent();
while ($parent instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) {
++$nestingLevel;
$parent = $parent->getParent();
}
return $nestingLevel;
} | php | public function getNestingLevel()
{
$nestingLevel = 0;
$parent = $this->getParent();
while ($parent instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) {
++$nestingLevel;
$parent = $parent->getParent();
}
return $nestingLevel;
} | [
"public",
"function",
"getNestingLevel",
"(",
")",
"{",
"$",
"nestingLevel",
"=",
"0",
";",
"$",
"parent",
"=",
"$",
"this",
"->",
"getParent",
"(",
")",
";",
"while",
"(",
"$",
"parent",
"instanceof",
"PHPExcel_Shared_Escher_DgContainer_SpgrContainer",
")",
"... | Get the nesting level of this spContainer. This is the number of spgrContainers between this spContainer and
the dgContainer. A value of 1 = immediately within first spgrContainer
Higher nesting level occurs if and only if spContainer is part of a shape group
@return int Nesting level | [
"Get",
"the",
"nesting",
"level",
"of",
"this",
"spContainer",
".",
"This",
"is",
"the",
"number",
"of",
"spgrContainers",
"between",
"this",
"spContainer",
"and",
"the",
"dgContainer",
".",
"A",
"value",
"of",
"1",
"=",
"immediately",
"within",
"first",
"sp... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php#L376-L387 |
211,853 | moodle/moodle | lib/adodb/datadict/datadict-postgres.inc.php | ADODB2_postgres.AddColumnSQL | function AddColumnSQL($tabname, $flds)
{
$tabname = $this->TableName ($tabname);
$sql = array();
$not_null = false;
list($lines,$pkey) = $this->_GenFields($flds);
$alter = 'ALTER TABLE ' . $tabname . $this->addCol . ' ';
foreach($lines as $v) {
if (($not_null = preg_match('/NOT NULL/i',$v))) {
$v = ... | php | function AddColumnSQL($tabname, $flds)
{
$tabname = $this->TableName ($tabname);
$sql = array();
$not_null = false;
list($lines,$pkey) = $this->_GenFields($flds);
$alter = 'ALTER TABLE ' . $tabname . $this->addCol . ' ';
foreach($lines as $v) {
if (($not_null = preg_match('/NOT NULL/i',$v))) {
$v = ... | [
"function",
"AddColumnSQL",
"(",
"$",
"tabname",
",",
"$",
"flds",
")",
"{",
"$",
"tabname",
"=",
"$",
"this",
"->",
"TableName",
"(",
"$",
"tabname",
")",
";",
"$",
"sql",
"=",
"array",
"(",
")",
";",
"$",
"not_null",
"=",
"false",
";",
"list",
... | Adding a new Column
reimplementation of the default function as postgres does NOT allow to set the default in the same statement
@param string $tabname table-name
@param string $flds column-names and types for the changed columns
@return array with SQL strings | [
"Adding",
"a",
"new",
"Column"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/datadict/datadict-postgres.inc.php#L131-L156 |
211,854 | moodle/moodle | lib/adodb/datadict/datadict-postgres.inc.php | ADODB2_postgres._recreate_copy_table | function _recreate_copy_table($tabname,$dropflds,$tableflds,$tableoptions='')
{
if ($dropflds && !is_array($dropflds)) $dropflds = explode(',',$dropflds);
$copyflds = array();
foreach($this->MetaColumns($tabname) as $fld) {
if (!$dropflds || !in_array($fld->name,$dropflds)) {
// we need to explicit conver... | php | function _recreate_copy_table($tabname,$dropflds,$tableflds,$tableoptions='')
{
if ($dropflds && !is_array($dropflds)) $dropflds = explode(',',$dropflds);
$copyflds = array();
foreach($this->MetaColumns($tabname) as $fld) {
if (!$dropflds || !in_array($fld->name,$dropflds)) {
// we need to explicit conver... | [
"function",
"_recreate_copy_table",
"(",
"$",
"tabname",
",",
"$",
"dropflds",
",",
"$",
"tableflds",
",",
"$",
"tableoptions",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"dropflds",
"&&",
"!",
"is_array",
"(",
"$",
"dropflds",
")",
")",
"$",
"dropflds",
"="... | Save the content into a temp. table, drop and recreate the original table and copy the content back in
We also take care to set the values of the sequenz and recreate the indexes.
All this is done in a transaction, to not loose the content of the table, if something went wrong!
@internal
@param string $tabname table-n... | [
"Save",
"the",
"content",
"into",
"a",
"temp",
".",
"table",
"drop",
"and",
"recreate",
"the",
"original",
"table",
"and",
"copy",
"the",
"content",
"back",
"in"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/datadict/datadict-postgres.inc.php#L310-L354 |
211,855 | moodle/moodle | lib/adodb/datadict/datadict-postgres.inc.php | ADODB2_postgres._DropAutoIncrement | function _DropAutoIncrement($tabname)
{
$tabname = $this->connection->quote('%'.$tabname.'%');
$seq = $this->connection->GetOne("SELECT relname FROM pg_class WHERE NOT relname ~ 'pg_.*' AND relname LIKE $tabname AND relkind='S'");
// check if a tables depends on the sequenz and it therefor cant and dont need t... | php | function _DropAutoIncrement($tabname)
{
$tabname = $this->connection->quote('%'.$tabname.'%');
$seq = $this->connection->GetOne("SELECT relname FROM pg_class WHERE NOT relname ~ 'pg_.*' AND relname LIKE $tabname AND relkind='S'");
// check if a tables depends on the sequenz and it therefor cant and dont need t... | [
"function",
"_DropAutoIncrement",
"(",
"$",
"tabname",
")",
"{",
"$",
"tabname",
"=",
"$",
"this",
"->",
"connection",
"->",
"quote",
"(",
"'%'",
".",
"$",
"tabname",
".",
"'%'",
")",
";",
"$",
"seq",
"=",
"$",
"this",
"->",
"connection",
"->",
"GetO... | this is still necessary if postgres < 7.3 or the SERIAL was created on an earlier version!!! | [
"this",
"is",
"still",
"necessary",
"if",
"postgres",
"<",
"7",
".",
"3",
"or",
"the",
"SERIAL",
"was",
"created",
"on",
"an",
"earlier",
"version!!!"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/datadict/datadict-postgres.inc.php#L383-L394 |
211,856 | moodle/moodle | mod/forum/classes/local/exporters/post.php | post.get_message | private function get_message(post_entity $post) : string {
global $CFG;
$message = $post->get_message();
if (!empty($CFG->enableplagiarism)) {
require_once($CFG->libdir . '/plagiarismlib.php');
$forum = $this->related['forum'];
$message .= plagiarism_get_lin... | php | private function get_message(post_entity $post) : string {
global $CFG;
$message = $post->get_message();
if (!empty($CFG->enableplagiarism)) {
require_once($CFG->libdir . '/plagiarismlib.php');
$forum = $this->related['forum'];
$message .= plagiarism_get_lin... | [
"private",
"function",
"get_message",
"(",
"post_entity",
"$",
"post",
")",
":",
"string",
"{",
"global",
"$",
"CFG",
";",
"$",
"message",
"=",
"$",
"post",
"->",
"get_message",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"enablepl... | Get the message text from a post.
@param post_entity $post The post
@return string | [
"Get",
"the",
"message",
"text",
"from",
"a",
"post",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/exporters/post.php#L493-L511 |
211,857 | moodle/moodle | mod/forum/classes/local/exporters/post.php | post.export_attachments | private function export_attachments(array $attachments, post_entity $post, renderer_base $output, bool $canexport) : array {
global $CFG;
$urlfactory = $this->related['urlfactory'];
$enableplagiarism = $CFG->enableplagiarism;
$forum = $this->related['forum'];
$context = $this->r... | php | private function export_attachments(array $attachments, post_entity $post, renderer_base $output, bool $canexport) : array {
global $CFG;
$urlfactory = $this->related['urlfactory'];
$enableplagiarism = $CFG->enableplagiarism;
$forum = $this->related['forum'];
$context = $this->r... | [
"private",
"function",
"export_attachments",
"(",
"array",
"$",
"attachments",
",",
"post_entity",
"$",
"post",
",",
"renderer_base",
"$",
"output",
",",
"bool",
"$",
"canexport",
")",
":",
"array",
"{",
"global",
"$",
"CFG",
";",
"$",
"urlfactory",
"=",
"... | Get the exported attachments for a post.
@param stored_file[] $attachments The list of attachments for the post
@param post_entity $post The post being exported
@param renderer_base $output Renderer base
@param bool $canexport If the user can export the post (relates to portfolios not exporters like this class)
@retur... | [
"Get",
"the",
"exported",
"attachments",
"for",
"a",
"post",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/exporters/post.php#L522-L568 |
211,858 | moodle/moodle | mod/forum/classes/local/exporters/post.php | post.export_tags | private function export_tags(array $tags) : array {
$user = $this->related['user'];
$context = $this->related['context'];
$capabilitymanager = $this->related['capabilitymanager'];
$canmanagetags = $capabilitymanager->can_manage_tags($user);
return array_values(array_map(function... | php | private function export_tags(array $tags) : array {
$user = $this->related['user'];
$context = $this->related['context'];
$capabilitymanager = $this->related['capabilitymanager'];
$canmanagetags = $capabilitymanager->can_manage_tags($user);
return array_values(array_map(function... | [
"private",
"function",
"export_tags",
"(",
"array",
"$",
"tags",
")",
":",
"array",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"related",
"[",
"'user'",
"]",
";",
"$",
"context",
"=",
"$",
"this",
"->",
"related",
"[",
"'context'",
"]",
";",
"$",
"c... | Export the list of tags.
@param core_tag_tag[] $tags List of tags to export
@return array | [
"Export",
"the",
"list",
"of",
"tags",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/exporters/post.php#L576-L595 |
211,859 | moodle/moodle | mod/forum/classes/local/exporters/post.php | post.get_author_subheading_html | private function get_author_subheading_html(stdClass $exportedauthor, int $timecreated) : string {
$fullname = $exportedauthor->fullname;
$profileurl = $exportedauthor->urls['profile'] ?? null;
$formatteddate = userdate($timecreated, get_string('strftimedaydatetime', 'core_langconfig'));
... | php | private function get_author_subheading_html(stdClass $exportedauthor, int $timecreated) : string {
$fullname = $exportedauthor->fullname;
$profileurl = $exportedauthor->urls['profile'] ?? null;
$formatteddate = userdate($timecreated, get_string('strftimedaydatetime', 'core_langconfig'));
... | [
"private",
"function",
"get_author_subheading_html",
"(",
"stdClass",
"$",
"exportedauthor",
",",
"int",
"$",
"timecreated",
")",
":",
"string",
"{",
"$",
"fullname",
"=",
"$",
"exportedauthor",
"->",
"fullname",
";",
"$",
"profileurl",
"=",
"$",
"exportedauthor... | Get the HTML to display as a subheading in a post.
@param stdClass $exportedauthor The exported author object
@param int $timecreated The post time created timestamp if it's to be displayed
@return string | [
"Get",
"the",
"HTML",
"to",
"display",
"as",
"a",
"subheading",
"in",
"a",
"post",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/exporters/post.php#L604-L611 |
211,860 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.render_workshop_message | protected function render_workshop_message(workshop_message $message) {
$text = $message->get_message();
$url = $message->get_action_url();
$label = $message->get_action_label();
if (empty($text) and empty($label)) {
return '';
}
switch ($message->get... | php | protected function render_workshop_message(workshop_message $message) {
$text = $message->get_message();
$url = $message->get_action_url();
$label = $message->get_action_label();
if (empty($text) and empty($label)) {
return '';
}
switch ($message->get... | [
"protected",
"function",
"render_workshop_message",
"(",
"workshop_message",
"$",
"message",
")",
"{",
"$",
"text",
"=",
"$",
"message",
"->",
"get_message",
"(",
")",
";",
"$",
"url",
"=",
"$",
"message",
"->",
"get_action_url",
"(",
")",
";",
"$",
"label... | Renders workshop message
@param workshop_message $message to display
@return string html code | [
"Renders",
"workshop",
"message"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L46-L74 |
211,861 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.render_workshop_submission_summary | protected function render_workshop_submission_summary(workshop_submission_summary $summary) {
$o = ''; // output HTML code
$anonymous = $summary->is_anonymous();
$classes = 'submission-summary';
if ($anonymous) {
$classes .= ' anonymous';
}
$gradestatus... | php | protected function render_workshop_submission_summary(workshop_submission_summary $summary) {
$o = ''; // output HTML code
$anonymous = $summary->is_anonymous();
$classes = 'submission-summary';
if ($anonymous) {
$classes .= ' anonymous';
}
$gradestatus... | [
"protected",
"function",
"render_workshop_submission_summary",
"(",
"workshop_submission_summary",
"$",
"summary",
")",
"{",
"$",
"o",
"=",
"''",
";",
"// output HTML code",
"$",
"anonymous",
"=",
"$",
"summary",
"->",
"is_anonymous",
"(",
")",
";",
"$",
"classes"... | Renders short summary of the submission
@param workshop_submission_summary $summary
@return string text to be echo'ed | [
"Renders",
"short",
"summary",
"of",
"the",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L157-L209 |
211,862 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.render_workshop_example_submission | protected function render_workshop_example_submission(workshop_example_submission $example) {
$o = ''; // output HTML code
$classes = 'submission-full example';
$o .= $this->output->container_start($classes);
$o .= $this->output->container_start('header');
$o .= $this->outpu... | php | protected function render_workshop_example_submission(workshop_example_submission $example) {
$o = ''; // output HTML code
$classes = 'submission-full example';
$o .= $this->output->container_start($classes);
$o .= $this->output->container_start('header');
$o .= $this->outpu... | [
"protected",
"function",
"render_workshop_example_submission",
"(",
"workshop_example_submission",
"$",
"example",
")",
"{",
"$",
"o",
"=",
"''",
";",
"// output HTML code",
"$",
"classes",
"=",
"'submission-full example'",
";",
"$",
"o",
".=",
"$",
"this",
"->",
... | Renders full workshop example submission
@param workshop_example_submission $example
@return string HTML | [
"Renders",
"full",
"workshop",
"example",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L217-L236 |
211,863 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.render_workshop_example_submission_summary | protected function render_workshop_example_submission_summary(workshop_example_submission_summary $summary) {
$o = ''; // output HTML code
// wrapping box
$o .= $this->output->box_start('generalbox example-summary ' . $summary->status);
// title
$o .= $this->output->contai... | php | protected function render_workshop_example_submission_summary(workshop_example_submission_summary $summary) {
$o = ''; // output HTML code
// wrapping box
$o .= $this->output->box_start('generalbox example-summary ' . $summary->status);
// title
$o .= $this->output->contai... | [
"protected",
"function",
"render_workshop_example_submission_summary",
"(",
"workshop_example_submission_summary",
"$",
"summary",
")",
"{",
"$",
"o",
"=",
"''",
";",
"// output HTML code",
"// wrapping box",
"$",
"o",
".=",
"$",
"this",
"->",
"output",
"->",
"box_sta... | Renders short summary of the example submission
@param workshop_example_submission_summary $summary
@return string text to be echo'ed | [
"Renders",
"short",
"summary",
"of",
"the",
"example",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L244-L275 |
211,864 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.render_workshop_user_plan | protected function render_workshop_user_plan(workshop_user_plan $plan) {
$o = ''; // Output HTML code.
$numberofphases = count($plan->phases);
$o .= html_writer::start_tag('div', array(
'class' => 'userplan',
'aria-labelledby' => 'mod_workshop-userplanheading',
... | php | protected function render_workshop_user_plan(workshop_user_plan $plan) {
$o = ''; // Output HTML code.
$numberofphases = count($plan->phases);
$o .= html_writer::start_tag('div', array(
'class' => 'userplan',
'aria-labelledby' => 'mod_workshop-userplanheading',
... | [
"protected",
"function",
"render_workshop_user_plan",
"(",
"workshop_user_plan",
"$",
"plan",
")",
"{",
"$",
"o",
"=",
"''",
";",
"// Output HTML code.",
"$",
"numberofphases",
"=",
"count",
"(",
"$",
"plan",
"->",
"phases",
")",
";",
"$",
"o",
".=",
"html_w... | Renders the user plannner tool
@param workshop_user_plan $plan prepared for the user
@return string html code to be displayed | [
"Renders",
"the",
"user",
"plannner",
"tool"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L283-L339 |
211,865 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.render_workshop_allocation_result | protected function render_workshop_allocation_result(workshop_allocation_result $result) {
global $CFG;
$status = $result->get_status();
if (is_null($status) or $status == workshop_allocation_result::STATUS_VOID) {
debugging('Attempt to render workshop_allocation_result with empty ... | php | protected function render_workshop_allocation_result(workshop_allocation_result $result) {
global $CFG;
$status = $result->get_status();
if (is_null($status) or $status == workshop_allocation_result::STATUS_VOID) {
debugging('Attempt to render workshop_allocation_result with empty ... | [
"protected",
"function",
"render_workshop_allocation_result",
"(",
"workshop_allocation_result",
"$",
"result",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"status",
"=",
"$",
"result",
"->",
"get_status",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"status",... | Renders the result of the submissions allocation process
@param workshop_allocation_result $result as returned by the allocator's init() method
@return string HTML to be echoed | [
"Renders",
"the",
"result",
"of",
"the",
"submissions",
"allocation",
"process"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L347-L408 |
211,866 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.helper_render_feedback | private function helper_render_feedback($feedback) {
$o = ''; // output HTML code
$o .= $this->output->container_start('feedback feedbackforauthor');
$o .= $this->output->container_start('header');
$o .= $this->output->heading(get_string('feedbackby', 'workshop', s(fullname($feedbac... | php | private function helper_render_feedback($feedback) {
$o = ''; // output HTML code
$o .= $this->output->container_start('feedback feedbackforauthor');
$o .= $this->output->container_start('header');
$o .= $this->output->heading(get_string('feedbackby', 'workshop', s(fullname($feedbac... | [
"private",
"function",
"helper_render_feedback",
"(",
"$",
"feedback",
")",
"{",
"$",
"o",
"=",
"''",
";",
"// output HTML code",
"$",
"o",
".=",
"$",
"this",
"->",
"output",
"->",
"container_start",
"(",
"'feedback feedbackforauthor'",
")",
";",
"$",
"o",
"... | Helper method to rendering feedback
@param workshop_feedback_author|workshop_feedback_reviewer $feedback
@return string HTML | [
"Helper",
"method",
"to",
"rendering",
"feedback"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L599-L616 |
211,867 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.overall_feedback | protected function overall_feedback(workshop_assessment $assessment) {
$content = $assessment->get_overall_feedback_content();
if ($content === false) {
return '';
}
$o = '';
if (!is_null($content)) {
$o .= $this->output->container($content, 'content')... | php | protected function overall_feedback(workshop_assessment $assessment) {
$content = $assessment->get_overall_feedback_content();
if ($content === false) {
return '';
}
$o = '';
if (!is_null($content)) {
$o .= $this->output->container($content, 'content')... | [
"protected",
"function",
"overall_feedback",
"(",
"workshop_assessment",
"$",
"assessment",
")",
"{",
"$",
"content",
"=",
"$",
"assessment",
"->",
"get_overall_feedback_content",
"(",
")",
";",
"if",
"(",
"$",
"content",
"===",
"false",
")",
"{",
"return",
"'... | Renders the overall feedback for the author of the submission
@param workshop_assessment $assessment
@return string HTML | [
"Renders",
"the",
"overall",
"feedback",
"for",
"the",
"author",
"of",
"the",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L735-L788 |
211,868 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.perpage_selector | public function perpage_selector($current=10) {
$options = array();
foreach (array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 1000) as $option) {
if ($option != $current) {
$options[$option] = $option;
}
}
$select = new single_se... | php | public function perpage_selector($current=10) {
$options = array();
foreach (array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 1000) as $option) {
if ($option != $current) {
$options[$option] = $option;
}
}
$select = new single_se... | [
"public",
"function",
"perpage_selector",
"(",
"$",
"current",
"=",
"10",
")",
"{",
"$",
"options",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"array",
"(",
"10",
",",
"20",
",",
"30",
",",
"40",
",",
"50",
",",
"60",
",",
"70",
",",
"80",
",... | Renders a perpage selector for workshop listings
The scripts using this have to define the $PAGE->url prior to calling this
and deal with eventually submitted value themselves.
@param int $current current value of the perpage parameter
@return string HTML | [
"Renders",
"a",
"perpage",
"selector",
"for",
"workshop",
"listings"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L799-L812 |
211,869 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.render_workshop_final_grades | protected function render_workshop_final_grades(workshop_final_grades $grades) {
$out = html_writer::start_tag('div', array('class' => 'finalgrades'));
if (!empty($grades->submissiongrade)) {
$cssclass = 'grade submissiongrade';
if ($grades->submissiongrade->hidden) {
... | php | protected function render_workshop_final_grades(workshop_final_grades $grades) {
$out = html_writer::start_tag('div', array('class' => 'finalgrades'));
if (!empty($grades->submissiongrade)) {
$cssclass = 'grade submissiongrade';
if ($grades->submissiongrade->hidden) {
... | [
"protected",
"function",
"render_workshop_final_grades",
"(",
"workshop_final_grades",
"$",
"grades",
")",
"{",
"$",
"out",
"=",
"html_writer",
"::",
"start_tag",
"(",
"'div'",
",",
"array",
"(",
"'class'",
"=>",
"'finalgrades'",
")",
")",
";",
"if",
"(",
"!",... | Renders the user's final grades
@param workshop_final_grades $grades with the info about grades in the gradebook
@return string HTML | [
"Renders",
"the",
"user",
"s",
"final",
"grades"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L820-L853 |
211,870 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.helper_user_plan_tasks | protected function helper_user_plan_tasks(array $tasks) {
$out = '';
foreach ($tasks as $taskcode => $task) {
$classes = '';
$accessibilitytext = '';
$icon = null;
if ($task->completed === true) {
$classes .= ' completed';
$... | php | protected function helper_user_plan_tasks(array $tasks) {
$out = '';
foreach ($tasks as $taskcode => $task) {
$classes = '';
$accessibilitytext = '';
$icon = null;
if ($task->completed === true) {
$classes .= ' completed';
$... | [
"protected",
"function",
"helper_user_plan_tasks",
"(",
"array",
"$",
"tasks",
")",
"{",
"$",
"out",
"=",
"''",
";",
"foreach",
"(",
"$",
"tasks",
"as",
"$",
"taskcode",
"=>",
"$",
"task",
")",
"{",
"$",
"classes",
"=",
"''",
";",
"$",
"accessibilityte... | Renders the tasks for the single phase in the user plan
@param stdClass $tasks
@return string html code | [
"Renders",
"the",
"tasks",
"for",
"the",
"single",
"phase",
"in",
"the",
"user",
"plan"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L943-L976 |
211,871 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.helper_grading_report_grade | protected function helper_grading_report_grade($grade, $over=null) {
$a = new stdclass();
$a->grade = is_null($grade) ? get_string('nullgrade', 'workshop') : $grade;
if (is_null($over)) {
$text = get_string('formataggregatedgrade', 'workshop', $a);
} else {
$a->ov... | php | protected function helper_grading_report_grade($grade, $over=null) {
$a = new stdclass();
$a->grade = is_null($grade) ? get_string('nullgrade', 'workshop') : $grade;
if (is_null($over)) {
$text = get_string('formataggregatedgrade', 'workshop', $a);
} else {
$a->ov... | [
"protected",
"function",
"helper_grading_report_grade",
"(",
"$",
"grade",
",",
"$",
"over",
"=",
"null",
")",
"{",
"$",
"a",
"=",
"new",
"stdclass",
"(",
")",
";",
"$",
"a",
"->",
"grade",
"=",
"is_null",
"(",
"$",
"grade",
")",
"?",
"get_string",
"... | Formats the aggreagated grades | [
"Formats",
"the",
"aggreagated",
"grades"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L1097-L1107 |
211,872 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.moodleform | protected static function moodleform(moodleform $mform) {
ob_start();
$mform->display();
$o = ob_get_contents();
ob_end_clean();
return $o;
} | php | protected static function moodleform(moodleform $mform) {
ob_start();
$mform->display();
$o = ob_get_contents();
ob_end_clean();
return $o;
} | [
"protected",
"static",
"function",
"moodleform",
"(",
"moodleform",
"$",
"mform",
")",
"{",
"ob_start",
"(",
")",
";",
"$",
"mform",
"->",
"display",
"(",
")",
";",
"$",
"o",
"=",
"ob_get_contents",
"(",
")",
";",
"ob_end_clean",
"(",
")",
";",
"return... | Helper method dealing with the fact we can not just fetch the output of moodleforms
@param moodleform $mform
@return string HTML | [
"Helper",
"method",
"dealing",
"with",
"the",
"fact",
"we",
"can",
"not",
"just",
"fetch",
"the",
"output",
"of",
"moodleforms"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L1119-L1127 |
211,873 | moodle/moodle | mod/workshop/renderer.php | mod_workshop_renderer.array_nth | protected static function array_nth(array $a, $n) {
$keys = array_keys($a);
if ($n < 0 or $n > count($keys) - 1) {
return null;
}
$key = $keys[$n];
return $a[$key];
} | php | protected static function array_nth(array $a, $n) {
$keys = array_keys($a);
if ($n < 0 or $n > count($keys) - 1) {
return null;
}
$key = $keys[$n];
return $a[$key];
} | [
"protected",
"static",
"function",
"array_nth",
"(",
"array",
"$",
"a",
",",
"$",
"n",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"a",
")",
";",
"if",
"(",
"$",
"n",
"<",
"0",
"or",
"$",
"n",
">",
"count",
"(",
"$",
"keys",
")",
"-",... | Helper function returning the n-th item of the array
@param array $a
@param int $n from 0 to m, where m is th number of items in the array
@return mixed the $n-th element of $a | [
"Helper",
"function",
"returning",
"the",
"n",
"-",
"th",
"item",
"of",
"the",
"array"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/renderer.php#L1136-L1143 |
211,874 | moodle/moodle | availability/condition/date/classes/frontend.php | frontend.get_time_from_fields | public static function get_time_from_fields($year, $month, $day, $hour, $minute) {
$calendartype = \core_calendar\type_factory::get_calendar_instance();
$gregoriandate = $calendartype->convert_to_gregorian(
$year, $month, $day, $hour, $minute);
return make_timestamp($gregoriandat... | php | public static function get_time_from_fields($year, $month, $day, $hour, $minute) {
$calendartype = \core_calendar\type_factory::get_calendar_instance();
$gregoriandate = $calendartype->convert_to_gregorian(
$year, $month, $day, $hour, $minute);
return make_timestamp($gregoriandat... | [
"public",
"static",
"function",
"get_time_from_fields",
"(",
"$",
"year",
",",
"$",
"month",
",",
"$",
"day",
",",
"$",
"hour",
",",
"$",
"minute",
")",
"{",
"$",
"calendartype",
"=",
"\\",
"core_calendar",
"\\",
"type_factory",
"::",
"get_calendar_instance"... | Given field values, obtains the corresponding timestamp.
@param int $year Year
@param int $month Month
@param int $day Day
@param int $hour Hour
@param int $minute Minute
@return int Timestamp | [
"Given",
"field",
"values",
"obtains",
"the",
"corresponding",
"timestamp",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/condition/date/classes/frontend.php#L65-L71 |
211,875 | moodle/moodle | availability/condition/date/classes/frontend.php | frontend.get_fields_from_time | public static function get_fields_from_time($time) {
$calendartype = \core_calendar\type_factory::get_calendar_instance();
$wrongfields = $calendartype->timestamp_to_date_array($time);
return array('day' => $wrongfields['mday'],
'month' => $wrongfields['mon'], 'year' => $wrongfie... | php | public static function get_fields_from_time($time) {
$calendartype = \core_calendar\type_factory::get_calendar_instance();
$wrongfields = $calendartype->timestamp_to_date_array($time);
return array('day' => $wrongfields['mday'],
'month' => $wrongfields['mon'], 'year' => $wrongfie... | [
"public",
"static",
"function",
"get_fields_from_time",
"(",
"$",
"time",
")",
"{",
"$",
"calendartype",
"=",
"\\",
"core_calendar",
"\\",
"type_factory",
"::",
"get_calendar_instance",
"(",
")",
";",
"$",
"wrongfields",
"=",
"$",
"calendartype",
"->",
"timestam... | Given a timestamp, obtains corresponding field values.
@param int $time Timestamp
@return \stdClass Object with fields for year, month, day, hour, minute | [
"Given",
"a",
"timestamp",
"obtains",
"corresponding",
"field",
"values",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/condition/date/classes/frontend.php#L79-L85 |
211,876 | moodle/moodle | backup/controller/backup_controller.class.php | backup_controller.execute_plan | public function execute_plan() {
// Basic/initial prevention against time/memory limits
core_php_time_limit::raise(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA);
// If this is not a course backup, or single activity backup (e.g. duplicate) inform... | php | public function execute_plan() {
// Basic/initial prevention against time/memory limits
core_php_time_limit::raise(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA);
// If this is not a course backup, or single activity backup (e.g. duplicate) inform... | [
"public",
"function",
"execute_plan",
"(",
")",
"{",
"// Basic/initial prevention against time/memory limits",
"core_php_time_limit",
"::",
"raise",
"(",
"1",
"*",
"60",
"*",
"60",
")",
";",
"// 1 hour for 1 course initially granted",
"raise_memory_limit",
"(",
"MEMORY_EXTR... | Executes the backup
@return void Throws and exception of completes | [
"Executes",
"the",
"backup"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/controller/backup_controller.class.php#L325-L338 |
211,877 | moodle/moodle | backup/controller/backup_controller.class.php | backup_controller.set_include_files | protected function set_include_files() {
// We normally include files.
$includefiles = true;
// In an import, we don't need to include files.
if ($this->get_mode() === backup::MODE_IMPORT) {
$includefiles = false;
}
// When a backup is intended for the same ... | php | protected function set_include_files() {
// We normally include files.
$includefiles = true;
// In an import, we don't need to include files.
if ($this->get_mode() === backup::MODE_IMPORT) {
$includefiles = false;
}
// When a backup is intended for the same ... | [
"protected",
"function",
"set_include_files",
"(",
")",
"{",
"// We normally include files.",
"$",
"includefiles",
"=",
"true",
";",
"// In an import, we don't need to include files.",
"if",
"(",
"$",
"this",
"->",
"get_mode",
"(",
")",
"===",
"backup",
"::",
"MODE_IM... | Set the initial value for the include_files setting.
@see backup_controller::get_include_files for further information on the purpose of this setting.
@return int Indicates whether files should be included in backups. | [
"Set",
"the",
"initial",
"value",
"for",
"the",
"include_files",
"setting",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/controller/backup_controller.class.php#L398-L416 |
211,878 | moodle/moodle | mod/forum/classes/local/vaults/author.php | author.get_authors_for_posts | public function get_authors_for_posts(array $posts) : array {
$authorids = array_reduce($posts, function($carry, $post) {
$carry[$post->get_author_id()] = true;
return $carry;
}, []);
$authorids = array_keys($authorids);
return $this->get_from_ids($authorids);
... | php | public function get_authors_for_posts(array $posts) : array {
$authorids = array_reduce($posts, function($carry, $post) {
$carry[$post->get_author_id()] = true;
return $carry;
}, []);
$authorids = array_keys($authorids);
return $this->get_from_ids($authorids);
... | [
"public",
"function",
"get_authors_for_posts",
"(",
"array",
"$",
"posts",
")",
":",
"array",
"{",
"$",
"authorids",
"=",
"array_reduce",
"(",
"$",
"posts",
",",
"function",
"(",
"$",
"carry",
",",
"$",
"post",
")",
"{",
"$",
"carry",
"[",
"$",
"post",... | Get the authors for the given posts.
Returns a distinct list of authors indexed by author id.
@param post_entity[] $posts The list of posts
@return author_entity[] | [
"Get",
"the",
"authors",
"for",
"the",
"given",
"posts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/author.php#L94-L101 |
211,879 | moodle/moodle | mod/forum/classes/local/vaults/author.php | author.get_context_ids_for_author_ids | public function get_context_ids_for_author_ids(array $authorids) : array {
$db = $this->get_db();
[$insql, $params] = $db->get_in_or_equal($authorids);
$sql = "SELECT instanceid, id FROM {context} WHERE contextlevel = ? AND instanceid {$insql}";
$records = $db->get_records_sql($sql, arra... | php | public function get_context_ids_for_author_ids(array $authorids) : array {
$db = $this->get_db();
[$insql, $params] = $db->get_in_or_equal($authorids);
$sql = "SELECT instanceid, id FROM {context} WHERE contextlevel = ? AND instanceid {$insql}";
$records = $db->get_records_sql($sql, arra... | [
"public",
"function",
"get_context_ids_for_author_ids",
"(",
"array",
"$",
"authorids",
")",
":",
"array",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"get_db",
"(",
")",
";",
"[",
"$",
"insql",
",",
"$",
"params",
"]",
"=",
"$",
"db",
"->",
"get_in_or_equ... | Get the context ids for a set of author ids. The results are indexed
by the author id.
@param int[] $authorids The list of author ids to fetch.
@return int[] Results indexed by author id. | [
"Get",
"the",
"context",
"ids",
"for",
"a",
"set",
"of",
"author",
"ids",
".",
"The",
"results",
"are",
"indexed",
"by",
"the",
"author",
"id",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/author.php#L110-L119 |
211,880 | moodle/moodle | lib/classes/event/course_module_updated.php | course_module_updated.create_from_cm | public static final function create_from_cm($cm, $modcontext = null) {
// If not set, get the module context.
if (empty($modcontext)) {
$modcontext = \context_module::instance($cm->id);
}
// Create event object for course module update action.
$event = static::create... | php | public static final function create_from_cm($cm, $modcontext = null) {
// If not set, get the module context.
if (empty($modcontext)) {
$modcontext = \context_module::instance($cm->id);
}
// Create event object for course module update action.
$event = static::create... | [
"public",
"static",
"final",
"function",
"create_from_cm",
"(",
"$",
"cm",
",",
"$",
"modcontext",
"=",
"null",
")",
"{",
"// If not set, get the module context.",
"if",
"(",
"empty",
"(",
"$",
"modcontext",
")",
")",
"{",
"$",
"modcontext",
"=",
"\\",
"cont... | Set data to create new event from course module.
@param \cm_info|\stdClass $cm course module instance, as returned by {@link get_coursemodule_from_id}
or {@link get_coursemodule_from_instance}.
@param \context_module $modcontext module context instance
@return \core\event\base returns instance of new event | [
"Set",
"data",
"to",
"create",
"new",
"event",
"from",
"course",
"module",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/course_module_updated.php#L148-L165 |
211,881 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/HTMLDefinition.php | HTMLPurifier_HTMLDefinition.addAttribute | public function addAttribute($element_name, $attr_name, $def)
{
$module = $this->getAnonymousModule();
if (!isset($module->info[$element_name])) {
$element = $module->addBlankElement($element_name);
} else {
$element = $module->info[$element_name];
}
$... | php | public function addAttribute($element_name, $attr_name, $def)
{
$module = $this->getAnonymousModule();
if (!isset($module->info[$element_name])) {
$element = $module->addBlankElement($element_name);
} else {
$element = $module->info[$element_name];
}
$... | [
"public",
"function",
"addAttribute",
"(",
"$",
"element_name",
",",
"$",
"attr_name",
",",
"$",
"def",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"getAnonymousModule",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"module",
"->",
"info",
"... | Adds a custom attribute to a pre-existing element
@note This is strictly convenience, and does not have a corresponding
method in HTMLPurifier_HTMLModule
@param string $element_name Element name to add attribute to
@param string $attr_name Name of attribute
@param mixed $def Attribute definition, can be string or objec... | [
"Adds",
"a",
"custom",
"attribute",
"to",
"a",
"pre",
"-",
"existing",
"element"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/HTMLDefinition.php#L113-L122 |
211,882 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/HTMLDefinition.php | HTMLPurifier_HTMLDefinition.addElement | public function addElement($element_name, $type, $contents, $attr_collections, $attributes = array())
{
$module = $this->getAnonymousModule();
// assume that if the user is calling this, the element
// is safe. This may not be a good idea
$element = $module->addElement($element_name,... | php | public function addElement($element_name, $type, $contents, $attr_collections, $attributes = array())
{
$module = $this->getAnonymousModule();
// assume that if the user is calling this, the element
// is safe. This may not be a good idea
$element = $module->addElement($element_name,... | [
"public",
"function",
"addElement",
"(",
"$",
"element_name",
",",
"$",
"type",
",",
"$",
"contents",
",",
"$",
"attr_collections",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"getAnonymousModule",
"("... | Adds a custom element to your HTML definition
@see HTMLPurifier_HTMLModule::addElement() for detailed
parameter and return value descriptions. | [
"Adds",
"a",
"custom",
"element",
"to",
"your",
"HTML",
"definition"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/HTMLDefinition.php#L129-L136 |
211,883 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/HTMLDefinition.php | HTMLPurifier_HTMLDefinition.addBlankElement | public function addBlankElement($element_name)
{
$module = $this->getAnonymousModule();
$element = $module->addBlankElement($element_name);
return $element;
} | php | public function addBlankElement($element_name)
{
$module = $this->getAnonymousModule();
$element = $module->addBlankElement($element_name);
return $element;
} | [
"public",
"function",
"addBlankElement",
"(",
"$",
"element_name",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"getAnonymousModule",
"(",
")",
";",
"$",
"element",
"=",
"$",
"module",
"->",
"addBlankElement",
"(",
"$",
"element_name",
")",
";",
"retur... | Adds a blank element to your HTML definition, for overriding
existing behavior
@param string $element_name
@return HTMLPurifier_ElementDef
@see HTMLPurifier_HTMLModule::addBlankElement() for detailed
parameter and return value descriptions. | [
"Adds",
"a",
"blank",
"element",
"to",
"your",
"HTML",
"definition",
"for",
"overriding",
"existing",
"behavior"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/HTMLDefinition.php#L146-L151 |
211,884 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/HTMLDefinition.php | HTMLPurifier_HTMLDefinition.getAnonymousModule | public function getAnonymousModule()
{
if (!$this->_anonModule) {
$this->_anonModule = new HTMLPurifier_HTMLModule();
$this->_anonModule->name = 'Anonymous';
}
return $this->_anonModule;
} | php | public function getAnonymousModule()
{
if (!$this->_anonModule) {
$this->_anonModule = new HTMLPurifier_HTMLModule();
$this->_anonModule->name = 'Anonymous';
}
return $this->_anonModule;
} | [
"public",
"function",
"getAnonymousModule",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_anonModule",
")",
"{",
"$",
"this",
"->",
"_anonModule",
"=",
"new",
"HTMLPurifier_HTMLModule",
"(",
")",
";",
"$",
"this",
"->",
"_anonModule",
"->",
"name",
... | Retrieves a reference to the anonymous module, so you can
bust out advanced features without having to make your own
module.
@return HTMLPurifier_HTMLModule | [
"Retrieves",
"a",
"reference",
"to",
"the",
"anonymous",
"module",
"so",
"you",
"can",
"bust",
"out",
"advanced",
"features",
"without",
"having",
"to",
"make",
"your",
"own",
"module",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/HTMLDefinition.php#L159-L166 |
211,885 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.setup_sortitemid | private function setup_sortitemid() {
global $SESSION;
if (!isset($SESSION->gradeuserreport)) {
$SESSION->gradeuserreport = new stdClass();
}
if ($this->sortitemid) {
if (!isset($SESSION->gradeuserreport->sort)) {
if ($this->sortitemid == 'first... | php | private function setup_sortitemid() {
global $SESSION;
if (!isset($SESSION->gradeuserreport)) {
$SESSION->gradeuserreport = new stdClass();
}
if ($this->sortitemid) {
if (!isset($SESSION->gradeuserreport->sort)) {
if ($this->sortitemid == 'first... | [
"private",
"function",
"setup_sortitemid",
"(",
")",
"{",
"global",
"$",
"SESSION",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"SESSION",
"->",
"gradeuserreport",
")",
")",
"{",
"$",
"SESSION",
"->",
"gradeuserreport",
"=",
"new",
"stdClass",
"(",
")",
";",... | Setting the sort order, this depends on last state
all this should be in the new table class that we might need to use
for displaying grades. | [
"Setting",
"the",
"sort",
"order",
"this",
"depends",
"on",
"last",
"state",
"all",
"this",
"should",
"be",
"in",
"the",
"new",
"table",
"class",
"that",
"we",
"might",
"need",
"to",
"use",
"for",
"displaying",
"grades",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L360-L414 |
211,886 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_allgradeitems | protected function get_allgradeitems() {
if (!empty($this->allgradeitems)) {
return $this->allgradeitems;
}
$allgradeitems = grade_item::fetch_all(array('courseid' => $this->courseid));
// But hang on - don't include ones which are set to not show the grade at all.
$t... | php | protected function get_allgradeitems() {
if (!empty($this->allgradeitems)) {
return $this->allgradeitems;
}
$allgradeitems = grade_item::fetch_all(array('courseid' => $this->courseid));
// But hang on - don't include ones which are set to not show the grade at all.
$t... | [
"protected",
"function",
"get_allgradeitems",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"allgradeitems",
")",
")",
"{",
"return",
"$",
"this",
"->",
"allgradeitems",
";",
"}",
"$",
"allgradeitems",
"=",
"grade_item",
"::",
"fetch_all"... | Load all grade items. | [
"Load",
"all",
"grade",
"items",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L533-L544 |
211,887 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_left_icons_row | public function get_left_icons_row($rows=array(), $colspan=1) {
global $USER;
if ($USER->gradeediting[$this->courseid]) {
$controlsrow = new html_table_row();
$controlsrow->attributes['class'] = 'controls';
$controlscell = new html_table_cell();
$controls... | php | public function get_left_icons_row($rows=array(), $colspan=1) {
global $USER;
if ($USER->gradeediting[$this->courseid]) {
$controlsrow = new html_table_row();
$controlsrow->attributes['class'] = 'controls';
$controlscell = new html_table_cell();
$controls... | [
"public",
"function",
"get_left_icons_row",
"(",
"$",
"rows",
"=",
"array",
"(",
")",
",",
"$",
"colspan",
"=",
"1",
")",
"{",
"global",
"$",
"USER",
";",
"if",
"(",
"$",
"USER",
"->",
"gradeediting",
"[",
"$",
"this",
"->",
"courseid",
"]",
")",
"... | Builds and return the row of icons for the left side of the report.
It only has one cell that says "Controls"
@param array $rows The Array of rows for the left part of the report
@param int $colspan The number of columns this cell has to span
@return array Array of rows for the left part of the report | [
"Builds",
"and",
"return",
"the",
"row",
"of",
"icons",
"for",
"the",
"left",
"side",
"of",
"the",
"report",
".",
"It",
"only",
"has",
"one",
"cell",
"that",
"says",
"Controls"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1286-L1301 |
211,888 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_left_range_row | public function get_left_range_row($rows=array(), $colspan=1) {
global $CFG, $USER;
if ($this->get_pref('showranges')) {
$rangerow = new html_table_row();
$rangerow->attributes['class'] = 'range r'.$this->rowcount++;
$rangecell = new html_table_cell();
$r... | php | public function get_left_range_row($rows=array(), $colspan=1) {
global $CFG, $USER;
if ($this->get_pref('showranges')) {
$rangerow = new html_table_row();
$rangerow->attributes['class'] = 'range r'.$this->rowcount++;
$rangecell = new html_table_cell();
$r... | [
"public",
"function",
"get_left_range_row",
"(",
"$",
"rows",
"=",
"array",
"(",
")",
",",
"$",
"colspan",
"=",
"1",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"if",
"(",
"$",
"this",
"->",
"get_pref",
"(",
"'showranges'",
")",
")",
"{"... | Builds and return the header for the row of ranges, for the left part of the grader report.
@param array $rows The Array of rows for the left part of the report
@param int $colspan The number of columns this cell has to span
@return array Array of rows for the left part of the report | [
"Builds",
"and",
"return",
"the",
"header",
"for",
"the",
"row",
"of",
"ranges",
"for",
"the",
"left",
"part",
"of",
"the",
"grader",
"report",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1309-L1326 |
211,889 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_left_avg_row | public function get_left_avg_row($rows=array(), $colspan=1, $groupavg=false) {
if (!$this->canviewhidden) {
// totals might be affected by hiding, if user can not see hidden grades the aggregations might be altered
// better not show them at all if user can not see all hideen grades
... | php | public function get_left_avg_row($rows=array(), $colspan=1, $groupavg=false) {
if (!$this->canviewhidden) {
// totals might be affected by hiding, if user can not see hidden grades the aggregations might be altered
// better not show them at all if user can not see all hideen grades
... | [
"public",
"function",
"get_left_avg_row",
"(",
"$",
"rows",
"=",
"array",
"(",
")",
",",
"$",
"colspan",
"=",
"1",
",",
"$",
"groupavg",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"canviewhidden",
")",
"{",
"// totals might be affected by... | Builds and return the headers for the rows of averages, for the left part of the grader report.
@param array $rows The Array of rows for the left part of the report
@param int $colspan The number of columns this cell has to span
@param bool $groupavg If true, returns the row for group averages, otherwise for overall av... | [
"Builds",
"and",
"return",
"the",
"headers",
"for",
"the",
"rows",
"of",
"averages",
"for",
"the",
"left",
"part",
"of",
"the",
"grader",
"report",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1335-L1377 |
211,890 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_right_icons_row | public function get_right_icons_row($rows=array()) {
global $USER;
if ($USER->gradeediting[$this->courseid]) {
$iconsrow = new html_table_row();
$iconsrow->attributes['class'] = 'controls';
foreach ($this->gtree->items as $itemid => $unused) {
// emul... | php | public function get_right_icons_row($rows=array()) {
global $USER;
if ($USER->gradeediting[$this->courseid]) {
$iconsrow = new html_table_row();
$iconsrow->attributes['class'] = 'controls';
foreach ($this->gtree->items as $itemid => $unused) {
// emul... | [
"public",
"function",
"get_right_icons_row",
"(",
"$",
"rows",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"USER",
";",
"if",
"(",
"$",
"USER",
"->",
"gradeediting",
"[",
"$",
"this",
"->",
"courseid",
"]",
")",
"{",
"$",
"iconsrow",
"=",
"new",... | Builds and return the row of icons when editing is on, for the right part of the grader report.
@param array $rows The Array of rows for the right part of the report
@return array Array of rows for the right part of the report | [
"Builds",
"and",
"return",
"the",
"row",
"of",
"icons",
"when",
"editing",
"is",
"on",
"for",
"the",
"right",
"part",
"of",
"the",
"grader",
"report",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1384-L1404 |
211,891 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_right_range_row | public function get_right_range_row($rows=array()) {
global $OUTPUT;
if ($this->get_pref('showranges')) {
$rangesdisplaytype = $this->get_pref('rangesdisplaytype');
$rangesdecimalpoints = $this->get_pref('rangesdecimalpoints');
$rangerow = new html_table_row();
... | php | public function get_right_range_row($rows=array()) {
global $OUTPUT;
if ($this->get_pref('showranges')) {
$rangesdisplaytype = $this->get_pref('rangesdisplaytype');
$rangesdecimalpoints = $this->get_pref('rangesdecimalpoints');
$rangerow = new html_table_row();
... | [
"public",
"function",
"get_right_range_row",
"(",
"$",
"rows",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"if",
"(",
"$",
"this",
"->",
"get_pref",
"(",
"'showranges'",
")",
")",
"{",
"$",
"rangesdisplaytype",
"=",
"$",
"this",
"->... | Builds and return the row of ranges for the right part of the grader report.
@param array $rows The Array of rows for the right part of the report
@return array Array of rows for the right part of the report | [
"Builds",
"and",
"return",
"the",
"row",
"of",
"ranges",
"for",
"the",
"right",
"part",
"of",
"the",
"grader",
"report",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1411-L1438 |
211,892 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_course_header | protected function get_course_header($element) {
global $OUTPUT;
$icon = '';
// If object is a category, display expand/contract icon.
if ($element['type'] == 'category') {
// Load language strings.
$strswitchminus = $this->get_lang_string('aggregatesonly', 'grad... | php | protected function get_course_header($element) {
global $OUTPUT;
$icon = '';
// If object is a category, display expand/contract icon.
if ($element['type'] == 'category') {
// Load language strings.
$strswitchminus = $this->get_lang_string('aggregatesonly', 'grad... | [
"protected",
"function",
"get_course_header",
"(",
"$",
"element",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"icon",
"=",
"''",
";",
"// If object is a category, display expand/contract icon.",
"if",
"(",
"$",
"element",
"[",
"'type'",
"]",
"==",
"'category'",
... | Given element category, create a collapsible icon and
course header.
@param array $element
@return string HTML | [
"Given",
"element",
"category",
"create",
"a",
"collapsible",
"icon",
"and",
"course",
"header",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1621-L1657 |
211,893 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_icons | protected function get_icons($element) {
global $CFG, $USER, $OUTPUT;
if (!$USER->gradeediting[$this->courseid]) {
return '<div class="grade_icons" />';
}
// Init all icons
$editicon = '';
$editable = true;
if ($element['type'] == 'grade') {
... | php | protected function get_icons($element) {
global $CFG, $USER, $OUTPUT;
if (!$USER->gradeediting[$this->courseid]) {
return '<div class="grade_icons" />';
}
// Init all icons
$editicon = '';
$editable = true;
if ($element['type'] == 'grade') {
... | [
"protected",
"function",
"get_icons",
"(",
"$",
"element",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
",",
"$",
"OUTPUT",
";",
"if",
"(",
"!",
"$",
"USER",
"->",
"gradeediting",
"[",
"$",
"this",
"->",
"courseid",
"]",
")",
"{",
"return",
"'... | Given a grade_category, grade_item or grade_grade, this function
figures out the state of the object and builds then returns a div
with the icons needed for the grader report.
@param array $element
@return string HTML | [
"Given",
"a",
"grade_category",
"grade_item",
"or",
"grade_grade",
"this",
"function",
"figures",
"out",
"the",
"state",
"of",
"the",
"object",
"and",
"builds",
"then",
"returns",
"a",
"div",
"with",
"the",
"icons",
"needed",
"for",
"the",
"grader",
"report",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1667-L1715 |
211,894 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.filter_collapsed_categories | protected static function filter_collapsed_categories($courseid, $collapsed) {
global $DB;
if (empty($collapsed)) {
$collapsed = array('aggregatesonly' => array(), 'gradesonly' => array());
}
if (empty($collapsed['aggregatesonly']) && empty($collapsed['gradesonly'])) {
... | php | protected static function filter_collapsed_categories($courseid, $collapsed) {
global $DB;
if (empty($collapsed)) {
$collapsed = array('aggregatesonly' => array(), 'gradesonly' => array());
}
if (empty($collapsed['aggregatesonly']) && empty($collapsed['gradesonly'])) {
... | [
"protected",
"static",
"function",
"filter_collapsed_categories",
"(",
"$",
"courseid",
",",
"$",
"collapsed",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"empty",
"(",
"$",
"collapsed",
")",
")",
"{",
"$",
"collapsed",
"=",
"array",
"(",
"'aggregateson... | From the list of categories that this user prefers to collapse choose ones that belong to the current course.
This function serves two purposes.
Mainly it helps migrating from user preference style when all courses were stored in one preference.
Also it helps to remove the settings for categories that were removed if ... | [
"From",
"the",
"list",
"of",
"categories",
"that",
"this",
"user",
"prefers",
"to",
"collapse",
"choose",
"ones",
"that",
"belong",
"to",
"the",
"current",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1747-L1759 |
211,895 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_collapsed_preferences | protected static function get_collapsed_preferences($courseid) {
if ($collapsed = get_user_preferences('grade_report_grader_collapsed_categories'.$courseid)) {
return json_decode($collapsed, true);
}
// Try looking for old location of user setting that used to store all courses in o... | php | protected static function get_collapsed_preferences($courseid) {
if ($collapsed = get_user_preferences('grade_report_grader_collapsed_categories'.$courseid)) {
return json_decode($collapsed, true);
}
// Try looking for old location of user setting that used to store all courses in o... | [
"protected",
"static",
"function",
"get_collapsed_preferences",
"(",
"$",
"courseid",
")",
"{",
"if",
"(",
"$",
"collapsed",
"=",
"get_user_preferences",
"(",
"'grade_report_grader_collapsed_categories'",
".",
"$",
"courseid",
")",
")",
"{",
"return",
"json_decode",
... | Returns the list of categories that this user wants to collapse or display aggregatesonly
This method also migrates on request from the old format of storing user preferences when they were stored
in one preference for all courses causing DB error when trying to insert very big value.
@param int $courseid
@return arr... | [
"Returns",
"the",
"list",
"of",
"categories",
"that",
"this",
"user",
"wants",
"to",
"collapse",
"or",
"display",
"aggregatesonly"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1770-L1798 |
211,896 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.set_collapsed_preferences | protected static function set_collapsed_preferences($courseid, $collapsed) {
global $DB;
// In an unlikely case that the list of collapsed categories for one course is too big for the user preference size,
// try to filter the list of categories since array may contain categories that were delet... | php | protected static function set_collapsed_preferences($courseid, $collapsed) {
global $DB;
// In an unlikely case that the list of collapsed categories for one course is too big for the user preference size,
// try to filter the list of categories since array may contain categories that were delet... | [
"protected",
"static",
"function",
"set_collapsed_preferences",
"(",
"$",
"courseid",
",",
"$",
"collapsed",
")",
"{",
"global",
"$",
"DB",
";",
"// In an unlikely case that the list of collapsed categories for one course is too big for the user preference size,",
"// try to filter... | Sets the list of categories that user wants to see collapsed in user preferences
This method may filter or even trim the list if it does not fit in DB field.
@param int $courseid
@param array $collapsed | [
"Sets",
"the",
"list",
"of",
"categories",
"that",
"user",
"wants",
"to",
"see",
"collapsed",
"in",
"user",
"preferences"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1808-L1831 |
211,897 | moodle/moodle | grade/report/grader/lib.php | grade_report_grader.get_sort_arrows | public function get_sort_arrows(array $extrafields = array()) {
global $OUTPUT, $CFG;
$arrows = array();
$strsortasc = $this->get_lang_string('sortasc', 'grades');
$strsortdesc = $this->get_lang_string('sortdesc', 'grades');
$iconasc = $OUTPUT->pix_icon('t/sort_asc', $strsort... | php | public function get_sort_arrows(array $extrafields = array()) {
global $OUTPUT, $CFG;
$arrows = array();
$strsortasc = $this->get_lang_string('sortasc', 'grades');
$strsortdesc = $this->get_lang_string('sortdesc', 'grades');
$iconasc = $OUTPUT->pix_icon('t/sort_asc', $strsort... | [
"public",
"function",
"get_sort_arrows",
"(",
"array",
"$",
"extrafields",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"OUTPUT",
",",
"$",
"CFG",
";",
"$",
"arrows",
"=",
"array",
"(",
")",
";",
"$",
"strsortasc",
"=",
"$",
"this",
"->",
"get_la... | Refactored function for generating HTML of sorting links with matching arrows.
Returns an array with 'studentname' and 'idnumber' as keys, with HTML ready
to inject into a table header cell.
@param array $extrafields Array of extra fields being displayed, such as
user idnumber
@return array An associative array of HTML... | [
"Refactored",
"function",
"for",
"generating",
"HTML",
"of",
"sorting",
"links",
"with",
"matching",
"arrows",
".",
"Returns",
"an",
"array",
"with",
"studentname",
"and",
"idnumber",
"as",
"keys",
"with",
"HTML",
"ready",
"to",
"inject",
"into",
"a",
"table",... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/grader/lib.php#L1903-L1955 |
211,898 | moodle/moodle | lib/classes/event/question_base.php | question_base.create_from_question_instance | public static function create_from_question_instance($question, $context = null, $other = null) {
$params = ['objectid' => $question->id, 'other' => ['categoryid' => $question->category]];
if (!empty($question->contextid)) {
$params['contextid'] = $question->contextid;
}
$... | php | public static function create_from_question_instance($question, $context = null, $other = null) {
$params = ['objectid' => $question->id, 'other' => ['categoryid' => $question->category]];
if (!empty($question->contextid)) {
$params['contextid'] = $question->contextid;
}
$... | [
"public",
"static",
"function",
"create_from_question_instance",
"(",
"$",
"question",
",",
"$",
"context",
"=",
"null",
",",
"$",
"other",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"[",
"'objectid'",
"=>",
"$",
"question",
"->",
"id",
",",
"'other'",
"... | Create a event from question object
@param object $question
@param object|null $context
@param array|null $other will override the categoryid pre-filled out on the first line.
@return base
@throws \coding_exception | [
"Create",
"a",
"event",
"from",
"question",
"object"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/question_base.php#L111-L127 |
211,899 | moodle/moodle | portfolio/boxnet/lib.php | portfolio_plugin_boxnet.get_folder_list | protected function get_folder_list() {
if (empty($this->folders)) {
$folders = array();
$result = $this->boxclient->get_folder_items();
foreach ($result->entries as $item) {
if ($item->type != 'folder') {
continue;
}
... | php | protected function get_folder_list() {
if (empty($this->folders)) {
$folders = array();
$result = $this->boxclient->get_folder_items();
foreach ($result->entries as $item) {
if ($item->type != 'folder') {
continue;
}
... | [
"protected",
"function",
"get_folder_list",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"folders",
")",
")",
"{",
"$",
"folders",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"boxclient",
"->",
"get_folder_items",
... | Get the folder list.
This is limited to the folders in the root folder.
@return array of folders. | [
"Get",
"the",
"folder",
"list",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/portfolio/boxnet/lib.php#L153-L169 |
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.