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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
216,100 | moodle/moodle | search/engine/solr/classes/engine.php | engine.standarize_solr_obj | public function standarize_solr_obj(\SolrObject $obj) {
$properties = $obj->getPropertyNames();
$docdata = array();
foreach($properties as $name) {
// http://php.net/manual/en/solrobject.getpropertynames.php#98018.
$name = trim($name);
$docdata[$name] = $obj-... | php | public function standarize_solr_obj(\SolrObject $obj) {
$properties = $obj->getPropertyNames();
$docdata = array();
foreach($properties as $name) {
// http://php.net/manual/en/solrobject.getpropertynames.php#98018.
$name = trim($name);
$docdata[$name] = $obj-... | [
"public",
"function",
"standarize_solr_obj",
"(",
"\\",
"SolrObject",
"$",
"obj",
")",
"{",
"$",
"properties",
"=",
"$",
"obj",
"->",
"getPropertyNames",
"(",
")",
";",
"$",
"docdata",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"properties",
"as",... | Returns a standard php array from a \SolrObject instance.
@param \SolrObject $obj
@return array The returned document as an array. | [
"Returns",
"a",
"standard",
"php",
"array",
"from",
"a",
"\\",
"SolrObject",
"instance",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L717-L727 |
216,101 | moodle/moodle | search/engine/solr/classes/engine.php | engine.add_solr_document | protected function add_solr_document($doc) {
$solrdoc = new \SolrInputDocument();
foreach ($doc as $field => $value) {
$solrdoc->addField($field, $value);
}
try {
$result = $this->get_search_client()->addDocument($solrdoc, true, static::AUTOCOMMIT_WITHIN);
... | php | protected function add_solr_document($doc) {
$solrdoc = new \SolrInputDocument();
foreach ($doc as $field => $value) {
$solrdoc->addField($field, $value);
}
try {
$result = $this->get_search_client()->addDocument($solrdoc, true, static::AUTOCOMMIT_WITHIN);
... | [
"protected",
"function",
"add_solr_document",
"(",
"$",
"doc",
")",
"{",
"$",
"solrdoc",
"=",
"new",
"\\",
"SolrInputDocument",
"(",
")",
";",
"foreach",
"(",
"$",
"doc",
"as",
"$",
"field",
"=>",
"$",
"value",
")",
"{",
"$",
"solrdoc",
"->",
"addField... | Adds a text document to the search engine.
@param array $doc
@return bool | [
"Adds",
"a",
"text",
"document",
"to",
"the",
"search",
"engine",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L759-L777 |
216,102 | moodle/moodle | search/engine/solr/classes/engine.php | engine.process_document_files | protected function process_document_files($document) {
if (!$this->file_indexing_enabled()) {
return;
}
// Maximum rows to process at a time.
$rows = 500;
// Get the attached files.
$files = $document->get_files();
// If this isn't a new document, w... | php | protected function process_document_files($document) {
if (!$this->file_indexing_enabled()) {
return;
}
// Maximum rows to process at a time.
$rows = 500;
// Get the attached files.
$files = $document->get_files();
// If this isn't a new document, w... | [
"protected",
"function",
"process_document_files",
"(",
"$",
"document",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"file_indexing_enabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"// Maximum rows to process at a time.",
"$",
"rows",
"=",
"500",
";",
"// Ge... | Index files attached to the docuemnt, ensuring the index matches the current document files.
For documents that aren't known to be new, we check the index for existing files.
- New files we will add.
- Existing and unchanged files we will skip.
- File that are in the index but not on the document will be deleted from ... | [
"Index",
"files",
"attached",
"to",
"the",
"docuemnt",
"ensuring",
"the",
"index",
"matches",
"the",
"current",
"document",
"files",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L790-L860 |
216,103 | moodle/moodle | search/engine/solr/classes/engine.php | engine.get_indexed_files | protected function get_indexed_files($document, $start = 0, $rows = 500) {
// Build a custom query that will get any document files that are in our solr_filegroupingid.
$query = new \SolrQuery();
// We want to get all file records tied to a document.
// For efficiency, we are building o... | php | protected function get_indexed_files($document, $start = 0, $rows = 500) {
// Build a custom query that will get any document files that are in our solr_filegroupingid.
$query = new \SolrQuery();
// We want to get all file records tied to a document.
// For efficiency, we are building o... | [
"protected",
"function",
"get_indexed_files",
"(",
"$",
"document",
",",
"$",
"start",
"=",
"0",
",",
"$",
"rows",
"=",
"500",
")",
"{",
"// Build a custom query that will get any document files that are in our solr_filegroupingid.",
"$",
"query",
"=",
"new",
"\\",
"S... | Get the currently indexed files for a particular document, returns the total count, and a subset of files.
@param document $document
@param int $start The row to start the results on. Zero indexed.
@param int $rows The number of rows to fetch
@return array A two element array, the first is the total number... | [
"Get",
"the",
"currently",
"indexed",
"files",
"for",
"a",
"particular",
"document",
"returns",
"the",
"total",
"count",
"and",
"a",
"subset",
"of",
"files",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L871-L900 |
216,104 | moodle/moodle | search/engine/solr/classes/engine.php | engine.convert_file_results | protected function convert_file_results($responsedoc) {
if (!$docs = $responsedoc->response->docs) {
return array();
}
$out = array();
foreach ($docs as $doc) {
// Copy the bare minimim needed info.
$result = new \stdClass();
$result->id ... | php | protected function convert_file_results($responsedoc) {
if (!$docs = $responsedoc->response->docs) {
return array();
}
$out = array();
foreach ($docs as $doc) {
// Copy the bare minimim needed info.
$result = new \stdClass();
$result->id ... | [
"protected",
"function",
"convert_file_results",
"(",
"$",
"responsedoc",
")",
"{",
"if",
"(",
"!",
"$",
"docs",
"=",
"$",
"responsedoc",
"->",
"response",
"->",
"docs",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"out",
"=",
"array",
"(",
... | A very lightweight handler for getting information about already indexed files from a Solr response.
@param SolrObject $responsedoc A Solr response document
@return stdClass[] An array of objects that contain the basic information for file processing. | [
"A",
"very",
"lightweight",
"handler",
"for",
"getting",
"information",
"about",
"already",
"indexed",
"files",
"from",
"a",
"Solr",
"response",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L908-L928 |
216,105 | moodle/moodle | search/engine/solr/classes/engine.php | engine.file_is_indexable | protected function file_is_indexable($file) {
if (!empty($this->config->maxindexfilekb) && ($file->get_filesize() > ($this->config->maxindexfilekb * 1024))) {
// The file is too big to index.
return false;
}
$mime = $file->get_mimetype();
if ($mime == 'applicati... | php | protected function file_is_indexable($file) {
if (!empty($this->config->maxindexfilekb) && ($file->get_filesize() > ($this->config->maxindexfilekb * 1024))) {
// The file is too big to index.
return false;
}
$mime = $file->get_mimetype();
if ($mime == 'applicati... | [
"protected",
"function",
"file_is_indexable",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"config",
"->",
"maxindexfilekb",
")",
"&&",
"(",
"$",
"file",
"->",
"get_filesize",
"(",
")",
">",
"(",
"$",
"this",
"->",
"co... | Checks to see if a passed file is indexable.
@param \stored_file $file The file to check
@return bool True if the file can be indexed | [
"Checks",
"to",
"see",
"if",
"a",
"passed",
"file",
"is",
"indexable",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L1045-L1059 |
216,106 | moodle/moodle | search/engine/solr/classes/engine.php | engine.is_server_ready | public function is_server_ready() {
$configured = $this->is_server_configured();
if ($configured !== true) {
return $configured;
}
// As part of the above we have already checked that we can contact the server. For pages
// where performance is important, we skip do... | php | public function is_server_ready() {
$configured = $this->is_server_configured();
if ($configured !== true) {
return $configured;
}
// As part of the above we have already checked that we can contact the server. For pages
// where performance is important, we skip do... | [
"public",
"function",
"is_server_ready",
"(",
")",
"{",
"$",
"configured",
"=",
"$",
"this",
"->",
"is_server_configured",
"(",
")",
";",
"if",
"(",
"$",
"configured",
"!==",
"true",
")",
"{",
"return",
"$",
"configured",
";",
"}",
"// As part of the above w... | Pings the Solr server using search_solr config
@return true|string Returns true if all good or an error string. | [
"Pings",
"the",
"Solr",
"server",
"using",
"search_solr",
"config"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L1136-L1164 |
216,107 | moodle/moodle | search/engine/solr/classes/engine.php | engine.is_server_configured | public function is_server_configured() {
if (empty($this->config->server_hostname) || empty($this->config->indexname)) {
return 'No solr configuration found';
}
if (!$client = $this->get_search_client(false)) {
return get_string('engineserverstatus', 'search');
... | php | public function is_server_configured() {
if (empty($this->config->server_hostname) || empty($this->config->indexname)) {
return 'No solr configuration found';
}
if (!$client = $this->get_search_client(false)) {
return get_string('engineserverstatus', 'search');
... | [
"public",
"function",
"is_server_configured",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"config",
"->",
"server_hostname",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"config",
"->",
"indexname",
")",
")",
"{",
"return",
"'No solr configur... | Is the solr server properly configured?.
@return true|string Returns true if all good or an error string. | [
"Is",
"the",
"solr",
"server",
"properly",
"configured?",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L1171-L1195 |
216,108 | moodle/moodle | search/engine/solr/classes/engine.php | engine.get_solr_major_version | public function get_solr_major_version() {
if ($this->solrmajorversion !== null) {
return $this->solrmajorversion;
}
// We should really ping first the server to see if the specified indexname is valid but
// we want to minimise solr server requests as they are expensive. sy... | php | public function get_solr_major_version() {
if ($this->solrmajorversion !== null) {
return $this->solrmajorversion;
}
// We should really ping first the server to see if the specified indexname is valid but
// we want to minimise solr server requests as they are expensive. sy... | [
"public",
"function",
"get_solr_major_version",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"solrmajorversion",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"solrmajorversion",
";",
"}",
"// We should really ping first the server to see if the specified indexn... | Returns the solr server major version.
@return int | [
"Returns",
"the",
"solr",
"server",
"major",
"version",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L1202-L1215 |
216,109 | moodle/moodle | search/engine/solr/classes/engine.php | engine.get_search_client | protected function get_search_client($triggerexception = true) {
global $CFG;
// Type comparison as it is set to false if not available.
if ($this->client !== null) {
return $this->client;
}
$options = array(
'hostname' => $this->config->server_hostname,... | php | protected function get_search_client($triggerexception = true) {
global $CFG;
// Type comparison as it is set to false if not available.
if ($this->client !== null) {
return $this->client;
}
$options = array(
'hostname' => $this->config->server_hostname,... | [
"protected",
"function",
"get_search_client",
"(",
"$",
"triggerexception",
"=",
"true",
")",
"{",
"global",
"$",
"CFG",
";",
"// Type comparison as it is set to false if not available.",
"if",
"(",
"$",
"this",
"->",
"client",
"!==",
"null",
")",
"{",
"return",
"... | Returns the solr client instance.
We don't reuse SolrClient if we are on libcurl 7.35.0, due to a bug in that version of curl.
@throws \core_search\engine_exception
@param bool $triggerexception
@return \SolrClient | [
"Returns",
"the",
"solr",
"client",
"instance",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L1235-L1284 |
216,110 | moodle/moodle | search/engine/solr/classes/engine.php | engine.get_curl_object | public function get_curl_object() {
if (!is_null($this->curl)) {
return $this->curl;
}
// Connection to Solr is allowed to use 'localhost' and other potentially blocked hosts/ports.
$this->curl = new \curl(['ignoresecurity' => true]);
$options = array();
// ... | php | public function get_curl_object() {
if (!is_null($this->curl)) {
return $this->curl;
}
// Connection to Solr is allowed to use 'localhost' and other potentially blocked hosts/ports.
$this->curl = new \curl(['ignoresecurity' => true]);
$options = array();
// ... | [
"public",
"function",
"get_curl_object",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"curl",
")",
")",
"{",
"return",
"$",
"this",
"->",
"curl",
";",
"}",
"// Connection to Solr is allowed to use 'localhost' and other potentially blocked hosts/... | Returns a curl object for conntecting to solr.
@return \curl | [
"Returns",
"a",
"curl",
"object",
"for",
"conntecting",
"to",
"solr",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L1291-L1336 |
216,111 | moodle/moodle | search/engine/solr/classes/engine.php | engine.get_connection_url | public function get_connection_url($path) {
// Must use the proper protocol, or SSL will fail.
$protocol = !empty($this->config->secure) ? 'https' : 'http';
$url = $protocol . '://' . rtrim($this->config->server_hostname, '/');
if (!empty($this->config->server_port)) {
$url .... | php | public function get_connection_url($path) {
// Must use the proper protocol, or SSL will fail.
$protocol = !empty($this->config->secure) ? 'https' : 'http';
$url = $protocol . '://' . rtrim($this->config->server_hostname, '/');
if (!empty($this->config->server_port)) {
$url .... | [
"public",
"function",
"get_connection_url",
"(",
"$",
"path",
")",
"{",
"// Must use the proper protocol, or SSL will fail.",
"$",
"protocol",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"config",
"->",
"secure",
")",
"?",
"'https'",
":",
"'http'",
";",
"$",
"u... | Return a Moodle url object for the server connection.
@param string $path The solr path to append.
@return \moodle_url | [
"Return",
"a",
"Moodle",
"url",
"object",
"for",
"the",
"server",
"connection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L1344-L1354 |
216,112 | moodle/moodle | search/engine/solr/classes/engine.php | engine.get_supported_orders | public function get_supported_orders(\context $context) {
$orders = parent::get_supported_orders($context);
// If not within a course, no other kind of sorting supported.
$coursecontext = $context->get_course_context(false);
if ($coursecontext) {
// Within a course or activi... | php | public function get_supported_orders(\context $context) {
$orders = parent::get_supported_orders($context);
// If not within a course, no other kind of sorting supported.
$coursecontext = $context->get_course_context(false);
if ($coursecontext) {
// Within a course or activi... | [
"public",
"function",
"get_supported_orders",
"(",
"\\",
"context",
"$",
"context",
")",
"{",
"$",
"orders",
"=",
"parent",
"::",
"get_supported_orders",
"(",
"$",
"context",
")",
";",
"// If not within a course, no other kind of sorting supported.",
"$",
"coursecontext... | Solr supports sort by location within course contexts or below.
@param \context $context Context that the user requested search from
@return array Array from order name => display text | [
"Solr",
"supports",
"sort",
"by",
"location",
"within",
"course",
"contexts",
"or",
"below",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/solr/classes/engine.php#L1398-L1410 |
216,113 | moodle/moodle | badges/criteria/award_criteria_competency.php | award_criteria_competency.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);
$sql = "SELECT DISTINCT bc.badgeid
FROM {badge_criteria} bc
JOIN {badge_criteria_param} bcp ON... | php | public static function has_records_for_competencies($competencyids) {
global $DB;
list($insql, $params) = $DB->get_in_or_equal($competencyids, SQL_PARAMS_NAMED);
$sql = "SELECT DISTINCT bc.badgeid
FROM {badge_criteria} bc
JOIN {badge_criteria_param} bcp ON... | [
"public",
"static",
"function",
"has_records_for_competencies",
"(",
"$",
"competencyids",
")",
"{",
"global",
"$",
"DB",
";",
"list",
"(",
"$",
"insql",
",",
"$",
"params",
")",
"=",
"$",
"DB",
"->",
"get_in_or_equal",
"(",
"$",
"competencyids",
",",
"SQL... | Check if any badge has records for competencies.
@param array $competencyids Array of competencies ids.
@return boolean Return true if competencies were found in any badge. | [
"Check",
"if",
"any",
"badge",
"has",
"records",
"for",
"competencies",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/criteria/award_criteria_competency.php#L272-L282 |
216,114 | moodle/moodle | tag/classes/index_builder.php | core_tag_index_builder.prepare_sql_courses | protected function prepare_sql_courses() {
global $DB;
if (!preg_match('/\\%COURSEFILTER\\%/', $this->sql)) {
return;
}
$this->init_course_access();
$unaccessiblecourses = array_filter($this->courseaccess, function($item) {
return !$item;
});
... | php | protected function prepare_sql_courses() {
global $DB;
if (!preg_match('/\\%COURSEFILTER\\%/', $this->sql)) {
return;
}
$this->init_course_access();
$unaccessiblecourses = array_filter($this->courseaccess, function($item) {
return !$item;
});
... | [
"protected",
"function",
"prepare_sql_courses",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"preg_match",
"(",
"'/\\\\%COURSEFILTER\\\\%/'",
",",
"$",
"this",
"->",
"sql",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"init_course_acce... | Substitute %COURSEFILTER% with an expression filtering out courses where current user does not have access | [
"Substitute",
"%COURSEFILTER%",
"with",
"an",
"expression",
"filtering",
"out",
"courses",
"where",
"current",
"user",
"does",
"not",
"have",
"access"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/tag/classes/index_builder.php#L134-L150 |
216,115 | moodle/moodle | tag/classes/index_builder.php | core_tag_index_builder.prepare_sql_items | protected function prepare_sql_items() {
global $DB;
if (!preg_match('/\\%ITEMFILTER\\%/', $this->sql)) {
return;
}
$this->init_items_access();
$unaccessibleitems = array_filter($this->accessibleitems, function($item) {
return !$item;
});
$... | php | protected function prepare_sql_items() {
global $DB;
if (!preg_match('/\\%ITEMFILTER\\%/', $this->sql)) {
return;
}
$this->init_items_access();
$unaccessibleitems = array_filter($this->accessibleitems, function($item) {
return !$item;
});
$... | [
"protected",
"function",
"prepare_sql_items",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"preg_match",
"(",
"'/\\\\%ITEMFILTER\\\\%/'",
",",
"$",
"this",
"->",
"sql",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"init_items_access",
... | Substitute %ITEMFILTER% with an expression filtering out items where current user does not have access | [
"Substitute",
"%ITEMFILTER%",
"with",
"an",
"expression",
"filtering",
"out",
"items",
"where",
"current",
"user",
"does",
"not",
"have",
"access"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/tag/classes/index_builder.php#L155-L171 |
216,116 | moodle/moodle | tag/classes/index_builder.php | core_tag_index_builder.get_items | public function get_items() {
global $DB, $CFG;
if (is_siteadmin()) {
$this->sql = preg_replace('/\\%COURSEFILTER\\%/', '<>0', $this->sql);
$this->sql = preg_replace('/\\%ITEMFILTER\\%/', '<>0', $this->sql);
return $DB->get_records_sql($this->sql, $this->params, $this... | php | public function get_items() {
global $DB, $CFG;
if (is_siteadmin()) {
$this->sql = preg_replace('/\\%COURSEFILTER\\%/', '<>0', $this->sql);
$this->sql = preg_replace('/\\%ITEMFILTER\\%/', '<>0', $this->sql);
return $DB->get_records_sql($this->sql, $this->params, $this... | [
"public",
"function",
"get_items",
"(",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"CFG",
";",
"if",
"(",
"is_siteadmin",
"(",
")",
")",
"{",
"$",
"this",
"->",
"sql",
"=",
"preg_replace",
"(",
"'/\\\\%COURSEFILTER\\\\%/'",
",",
"'<>0'",
",",
"$",
"this"... | Returns the filtered records from SQL query result.
This function can only be executed after $builder->has_item_that_needs_access_check() returns null
@return array | [
"Returns",
"the",
"filtered",
"records",
"from",
"SQL",
"query",
"result",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/tag/classes/index_builder.php#L202-L230 |
216,117 | moodle/moodle | tag/classes/index_builder.php | core_tag_index_builder.has_item_that_needs_access_check | public function has_item_that_needs_access_check() {
if (is_siteadmin()) {
return null;
}
$this->retrieve_items();
$counter = 0; // Counter for accessible items.
foreach ($this->itemkeys as $id) {
if (!array_key_exists($id, $this->accessibleitems)) {
... | php | public function has_item_that_needs_access_check() {
if (is_siteadmin()) {
return null;
}
$this->retrieve_items();
$counter = 0; // Counter for accessible items.
foreach ($this->itemkeys as $id) {
if (!array_key_exists($id, $this->accessibleitems)) {
... | [
"public",
"function",
"has_item_that_needs_access_check",
"(",
")",
"{",
"if",
"(",
"is_siteadmin",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"this",
"->",
"retrieve_items",
"(",
")",
";",
"$",
"counter",
"=",
"0",
";",
"// Counter for accessible ... | Returns the first row from the SQL result that we don't know whether it is accessible by user or not.
This will return null when we have necessary number of accessible items to return in {@link get_items()}
After analyzing you may decide to mark not only this record but all similar as accessible or not accessible.
Fo... | [
"Returns",
"the",
"first",
"row",
"from",
"the",
"SQL",
"result",
"that",
"we",
"don",
"t",
"know",
"whether",
"it",
"is",
"accessible",
"by",
"user",
"or",
"not",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/tag/classes/index_builder.php#L245-L262 |
216,118 | moodle/moodle | tag/classes/index_builder.php | core_tag_index_builder.init_items_access | protected function init_items_access() {
if ($this->accessibleitems === null) {
$this->accessibleitems = cache::make('core', 'tagindexbuilder')->get($this->component.'__'.$this->itemtype) ?: [];
}
} | php | protected function init_items_access() {
if ($this->accessibleitems === null) {
$this->accessibleitems = cache::make('core', 'tagindexbuilder')->get($this->component.'__'.$this->itemtype) ?: [];
}
} | [
"protected",
"function",
"init_items_access",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"accessibleitems",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"accessibleitems",
"=",
"cache",
"::",
"make",
"(",
"'core'",
",",
"'tagindexbuilder'",
")",
"->",
"ge... | Ensures that we read the items access from the cache. | [
"Ensures",
"that",
"we",
"read",
"the",
"items",
"access",
"from",
"the",
"cache",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/tag/classes/index_builder.php#L329-L333 |
216,119 | moodle/moodle | tag/classes/index_builder.php | core_tag_index_builder.can_access_course | public function can_access_course($courseid) {
$this->init_course_access();
if (!array_key_exists($courseid, $this->courseaccess)) {
$this->courseaccess[$courseid] = can_access_course($this->get_course($courseid)) ? 1 : 0;
$this->cachechangedcourse = true;
}
retur... | php | public function can_access_course($courseid) {
$this->init_course_access();
if (!array_key_exists($courseid, $this->courseaccess)) {
$this->courseaccess[$courseid] = can_access_course($this->get_course($courseid)) ? 1 : 0;
$this->cachechangedcourse = true;
}
retur... | [
"public",
"function",
"can_access_course",
"(",
"$",
"courseid",
")",
"{",
"$",
"this",
"->",
"init_course_access",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"courseid",
",",
"$",
"this",
"->",
"courseaccess",
")",
")",
"{",
"$",
"this... | Checks if current user has access to the course
This method calls global function {@link can_access_course} and caches results
@param int $courseid
@return bool | [
"Checks",
"if",
"current",
"user",
"has",
"access",
"to",
"the",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/tag/classes/index_builder.php#L343-L350 |
216,120 | moodle/moodle | search/engine/simpledb/classes/engine.php | engine.get_simple_query | protected function get_simple_query($q) {
global $DB;
$sql = '(' .
$DB->sql_like('title', '?', false, false) . ' OR ' .
$DB->sql_like('content', '?', false, false) . ' OR ' .
$DB->sql_like('description1', '?', false, false) . ' OR ' .
$DB->sql_like('descr... | php | protected function get_simple_query($q) {
global $DB;
$sql = '(' .
$DB->sql_like('title', '?', false, false) . ' OR ' .
$DB->sql_like('content', '?', false, false) . ' OR ' .
$DB->sql_like('description1', '?', false, false) . ' OR ' .
$DB->sql_like('descr... | [
"protected",
"function",
"get_simple_query",
"(",
"$",
"q",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"'('",
".",
"$",
"DB",
"->",
"sql_like",
"(",
"'title'",
",",
"'?'",
",",
"false",
",",
"false",
")",
".",
"' OR '",
".",
"$",
"DB",
... | Returns the default query for db engines.
@param string $q The query string
@return array SQL string and params list | [
"Returns",
"the",
"default",
"query",
"for",
"db",
"engines",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/engine/simpledb/classes/engine.php#L340-L356 |
216,121 | moodle/moodle | mod/assign/backup/moodle2/backup_assign_stepslib.php | backup_assign_activity_structure_step.annotate_plugin_config_files | protected function annotate_plugin_config_files(backup_nested_element $assign, $subtype) {
$dummyassign = new assign(null, null, null);
$plugins = $dummyassign->load_plugins($subtype);
foreach ($plugins as $plugin) {
$component = $plugin->get_subtype() . '_' . $plugin->get_type();
... | php | protected function annotate_plugin_config_files(backup_nested_element $assign, $subtype) {
$dummyassign = new assign(null, null, null);
$plugins = $dummyassign->load_plugins($subtype);
foreach ($plugins as $plugin) {
$component = $plugin->get_subtype() . '_' . $plugin->get_type();
... | [
"protected",
"function",
"annotate_plugin_config_files",
"(",
"backup_nested_element",
"$",
"assign",
",",
"$",
"subtype",
")",
"{",
"$",
"dummyassign",
"=",
"new",
"assign",
"(",
"null",
",",
"null",
",",
"null",
")",
";",
"$",
"plugins",
"=",
"$",
"dummyas... | Annotate files from plugin configuration
@param backup_nested_element $assign the backup structure of the activity
@param string $subtype the plugin type to handle
@return void | [
"Annotate",
"files",
"from",
"plugin",
"configuration"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/backup/moodle2/backup_assign_stepslib.php#L44-L54 |
216,122 | moodle/moodle | lib/horde/framework/Horde/Support/Guid.php | Horde_Support_Guid.generate | public function generate(array $opts = array())
{
$this->_guid = date('YmdHis')
. '.'
. (isset($opts['prefix']) ? $opts['prefix'] . '.' : '')
. strval(new Horde_Support_Randomid())
. '@'
. (isset($opts['server']) ? $opts['server'] : (isset($_SERVER... | php | public function generate(array $opts = array())
{
$this->_guid = date('YmdHis')
. '.'
. (isset($opts['prefix']) ? $opts['prefix'] . '.' : '')
. strval(new Horde_Support_Randomid())
. '@'
. (isset($opts['server']) ? $opts['server'] : (isset($_SERVER... | [
"public",
"function",
"generate",
"(",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_guid",
"=",
"date",
"(",
"'YmdHis'",
")",
".",
"'.'",
".",
"(",
"isset",
"(",
"$",
"opts",
"[",
"'prefix'",
"]",
")",
"?",
"$",
... | Generates a GUID.
@param array $opts Additional options:
<pre>
'prefix' - (string) A prefix to add between the date string and the
random string.
DEFAULT: NONE
'server' - (string) The server name.
DEFAULT: $_SERVER['SERVER_NAME'] (or 'localhost')
</pre> | [
"Generates",
"a",
"GUID",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Support/Guid.php#L53-L61 |
216,123 | moodle/moodle | lib/typo3/class.t3lib_l10n_locales.php | t3lib_l10n_Locales.initialize | public static function initialize() {
/** @var $instance t3lib_l10n_Locales */
$instance = t3lib_div::makeInstance('t3lib_l10n_Locales');
$instance->isoMapping = array_flip($instance->isoReverseMapping);
// Allow user-defined locales
if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['u... | php | public static function initialize() {
/** @var $instance t3lib_l10n_Locales */
$instance = t3lib_div::makeInstance('t3lib_l10n_Locales');
$instance->isoMapping = array_flip($instance->isoReverseMapping);
// Allow user-defined locales
if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['u... | [
"public",
"static",
"function",
"initialize",
"(",
")",
"{",
"/** @var $instance t3lib_l10n_Locales */",
"$",
"instance",
"=",
"t3lib_div",
"::",
"makeInstance",
"(",
"'t3lib_l10n_Locales'",
")",
";",
"$",
"instance",
"->",
"isoMapping",
"=",
"array_flip",
"(",
"$",... | Initializes the languages.
@static
@return void | [
"Initializes",
"the",
"languages",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_l10n_locales.php#L153-L188 |
216,124 | moodle/moodle | lib/typo3/class.t3lib_l10n_locales.php | t3lib_l10n_Locales.getLocaleDependencies | public function getLocaleDependencies($locale) {
$dependencies = array();
if (isset($this->localeDependencies[$locale])) {
$dependencies = $this->localeDependencies[$locale];
// Search for dependencies recursively
$localeDependencies = $dependencies;
foreach ($localeDependencies as $dependency) {
... | php | public function getLocaleDependencies($locale) {
$dependencies = array();
if (isset($this->localeDependencies[$locale])) {
$dependencies = $this->localeDependencies[$locale];
// Search for dependencies recursively
$localeDependencies = $dependencies;
foreach ($localeDependencies as $dependency) {
... | [
"public",
"function",
"getLocaleDependencies",
"(",
"$",
"locale",
")",
"{",
"$",
"dependencies",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"localeDependencies",
"[",
"$",
"locale",
"]",
")",
")",
"{",
"$",
"dependencies",
... | Returns the dependencies of a given locale, if any.
@param string $locale
@return array | [
"Returns",
"the",
"dependencies",
"of",
"a",
"given",
"locale",
"if",
"any",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_l10n_locales.php#L233-L247 |
216,125 | moodle/moodle | lib/typo3/class.t3lib_l10n_locales.php | t3lib_l10n_Locales.getTerLocaleDependencies | public function getTerLocaleDependencies($locale) {
$terLocale = isset($this->isoMapping[$locale])
? $this->isoMapping[$locale]
: $locale;
return $this->convertToTerLocales($this->getLocaleDependencies($terLocale));
} | php | public function getTerLocaleDependencies($locale) {
$terLocale = isset($this->isoMapping[$locale])
? $this->isoMapping[$locale]
: $locale;
return $this->convertToTerLocales($this->getLocaleDependencies($terLocale));
} | [
"public",
"function",
"getTerLocaleDependencies",
"(",
"$",
"locale",
")",
"{",
"$",
"terLocale",
"=",
"isset",
"(",
"$",
"this",
"->",
"isoMapping",
"[",
"$",
"locale",
"]",
")",
"?",
"$",
"this",
"->",
"isoMapping",
"[",
"$",
"locale",
"]",
":",
"$",... | Returns the dependencies of a given locale using TER compatible locale codes.
@param string $locale
@return array
@deprecated since TYPO3 4.6 | [
"Returns",
"the",
"dependencies",
"of",
"a",
"given",
"locale",
"using",
"TER",
"compatible",
"locale",
"codes",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_l10n_locales.php#L256-L261 |
216,126 | moodle/moodle | lib/typo3/class.t3lib_l10n_locales.php | t3lib_l10n_Locales.convertToTerLocales | protected function convertToTerLocales(array $locales) {
$terLocales = array();
foreach ($locales as $locale) {
$terLocales[] = isset($this->isoReverseMapping[$locale]) ? $this->isoReverseMapping[$locale] : $locale;
}
return $terLocales;
} | php | protected function convertToTerLocales(array $locales) {
$terLocales = array();
foreach ($locales as $locale) {
$terLocales[] = isset($this->isoReverseMapping[$locale]) ? $this->isoReverseMapping[$locale] : $locale;
}
return $terLocales;
} | [
"protected",
"function",
"convertToTerLocales",
"(",
"array",
"$",
"locales",
")",
"{",
"$",
"terLocales",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"locales",
"as",
"$",
"locale",
")",
"{",
"$",
"terLocales",
"[",
"]",
"=",
"isset",
"(",
"$",
... | Converts an array of ISO locale codes into their TER equivalent.
@param array $locales
@return array
@deprecated since TYPO3 4.6 | [
"Converts",
"an",
"array",
"of",
"ISO",
"locale",
"codes",
"into",
"their",
"TER",
"equivalent",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/typo3/class.t3lib_l10n_locales.php#L270-L276 |
216,127 | moodle/moodle | mod/workshop/form/numerrors/backup/moodle2/restore_workshopform_numerrors_subplugin.class.php | restore_workshopform_numerrors_subplugin.process_workshopform_numerrors_map | public function process_workshopform_numerrors_map($data) {
global $DB;
$data = (object)$data;
$data->workshopid = $this->get_new_parentid('workshop');
$DB->insert_record('workshopform_numerrors_map', $data);
} | php | public function process_workshopform_numerrors_map($data) {
global $DB;
$data = (object)$data;
$data->workshopid = $this->get_new_parentid('workshop');
$DB->insert_record('workshopform_numerrors_map', $data);
} | [
"public",
"function",
"process_workshopform_numerrors_map",
"(",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"data",
"=",
"(",
"object",
")",
"$",
"data",
";",
"$",
"data",
"->",
"workshopid",
"=",
"$",
"this",
"->",
"get_new_parentid",
"(",
"'... | Processes the workshopform_numerrors_map element | [
"Processes",
"the",
"workshopform_numerrors_map",
"element"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/numerrors/backup/moodle2/restore_workshopform_numerrors_subplugin.class.php#L103-L109 |
216,128 | moodle/moodle | mod/workshop/form/numerrors/backup/moodle2/restore_workshopform_numerrors_subplugin.class.php | restore_workshopform_numerrors_subplugin.process_dimension_grades_structure | private function process_dimension_grades_structure($elementname, $data) {
global $DB;
$data = (object)$data;
$oldid = $data->id;
$data->assessmentid = $this->get_new_parentid($elementname);
$data->strategy = 'numerrors';
$data->dimensionid = $this->get_mappingid($this-... | php | private function process_dimension_grades_structure($elementname, $data) {
global $DB;
$data = (object)$data;
$oldid = $data->id;
$data->assessmentid = $this->get_new_parentid($elementname);
$data->strategy = 'numerrors';
$data->dimensionid = $this->get_mappingid($this-... | [
"private",
"function",
"process_dimension_grades_structure",
"(",
"$",
"elementname",
",",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"data",
"=",
"(",
"object",
")",
"$",
"data",
";",
"$",
"oldid",
"=",
"$",
"data",
"->",
"id",
";",
"$",
... | Process the dimension grades linked with the given type of assessment
Populates the workshop_grades table with new records mapped to the restored
instances of assessments.
@param mixed $elementname the name of the assessment element
@param array $data parsed xml data | [
"Process",
"the",
"dimension",
"grades",
"linked",
"with",
"the",
"given",
"type",
"of",
"assessment"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/numerrors/backup/moodle2/restore_workshopform_numerrors_subplugin.class.php#L163-L174 |
216,129 | moodle/moodle | lib/tcpdf/include/tcpdf_filters.php | TCPDF_FILTERS.decodeFilter | public static function decodeFilter($filter, $data) {
switch ($filter) {
case 'ASCIIHexDecode': {
return self::decodeFilterASCIIHexDecode($data);
break;
}
case 'ASCII85Decode': {
return self::decodeFilterASCII85Decode($data);
break;
}
case 'LZWDecode': {
return self::decodeFilterLZW... | php | public static function decodeFilter($filter, $data) {
switch ($filter) {
case 'ASCIIHexDecode': {
return self::decodeFilterASCIIHexDecode($data);
break;
}
case 'ASCII85Decode': {
return self::decodeFilterASCII85Decode($data);
break;
}
case 'LZWDecode': {
return self::decodeFilterLZW... | [
"public",
"static",
"function",
"decodeFilter",
"(",
"$",
"filter",
",",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"filter",
")",
"{",
"case",
"'ASCIIHexDecode'",
":",
"{",
"return",
"self",
"::",
"decodeFilterASCIIHexDecode",
"(",
"$",
"data",
")",
";",
... | Decode data using the specified filter type.
@param $filter (string) Filter name.
@param $data (string) Data to decode.
@return Decoded data string.
@since 1.0.000 (2011-05-23)
@public static | [
"Decode",
"data",
"using",
"the",
"specified",
"filter",
"type",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/tcpdf/include/tcpdf_filters.php#L79-L126 |
216,130 | moodle/moodle | lib/tcpdf/include/tcpdf_filters.php | TCPDF_FILTERS.decodeFilterASCII85Decode | public static function decodeFilterASCII85Decode($data) {
// initialize string to return
$decoded = '';
// all white-space characters shall be ignored
$data = preg_replace('/[\s]/', '', $data);
// remove start sequence 2-character sequence <~ (3Ch)(7Eh)
if (strpos($data, '<~') !== false) {
// remove EOD ... | php | public static function decodeFilterASCII85Decode($data) {
// initialize string to return
$decoded = '';
// all white-space characters shall be ignored
$data = preg_replace('/[\s]/', '', $data);
// remove start sequence 2-character sequence <~ (3Ch)(7Eh)
if (strpos($data, '<~') !== false) {
// remove EOD ... | [
"public",
"static",
"function",
"decodeFilterASCII85Decode",
"(",
"$",
"data",
")",
"{",
"// initialize string to return",
"$",
"decoded",
"=",
"''",
";",
"// all white-space characters shall be ignored",
"$",
"data",
"=",
"preg_replace",
"(",
"'/[\\s]/'",
",",
"''",
... | ASCII85Decode
Decodes data encoded in an ASCII base-85 representation, reproducing the original binary data.
@param $data (string) Data to decode.
@return Decoded data string.
@since 1.0.000 (2011-05-23)
@public static | [
"ASCII85Decode",
"Decodes",
"data",
"encoded",
"in",
"an",
"ASCII",
"base",
"-",
"85",
"representation",
"reproducing",
"the",
"original",
"binary",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/tcpdf/include/tcpdf_filters.php#L190-L264 |
216,131 | moodle/moodle | course/classes/task/course_delete_modules.php | course_delete_modules.execute | public function execute() {
global $CFG;
require_once($CFG->dirroot. '/course/lib.php');
// Set the proper user.
if ($this->get_custom_data()->userid !== $this->get_custom_data()->realuserid) {
$realuser = \core_user::get_user($this->get_custom_data()->realuserid, '*', MUST_... | php | public function execute() {
global $CFG;
require_once($CFG->dirroot. '/course/lib.php');
// Set the proper user.
if ($this->get_custom_data()->userid !== $this->get_custom_data()->realuserid) {
$realuser = \core_user::get_user($this->get_custom_data()->realuserid, '*', MUST_... | [
"public",
"function",
"execute",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/course/lib.php'",
")",
";",
"// Set the proper user.",
"if",
"(",
"$",
"this",
"->",
"get_custom_data",
"(",
")",
"->",
"us... | Run the deletion task.
@throws \coding_exception if the module could not be removed. | [
"Run",
"the",
"deletion",
"task",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/classes/task/course_delete_modules.php#L49-L71 |
216,132 | moodle/moodle | lib/listlib.php | moodle_list.to_html | public function to_html($indent=0, $extraargs=array()) {
if (count($this->items)) {
$tabs = str_repeat("\t", $indent);
$first = true;
$itemiter = 1;
$lastitem = '';
$html = '';
foreach ($this->items as $item) {
$last = (cou... | php | public function to_html($indent=0, $extraargs=array()) {
if (count($this->items)) {
$tabs = str_repeat("\t", $indent);
$first = true;
$itemiter = 1;
$lastitem = '';
$html = '';
foreach ($this->items as $item) {
$last = (cou... | [
"public",
"function",
"to_html",
"(",
"$",
"indent",
"=",
"0",
",",
"$",
"extraargs",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"items",
")",
")",
"{",
"$",
"tabs",
"=",
"str_repeat",
"(",
"\"\\t\"",
",",
"$",
... | Returns html string.
@param integer $indent depth of indentation. | [
"Returns",
"html",
"string",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/listlib.php#L115-L148 |
216,133 | moodle/moodle | lib/listlib.php | moodle_list.find_item | public function find_item($id, $suppresserror = false) {
if (isset($this->items)) {
foreach ($this->items as $key => $child) {
if ($child->id == $id) {
return $this->items[$key];
}
}
foreach (array_keys($this->items) as $key... | php | public function find_item($id, $suppresserror = false) {
if (isset($this->items)) {
foreach ($this->items as $key => $child) {
if ($child->id == $id) {
return $this->items[$key];
}
}
foreach (array_keys($this->items) as $key... | [
"public",
"function",
"find_item",
"(",
"$",
"id",
",",
"$",
"suppresserror",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"items",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"key",
"=>",
"$",
"ch... | Recurse down the tree and find an item by it's id.
@param integer $id
@param boolean $suppresserror error if not item found?
@return list_item *copy* or null if item is not found | [
"Recurse",
"down",
"the",
"tree",
"and",
"find",
"an",
"item",
"by",
"it",
"s",
"id",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/listlib.php#L157-L177 |
216,134 | moodle/moodle | lib/listlib.php | moodle_list.list_from_records | public function list_from_records($paged = false, $offset = 0) {
$this->paged = $paged;
$this->offset = $offset;
$this->get_records();
$records = $this->records;
$page = $this->page;
if (!empty($page)) {
$this->firstitem = ($page - 1) * $this->itemsperpage;
... | php | public function list_from_records($paged = false, $offset = 0) {
$this->paged = $paged;
$this->offset = $offset;
$this->get_records();
$records = $this->records;
$page = $this->page;
if (!empty($page)) {
$this->firstitem = ($page - 1) * $this->itemsperpage;
... | [
"public",
"function",
"list_from_records",
"(",
"$",
"paged",
"=",
"false",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"paged",
"=",
"$",
"paged",
";",
"$",
"this",
"->",
"offset",
"=",
"$",
"offset",
";",
"$",
"this",
"->",
"get_re... | Produces a hierarchical tree of list items from a flat array of records.
'parent' field is expected to point to a parent record.
records are already sorted.
If the parent field doesn't point to another record in the array then this is
a top level list
@param integer $offset how many list toplevel items are there in li... | [
"Produces",
"a",
"hierarchical",
"tree",
"of",
"list",
"items",
"from",
"a",
"flat",
"array",
"of",
"records",
".",
"parent",
"field",
"is",
"expected",
"to",
"point",
"to",
"a",
"parent",
"record",
".",
"records",
"are",
"already",
"sorted",
".",
"If",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/listlib.php#L198-L245 |
216,135 | moodle/moodle | lib/listlib.php | moodle_list.display_page_numbers | public function display_page_numbers() {
$html = '';
$topcount = count($this->items);
$this->pagecount = (integer) ceil(($topcount + $this->offset)/ QUESTION_PAGE_LENGTH );
if (!empty($this->page) && ($this->paged)) {
$html = "<div class=\"paging\">".get_string('page').":\n";... | php | public function display_page_numbers() {
$html = '';
$topcount = count($this->items);
$this->pagecount = (integer) ceil(($topcount + $this->offset)/ QUESTION_PAGE_LENGTH );
if (!empty($this->page) && ($this->paged)) {
$html = "<div class=\"paging\">".get_string('page').":\n";... | [
"public",
"function",
"display_page_numbers",
"(",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"topcount",
"=",
"count",
"(",
"$",
"this",
"->",
"items",
")",
";",
"$",
"this",
"->",
"pagecount",
"=",
"(",
"integer",
")",
"ceil",
"(",
"(",
"$",
"to... | display list of page numbers for navigation | [
"display",
"list",
"of",
"page",
"numbers",
"for",
"navigation"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/listlib.php#L255-L273 |
216,136 | moodle/moodle | lib/listlib.php | moodle_list.get_items_peers | public function get_items_peers($itemid) {
$itemref = $this->find_item($itemid);
$peerids = $itemref->parentlist->get_child_ids();
return $peerids;
} | php | public function get_items_peers($itemid) {
$itemref = $this->find_item($itemid);
$peerids = $itemref->parentlist->get_child_ids();
return $peerids;
} | [
"public",
"function",
"get_items_peers",
"(",
"$",
"itemid",
")",
"{",
"$",
"itemref",
"=",
"$",
"this",
"->",
"find_item",
"(",
"$",
"itemid",
")",
";",
"$",
"peerids",
"=",
"$",
"itemref",
"->",
"parentlist",
"->",
"get_child_ids",
"(",
")",
";",
"re... | Returns an array of ids of peers of an item.
@param int itemid - if given, restrict records to those with this parent id.
@return array peer ids | [
"Returns",
"an",
"array",
"of",
"ids",
"of",
"peers",
"of",
"an",
"item",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/listlib.php#L281-L285 |
216,137 | moodle/moodle | lib/listlib.php | moodle_list.get_child_ids | public function get_child_ids() {
$childids = array();
foreach ($this->items as $child) {
$childids[] = $child->id;
}
return $childids;
} | php | public function get_child_ids() {
$childids = array();
foreach ($this->items as $child) {
$childids[] = $child->id;
}
return $childids;
} | [
"public",
"function",
"get_child_ids",
"(",
")",
"{",
"$",
"childids",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"child",
")",
"{",
"$",
"childids",
"[",
"]",
"=",
"$",
"child",
"->",
"id",
";",
"}",
"ret... | Returns an array of ids of child items.
@return array peer ids | [
"Returns",
"an",
"array",
"of",
"ids",
"of",
"child",
"items",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/listlib.php#L292-L298 |
216,138 | moodle/moodle | lib/listlib.php | moodle_list.move_item_up_down | public function move_item_up_down($direction, $id) {
$peers = $this->get_items_peers($id);
$itemkey = array_search($id, $peers);
switch ($direction) {
case 'down' :
if (isset($peers[$itemkey+1])) {
$olditem = $peers[$itemkey+1];
... | php | public function move_item_up_down($direction, $id) {
$peers = $this->get_items_peers($id);
$itemkey = array_search($id, $peers);
switch ($direction) {
case 'down' :
if (isset($peers[$itemkey+1])) {
$olditem = $peers[$itemkey+1];
... | [
"public",
"function",
"move_item_up_down",
"(",
"$",
"direction",
",",
"$",
"id",
")",
"{",
"$",
"peers",
"=",
"$",
"this",
"->",
"get_items_peers",
"(",
"$",
"id",
")",
";",
"$",
"itemkey",
"=",
"array_search",
"(",
"$",
"id",
",",
"$",
"peers",
")"... | Move a record up or down
@param string $direction up / down
@param integer $id | [
"Move",
"a",
"record",
"up",
"or",
"down"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/listlib.php#L317-L342 |
216,139 | moodle/moodle | lib/listlib.php | moodle_list.move_item_left | public function move_item_left($id) {
global $DB;
$item = $this->find_item($id);
if (!isset($item->parentlist->parentitem->parentlist)) {
print_error('listcantmoveleft');
} else {
$newpeers = $this->get_items_peers($item->parentlist->parentitem->id);
... | php | public function move_item_left($id) {
global $DB;
$item = $this->find_item($id);
if (!isset($item->parentlist->parentitem->parentlist)) {
print_error('listcantmoveleft');
} else {
$newpeers = $this->get_items_peers($item->parentlist->parentitem->id);
... | [
"public",
"function",
"move_item_left",
"(",
"$",
"id",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"item",
"=",
"$",
"this",
"->",
"find_item",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"item",
"->",
"parentlist",
"->",
"parentitem... | Moves the item one step up in the tree.
@param int $id an item index.
@return list_item the item that used to be the parent of the item moved. | [
"Moves",
"the",
"item",
"one",
"step",
"up",
"in",
"the",
"tree",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/listlib.php#L357-L376 |
216,140 | moodle/moodle | lib/listlib.php | list_item.item_html | public function item_html($extraargs = array()) {
if (is_string($this->item)) {
$html = $this->item;
} elseif (is_object($this->item)) {
//for debug purposes only. You should create a sub class to
//properly handle the record
$html = join(', ', (array)$thi... | php | public function item_html($extraargs = array()) {
if (is_string($this->item)) {
$html = $this->item;
} elseif (is_object($this->item)) {
//for debug purposes only. You should create a sub class to
//properly handle the record
$html = join(', ', (array)$thi... | [
"public",
"function",
"item_html",
"(",
"$",
"extraargs",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"item",
")",
")",
"{",
"$",
"html",
"=",
"$",
"this",
"->",
"item",
";",
"}",
"elseif",
"(",
"is_object",
... | Output the html just for this item. Called by to_html which adds html for children. | [
"Output",
"the",
"html",
"just",
"for",
"this",
"item",
".",
"Called",
"by",
"to_html",
"which",
"adds",
"html",
"for",
"children",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/listlib.php#L525-L534 |
216,141 | moodle/moodle | mod/quiz/classes/group_observers.php | group_observers.group_member_removed | public static function group_member_removed($event) {
if (!empty(self::$resetinprogress)) {
// We will take care of that once the course reset ends.
return;
}
quiz_update_open_attempts(array('userid' => $event->relateduserid, 'groupid' => $event->objectid));
} | php | public static function group_member_removed($event) {
if (!empty(self::$resetinprogress)) {
// We will take care of that once the course reset ends.
return;
}
quiz_update_open_attempts(array('userid' => $event->relateduserid, 'groupid' => $event->objectid));
} | [
"public",
"static",
"function",
"group_member_removed",
"(",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"self",
"::",
"$",
"resetinprogress",
")",
")",
"{",
"// We will take care of that once the course reset ends.",
"return",
";",
"}",
"quiz_update_open_... | A group member was deleted.
@param \core\event\base $event The event.
@return void | [
"A",
"group",
"member",
"was",
"deleted",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/group_observers.php#L105-L111 |
216,142 | moodle/moodle | lib/classes/output/icon_system.php | icon_system.remap_icon_name | public final function remap_icon_name($iconname, $component) {
if ($this->map === null) {
$this->map = $this->get_icon_name_map();
}
if ($component == null || $component == 'moodle') {
$component = 'core';
} else if ($component != 'theme') {
$component... | php | public final function remap_icon_name($iconname, $component) {
if ($this->map === null) {
$this->map = $this->get_icon_name_map();
}
if ($component == null || $component == 'moodle') {
$component = 'core';
} else if ($component != 'theme') {
$component... | [
"public",
"final",
"function",
"remap_icon_name",
"(",
"$",
"iconname",
",",
"$",
"component",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"map",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"map",
"=",
"$",
"this",
"->",
"get_icon_name_map",
"(",
")",
";... | Overridable function to map the icon name to something else.
Default is to do no mapping. Map is cached in the singleton. | [
"Overridable",
"function",
"to",
"map",
"the",
"icon",
"name",
"to",
"something",
"else",
".",
"Default",
"is",
"to",
"do",
"no",
"mapping",
".",
"Map",
"is",
"cached",
"in",
"the",
"singleton",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/output/icon_system.php#L133-L147 |
216,143 | moodle/moodle | lib/horde/framework/Horde/Stream/Wrapper/Combine.php | Horde_Stream_Wrapper_Combine.getStream | public static function getStream($data)
{
if (!self::$_id) {
stream_wrapper_register(self::WRAPPER_NAME, __CLASS__);
}
return fopen(
self::WRAPPER_NAME . '://' . ++self::$_id,
'wb',
false,
stream_context_create(array(
... | php | public static function getStream($data)
{
if (!self::$_id) {
stream_wrapper_register(self::WRAPPER_NAME, __CLASS__);
}
return fopen(
self::WRAPPER_NAME . '://' . ++self::$_id,
'wb',
false,
stream_context_create(array(
... | [
"public",
"static",
"function",
"getStream",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"_id",
")",
"{",
"stream_wrapper_register",
"(",
"self",
"::",
"WRAPPER_NAME",
",",
"__CLASS__",
")",
";",
"}",
"return",
"fopen",
"(",
"self",
... | Create a stream from multiple data sources.
@since 2.1.0
@param array $data An array of strings and/or streams to combine into
a single stream.
@return resource A PHP stream. | [
"Create",
"a",
"stream",
"from",
"multiple",
"data",
"sources",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Stream/Wrapper/Combine.php#L88-L104 |
216,144 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Auth/DigestMD5.php | Horde_Imap_Client_Auth_DigestMD5._parseChallenge | protected function _parseChallenge($challenge)
{
$tokens = array(
'maxbuf' => 65536,
'realm' => ''
);
preg_match_all('/([a-z-]+)=("[^"]+(?<!\\\)"|[^,]+)/i', $challenge, $matches, PREG_SET_ORDER);
foreach ($matches as $val) {
$tokens[$val[1]] = tr... | php | protected function _parseChallenge($challenge)
{
$tokens = array(
'maxbuf' => 65536,
'realm' => ''
);
preg_match_all('/([a-z-]+)=("[^"]+(?<!\\\)"|[^,]+)/i', $challenge, $matches, PREG_SET_ORDER);
foreach ($matches as $val) {
$tokens[$val[1]] = tr... | [
"protected",
"function",
"_parseChallenge",
"(",
"$",
"challenge",
")",
"{",
"$",
"tokens",
"=",
"array",
"(",
"'maxbuf'",
"=>",
"65536",
",",
"'realm'",
"=>",
"''",
")",
";",
"preg_match_all",
"(",
"'/([a-z-]+)=(\"[^\"]+(?<!\\\\\\)\"|[^,]+)/i'",
",",
"$",
"chal... | Parses and verifies the digest challenge.
@param string $challenge The digest challenge
@return array The parsed challenge as an array with directives as keys.
@throws Horde_Imap_Client_Exception | [
"Parses",
"and",
"verifies",
"the",
"digest",
"challenge",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Auth/DigestMD5.php#L142-L164 |
216,145 | moodle/moodle | badges/classes/privacy/provider.php | provider.delete_user_data | protected static function delete_user_data($userid) {
global $DB;
// Delete the stuff.
$DB->delete_records('badge_manual_award', ['recipientid' => $userid]);
$DB->delete_records('badge_criteria_met', ['userid' => $userid]);
$DB->delete_records('badge_issued', ['userid' => $useri... | php | protected static function delete_user_data($userid) {
global $DB;
// Delete the stuff.
$DB->delete_records('badge_manual_award', ['recipientid' => $userid]);
$DB->delete_records('badge_criteria_met', ['userid' => $userid]);
$DB->delete_records('badge_issued', ['userid' => $useri... | [
"protected",
"static",
"function",
"delete_user_data",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
";",
"// Delete the stuff.",
"$",
"DB",
"->",
"delete_records",
"(",
"'badge_manual_award'",
",",
"[",
"'recipientid'",
"=>",
"$",
"userid",
"]",
")",
";"... | Delete all the data for a user.
@param int $userid The user ID.
@return void | [
"Delete",
"all",
"the",
"data",
"for",
"a",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/classes/privacy/provider.php#L645-L660 |
216,146 | moodle/moodle | admin/tool/dataprivacy/classes/form/context_instance.php | context_instance.add_purpose_category | protected function add_purpose_category($contextlevel = false) {
$mform = $this->_form;
$addcategorytext = $this->get_add_element_content(get_string('addcategory', 'tool_dataprivacy'));
$categoryselect = $mform->createElement('select', 'categoryid', null, $this->_customdata['categories']);
... | php | protected function add_purpose_category($contextlevel = false) {
$mform = $this->_form;
$addcategorytext = $this->get_add_element_content(get_string('addcategory', 'tool_dataprivacy'));
$categoryselect = $mform->createElement('select', 'categoryid', null, $this->_customdata['categories']);
... | [
"protected",
"function",
"add_purpose_category",
"(",
"$",
"contextlevel",
"=",
"false",
")",
"{",
"$",
"mform",
"=",
"$",
"this",
"->",
"_form",
";",
"$",
"addcategorytext",
"=",
"$",
"this",
"->",
"get_add_element_content",
"(",
"get_string",
"(",
"'addcateg... | Adds purpose and category selectors.
@param int $contextlevel Apply this context level defaults. False for no defaults.
@return null | [
"Adds",
"purpose",
"and",
"category",
"selectors",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/context_instance.php#L75-L102 |
216,147 | moodle/moodle | admin/tool/dataprivacy/classes/form/context_instance.php | context_instance.get_add_element_content | private function get_add_element_content($label) {
global $PAGE, $OUTPUT;
$bs4 = false;
$theme = $PAGE->theme;
if ($theme->name === 'boost') {
$bs4 = true;
} else {
foreach ($theme->parents as $basetheme) {
if ($basetheme === 'boost') {
... | php | private function get_add_element_content($label) {
global $PAGE, $OUTPUT;
$bs4 = false;
$theme = $PAGE->theme;
if ($theme->name === 'boost') {
$bs4 = true;
} else {
foreach ($theme->parents as $basetheme) {
if ($basetheme === 'boost') {
... | [
"private",
"function",
"get_add_element_content",
"(",
"$",
"label",
")",
"{",
"global",
"$",
"PAGE",
",",
"$",
"OUTPUT",
";",
"$",
"bs4",
"=",
"false",
";",
"$",
"theme",
"=",
"$",
"PAGE",
"->",
"theme",
";",
"if",
"(",
"$",
"theme",
"->",
"name",
... | Returns the 'add' label.
It depends on the theme in use.
@param string $label
@return \renderable|string | [
"Returns",
"the",
"add",
"label",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/context_instance.php#L112-L132 |
216,148 | moodle/moodle | admin/tool/dataprivacy/classes/form/context_instance.php | context_instance.get_context_instance_customdata | public static function get_context_instance_customdata(\context $context) {
$persistent = \tool_dataprivacy\context_instance::get_record_by_contextid($context->id, false);
if (!$persistent) {
$persistent = new \tool_dataprivacy\context_instance();
$persistent->set('contextid', $... | php | public static function get_context_instance_customdata(\context $context) {
$persistent = \tool_dataprivacy\context_instance::get_record_by_contextid($context->id, false);
if (!$persistent) {
$persistent = new \tool_dataprivacy\context_instance();
$persistent->set('contextid', $... | [
"public",
"static",
"function",
"get_context_instance_customdata",
"(",
"\\",
"context",
"$",
"context",
")",
"{",
"$",
"persistent",
"=",
"\\",
"tool_dataprivacy",
"\\",
"context_instance",
"::",
"get_record_by_contextid",
"(",
"$",
"context",
"->",
"id",
",",
"f... | Returns the customdata array for the provided context instance.
@param \context $context
@return array | [
"Returns",
"the",
"customdata",
"array",
"for",
"the",
"provided",
"context",
"instance",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/context_instance.php#L140-L190 |
216,149 | moodle/moodle | admin/tool/dataprivacy/classes/form/context_instance.php | context_instance.get_retention_display_text | protected static function get_retention_display_text(purpose $effectivepurpose, $retentioncontextlevel, \context $context) {
global $PAGE;
$renderer = $PAGE->get_renderer('tool_dataprivacy');
$exporter = new \tool_dataprivacy\external\purpose_exporter($effectivepurpose, ['context' => $context]... | php | protected static function get_retention_display_text(purpose $effectivepurpose, $retentioncontextlevel, \context $context) {
global $PAGE;
$renderer = $PAGE->get_renderer('tool_dataprivacy');
$exporter = new \tool_dataprivacy\external\purpose_exporter($effectivepurpose, ['context' => $context]... | [
"protected",
"static",
"function",
"get_retention_display_text",
"(",
"purpose",
"$",
"effectivepurpose",
",",
"$",
"retentioncontextlevel",
",",
"\\",
"context",
"$",
"context",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"renderer",
"=",
"$",
"PAGE",
"->",
"g... | Returns the purpose display text.
@param purpose $effectivepurpose
@param int $retentioncontextlevel
@param \context $context The context, just for displaying (filters) purposes.
@return string | [
"Returns",
"the",
"purpose",
"display",
"text",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/context_instance.php#L200-L224 |
216,150 | moodle/moodle | course/format/formatlegacy.php | format_legacy.supports_ajax | public function supports_ajax() {
// set up default values
$ajaxsupport = parent::supports_ajax();
// get the information from the course format library
$featurefunction = 'callback_'.$this->format.'_ajax_support';
if (function_exists($featurefunction)) {
$formatsupp... | php | public function supports_ajax() {
// set up default values
$ajaxsupport = parent::supports_ajax();
// get the information from the course format library
$featurefunction = 'callback_'.$this->format.'_ajax_support';
if (function_exists($featurefunction)) {
$formatsupp... | [
"public",
"function",
"supports_ajax",
"(",
")",
"{",
"// set up default values",
"$",
"ajaxsupport",
"=",
"parent",
"::",
"supports_ajax",
"(",
")",
";",
"// get the information from the course format library",
"$",
"featurefunction",
"=",
"'callback_'",
".",
"$",
"thi... | Returns the information about the ajax support in the given source format
This function calls function callback_FORMATNAME_ajax_support() if it exists
The returned object's property (boolean)capable indicates that
the course format supports Moodle course ajax features.
@return stdClass | [
"Returns",
"the",
"information",
"about",
"the",
"ajax",
"support",
"in",
"the",
"given",
"source",
"format"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/format/formatlegacy.php#L153-L166 |
216,151 | moodle/moodle | message/externallib.php | core_message_external.send_messages_to_conversation | public static function send_messages_to_conversation(int $conversationid, array $messages = []) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Ensure the current user is a... | php | public static function send_messages_to_conversation(int $conversationid, array $messages = []) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Ensure the current user is a... | [
"public",
"static",
"function",
"send_messages_to_conversation",
"(",
"int",
"$",
"conversationid",
",",
"array",
"$",
"messages",
"=",
"[",
"]",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(... | Send messages from the current USER to a conversation.
This conversation may be any type of conversation, individual or group.
@param int $conversationid the id of the conversation to which the messages will be sent.
@param array $messages An array of message to send.
@return array the array of messages which were se... | [
"Send",
"messages",
"from",
"the",
"current",
"USER",
"to",
"a",
"conversation",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L74-L104 |
216,152 | moodle/moodle | message/externallib.php | core_message_external.create_contacts | public static function create_contacts($userids, $userid = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
$userid = $USER->id;
}
... | php | public static function create_contacts($userids, $userid = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
$userid = $USER->id;
}
... | [
"public",
"static",
"function",
"create_contacts",
"(",
"$",
"userids",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"messaging",
")",
... | Create contacts.
@deprecated since Moodle 3.6
@param array $userids array of user IDs.
@param int $userid The id of the user we are creating the contacts for
@return external_description
@since Moodle 2.5 | [
"Create",
"contacts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L294-L330 |
216,153 | moodle/moodle | message/externallib.php | core_message_external.delete_contacts | public static function delete_contacts($userids, $userid = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
$userid = $USER->id;
}
... | php | public static function delete_contacts($userids, $userid = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
$userid = $USER->id;
}
... | [
"public",
"static",
"function",
"delete_contacts",
"(",
"$",
"userids",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"messaging",
")",
... | Delete contacts.
@param array $userids array of user IDs.
@param int $userid The id of the user we are deleting the contacts for
@return null
@since Moodle 2.5 | [
"Delete",
"contacts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L379-L408 |
216,154 | moodle/moodle | message/externallib.php | core_message_external.mute_conversations | public static function mute_conversations(int $userid, array $conversationids) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Validate context.
$context = context_... | php | public static function mute_conversations(int $userid, array $conversationids) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Validate context.
$context = context_... | [
"public",
"static",
"function",
"mute_conversations",
"(",
"int",
"$",
"userid",
",",
"array",
"$",
"conversationids",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"mes... | Mutes conversations.
@param int $userid The id of the user who is blocking
@param array $conversationids The list of conversations being muted
@return external_description | [
"Mutes",
"conversations",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L443-L470 |
216,155 | moodle/moodle | message/externallib.php | core_message_external.unmute_conversations | public static function unmute_conversations(int $userid, array $conversationids) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Validate context.
$context = contex... | php | public static function unmute_conversations(int $userid, array $conversationids) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Validate context.
$context = contex... | [
"public",
"static",
"function",
"unmute_conversations",
"(",
"int",
"$",
"userid",
",",
"array",
"$",
"conversationids",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"m... | Unmute conversations.
@param int $userid The id of the user who is unblocking
@param array $conversationids The list of conversations being muted | [
"Unmute",
"conversations",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L503-L528 |
216,156 | moodle/moodle | message/externallib.php | core_message_external.block_contacts | public static function block_contacts($userids, $userid = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
$userid = $USER->id;
}
... | php | public static function block_contacts($userids, $userid = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
$userid = $USER->id;
}
... | [
"public",
"static",
"function",
"block_contacts",
"(",
"$",
"userids",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"messaging",
")",
... | Block contacts.
@deprecated since Moodle 3.6
@param array $userids array of user IDs.
@param int $userid The id of the user we are blocking the contacts for
@return external_description
@since Moodle 2.5 | [
"Block",
"contacts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L679-L715 |
216,157 | moodle/moodle | message/externallib.php | core_message_external.unblock_contacts | public static function unblock_contacts($userids, $userid = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
$userid = $USER->id;
}... | php | public static function unblock_contacts($userids, $userid = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
$userid = $USER->id;
}... | [
"public",
"static",
"function",
"unblock_contacts",
"(",
"$",
"userids",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"messaging",
")",
... | Unblock contacts.
@param array $userids array of user IDs.
@param int $userid The id of the user we are unblocking the contacts for
@return null
@since Moodle 2.5 | [
"Unblock",
"contacts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L765-L794 |
216,158 | moodle/moodle | message/externallib.php | core_message_external.get_contact_requests_parameters | public static function get_contact_requests_parameters() {
return new external_function_parameters(
[
'userid' => new external_value(PARAM_INT, 'The id of the user we want the requests for'),
'limitfrom' => new external_value(PARAM_INT, 'Limit from', VALUE_DEFAULT, 0)... | php | public static function get_contact_requests_parameters() {
return new external_function_parameters(
[
'userid' => new external_value(PARAM_INT, 'The id of the user we want the requests for'),
'limitfrom' => new external_value(PARAM_INT, 'Limit from', VALUE_DEFAULT, 0)... | [
"public",
"static",
"function",
"get_contact_requests_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"[",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user we want the requests for'",
")",
",",
"'limi... | Returns contact requests parameters description.
@return external_function_parameters | [
"Returns",
"contact",
"requests",
"parameters",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L821-L829 |
216,159 | moodle/moodle | message/externallib.php | core_message_external.get_conversation_members_parameters | public static function get_conversation_members_parameters() {
return new external_function_parameters(
[
'userid' => new external_value(PARAM_INT, 'The id of the user we are performing this action on behalf of'),
'conversationid' => new external_value(PARAM_INT, 'The... | php | public static function get_conversation_members_parameters() {
return new external_function_parameters(
[
'userid' => new external_value(PARAM_INT, 'The id of the user we are performing this action on behalf of'),
'conversationid' => new external_value(PARAM_INT, 'The... | [
"public",
"static",
"function",
"get_conversation_members_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"[",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user we are performing this action on behalf of'",
... | Returns get conversation members parameters description.
@return external_function_parameters | [
"Returns",
"get",
"conversation",
"members",
"parameters",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L940-L953 |
216,160 | moodle/moodle | message/externallib.php | core_message_external.create_contact_request | public static function create_contact_request(int $userid, int $requesteduserid) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Validate context.
$context = contex... | php | public static function create_contact_request(int $userid, int $requesteduserid) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Validate context.
$context = contex... | [
"public",
"static",
"function",
"create_contact_request",
"(",
"int",
"$",
"userid",
",",
"int",
"$",
"requesteduserid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"m... | Creates a contact request.
@param int $userid The id of the user who is creating the contact request
@param int $requesteduserid The id of the user being requested | [
"Creates",
"a",
"contact",
"request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1034-L1075 |
216,161 | moodle/moodle | message/externallib.php | core_message_external.create_contact_request_returns | public static function create_contact_request_returns() {
return new external_single_structure(
array(
'request' => new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'Message id'),
'userid' ... | php | public static function create_contact_request_returns() {
return new external_single_structure(
array(
'request' => new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'Message id'),
'userid' ... | [
"public",
"static",
"function",
"create_contact_request_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'request'",
"=>",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>",
"new",
"external_value",
"(",
"P... | Creates a contact request return description.
@return external_description | [
"Creates",
"a",
"contact",
"request",
"return",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1082-L1098 |
216,162 | moodle/moodle | message/externallib.php | core_message_external.get_messagearea_contact_structure | private static function get_messagearea_contact_structure() {
return new external_single_structure(
array(
'userid' => new external_value(PARAM_INT, 'The user\'s id'),
'fullname' => new external_value(PARAM_NOTAGS, 'The user\'s name'),
'profileimageurl... | php | private static function get_messagearea_contact_structure() {
return new external_single_structure(
array(
'userid' => new external_value(PARAM_INT, 'The user\'s id'),
'fullname' => new external_value(PARAM_NOTAGS, 'The user\'s name'),
'profileimageurl... | [
"private",
"static",
"function",
"get_messagearea_contact_structure",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The user\\'s id'",
")",
",",
"'fullname'",
"=>",
... | Return the structure of a message area contact.
@return external_single_structure
@since Moodle 3.2 | [
"Return",
"the",
"structure",
"of",
"a",
"message",
"area",
"contact",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1214-L1235 |
216,163 | moodle/moodle | message/externallib.php | core_message_external.get_conversation_structure | private static function get_conversation_structure() {
return new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'The conversation id'),
'name' => new external_value(PARAM_TEXT, 'The conversation name, if set', VALUE_DEFAULT, null),
... | php | private static function get_conversation_structure() {
return new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'The conversation id'),
'name' => new external_value(PARAM_TEXT, 'The conversation name, if set', VALUE_DEFAULT, null),
... | [
"private",
"static",
"function",
"get_conversation_structure",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The conversation id'",
")",
",",
"'name'",
"=>",
"new",
"... | Return the structure of a conversation.
@return external_single_structure
@since Moodle 3.6 | [
"Return",
"the",
"structure",
"of",
"a",
"conversation",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1243-L1265 |
216,164 | moodle/moodle | message/externallib.php | core_message_external.get_conversation_member_structure | private static function get_conversation_member_structure() {
$result = [
'id' => new external_value(PARAM_INT, 'The user id'),
'fullname' => new external_value(PARAM_NOTAGS, 'The user\'s name'),
'profileurl' => new external_value(PARAM_URL, 'The link to the user\'s profile p... | php | private static function get_conversation_member_structure() {
$result = [
'id' => new external_value(PARAM_INT, 'The user id'),
'fullname' => new external_value(PARAM_NOTAGS, 'The user\'s name'),
'profileurl' => new external_value(PARAM_URL, 'The link to the user\'s profile p... | [
"private",
"static",
"function",
"get_conversation_member_structure",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"'id'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The user id'",
")",
",",
"'fullname'",
"=>",
"new",
"external_value",
"(",
"PARAM_NOTAGS",... | Return the structure of a conversation member.
@return external_single_structure
@since Moodle 3.6 | [
"Return",
"the",
"structure",
"of",
"a",
"conversation",
"member",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1273-L1313 |
216,165 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_search_users_in_course_parameters | public static function data_for_messagearea_search_users_in_course_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who is performing the search'),
'courseid' => new external_value(PARAM_INT, ... | php | public static function data_for_messagearea_search_users_in_course_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who is performing the search'),
'courseid' => new external_value(PARAM_INT, ... | [
"public",
"static",
"function",
"data_for_messagearea_search_users_in_course_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user who is performin... | Get messagearea search users in course parameters.
@deprecated since 3.6
@return external_function_parameters
@since 3.2 | [
"Get",
"messagearea",
"search",
"users",
"in",
"course",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1363-L1373 |
216,166 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_search_users_in_course | public static function data_for_messagearea_search_users_in_course($userid, $courseid, $search, $limitfrom = 0,
$limitnum = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
... | php | public static function data_for_messagearea_search_users_in_course($userid, $courseid, $search, $limitfrom = 0,
$limitnum = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
... | [
"public",
"static",
"function",
"data_for_messagearea_search_users_in_course",
"(",
"$",
"userid",
",",
"$",
"courseid",
",",
"$",
"search",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitnum",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"PAGE",
... | Get messagearea search users in course results.
@deprecated since 3.6
@param int $userid The id of the user who is performing the search
@param int $courseid The id of the course
@param string $search The string being searched
@param int $limitfrom
@param int $limitnum
@return stdClass
@throws moodle_exception
@since... | [
"Get",
"messagearea",
"search",
"users",
"in",
"course",
"results",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1389-L1425 |
216,167 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_search_users | public static function data_for_messagearea_search_users($userid, $search, $limitnum = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = context_syste... | php | public static function data_for_messagearea_search_users($userid, $search, $limitnum = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = context_syste... | [
"public",
"static",
"function",
"data_for_messagearea_search_users",
"(",
"$",
"userid",
",",
"$",
"search",
",",
"$",
"limitnum",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"PAGE",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"... | Get messagearea search users results.
@deprecated since 3.6
@param int $userid The id of the user who is performing the search
@param string $search The string being searched
@param int $limitnum
@return stdClass
@throws moodle_exception
@since 3.2 | [
"Get",
"messagearea",
"search",
"users",
"results",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1484-L1516 |
216,168 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_search_users_returns | public static function data_for_messagearea_search_users_returns() {
return new external_single_structure(
array(
'contacts' => new external_multiple_structure(
self::get_messagearea_contact_structure()
),
'courses' => new external_... | php | public static function data_for_messagearea_search_users_returns() {
return new external_single_structure(
array(
'contacts' => new external_multiple_structure(
self::get_messagearea_contact_structure()
),
'courses' => new external_... | [
"public",
"static",
"function",
"data_for_messagearea_search_users_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'contacts'",
"=>",
"new",
"external_multiple_structure",
"(",
"self",
"::",
"get_messagearea_contact_structure",
"("... | Get messagearea search users returns.
@deprecated since 3.6
@return external_single_structure
@since 3.2 | [
"Get",
"messagearea",
"search",
"users",
"returns",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1526-L1546 |
216,169 | moodle/moodle | message/externallib.php | core_message_external.message_search_users_parameters | public static function message_search_users_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who is performing the search'),
'search' => new external_value(PARAM_RAW, 'The string being searche... | php | public static function message_search_users_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who is performing the search'),
'search' => new external_value(PARAM_RAW, 'The string being searche... | [
"public",
"static",
"function",
"message_search_users_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user who is performing the search'",
")",
... | Get messagearea message search users parameters.
@return external_function_parameters
@since 3.6 | [
"Get",
"messagearea",
"message",
"search",
"users",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1563-L1572 |
216,170 | moodle/moodle | message/externallib.php | core_message_external.message_search_users | public static function message_search_users($userid, $search, $limitfrom = 0, $limitnum = 0) {
global $USER;
$systemcontext = context_system::instance();
$params = array(
'userid' => $userid,
'search' => $search,
'limitfrom' => $limitfrom,
'limit... | php | public static function message_search_users($userid, $search, $limitfrom = 0, $limitnum = 0) {
global $USER;
$systemcontext = context_system::instance();
$params = array(
'userid' => $userid,
'search' => $search,
'limitfrom' => $limitfrom,
'limit... | [
"public",
"static",
"function",
"message_search_users",
"(",
"$",
"userid",
",",
"$",
"search",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitnum",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"systemcontext",
"=",
"context_system",
"::",
"ins... | Get search users results.
@param int $userid The id of the user who is performing the search
@param string $search The string being searched
@param int $limitfrom
@param int $limitnum
@return array
@throws moodle_exception
@since 3.6 | [
"Get",
"search",
"users",
"results",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1585-L1610 |
216,171 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_search_messages_parameters | public static function data_for_messagearea_search_messages_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who is performing the search'),
'search' => new external_value(PARAM_RAW, 'The stri... | php | public static function data_for_messagearea_search_messages_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who is performing the search'),
'search' => new external_value(PARAM_RAW, 'The stri... | [
"public",
"static",
"function",
"data_for_messagearea_search_messages_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user who is performing the s... | Get messagearea search messages parameters.
@return external_function_parameters
@since 3.2 | [
"Get",
"messagearea",
"search",
"messages",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1637-L1646 |
216,172 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_search_messages | public static function data_for_messagearea_search_messages($userid, $search, $limitfrom = 0, $limitnum = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = c... | php | public static function data_for_messagearea_search_messages($userid, $search, $limitfrom = 0, $limitnum = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = c... | [
"public",
"static",
"function",
"data_for_messagearea_search_messages",
"(",
"$",
"userid",
",",
"$",
"search",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitnum",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is ... | Get messagearea search messages results.
@param int $userid The id of the user who is performing the search
@param string $search The string being searched
@param int $limitfrom
@param int $limitnum
@return stdClass
@throws moodle_exception
@since 3.2 | [
"Get",
"messagearea",
"search",
"messages",
"results",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1659-L1721 |
216,173 | moodle/moodle | message/externallib.php | core_message_external.get_conversations_parameters | public static function get_conversations_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who we are viewing conversations for'),
'limitfrom' => new external_value(PARAM_INT, 'The offset to st... | php | public static function get_conversations_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who we are viewing conversations for'),
'limitfrom' => new external_value(PARAM_INT, 'The offset to st... | [
"public",
"static",
"function",
"get_conversations_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user who we are viewing conversations for'",
... | Get conversations parameters.
@return external_function_parameters
@since 3.6 | [
"Get",
"conversations",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1745-L1760 |
216,174 | moodle/moodle | message/externallib.php | core_message_external.get_conversations | public static function get_conversations($userid, $limitfrom = 0, $limitnum = 0, int $type = null, bool $favourites = null,
bool $mergeself = false) {
global $CFG, $USER;
// All the standard BL checks.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', ... | php | public static function get_conversations($userid, $limitfrom = 0, $limitnum = 0, int $type = null, bool $favourites = null,
bool $mergeself = false) {
global $CFG, $USER;
// All the standard BL checks.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', ... | [
"public",
"static",
"function",
"get_conversations",
"(",
"$",
"userid",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitnum",
"=",
"0",
",",
"int",
"$",
"type",
"=",
"null",
",",
"bool",
"$",
"favourites",
"=",
"null",
",",
"bool",
"$",
"mergeself",
... | Get the list of conversations for the user.
@param int $userid The id of the user who is performing the search
@param int $limitfrom
@param int $limitnum
@param int|null $type
@param bool|null $favourites
@param bool $mergeself whether to include self-conversations (true) or ONLY private conversations (false)
when pri... | [
"Get",
"the",
"list",
"of",
"conversations",
"for",
"the",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1776-L1812 |
216,175 | moodle/moodle | message/externallib.php | core_message_external.get_conversation_between_users | public static function get_conversation_between_users(
int $userid,
int $otheruserid,
bool $includecontactrequests = false,
bool $includeprivacyinfo = false,
int $memberlimit = 0,
int $memberoffset = 0,
int $messagelimit = 0,
int $messageoffset = 0,
... | php | public static function get_conversation_between_users(
int $userid,
int $otheruserid,
bool $includecontactrequests = false,
bool $includeprivacyinfo = false,
int $memberlimit = 0,
int $memberoffset = 0,
int $messagelimit = 0,
int $messageoffset = 0,
... | [
"public",
"static",
"function",
"get_conversation_between_users",
"(",
"int",
"$",
"userid",
",",
"int",
"$",
"otheruserid",
",",
"bool",
"$",
"includecontactrequests",
"=",
"false",
",",
"bool",
"$",
"includeprivacyinfo",
"=",
"false",
",",
"int",
"$",
"memberl... | Get a single conversation between users.
@param int $userid The user id to get the conversation for
@param int $otheruserid The other user id
@param bool $includecontactrequests Should contact requests be included between members
@param bool $includeprivacyinfo Should privacy info be included between members
@param in... | [
"Get",
"a",
"single",
"conversation",
"between",
"users",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L1966-L2024 |
216,176 | moodle/moodle | message/externallib.php | core_message_external.get_self_conversation_parameters | public static function get_self_conversation_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who we are viewing self-conversations for'),
'messagelimit' => new external_value(PARAM_INT, 'Limi... | php | public static function get_self_conversation_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who we are viewing self-conversations for'),
'messagelimit' => new external_value(PARAM_INT, 'Limi... | [
"public",
"static",
"function",
"get_self_conversation_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user who we are viewing self-conversations ... | Get self-conversation parameters.
@return external_function_parameters | [
"Get",
"self",
"-",
"conversation",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2040-L2049 |
216,177 | moodle/moodle | message/externallib.php | core_message_external.get_self_conversation | public static function get_self_conversation(
int $userid,
int $messagelimit = 0,
int $messageoffset = 0,
bool $newestmessagesfirst = true
) {
global $CFG;
// All the standard BL checks.
if (empty($CFG->messaging)) {
throw new moodle_exception('di... | php | public static function get_self_conversation(
int $userid,
int $messagelimit = 0,
int $messageoffset = 0,
bool $newestmessagesfirst = true
) {
global $CFG;
// All the standard BL checks.
if (empty($CFG->messaging)) {
throw new moodle_exception('di... | [
"public",
"static",
"function",
"get_self_conversation",
"(",
"int",
"$",
"userid",
",",
"int",
"$",
"messagelimit",
"=",
"0",
",",
"int",
"$",
"messageoffset",
"=",
"0",
",",
"bool",
"$",
"newestmessagesfirst",
"=",
"true",
")",
"{",
"global",
"$",
"CFG",... | Get a single self-conversation.
@param int $userid The user id to get the self-conversation for
@param int $messagelimit Limit number of messages to load
@param int $messageoffset Offset the messages
@param bool $newestmessagesfirst Order messages by newest first
@return stdClass
@throws \moodle_exception if the messa... | [
"Get",
"a",
"single",
"self",
"-",
"conversation",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2062-L2109 |
216,178 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_conversations_parameters | public static function data_for_messagearea_conversations_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who we are viewing conversations for'),
'limitfrom' => new external_value(PARAM_INT, ... | php | public static function data_for_messagearea_conversations_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who we are viewing conversations for'),
'limitfrom' => new external_value(PARAM_INT, ... | [
"public",
"static",
"function",
"data_for_messagearea_conversations_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user who we are viewing conver... | The messagearea conversations parameters.
@deprecated since 3.6
@return external_function_parameters
@since 3.2 | [
"The",
"messagearea",
"conversations",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2127-L2135 |
216,179 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_conversations | public static function data_for_messagearea_conversations($userid, $limitfrom = 0, $limitnum = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = conte... | php | public static function data_for_messagearea_conversations($userid, $limitfrom = 0, $limitnum = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = conte... | [
"public",
"static",
"function",
"data_for_messagearea_conversations",
"(",
"$",
"userid",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitnum",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"PAGE",
",",
"$",
"USER",
";",
"// Check if messaging is enab... | Get messagearea conversations.
NOTE FOR FINAL DEPRECATION:
When removing this method, please also consider removal of get_conversations_legacy_formatter()
from the \core_message\helper class. This helper method was used solely to format the new get_conversations() return data
into the old format used here, and in mess... | [
"Get",
"messagearea",
"conversations",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2154-L2185 |
216,180 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_contacts | public static function data_for_messagearea_contacts($userid, $limitfrom = 0, $limitnum = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = context_sy... | php | public static function data_for_messagearea_contacts($userid, $limitfrom = 0, $limitnum = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = context_sy... | [
"public",
"static",
"function",
"data_for_messagearea_contacts",
"(",
"$",
"userid",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitnum",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"PAGE",
",",
"$",
"USER",
";",
"// Check if messaging is enabled."... | Get messagearea contacts parameters.
@deprecated since 3.6
@param int $userid The id of the user who we are viewing conversations for
@param int $limitfrom
@param int $limitnum
@return stdClass
@throws moodle_exception
@since 3.2 | [
"Get",
"messagearea",
"contacts",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2235-L2262 |
216,181 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_messages_parameters | public static function data_for_messagearea_messages_parameters() {
return new external_function_parameters(
array(
'currentuserid' => new external_value(PARAM_INT, 'The current user\'s id'),
'otheruserid' => new external_value(PARAM_INT, 'The other user\'s id'),
... | php | public static function data_for_messagearea_messages_parameters() {
return new external_function_parameters(
array(
'currentuserid' => new external_value(PARAM_INT, 'The current user\'s id'),
'otheruserid' => new external_value(PARAM_INT, 'The other user\'s id'),
... | [
"public",
"static",
"function",
"data_for_messagearea_messages_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'currentuserid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The current user\\'s id'",
")",
",",
... | The messagearea messages parameters.
@deprecated since 3.6
@return external_function_parameters
@since 3.2 | [
"The",
"messagearea",
"messages",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2291-L2303 |
216,182 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_messages | public static function data_for_messagearea_messages($currentuserid, $otheruserid, $limitfrom = 0, $limitnum = 0,
$newest = false, $timefrom = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {... | php | public static function data_for_messagearea_messages($currentuserid, $otheruserid, $limitfrom = 0, $limitnum = 0,
$newest = false, $timefrom = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {... | [
"public",
"static",
"function",
"data_for_messagearea_messages",
"(",
"$",
"currentuserid",
",",
"$",
"otheruserid",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitnum",
"=",
"0",
",",
"$",
"newest",
"=",
"false",
",",
"$",
"timefrom",
"=",
"0",
")",
"... | Get messagearea messages.
@deprecated since 3.6
@param int $currentuserid The current user's id
@param int $otheruserid The other user's id
@param int $limitfrom
@param int $limitnum
@param boolean $newest
@return stdClass
@throws moodle_exception
@since 3.2 | [
"Get",
"messagearea",
"messages",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2318-L2376 |
216,183 | moodle/moodle | message/externallib.php | core_message_external.get_conversation_messages_parameters | public static function get_conversation_messages_parameters() {
return new external_function_parameters(
array(
'currentuserid' => new external_value(PARAM_INT, 'The current user\'s id'),
'convid' => new external_value(PARAM_INT, 'The conversation id'),
... | php | public static function get_conversation_messages_parameters() {
return new external_function_parameters(
array(
'currentuserid' => new external_value(PARAM_INT, 'The current user\'s id'),
'convid' => new external_value(PARAM_INT, 'The conversation id'),
... | [
"public",
"static",
"function",
"get_conversation_messages_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'currentuserid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The current user\\'s id'",
")",
",",
"'c... | The conversation messages parameters.
@return external_function_parameters
@since 3.6 | [
"The",
"conversation",
"messages",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2418-L2430 |
216,184 | moodle/moodle | message/externallib.php | core_message_external.get_conversation_messages | public static function get_conversation_messages(int $currentuserid, int $convid, int $limitfrom = 0, int $limitnum = 0,
bool $newest = false, int $timefrom = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CF... | php | public static function get_conversation_messages(int $currentuserid, int $convid, int $limitfrom = 0, int $limitnum = 0,
bool $newest = false, int $timefrom = 0) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CF... | [
"public",
"static",
"function",
"get_conversation_messages",
"(",
"int",
"$",
"currentuserid",
",",
"int",
"$",
"convid",
",",
"int",
"$",
"limitfrom",
"=",
"0",
",",
"int",
"$",
"limitnum",
"=",
"0",
",",
"bool",
"$",
"newest",
"=",
"false",
",",
"int",... | Get conversation messages.
@param int $currentuserid The current user's id.
@param int $convid The conversation id.
@param int $limitfrom Return a subset of records, starting at this point (optional).
@param int $limitnum Return a subset comprising this many records in total (optional, required if $limitfrom is se... | [
"Get",
"conversation",
"messages",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2445-L2498 |
216,185 | moodle/moodle | message/externallib.php | core_message_external.get_user_contacts_parameters | public static function get_user_contacts_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who we retrieving the contacts for'),
'limitfrom' => new external_value(PARAM_INT, 'Limit from', VALUE... | php | public static function get_user_contacts_parameters() {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user who we retrieving the contacts for'),
'limitfrom' => new external_value(PARAM_INT, 'Limit from', VALUE... | [
"public",
"static",
"function",
"get_user_contacts_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user who we retrieving the contacts for'",
")... | The user contacts return parameters.
@return external_function_parameters | [
"The",
"user",
"contacts",
"return",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2525-L2533 |
216,186 | moodle/moodle | message/externallib.php | core_message_external.get_user_contacts | public static function get_user_contacts(int $userid, int $limitfrom = 0, int $limitnum = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = context_system::i... | php | public static function get_user_contacts(int $userid, int $limitfrom = 0, int $limitnum = 0) {
global $CFG, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = context_system::i... | [
"public",
"static",
"function",
"get_user_contacts",
"(",
"int",
"$",
"userid",
",",
"int",
"$",
"limitfrom",
"=",
"0",
",",
"int",
"$",
"limitnum",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",... | Get user contacts.
@param int $userid The id of the user who we are viewing conversations for
@param int $limitfrom
@param int $limitnum
@return array
@throws moodle_exception | [
"Get",
"user",
"contacts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2544-L2567 |
216,187 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_get_most_recent_message | public static function data_for_messagearea_get_most_recent_message($currentuserid, $otheruserid) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = conte... | php | public static function data_for_messagearea_get_most_recent_message($currentuserid, $otheruserid) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = conte... | [
"public",
"static",
"function",
"data_for_messagearea_get_most_recent_message",
"(",
"$",
"currentuserid",
",",
"$",
"otheruserid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"PAGE",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(... | Get the most recent message in a conversation.
@deprecated since 3.6
@param int $currentuserid The current user's id
@param int $otheruserid The other user's id
@return stdClass
@throws moodle_exception
@since 3.2 | [
"Get",
"the",
"most",
"recent",
"message",
"in",
"a",
"conversation",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2606-L2632 |
216,188 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_get_profile | public static function data_for_messagearea_get_profile($currentuserid, $otheruserid) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = context_system::i... | php | public static function data_for_messagearea_get_profile($currentuserid, $otheruserid) {
global $CFG, $PAGE, $USER;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$systemcontext = context_system::i... | [
"public",
"static",
"function",
"data_for_messagearea_get_profile",
"(",
"$",
"currentuserid",
",",
"$",
"otheruserid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"PAGE",
",",
"$",
"USER",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
... | Get the profile information for a contact.
@deprecated since 3.6
@param int $currentuserid The current user's id
@param int $otheruserid The id of the user whose profile we are viewing
@return stdClass
@throws moodle_exception
@since 3.2 | [
"Get",
"the",
"profile",
"information",
"for",
"a",
"contact",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2680-L2706 |
216,189 | moodle/moodle | message/externallib.php | core_message_external.data_for_messagearea_get_profile_returns | public static function data_for_messagearea_get_profile_returns() {
return new external_single_structure(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user whose profile we are viewing'),
'email' => new external_value(core_user::get_property_type('e... | php | public static function data_for_messagearea_get_profile_returns() {
return new external_single_structure(
array(
'userid' => new external_value(PARAM_INT, 'The id of the user whose profile we are viewing'),
'email' => new external_value(core_user::get_property_type('e... | [
"public",
"static",
"function",
"data_for_messagearea_get_profile_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The id of the user whose profile we are viewing'",
... | The get profile return structure.
@deprecated since 3.6
@return external_single_structure
@since 3.2 | [
"The",
"get",
"profile",
"return",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2715-L2731 |
216,190 | moodle/moodle | message/externallib.php | core_message_external.get_contacts_returns | public static function get_contacts_returns() {
return new external_single_structure(
array(
'online' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM_INT... | php | public static function get_contacts_returns() {
return new external_single_structure(
array(
'online' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM_INT... | [
"public",
"static",
"function",
"get_contacts_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'online'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>",
... | Get contacts return description.
@deprecated since 3.6
@return external_description
@since Moodle 2.5 | [
"Get",
"contacts",
"return",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2842-L2883 |
216,191 | moodle/moodle | message/externallib.php | core_message_external.search_contacts | public static function search_contacts($searchtext, $onlymycourses = false) {
global $CFG, $USER, $PAGE;
require_once($CFG->dirroot . '/user/lib.php');
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
... | php | public static function search_contacts($searchtext, $onlymycourses = false) {
global $CFG, $USER, $PAGE;
require_once($CFG->dirroot . '/user/lib.php');
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
... | [
"public",
"static",
"function",
"search_contacts",
"(",
"$",
"searchtext",
",",
"$",
"onlymycourses",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
",",
"$",
"PAGE",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/user/li... | Search contacts.
@param string $searchtext query string.
@param bool $onlymycourses limit the search to the user's courses only.
@return external_description
@since Moodle 2.5 | [
"Search",
"contacts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2918-L2975 |
216,192 | moodle/moodle | message/externallib.php | core_message_external.search_contacts_returns | public static function search_contacts_returns() {
return new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'User ID'),
'fullname' => new external_value(PARAM_NOTAGS, 'User full name'),... | php | public static function search_contacts_returns() {
return new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'User ID'),
'fullname' => new external_value(PARAM_NOTAGS, 'User full name'),... | [
"public",
"static",
"function",
"search_contacts_returns",
"(",
")",
"{",
"return",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'User ID'",
")",
",",... | Search contacts return description.
@return external_description
@since Moodle 2.5 | [
"Search",
"contacts",
"return",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L2983-L2995 |
216,193 | moodle/moodle | message/externallib.php | core_message_external.get_messages_parameters | public static function get_messages_parameters() {
return new external_function_parameters(
array(
'useridto' => new external_value(PARAM_INT, 'the user id who received the message, 0 for any user', VALUE_REQUIRED),
'useridfrom' => new external_value(
... | php | public static function get_messages_parameters() {
return new external_function_parameters(
array(
'useridto' => new external_value(PARAM_INT, 'the user id who received the message, 0 for any user', VALUE_REQUIRED),
'useridfrom' => new external_value(
... | [
"public",
"static",
"function",
"get_messages_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'useridto'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'the user id who received the message, 0 for any user'",
",",
... | Get messages parameters description.
@return external_function_parameters
@since 2.8 | [
"Get",
"messages",
"parameters",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L3003-L3021 |
216,194 | moodle/moodle | message/externallib.php | core_message_external.get_messages_returns | public static function get_messages_returns() {
return new external_single_structure(
array(
'messages' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM_I... | php | public static function get_messages_returns() {
return new external_single_structure(
array(
'messages' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM_I... | [
"public",
"static",
"function",
"get_messages_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'messages'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>",
... | Get messages return description.
@return external_single_structure
@since 2.8 | [
"Get",
"messages",
"return",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L3190-L3223 |
216,195 | moodle/moodle | message/externallib.php | core_message_external.mark_all_notifications_as_read | public static function mark_all_notifications_as_read($useridto, $useridfrom) {
global $USER;
$params = self::validate_parameters(
self::mark_all_notifications_as_read_parameters(),
array(
'useridto' => $useridto,
'useridfrom' => $useridfrom,
... | php | public static function mark_all_notifications_as_read($useridto, $useridfrom) {
global $USER;
$params = self::validate_parameters(
self::mark_all_notifications_as_read_parameters(),
array(
'useridto' => $useridto,
'useridfrom' => $useridfrom,
... | [
"public",
"static",
"function",
"mark_all_notifications_as_read",
"(",
"$",
"useridto",
",",
"$",
"useridfrom",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"mark_all_notifications_as_read_paramete... | Mark all notifications as read function.
@since 3.2
@throws invalid_parameter_exception
@throws moodle_exception
@param int $useridto the user id who received the message
@param int $useridfrom the user id who send the message. -10 or -20 for no-reply or support user
@return external_description | [
"Mark",
"all",
"notifications",
"as",
"read",
"function",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L3252-L3292 |
216,196 | moodle/moodle | message/externallib.php | core_message_external.get_unread_conversations_count | public static function get_unread_conversations_count($useridto) {
global $USER, $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = self::validate_parameters(
self::get_unr... | php | public static function get_unread_conversations_count($useridto) {
global $USER, $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = self::validate_parameters(
self::get_unr... | [
"public",
"static",
"function",
"get_unread_conversations_count",
"(",
"$",
"useridto",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"CFG",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"messaging",
")",
")",
"{",
"throw",
... | Get unread messages count function.
@since 3.2
@throws invalid_parameter_exception
@throws moodle_exception
@param int $useridto the user id who received the message
@return external_description | [
"Get",
"unread",
"messages",
"count",
"function",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L3327-L3361 |
216,197 | moodle/moodle | message/externallib.php | core_message_external.get_blocked_users | public static function get_blocked_users($userid) {
global $CFG, $USER, $PAGE;
// Warnings array, it can be empty at the end but is mandatory.
$warnings = array();
// Validate params.
$params = array(
'userid' => $userid
);
$params = self::validate_p... | php | public static function get_blocked_users($userid) {
global $CFG, $USER, $PAGE;
// Warnings array, it can be empty at the end but is mandatory.
$warnings = array();
// Validate params.
$params = array(
'userid' => $userid
);
$params = self::validate_p... | [
"public",
"static",
"function",
"get_blocked_users",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
",",
"$",
"PAGE",
";",
"// Warnings array, it can be empty at the end but is mandatory.",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"//... | Retrieve a list of users blocked
@param int $userid the user whose blocked users we want to retrieve
@return external_description
@since 2.9 | [
"Retrieve",
"a",
"list",
"of",
"users",
"blocked"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L3396-L3449 |
216,198 | moodle/moodle | message/externallib.php | core_message_external.get_blocked_users_returns | public static function get_blocked_users_returns() {
return new external_single_structure(
array(
'users' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM... | php | public static function get_blocked_users_returns() {
return new external_single_structure(
array(
'users' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM... | [
"public",
"static",
"function",
"get_blocked_users_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'users'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>"... | Get blocked users return description.
@return external_single_structure
@since 2.9 | [
"Get",
"blocked",
"users",
"return",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L3457-L3473 |
216,199 | moodle/moodle | message/externallib.php | core_message_external.mark_message_read | public static function mark_message_read($messageid, $timeread) {
global $CFG, $DB, $USER;
// Check if private messaging between users is allowed.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Warnings array, it can be empty a... | php | public static function mark_message_read($messageid, $timeread) {
global $CFG, $DB, $USER;
// Check if private messaging between users is allowed.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Warnings array, it can be empty a... | [
"public",
"static",
"function",
"mark_message_read",
"(",
"$",
"messageid",
",",
"$",
"timeread",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
",",
"$",
"USER",
";",
"// Check if private messaging between users is allowed.",
"if",
"(",
"empty",
"(",
"$",
"C... | Mark a single message as read, trigger message_viewed event
@param int $messageid id of the message (in the message table)
@param int $timeread timestamp for when the message should be marked read
@return external_description
@throws invalid_parameter_exception
@throws moodle_exception
@since 2.9 | [
"Mark",
"a",
"single",
"message",
"as",
"read",
"trigger",
"message_viewed",
"event"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L3501-L3557 |
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.