id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
213,700 | moodle/moodle | mod/lesson/pagetypes/essay.php | lesson_page_type_essay.format_answer | public function format_answer($answer, $context, $answerformat, $options = []) {
$answer = file_rewrite_pluginfile_urls($answer, 'pluginfile.php', $context->id,
'mod_lesson', 'essay_answers', $options->attemptid);
return parent::format_answer($answer, $context, $answerformat, $options);
... | php | public function format_answer($answer, $context, $answerformat, $options = []) {
$answer = file_rewrite_pluginfile_urls($answer, 'pluginfile.php', $context->id,
'mod_lesson', 'essay_answers', $options->attemptid);
return parent::format_answer($answer, $context, $answerformat, $options);
... | [
"public",
"function",
"format_answer",
"(",
"$",
"answer",
",",
"$",
"context",
",",
"$",
"answerformat",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"answer",
"=",
"file_rewrite_pluginfile_urls",
"(",
"$",
"answer",
",",
"'pluginfile.php'",
",",
"$... | Custom formats the answer to display
@param string $answer
@param context $context
@param int $answerformat
@param array $options Optional param for additional options.
@return string Returns formatted string | [
"Custom",
"formats",
"the",
"answer",
"to",
"display"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/pagetypes/essay.php#L175-L179 |
213,701 | moodle/moodle | lib/horde/framework/Horde/Mime/Mail.php | Horde_Mime_Mail.addHeaders | public function addHeaders($headers = array())
{
foreach ($headers as $header => $value) {
$this->addHeader($header, $value);
}
} | php | public function addHeaders($headers = array())
{
foreach ($headers as $header => $value) {
$this->addHeader($header, $value);
}
} | [
"public",
"function",
"addHeaders",
"(",
"$",
"headers",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"header",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"addHeader",
"(",
"$",
"header",
",",
"$",
"value",
")"... | Adds several message headers at once.
@param array $header Hash with header names as keys and header
contents as values.
@throws Horde_Mime_Exception | [
"Adds",
"several",
"message",
"headers",
"at",
"once",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Mail.php#L143-L148 |
213,702 | moodle/moodle | lib/horde/framework/Horde/Mime/Mail.php | Horde_Mime_Mail.addHeader | public function addHeader($header, $value, $overwrite = null)
{
$lc_header = Horde_String::lower($header);
if (is_null($overwrite) &&
in_array($lc_header, $this->_headers->singleFields(true))) {
$overwrite = true;
}
if ($overwrite) {
$this->_head... | php | public function addHeader($header, $value, $overwrite = null)
{
$lc_header = Horde_String::lower($header);
if (is_null($overwrite) &&
in_array($lc_header, $this->_headers->singleFields(true))) {
$overwrite = true;
}
if ($overwrite) {
$this->_head... | [
"public",
"function",
"addHeader",
"(",
"$",
"header",
",",
"$",
"value",
",",
"$",
"overwrite",
"=",
"null",
")",
"{",
"$",
"lc_header",
"=",
"Horde_String",
"::",
"lower",
"(",
"$",
"header",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"overwrite",
"... | Adds a message header.
@param string $header The header name.
@param string $value The header value.
@param boolean $overwrite If true, an existing header of the same name
is being overwritten; if false, multiple
headers are added; if null, the correct
behaviour is automatically chosen depending
on the hea... | [
"Adds",
"a",
"message",
"header",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Mail.php#L163-L181 |
213,703 | moodle/moodle | lib/horde/framework/Horde/Mime/Mail.php | Horde_Mime_Mail.removeHeader | public function removeHeader($header)
{
if (Horde_String::lower($header) === 'bcc') {
unset($this->_bcc);
} else {
$this->_headers->removeHeader($header);
}
} | php | public function removeHeader($header)
{
if (Horde_String::lower($header) === 'bcc') {
unset($this->_bcc);
} else {
$this->_headers->removeHeader($header);
}
} | [
"public",
"function",
"removeHeader",
"(",
"$",
"header",
")",
"{",
"if",
"(",
"Horde_String",
"::",
"lower",
"(",
"$",
"header",
")",
"===",
"'bcc'",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"_bcc",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",... | Removes a message header.
@param string $header The header name. | [
"Removes",
"a",
"message",
"header",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Mail.php#L202-L209 |
213,704 | moodle/moodle | lib/horde/framework/Horde/Mime/Mail.php | Horde_Mime_Mail.setBody | public function setBody($body, $charset = null, $wrap = false)
{
if (!$charset) {
$charset = $this->_charset;
}
$body = Horde_String::convertCharset($body, 'UTF-8', $charset);
if ($wrap) {
$body = Horde_String::wrap($body, $wrap === true ? 76 : $wrap);
... | php | public function setBody($body, $charset = null, $wrap = false)
{
if (!$charset) {
$charset = $this->_charset;
}
$body = Horde_String::convertCharset($body, 'UTF-8', $charset);
if ($wrap) {
$body = Horde_String::wrap($body, $wrap === true ? 76 : $wrap);
... | [
"public",
"function",
"setBody",
"(",
"$",
"body",
",",
"$",
"charset",
"=",
"null",
",",
"$",
"wrap",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"charset",
")",
"{",
"$",
"charset",
"=",
"$",
"this",
"->",
"_charset",
";",
"}",
"$",
"body",
... | Sets the message body text.
@param string $body The message content.
@param string $charset The character set of the message.
@param boolean|integer $wrap If true, wrap the message at column 76;
If an integer wrap the message at that
column. Don't use wrapping if sending
flowed messages. | [
"Sets",
"the",
"message",
"body",
"text",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Mail.php#L221-L235 |
213,705 | moodle/moodle | lib/horde/framework/Horde/Mime/Mail.php | Horde_Mime_Mail.setHtmlBody | public function setHtmlBody($body, $charset = null, $alternative = true)
{
if (!$charset) {
$charset = $this->_charset;
}
$this->_htmlBody = new Horde_Mime_Part();
$this->_htmlBody->setType('text/html');
$this->_htmlBody->setCharset($charset);
$this->_html... | php | public function setHtmlBody($body, $charset = null, $alternative = true)
{
if (!$charset) {
$charset = $this->_charset;
}
$this->_htmlBody = new Horde_Mime_Part();
$this->_htmlBody->setType('text/html');
$this->_htmlBody->setCharset($charset);
$this->_html... | [
"public",
"function",
"setHtmlBody",
"(",
"$",
"body",
",",
"$",
"charset",
"=",
"null",
",",
"$",
"alternative",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"charset",
")",
"{",
"$",
"charset",
"=",
"$",
"this",
"->",
"_charset",
";",
"}",
"$",
... | Sets the HTML message body text.
@param string $body The message content.
@param string $charset The character set of the message.
@param boolean $alternative If true, a multipart/alternative message is
created and the text/plain part is
generated automatically. If false, a
text/html message is generat... | [
"Sets",
"the",
"HTML",
"message",
"body",
"text",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Mail.php#L247-L260 |
213,706 | moodle/moodle | lib/horde/framework/Horde/Mime/Mail.php | Horde_Mime_Mail.addPart | public function addPart($mime_type, $content, $charset = 'us-ascii',
$disposition = null)
{
$part = new Horde_Mime_Part();
$part->setType($mime_type);
$part->setCharset($charset);
$part->setDisposition($disposition);
$part->setContents($content);
... | php | public function addPart($mime_type, $content, $charset = 'us-ascii',
$disposition = null)
{
$part = new Horde_Mime_Part();
$part->setType($mime_type);
$part->setCharset($charset);
$part->setDisposition($disposition);
$part->setContents($content);
... | [
"public",
"function",
"addPart",
"(",
"$",
"mime_type",
",",
"$",
"content",
",",
"$",
"charset",
"=",
"'us-ascii'",
",",
"$",
"disposition",
"=",
"null",
")",
"{",
"$",
"part",
"=",
"new",
"Horde_Mime_Part",
"(",
")",
";",
"$",
"part",
"->",
"setType"... | Adds a message part.
@param string $mime_type The content type of the part.
@param string $content The content of the part.
@param string $charset The character set of the part.
@param string $disposition The content disposition of the part.
@return integer The part number. | [
"Adds",
"a",
"message",
"part",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Mail.php#L272-L281 |
213,707 | moodle/moodle | lib/horde/framework/Horde/Mime/Mail.php | Horde_Mime_Mail.addAttachment | public function addAttachment($file, $name = null, $type = null,
$charset = 'us-ascii')
{
if (empty($name)) {
$name = basename($file);
}
if (empty($type)) {
$type = Horde_Mime_Magic::filenameToMime($file, false);
}
$... | php | public function addAttachment($file, $name = null, $type = null,
$charset = 'us-ascii')
{
if (empty($name)) {
$name = basename($file);
}
if (empty($type)) {
$type = Horde_Mime_Magic::filenameToMime($file, false);
}
$... | [
"public",
"function",
"addAttachment",
"(",
"$",
"file",
",",
"$",
"name",
"=",
"null",
",",
"$",
"type",
"=",
"null",
",",
"$",
"charset",
"=",
"'us-ascii'",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"basen... | Adds an attachment.
@param string $file The path to the file.
@param string $name The file name to use for the attachment.
@param string $type The content type of the file.
@param string $charset The character set of the part (only relevant for
text parts.
@return integer The part number. | [
"Adds",
"an",
"attachment",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Mail.php#L320-L334 |
213,708 | moodle/moodle | lib/horde/framework/Horde/Mime/Mail.php | Horde_Mime_Mail.getRaw | public function getRaw($stream = true)
{
if ($stream) {
$hdr = new Horde_Stream();
$hdr->add($this->_headers->toString(), true);
return Horde_Stream_Wrapper_Combine::getStream(
array($hdr->stream,
$this->getBasePart()->toString(
... | php | public function getRaw($stream = true)
{
if ($stream) {
$hdr = new Horde_Stream();
$hdr->add($this->_headers->toString(), true);
return Horde_Stream_Wrapper_Combine::getStream(
array($hdr->stream,
$this->getBasePart()->toString(
... | [
"public",
"function",
"getRaw",
"(",
"$",
"stream",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"stream",
")",
"{",
"$",
"hdr",
"=",
"new",
"Horde_Stream",
"(",
")",
";",
"$",
"hdr",
"->",
"add",
"(",
"$",
"this",
"->",
"_headers",
"->",
"toString",
"... | Get the raw email data sent by this object.
@param boolean $stream If true, return a stream resource, otherwise
a string is returned.
@return stream|string The raw email data.
@since 2.4.0 | [
"Get",
"the",
"raw",
"email",
"data",
"sent",
"by",
"this",
"object",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Mail.php#L494-L508 |
213,709 | moodle/moodle | admin/tool/lp/classes/output/template_cohorts_table.php | template_cohorts_table.col_actions | protected function col_actions($row) {
global $OUTPUT;
$action = new \confirm_action(get_string('areyousure'));
$url = new moodle_url($this->baseurl);
$url->params(array('removecohort' => $row->id, 'sesskey' => sesskey()));
$actionlink = $OUTPUT->action_link($url, '', $action, n... | php | protected function col_actions($row) {
global $OUTPUT;
$action = new \confirm_action(get_string('areyousure'));
$url = new moodle_url($this->baseurl);
$url->params(array('removecohort' => $row->id, 'sesskey' => sesskey()));
$actionlink = $OUTPUT->action_link($url, '', $action, n... | [
"protected",
"function",
"col_actions",
"(",
"$",
"row",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"action",
"=",
"new",
"\\",
"confirm_action",
"(",
"get_string",
"(",
"'areyousure'",
")",
")",
";",
"$",
"url",
"=",
"new",
"moodle_url",
"(",
"$",
"... | Column actions.
@param object $row
@return string | [
"Column",
"actions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/lp/classes/output/template_cohorts_table.php#L85-L96 |
213,710 | moodle/moodle | admin/tool/lp/classes/output/template_cohorts_table.php | template_cohorts_table.define_table_columns | protected function define_table_columns() {
// Define headers and columns.
$cols = array(
'name' => get_string('name', 'cohort'),
'idnumber' => get_string('idnumber', 'cohort'),
);
if ($this->template->can_manage()) {
$cols['actions'] = get_string('ac... | php | protected function define_table_columns() {
// Define headers and columns.
$cols = array(
'name' => get_string('name', 'cohort'),
'idnumber' => get_string('idnumber', 'cohort'),
);
if ($this->template->can_manage()) {
$cols['actions'] = get_string('ac... | [
"protected",
"function",
"define_table_columns",
"(",
")",
"{",
"// Define headers and columns.",
"$",
"cols",
"=",
"array",
"(",
"'name'",
"=>",
"get_string",
"(",
"'name'",
",",
"'cohort'",
")",
",",
"'idnumber'",
"=>",
"get_string",
"(",
"'idnumber'",
",",
"'... | Setup the headers for the table. | [
"Setup",
"the",
"headers",
"for",
"the",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/lp/classes/output/template_cohorts_table.php#L101-L114 |
213,711 | moodle/moodle | admin/tool/lp/classes/output/template_cohorts_table.php | template_cohorts_table.query_db | public function query_db($pagesize, $useinitialsbar = true) {
global $DB;
list($countsql, $countparams) = $this->get_sql_and_params(true);
list($sql, $params) = $this->get_sql_and_params();
$total = $DB->count_records_sql($countsql, $countparams);
$this->pagesize($pagesize, $tot... | php | public function query_db($pagesize, $useinitialsbar = true) {
global $DB;
list($countsql, $countparams) = $this->get_sql_and_params(true);
list($sql, $params) = $this->get_sql_and_params();
$total = $DB->count_records_sql($countsql, $countparams);
$this->pagesize($pagesize, $tot... | [
"public",
"function",
"query_db",
"(",
"$",
"pagesize",
",",
"$",
"useinitialsbar",
"=",
"true",
")",
"{",
"global",
"$",
"DB",
";",
"list",
"(",
"$",
"countsql",
",",
"$",
"countparams",
")",
"=",
"$",
"this",
"->",
"get_sql_and_params",
"(",
"true",
... | Query the DB.
@param int $pagesize size of page for paginated displayed table.
@param bool $useinitialsbar do you want to use the initials bar. | [
"Query",
"the",
"DB",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/lp/classes/output/template_cohorts_table.php#L171-L184 |
213,712 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base/Debug.php | Horde_Imap_Client_Base_Debug._write | protected function _write($msg, $pre = null)
{
if (!$this->debug || !$this->_stream) {
return;
}
if (!is_null($pre)) {
$new_time = microtime(true);
if (is_null($this->_time)) {
fwrite(
$this->_stream,
... | php | protected function _write($msg, $pre = null)
{
if (!$this->debug || !$this->_stream) {
return;
}
if (!is_null($pre)) {
$new_time = microtime(true);
if (is_null($this->_time)) {
fwrite(
$this->_stream,
... | [
"protected",
"function",
"_write",
"(",
"$",
"msg",
",",
"$",
"pre",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"debug",
"||",
"!",
"$",
"this",
"->",
"_stream",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"is_null",
"(",
"$",
... | Write debug information to the output stream.
@param string $msg Debug data. | [
"Write",
"debug",
"information",
"to",
"the",
"output",
"stream",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base/Debug.php#L125-L150 |
213,713 | moodle/moodle | repository/skydrive/lib.php | repository_skydrive.print_login | public function print_login() {
$url = $this->skydrive->get_login_url();
if ($this->options['ajax']) {
$popup = new stdClass();
$popup->type = 'popup';
$popup->url = $url->out(false);
return array('login' => array($popup));
} else {
ec... | php | public function print_login() {
$url = $this->skydrive->get_login_url();
if ($this->options['ajax']) {
$popup = new stdClass();
$popup->type = 'popup';
$popup->url = $url->out(false);
return array('login' => array($popup));
} else {
ec... | [
"public",
"function",
"print_login",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"skydrive",
"->",
"get_login_url",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'ajax'",
"]",
")",
"{",
"$",
"popup",
"=",
"new",
"stdClass",
"... | Print the login form, if required
@return array of login options | [
"Print",
"the",
"login",
"form",
"if",
"required"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/skydrive/lib.php#L77-L88 |
213,714 | moodle/moodle | repository/skydrive/lib.php | repository_skydrive.get_listing | public function get_listing($path='', $page = '') {
$ret = array();
$ret['dynload'] = true;
$ret['nosearch'] = true;
$ret['manage'] = 'https://skydrive.live.com/';
$fileslist = $this->skydrive->get_file_list($path);
// Filter list for accepted types. Hopefully this will ... | php | public function get_listing($path='', $page = '') {
$ret = array();
$ret['dynload'] = true;
$ret['nosearch'] = true;
$ret['manage'] = 'https://skydrive.live.com/';
$fileslist = $this->skydrive->get_file_list($path);
// Filter list for accepted types. Hopefully this will ... | [
"public",
"function",
"get_listing",
"(",
"$",
"path",
"=",
"''",
",",
"$",
"page",
"=",
"''",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"ret",
"[",
"'dynload'",
"]",
"=",
"true",
";",
"$",
"ret",
"[",
"'nosearch'",
"]",
"=",
"tru... | Given a path, and perhaps a search, get a list of files.
See details on {@link http://docs.moodle.org/dev/Repository_plugins}
@param string $path identifier for current path
@param string $page the page number of file list
@return array list of files including meta information as specified by parent. | [
"Given",
"a",
"path",
"and",
"perhaps",
"a",
"search",
"get",
"a",
"list",
"of",
"files",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/skydrive/lib.php#L99-L128 |
213,715 | moodle/moodle | repository/skydrive/lib.php | repository_skydrive.type_config_form | public static function type_config_form($mform, $classname = 'repository') {
global $OUTPUT;
$a = new stdClass;
$a->callbackurl = microsoft_skydrive::callback_url()->out(false);
$mform->addElement('static', null, '', get_string('oauthinfo', 'repository_skydrive', $a));
$mform->... | php | public static function type_config_form($mform, $classname = 'repository') {
global $OUTPUT;
$a = new stdClass;
$a->callbackurl = microsoft_skydrive::callback_url()->out(false);
$mform->addElement('static', null, '', get_string('oauthinfo', 'repository_skydrive', $a));
$mform->... | [
"public",
"static",
"function",
"type_config_form",
"(",
"$",
"mform",
",",
"$",
"classname",
"=",
"'repository'",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"a",
"=",
"new",
"stdClass",
";",
"$",
"a",
"->",
"callbackurl",
"=",
"microsoft_skydrive",
"::"... | Setup repistory form.
@param moodleform $mform Moodle form (passed by reference)
@param string $classname repository class name | [
"Setup",
"repistory",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/skydrive/lib.php#L159-L176 |
213,716 | moodle/moodle | badges/renderer.php | core_badges_renderer.print_badge_table_actions | public function print_badge_table_actions($badge, $context) {
$actions = "";
if (has_capability('moodle/badges:configuredetails', $context) && $badge->has_criteria()) {
// Activate/deactivate badge.
if ($badge->status == BADGE_STATUS_INACTIVE || $badge->status == BADGE_STATUS_IN... | php | public function print_badge_table_actions($badge, $context) {
$actions = "";
if (has_capability('moodle/badges:configuredetails', $context) && $badge->has_criteria()) {
// Activate/deactivate badge.
if ($badge->status == BADGE_STATUS_INACTIVE || $badge->status == BADGE_STATUS_IN... | [
"public",
"function",
"print_badge_table_actions",
"(",
"$",
"badge",
",",
"$",
"context",
")",
"{",
"$",
"actions",
"=",
"\"\"",
";",
"if",
"(",
"has_capability",
"(",
"'moodle/badges:configuredetails'",
",",
"$",
"context",
")",
"&&",
"$",
"badge",
"->",
"... | Prints action icons for the badge. | [
"Prints",
"action",
"icons",
"for",
"the",
"badge",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L231-L281 |
213,717 | moodle/moodle | badges/renderer.php | core_badges_renderer.render_badge_collection | protected function render_badge_collection(badge_collection $badges) {
$paging = new paging_bar($badges->totalcount, $badges->page, $badges->perpage, $this->page->url, 'page');
$htmlpagingbar = $this->render($paging);
$table = new html_table();
$table->attributes['class'] = 'collection';... | php | protected function render_badge_collection(badge_collection $badges) {
$paging = new paging_bar($badges->totalcount, $badges->page, $badges->perpage, $this->page->url, 'page');
$htmlpagingbar = $this->render($paging);
$table = new html_table();
$table->attributes['class'] = 'collection';... | [
"protected",
"function",
"render_badge_collection",
"(",
"badge_collection",
"$",
"badges",
")",
"{",
"$",
"paging",
"=",
"new",
"paging_bar",
"(",
"$",
"badges",
"->",
"totalcount",
",",
"$",
"badges",
"->",
"page",
",",
"$",
"badges",
"->",
"perpage",
",",... | Displays the available badges. | [
"Displays",
"the",
"available",
"badges",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L594-L634 |
213,718 | moodle/moodle | badges/renderer.php | core_badges_renderer.render_badge_management | protected function render_badge_management(badge_management $badges) {
$paging = new paging_bar($badges->totalcount, $badges->page, $badges->perpage, $this->page->url, 'page');
// New badge button.
$htmlnew = '';
if (has_capability('moodle/badges:createbadge', $this->page->context)) {
... | php | protected function render_badge_management(badge_management $badges) {
$paging = new paging_bar($badges->totalcount, $badges->page, $badges->perpage, $this->page->url, 'page');
// New badge button.
$htmlnew = '';
if (has_capability('moodle/badges:createbadge', $this->page->context)) {
... | [
"protected",
"function",
"render_badge_management",
"(",
"badge_management",
"$",
"badges",
")",
"{",
"$",
"paging",
"=",
"new",
"paging_bar",
"(",
"$",
"badges",
"->",
"totalcount",
",",
"$",
"badges",
"->",
"page",
",",
"$",
"badges",
"->",
"perpage",
",",... | Outputs table of badges with actions available. | [
"Outputs",
"table",
"of",
"badges",
"with",
"actions",
"available",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L637-L687 |
213,719 | moodle/moodle | badges/renderer.php | core_badges_renderer.print_badge_status_box | public function print_badge_status_box(badge $badge) {
if (has_capability('moodle/badges:configurecriteria', $badge->get_context())) {
if (!$badge->has_criteria()) {
$criteriaurl = new moodle_url('/badges/criteria.php', array('id' => $badge->id));
$status = get_strin... | php | public function print_badge_status_box(badge $badge) {
if (has_capability('moodle/badges:configurecriteria', $badge->get_context())) {
if (!$badge->has_criteria()) {
$criteriaurl = new moodle_url('/badges/criteria.php', array('id' => $badge->id));
$status = get_strin... | [
"public",
"function",
"print_badge_status_box",
"(",
"badge",
"$",
"badge",
")",
"{",
"if",
"(",
"has_capability",
"(",
"'moodle/badges:configurecriteria'",
",",
"$",
"badge",
"->",
"get_context",
"(",
")",
")",
")",
"{",
"if",
"(",
"!",
"$",
"badge",
"->",
... | Prints badge status box.
@return Either the status box html as a string or null | [
"Prints",
"badge",
"status",
"box",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L766-L804 |
213,720 | moodle/moodle | badges/renderer.php | core_badges_renderer.print_criteria_actions | public function print_criteria_actions(badge $badge) {
$output = '';
if (!$badge->is_active() && !$badge->is_locked()) {
$accepted = $badge->get_accepted_criteria();
$potential = array_diff($accepted, array_keys($badge->criteria));
if (!empty($potential)) {
... | php | public function print_criteria_actions(badge $badge) {
$output = '';
if (!$badge->is_active() && !$badge->is_locked()) {
$accepted = $badge->get_accepted_criteria();
$potential = array_diff($accepted, array_keys($badge->criteria));
if (!empty($potential)) {
... | [
"public",
"function",
"print_criteria_actions",
"(",
"badge",
"$",
"badge",
")",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"!",
"$",
"badge",
"->",
"is_active",
"(",
")",
"&&",
"!",
"$",
"badge",
"->",
"is_locked",
"(",
")",
")",
"{",
"$",
"ac... | Prints criteria actions for badge editing. | [
"Prints",
"criteria",
"actions",
"for",
"badge",
"editing",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L884-L911 |
213,721 | moodle/moodle | badges/renderer.php | core_badges_renderer.render_badge_recipients | protected function render_badge_recipients(badge_recipients $recipients) {
$paging = new paging_bar($recipients->totalcount, $recipients->page, $recipients->perpage, $this->page->url, 'page');
$htmlpagingbar = $this->render($paging);
$table = new html_table();
$table->attributes['class']... | php | protected function render_badge_recipients(badge_recipients $recipients) {
$paging = new paging_bar($recipients->totalcount, $recipients->page, $recipients->perpage, $this->page->url, 'page');
$htmlpagingbar = $this->render($paging);
$table = new html_table();
$table->attributes['class']... | [
"protected",
"function",
"render_badge_recipients",
"(",
"badge_recipients",
"$",
"recipients",
")",
"{",
"$",
"paging",
"=",
"new",
"paging_bar",
"(",
"$",
"recipients",
"->",
"totalcount",
",",
"$",
"recipients",
"->",
"page",
",",
"$",
"recipients",
"->",
"... | Based on stamps collection plugin. | [
"Based",
"on",
"stamps",
"collection",
"plugin",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L915-L955 |
213,722 | moodle/moodle | badges/renderer.php | core_badges_renderer.helper_sortable_heading | protected function helper_sortable_heading($text, $sortid = null, $sortby = null, $sorthow = null) {
$out = html_writer::tag('span', $text, array('class' => 'text'));
if (!is_null($sortid)) {
if ($sortby !== $sortid || $sorthow !== 'ASC') {
$url = new moodle_url($this->page-... | php | protected function helper_sortable_heading($text, $sortid = null, $sortby = null, $sorthow = null) {
$out = html_writer::tag('span', $text, array('class' => 'text'));
if (!is_null($sortid)) {
if ($sortby !== $sortid || $sorthow !== 'ASC') {
$url = new moodle_url($this->page-... | [
"protected",
"function",
"helper_sortable_heading",
"(",
"$",
"text",
",",
"$",
"sortid",
"=",
"null",
",",
"$",
"sortby",
"=",
"null",
",",
"$",
"sorthow",
"=",
"null",
")",
"{",
"$",
"out",
"=",
"html_writer",
"::",
"tag",
"(",
"'span'",
",",
"$",
... | Renders a text with icons to sort by the given column
This is intended for table headings.
@param string $text The heading text
@param string $sortid The column id used for sorting
@param string $sortby Currently sorted by (column id)
@param string $sorthow Currently sorted how (ASC|DESC)
@return string | [
"Renders",
"a",
"text",
"with",
"icons",
"to",
"sort",
"by",
"the",
"given",
"column"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L974-L992 |
213,723 | moodle/moodle | badges/renderer.php | core_badges_renderer.helper_search_form | protected function helper_search_form($search) {
global $CFG;
require_once($CFG->libdir . '/formslib.php');
$mform = new MoodleQuickForm('searchform', 'POST', $this->page->url);
$mform->addElement('hidden', 'sesskey', sesskey());
$el[] = $mform->createElement('text', 'search',... | php | protected function helper_search_form($search) {
global $CFG;
require_once($CFG->libdir . '/formslib.php');
$mform = new MoodleQuickForm('searchform', 'POST', $this->page->url);
$mform->addElement('hidden', 'sesskey', sesskey());
$el[] = $mform->createElement('text', 'search',... | [
"protected",
"function",
"helper_search_form",
"(",
"$",
"search",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/formslib.php'",
")",
";",
"$",
"mform",
"=",
"new",
"MoodleQuickForm",
"(",
"'searchform'",
",",
... | Renders a search form
@param string $search Search string
@return string HTML | [
"Renders",
"a",
"search",
"form"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L1015-L1034 |
213,724 | moodle/moodle | badges/renderer.php | core_badges_renderer.definition_list | protected function definition_list(array $items, array $attributes = array()) {
$output = html_writer::start_tag('dl', $attributes);
foreach ($items as $label => $value) {
$output .= html_writer::tag('dt', $label);
$output .= html_writer::tag('dd', $value);
}
$out... | php | protected function definition_list(array $items, array $attributes = array()) {
$output = html_writer::start_tag('dl', $attributes);
foreach ($items as $label => $value) {
$output .= html_writer::tag('dt', $label);
$output .= html_writer::tag('dd', $value);
}
$out... | [
"protected",
"function",
"definition_list",
"(",
"array",
"$",
"items",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"output",
"=",
"html_writer",
"::",
"start_tag",
"(",
"'dl'",
",",
"$",
"attributes",
")",
";",
"foreach",
"("... | Renders a definition list
@param array $items the list of items to define
@param array | [
"Renders",
"a",
"definition",
"list"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L1042-L1050 |
213,725 | moodle/moodle | badges/renderer.php | core_badges_renderer.print_badge_endorsement | protected function print_badge_endorsement(badge $badge) {
$output = '';
$endorsement = $badge->get_endorsement();
$dl = array();
$output .= $this->heading(get_string('endorsement', 'badges'), 3);
if (!empty($endorsement)) {
$dl[get_string('issuername', 'badges')] = $... | php | protected function print_badge_endorsement(badge $badge) {
$output = '';
$endorsement = $badge->get_endorsement();
$dl = array();
$output .= $this->heading(get_string('endorsement', 'badges'), 3);
if (!empty($endorsement)) {
$dl[get_string('issuername', 'badges')] = $... | [
"protected",
"function",
"print_badge_endorsement",
"(",
"badge",
"$",
"badge",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"endorsement",
"=",
"$",
"badge",
"->",
"get_endorsement",
"(",
")",
";",
"$",
"dl",
"=",
"array",
"(",
")",
";",
"$",
"output... | Outputs list en badges.
@param badge $badge Badge object.
@return string $output content endorsement to output. | [
"Outputs",
"list",
"en",
"badges",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L1058-L1078 |
213,726 | moodle/moodle | badges/renderer.php | core_badges_renderer.print_badge_related | protected function print_badge_related(badge $badge) {
$output = '';
$relatedbadges = $badge->get_related_badges();
$output .= $this->heading(get_string('relatedbages', 'badges'), 3);
if (!empty($relatedbadges)) {
$items = array();
foreach ($relatedbadges as $rela... | php | protected function print_badge_related(badge $badge) {
$output = '';
$relatedbadges = $badge->get_related_badges();
$output .= $this->heading(get_string('relatedbages', 'badges'), 3);
if (!empty($relatedbadges)) {
$items = array();
foreach ($relatedbadges as $rela... | [
"protected",
"function",
"print_badge_related",
"(",
"badge",
"$",
"badge",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"relatedbadges",
"=",
"$",
"badge",
"->",
"get_related_badges",
"(",
")",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"heading",
"(... | Print list badges related.
@param badge $badge Badge objects.
@return string $output List related badges to output. | [
"Print",
"list",
"badges",
"related",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L1086-L1101 |
213,727 | moodle/moodle | badges/renderer.php | core_badges_renderer.print_badge_alignments | protected function print_badge_alignments(badge $badge) {
$output = '';
$output .= $this->heading(get_string('alignment', 'badges'), 3);
$alignments = $badge->get_alignments();
if (!empty($alignments)) {
$items = array();
foreach ($alignments as $alignment) {
... | php | protected function print_badge_alignments(badge $badge) {
$output = '';
$output .= $this->heading(get_string('alignment', 'badges'), 3);
$alignments = $badge->get_alignments();
if (!empty($alignments)) {
$items = array();
foreach ($alignments as $alignment) {
... | [
"protected",
"function",
"print_badge_alignments",
"(",
"badge",
"$",
"badge",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"heading",
"(",
"get_string",
"(",
"'alignment'",
",",
"'badges'",
")",
",",
"3",
")",
";",
... | Print list badge alignments.
@param badge $badge Badge objects.
@return string $output List alignments to output. | [
"Print",
"list",
"badge",
"alignments",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L1109-L1126 |
213,728 | moodle/moodle | badges/renderer.php | core_badges_renderer.render_badge_related | protected function render_badge_related(badge_related $related) {
$currentbadge = new badge($related->currentbadgeid);
$languages = get_string_manager()->get_list_of_languages();
$paging = new paging_bar($related->totalcount, $related->page, $related->perpage, $this->page->url, 'page');
... | php | protected function render_badge_related(badge_related $related) {
$currentbadge = new badge($related->currentbadgeid);
$languages = get_string_manager()->get_list_of_languages();
$paging = new paging_bar($related->totalcount, $related->page, $related->perpage, $this->page->url, 'page');
... | [
"protected",
"function",
"render_badge_related",
"(",
"badge_related",
"$",
"related",
")",
"{",
"$",
"currentbadge",
"=",
"new",
"badge",
"(",
"$",
"related",
"->",
"currentbadgeid",
")",
";",
"$",
"languages",
"=",
"get_string_manager",
"(",
")",
"->",
"get_... | Renders a table for related badges.
@param badge_related $related list related badges.
@return string list related badges to output. | [
"Renders",
"a",
"table",
"for",
"related",
"badges",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L1134-L1186 |
213,729 | moodle/moodle | badges/renderer.php | core_badges_renderer.render_badge_alignments | protected function render_badge_alignments(badge_alignments $alignments) {
$currentbadge = new badge($alignments->currentbadgeid);
$paging = new paging_bar($alignments->totalcount, $alignments->page, $alignments->perpage, $this->page->url, 'page');
$htmlpagingbar = $this->render($paging);
... | php | protected function render_badge_alignments(badge_alignments $alignments) {
$currentbadge = new badge($alignments->currentbadgeid);
$paging = new paging_bar($alignments->totalcount, $alignments->page, $alignments->perpage, $this->page->url, 'page');
$htmlpagingbar = $this->render($paging);
... | [
"protected",
"function",
"render_badge_alignments",
"(",
"badge_alignments",
"$",
"alignments",
")",
"{",
"$",
"currentbadge",
"=",
"new",
"badge",
"(",
"$",
"alignments",
"->",
"currentbadgeid",
")",
";",
"$",
"paging",
"=",
"new",
"paging_bar",
"(",
"$",
"al... | Renders a table with alignment.
@param badge_alignments $alignments List alignments.
@return string List alignment to output. | [
"Renders",
"a",
"table",
"with",
"alignment",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/renderer.php#L1194-L1238 |
213,730 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.get_quickgrading_html | public function get_quickgrading_html($userid, $grade) {
$commenttext = '';
if ($grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
$commenttext = $feedbackcomments->commenttext;
}
}
$plugin... | php | public function get_quickgrading_html($userid, $grade) {
$commenttext = '';
if ($grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
$commenttext = $feedbackcomments->commenttext;
}
}
$plugin... | [
"public",
"function",
"get_quickgrading_html",
"(",
"$",
"userid",
",",
"$",
"grade",
")",
"{",
"$",
"commenttext",
"=",
"''",
";",
"if",
"(",
"$",
"grade",
")",
"{",
"$",
"feedbackcomments",
"=",
"$",
"this",
"->",
"get_feedback_comments",
"(",
"$",
"gr... | Get quickgrading form elements as html.
@param int $userid The user id in the table this quickgrading element relates to
@param mixed $grade - The grade data - may be null if there are no grades for this user (yet)
@return mixed - A html string containing the html form elements required for quickgrading | [
"Get",
"quickgrading",
"form",
"elements",
"as",
"html",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L69-L86 |
213,731 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.is_quickgrading_modified | public function is_quickgrading_modified($userid, $grade) {
$commenttext = '';
if ($grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
$commenttext = $feedbackcomments->commenttext;
}
}
// No... | php | public function is_quickgrading_modified($userid, $grade) {
$commenttext = '';
if ($grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
$commenttext = $feedbackcomments->commenttext;
}
}
// No... | [
"public",
"function",
"is_quickgrading_modified",
"(",
"$",
"userid",
",",
"$",
"grade",
")",
"{",
"$",
"commenttext",
"=",
"''",
";",
"if",
"(",
"$",
"grade",
")",
"{",
"$",
"feedbackcomments",
"=",
"$",
"this",
"->",
"get_feedback_comments",
"(",
"$",
... | Has the plugin quickgrading form element been modified in the current form submission?
@param int $userid The user id in the table this quickgrading element relates to
@param stdClass $grade The grade
@return boolean - true if the quickgrading form element has been modified | [
"Has",
"the",
"plugin",
"quickgrading",
"form",
"element",
"been",
"modified",
"in",
"the",
"current",
"form",
"submission?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L95-L107 |
213,732 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.is_feedback_modified | public function is_feedback_modified(stdClass $grade, stdClass $data) {
$commenttext = '';
if ($grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
$commenttext = $feedbackcomments->commenttext;
}
}
... | php | public function is_feedback_modified(stdClass $grade, stdClass $data) {
$commenttext = '';
if ($grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
$commenttext = $feedbackcomments->commenttext;
}
}
... | [
"public",
"function",
"is_feedback_modified",
"(",
"stdClass",
"$",
"grade",
",",
"stdClass",
"$",
"data",
")",
"{",
"$",
"commenttext",
"=",
"''",
";",
"if",
"(",
"$",
"grade",
")",
"{",
"$",
"feedbackcomments",
"=",
"$",
"this",
"->",
"get_feedback_comme... | Has the comment feedback been modified?
@param stdClass $grade The grade object.
@param stdClass $data Data from the form submission.
@return boolean True if the comment feedback has been modified, else false. | [
"Has",
"the",
"comment",
"feedback",
"been",
"modified?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L116-L138 |
213,733 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.save_quickgrading_changes | public function save_quickgrading_changes($userid, $grade) {
global $DB;
$feedbackcomment = $this->get_feedback_comments($grade->id);
$quickgradecomments = optional_param('quickgrade_comments_' . $userid, null, PARAM_RAW);
if (!$quickgradecomments && $quickgradecomments !== '') {
... | php | public function save_quickgrading_changes($userid, $grade) {
global $DB;
$feedbackcomment = $this->get_feedback_comments($grade->id);
$quickgradecomments = optional_param('quickgrade_comments_' . $userid, null, PARAM_RAW);
if (!$quickgradecomments && $quickgradecomments !== '') {
... | [
"public",
"function",
"save_quickgrading_changes",
"(",
"$",
"userid",
",",
"$",
"grade",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"feedbackcomment",
"=",
"$",
"this",
"->",
"get_feedback_comments",
"(",
"$",
"grade",
"->",
"id",
")",
";",
"$",
"quickgrade... | Save quickgrading changes.
@param int $userid The user id in the table this quickgrading element relates to
@param stdClass $grade The grade
@return boolean - true if the grade changes were saved correctly | [
"Save",
"quickgrading",
"changes",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L213-L231 |
213,734 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.get_settings | public function get_settings(MoodleQuickForm $mform) {
$default = $this->get_config('commentinline');
if ($default === false) {
// Apply the admin default if we don't have a value yet.
$default = get_config('assignfeedback_comments', 'inline');
}
$mform->addElemen... | php | public function get_settings(MoodleQuickForm $mform) {
$default = $this->get_config('commentinline');
if ($default === false) {
// Apply the admin default if we don't have a value yet.
$default = get_config('assignfeedback_comments', 'inline');
}
$mform->addElemen... | [
"public",
"function",
"get_settings",
"(",
"MoodleQuickForm",
"$",
"mform",
")",
"{",
"$",
"default",
"=",
"$",
"this",
"->",
"get_config",
"(",
"'commentinline'",
")",
";",
"if",
"(",
"$",
"default",
"===",
"false",
")",
"{",
"// Apply the admin default if we... | Get the default setting for feedback comments plugin
@param MoodleQuickForm $mform The form to add elements to
@return void | [
"Get",
"the",
"default",
"setting",
"for",
"feedback",
"comments",
"plugin"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L250-L263 |
213,735 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.convert_submission_text_to_feedback | protected function convert_submission_text_to_feedback($submission, $data, $grade) {
global $DB;
$format = false;
$text = '';
foreach ($this->assignment->get_submission_plugins() as $plugin) {
$fields = $plugin->get_editor_fields();
if ($plugin->is_enabled() && ... | php | protected function convert_submission_text_to_feedback($submission, $data, $grade) {
global $DB;
$format = false;
$text = '';
foreach ($this->assignment->get_submission_plugins() as $plugin) {
$fields = $plugin->get_editor_fields();
if ($plugin->is_enabled() && ... | [
"protected",
"function",
"convert_submission_text_to_feedback",
"(",
"$",
"submission",
",",
"$",
"data",
",",
"$",
"grade",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"format",
"=",
"false",
";",
"$",
"text",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
... | Convert the text from any submission plugin that has an editor field to
a format suitable for inserting in the feedback text field.
@param stdClass $submission
@param stdClass $data - Form data to be filled with the converted submission text and format.
@param stdClass|null $grade
@return boolean - True if feedback te... | [
"Convert",
"the",
"text",
"from",
"any",
"submission",
"plugin",
"that",
"has",
"an",
"editor",
"field",
"to",
"a",
"format",
"suitable",
"for",
"inserting",
"in",
"the",
"feedback",
"text",
"field",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L274-L332 |
213,736 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.get_form_elements_for_user | public function get_form_elements_for_user($grade, MoodleQuickForm $mform, stdClass $data, $userid) {
$commentinlinenabled = $this->get_config('commentinline');
$submission = $this->assignment->get_user_submission($userid, false);
$feedbackcomments = false;
if ($grade) {
$fe... | php | public function get_form_elements_for_user($grade, MoodleQuickForm $mform, stdClass $data, $userid) {
$commentinlinenabled = $this->get_config('commentinline');
$submission = $this->assignment->get_user_submission($userid, false);
$feedbackcomments = false;
if ($grade) {
$fe... | [
"public",
"function",
"get_form_elements_for_user",
"(",
"$",
"grade",
",",
"MoodleQuickForm",
"$",
"mform",
",",
"stdClass",
"$",
"data",
",",
"$",
"userid",
")",
"{",
"$",
"commentinlinenabled",
"=",
"$",
"this",
"->",
"get_config",
"(",
"'commentinline'",
"... | Get form elements for the grading page
@param stdClass|null $grade
@param MoodleQuickForm $mform
@param stdClass $data
@return bool true if elements were added to the form | [
"Get",
"form",
"elements",
"for",
"the",
"grading",
"page"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L342-L377 |
213,737 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.save | public function save(stdClass $grade, stdClass $data) {
global $DB;
// Save the files.
$data = file_postupdate_standard_editor(
$data,
'assignfeedbackcomments',
$this->get_editor_options(),
$this->assignment->get_context(),
ASSIGNFEEDB... | php | public function save(stdClass $grade, stdClass $data) {
global $DB;
// Save the files.
$data = file_postupdate_standard_editor(
$data,
'assignfeedbackcomments',
$this->get_editor_options(),
$this->assignment->get_context(),
ASSIGNFEEDB... | [
"public",
"function",
"save",
"(",
"stdClass",
"$",
"grade",
",",
"stdClass",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"// Save the files.",
"$",
"data",
"=",
"file_postupdate_standard_editor",
"(",
"$",
"data",
",",
"'assignfeedbackcomments'",
",",
"$... | Saving the comment content into database.
@param stdClass $grade
@param stdClass $data
@return bool | [
"Saving",
"the",
"comment",
"content",
"into",
"database",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L386-L413 |
213,738 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.upgrade | public function upgrade(context $oldcontext,
stdClass $oldassignment,
stdClass $oldsubmission,
stdClass $grade,
& $log) {
global $DB;
$feedbackcomments = new stdClass();
$feedbackcomm... | php | public function upgrade(context $oldcontext,
stdClass $oldassignment,
stdClass $oldsubmission,
stdClass $grade,
& $log) {
global $DB;
$feedbackcomments = new stdClass();
$feedbackcomm... | [
"public",
"function",
"upgrade",
"(",
"context",
"$",
"oldcontext",
",",
"stdClass",
"$",
"oldassignment",
",",
"stdClass",
"$",
"oldsubmission",
",",
"stdClass",
"$",
"grade",
",",
"&",
"$",
"log",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"feedbackcomment... | Upgrade the feedback from the old assignment to the new one
@param context $oldcontext - the database for the old assignment context
@param stdClass $oldassignment The data record for the old assignment
@param stdClass $oldsubmission The data record for the old submission
@param stdClass $grade The data record for the... | [
"Upgrade",
"the",
"feedback",
"from",
"the",
"old",
"assignment",
"to",
"the",
"new",
"one"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L508-L527 |
213,739 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.format_for_gradebook | public function format_for_gradebook(stdClass $grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
return $feedbackcomments->commentformat;
}
return FORMAT_MOODLE;
} | php | public function format_for_gradebook(stdClass $grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
return $feedbackcomments->commentformat;
}
return FORMAT_MOODLE;
} | [
"public",
"function",
"format_for_gradebook",
"(",
"stdClass",
"$",
"grade",
")",
"{",
"$",
"feedbackcomments",
"=",
"$",
"this",
"->",
"get_feedback_comments",
"(",
"$",
"grade",
"->",
"id",
")",
";",
"if",
"(",
"$",
"feedbackcomments",
")",
"{",
"return",
... | If this plugin adds to the gradebook comments field, it must specify the format of the text
of the comment
Only one feedback plugin can push comments to the gradebook and that is chosen by the assignment
settings page.
@param stdClass $grade The grade
@return int | [
"If",
"this",
"plugin",
"adds",
"to",
"the",
"gradebook",
"comments",
"field",
"it",
"must",
"specify",
"the",
"format",
"of",
"the",
"text",
"of",
"the",
"comment"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L539-L545 |
213,740 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.text_for_gradebook | public function text_for_gradebook(stdClass $grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
return $feedbackcomments->commenttext;
}
return '';
} | php | public function text_for_gradebook(stdClass $grade) {
$feedbackcomments = $this->get_feedback_comments($grade->id);
if ($feedbackcomments) {
return $feedbackcomments->commenttext;
}
return '';
} | [
"public",
"function",
"text_for_gradebook",
"(",
"stdClass",
"$",
"grade",
")",
"{",
"$",
"feedbackcomments",
"=",
"$",
"this",
"->",
"get_feedback_comments",
"(",
"$",
"grade",
"->",
"id",
")",
";",
"if",
"(",
"$",
"feedbackcomments",
")",
"{",
"return",
... | If this plugin adds to the gradebook comments field, it must format the text
of the comment
Only one feedback plugin can push comments to the gradebook and that is chosen by the assignment
settings page.
@param stdClass $grade The grade
@return string | [
"If",
"this",
"plugin",
"adds",
"to",
"the",
"gradebook",
"comments",
"field",
"it",
"must",
"format",
"the",
"text",
"of",
"the",
"comment"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L557-L563 |
213,741 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.files_for_gradebook | public function files_for_gradebook(stdClass $grade) : array {
return [
'contextid' => $this->assignment->get_context()->id,
'component' => ASSIGNFEEDBACK_COMMENTS_COMPONENT,
'filearea' => ASSIGNFEEDBACK_COMMENTS_FILEAREA,
'itemid' => $grade->id
];
} | php | public function files_for_gradebook(stdClass $grade) : array {
return [
'contextid' => $this->assignment->get_context()->id,
'component' => ASSIGNFEEDBACK_COMMENTS_COMPONENT,
'filearea' => ASSIGNFEEDBACK_COMMENTS_FILEAREA,
'itemid' => $grade->id
];
} | [
"public",
"function",
"files_for_gradebook",
"(",
"stdClass",
"$",
"grade",
")",
":",
"array",
"{",
"return",
"[",
"'contextid'",
"=>",
"$",
"this",
"->",
"assignment",
"->",
"get_context",
"(",
")",
"->",
"id",
",",
"'component'",
"=>",
"ASSIGNFEEDBACK_COMMEN... | Return any files this plugin wishes to save to the gradebook.
@param stdClass $grade The assign_grades object from the db
@return array | [
"Return",
"any",
"files",
"this",
"plugin",
"wishes",
"to",
"save",
"to",
"the",
"gradebook",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L571-L578 |
213,742 | moodle/moodle | mod/assign/feedback/comments/locallib.php | assign_feedback_comments.get_external_parameters | public function get_external_parameters() {
$editorparams = array('text' => new external_value(PARAM_RAW, 'The text for this feedback.'),
'format' => new external_value(PARAM_INT, 'The format for this feedback'));
$editorstructure = new external_single_structure($editorpara... | php | public function get_external_parameters() {
$editorparams = array('text' => new external_value(PARAM_RAW, 'The text for this feedback.'),
'format' => new external_value(PARAM_INT, 'The format for this feedback'));
$editorstructure = new external_single_structure($editorpara... | [
"public",
"function",
"get_external_parameters",
"(",
")",
"{",
"$",
"editorparams",
"=",
"array",
"(",
"'text'",
"=>",
"new",
"external_value",
"(",
"PARAM_RAW",
",",
"'The text for this feedback.'",
")",
",",
"'format'",
"=>",
"new",
"external_value",
"(",
"PARA... | Return a description of external params suitable for uploading an feedback comment from a webservice.
@return external_description|null | [
"Return",
"a",
"description",
"of",
"external",
"params",
"suitable",
"for",
"uploading",
"an",
"feedback",
"comment",
"from",
"a",
"webservice",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/comments/locallib.php#L616-L621 |
213,743 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.get_default_tree_structure | private function get_default_tree_structure() {
$frontpage = \context_course::instance(SITEID);
$categorybranches = $this->get_all_category_branches();
$elements = [
'text' => get_string('contextlevelname' . CONTEXT_SYSTEM, 'tool_dataprivacy'),
'contextlevel' => CONTEX... | php | private function get_default_tree_structure() {
$frontpage = \context_course::instance(SITEID);
$categorybranches = $this->get_all_category_branches();
$elements = [
'text' => get_string('contextlevelname' . CONTEXT_SYSTEM, 'tool_dataprivacy'),
'contextlevel' => CONTEX... | [
"private",
"function",
"get_default_tree_structure",
"(",
")",
"{",
"$",
"frontpage",
"=",
"\\",
"context_course",
"::",
"instance",
"(",
"SITEID",
")",
";",
"$",
"categorybranches",
"=",
"$",
"this",
"->",
"get_all_category_branches",
"(",
")",
";",
"$",
"ele... | Returns the tree default structure.
@return array | [
"Returns",
"the",
"tree",
"default",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L123-L162 |
213,744 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.get_all_category_branches | private function get_all_category_branches() {
$categories = data_registry::get_site_categories();
$categoriesbranch = [];
while (count($categories) > 0) {
foreach ($categories as $key => $category) {
$context = \context_coursecat::instance($category->id);
... | php | private function get_all_category_branches() {
$categories = data_registry::get_site_categories();
$categoriesbranch = [];
while (count($categories) > 0) {
foreach ($categories as $key => $category) {
$context = \context_coursecat::instance($category->id);
... | [
"private",
"function",
"get_all_category_branches",
"(",
")",
"{",
"$",
"categories",
"=",
"data_registry",
"::",
"get_site_categories",
"(",
")",
";",
"$",
"categoriesbranch",
"=",
"[",
"]",
";",
"while",
"(",
"count",
"(",
"$",
"categories",
")",
">",
"0",... | Returns the hierarchy of system course categories.
@return array | [
"Returns",
"the",
"hierarchy",
"of",
"system",
"course",
"categories",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L169-L214 |
213,745 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.get_courses_branch | public static function get_courses_branch(\context $catcontext) {
if ($catcontext->contextlevel !== CONTEXT_COURSECAT) {
throw new \coding_exception('A course category context should be provided');
}
$coursecat = \core_course_category::get($catcontext->instanceid);
$courses... | php | public static function get_courses_branch(\context $catcontext) {
if ($catcontext->contextlevel !== CONTEXT_COURSECAT) {
throw new \coding_exception('A course category context should be provided');
}
$coursecat = \core_course_category::get($catcontext->instanceid);
$courses... | [
"public",
"static",
"function",
"get_courses_branch",
"(",
"\\",
"context",
"$",
"catcontext",
")",
"{",
"if",
"(",
"$",
"catcontext",
"->",
"contextlevel",
"!==",
"CONTEXT_COURSECAT",
")",
"{",
"throw",
"new",
"\\",
"coding_exception",
"(",
"'A course category co... | Gets the courses branch for the provided category.
@param \context $catcontext
@return array | [
"Gets",
"the",
"courses",
"branch",
"for",
"the",
"provided",
"category",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L222-L258 |
213,746 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.get_modules_branch | public static function get_modules_branch(\context $coursecontext) {
if ($coursecontext->contextlevel !== CONTEXT_COURSE) {
throw new \coding_exception('A course context should be provided');
}
$branches = [];
// Using the current user.
$modinfo = get_fast_modinfo(... | php | public static function get_modules_branch(\context $coursecontext) {
if ($coursecontext->contextlevel !== CONTEXT_COURSE) {
throw new \coding_exception('A course context should be provided');
}
$branches = [];
// Using the current user.
$modinfo = get_fast_modinfo(... | [
"public",
"static",
"function",
"get_modules_branch",
"(",
"\\",
"context",
"$",
"coursecontext",
")",
"{",
"if",
"(",
"$",
"coursecontext",
"->",
"contextlevel",
"!==",
"CONTEXT_COURSE",
")",
"{",
"throw",
"new",
"\\",
"coding_exception",
"(",
"'A course context ... | Gets the modules branch for the provided course.
@param \context $coursecontext
@return array | [
"Gets",
"the",
"modules",
"branch",
"for",
"the",
"provided",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L266-L297 |
213,747 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.get_blocks_branch | public static function get_blocks_branch(\context $coursecontext) {
global $DB;
if ($coursecontext->contextlevel !== CONTEXT_COURSE) {
throw new \coding_exception('A course context should be provided');
}
$branches = [];
$children = $coursecontext->get_child_contex... | php | public static function get_blocks_branch(\context $coursecontext) {
global $DB;
if ($coursecontext->contextlevel !== CONTEXT_COURSE) {
throw new \coding_exception('A course context should be provided');
}
$branches = [];
$children = $coursecontext->get_child_contex... | [
"public",
"static",
"function",
"get_blocks_branch",
"(",
"\\",
"context",
"$",
"coursecontext",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"coursecontext",
"->",
"contextlevel",
"!==",
"CONTEXT_COURSE",
")",
"{",
"throw",
"new",
"\\",
"coding_excepti... | Gets the blocks branch for the provided course.
@param \context $coursecontext
@return null | [
"Gets",
"the",
"blocks",
"branch",
"for",
"the",
"provided",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L305-L331 |
213,748 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.add_to_parent_category_branch | private function add_to_parent_category_branch($category, $newnode, &$categoriesbranch) {
foreach ($categoriesbranch as $key => $branch) {
if (!empty($branch['categoryid']) && $branch['categoryid'] == $category->parent) {
// It may be empty (if it does not contain courses and this i... | php | private function add_to_parent_category_branch($category, $newnode, &$categoriesbranch) {
foreach ($categoriesbranch as $key => $branch) {
if (!empty($branch['categoryid']) && $branch['categoryid'] == $category->parent) {
// It may be empty (if it does not contain courses and this i... | [
"private",
"function",
"add_to_parent_category_branch",
"(",
"$",
"category",
",",
"$",
"newnode",
",",
"&",
"$",
"categoriesbranch",
")",
"{",
"foreach",
"(",
"$",
"categoriesbranch",
"as",
"$",
"key",
"=>",
"$",
"branch",
")",
"{",
"if",
"(",
"!",
"empty... | Adds the provided category to the categories branch.
@param stdClass $category
@param array $newnode
@param array $categoriesbranch
@return bool | [
"Adds",
"the",
"provided",
"category",
"to",
"the",
"categories",
"branch",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L341-L361 |
213,749 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.complete | private static function complete($node, $currentcontextlevel = false, $currentcontextid = false) {
if (!isset($node['active'])) {
if ($currentcontextlevel && !empty($node['contextlevel']) &&
$currentcontextlevel == $node['contextlevel'] &&
empty($currentcontex... | php | private static function complete($node, $currentcontextlevel = false, $currentcontextid = false) {
if (!isset($node['active'])) {
if ($currentcontextlevel && !empty($node['contextlevel']) &&
$currentcontextlevel == $node['contextlevel'] &&
empty($currentcontex... | [
"private",
"static",
"function",
"complete",
"(",
"$",
"node",
",",
"$",
"currentcontextlevel",
"=",
"false",
",",
"$",
"currentcontextid",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"node",
"[",
"'active'",
"]",
")",
")",
"{",
"if",
... | Completes tree nodes with default values.
@param array $node
@param int|false $currentcontextlevel
@param int|false $currentcontextid
@return array | [
"Completes",
"tree",
"nodes",
"with",
"default",
"values",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L371-L419 |
213,750 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.purpose_options | public static function purpose_options($purposes, $includenotset = true, $includeinherit = true) {
$options = self::base_options($includenotset, $includeinherit);
foreach ($purposes as $purpose) {
$options[$purpose->get('id')] = $purpose->get('name');
}
return $options;
... | php | public static function purpose_options($purposes, $includenotset = true, $includeinherit = true) {
$options = self::base_options($includenotset, $includeinherit);
foreach ($purposes as $purpose) {
$options[$purpose->get('id')] = $purpose->get('name');
}
return $options;
... | [
"public",
"static",
"function",
"purpose_options",
"(",
"$",
"purposes",
",",
"$",
"includenotset",
"=",
"true",
",",
"$",
"includeinherit",
"=",
"true",
")",
"{",
"$",
"options",
"=",
"self",
"::",
"base_options",
"(",
"$",
"includenotset",
",",
"$",
"inc... | From a list of purpose persistents to a list of id => name purposes.
@param \tool_dataprivacy\purpose[] $purposes
@param bool $includenotset
@param bool $includeinherit
@return string[] | [
"From",
"a",
"list",
"of",
"purpose",
"persistents",
"to",
"a",
"list",
"of",
"id",
"=",
">",
"name",
"purposes",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L429-L436 |
213,751 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.category_options | public static function category_options($categories, $includenotset = true, $includeinherit = true) {
$options = self::base_options($includenotset, $includeinherit);
foreach ($categories as $category) {
$options[$category->get('id')] = $category->get('name');
}
return $optio... | php | public static function category_options($categories, $includenotset = true, $includeinherit = true) {
$options = self::base_options($includenotset, $includeinherit);
foreach ($categories as $category) {
$options[$category->get('id')] = $category->get('name');
}
return $optio... | [
"public",
"static",
"function",
"category_options",
"(",
"$",
"categories",
",",
"$",
"includenotset",
"=",
"true",
",",
"$",
"includeinherit",
"=",
"true",
")",
"{",
"$",
"options",
"=",
"self",
"::",
"base_options",
"(",
"$",
"includenotset",
",",
"$",
"... | From a list of category persistents to a list of id => name categories.
@param \tool_dataprivacy\category[] $categories
@param bool $includenotset
@param bool $includeinherit
@return string[] | [
"From",
"a",
"list",
"of",
"category",
"persistents",
"to",
"a",
"list",
"of",
"id",
"=",
">",
"name",
"categories",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L446-L453 |
213,752 | moodle/moodle | admin/tool/dataprivacy/classes/output/data_registry_page.php | data_registry_page.base_options | private static function base_options($includenotset = true, $includeinherit = true) {
$options = [];
if ($includenotset) {
$options[\tool_dataprivacy\context_instance::NOTSET] = get_string('notset', 'tool_dataprivacy');
}
if ($includeinherit) {
$options[\tool_d... | php | private static function base_options($includenotset = true, $includeinherit = true) {
$options = [];
if ($includenotset) {
$options[\tool_dataprivacy\context_instance::NOTSET] = get_string('notset', 'tool_dataprivacy');
}
if ($includeinherit) {
$options[\tool_d... | [
"private",
"static",
"function",
"base_options",
"(",
"$",
"includenotset",
"=",
"true",
",",
"$",
"includeinherit",
"=",
"true",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"includenotset",
")",
"{",
"$",
"options",
"[",
"\\",
"tool_... | Base not set and inherit options.
@param bool $includenotset
@param bool $includeinherit
@return array | [
"Base",
"not",
"set",
"and",
"inherit",
"options",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/data_registry_page.php#L462-L475 |
213,753 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.reset_database | public static function reset_database() {
global $DB;
if (!is_null(self::$lastdbwrites) and self::$lastdbwrites == $DB->perf_get_writes()) {
return false;
}
if (!parent::reset_database()) {
return false;
}
self::$lastdbwrites = $DB->perf_get_wri... | php | public static function reset_database() {
global $DB;
if (!is_null(self::$lastdbwrites) and self::$lastdbwrites == $DB->perf_get_writes()) {
return false;
}
if (!parent::reset_database()) {
return false;
}
self::$lastdbwrites = $DB->perf_get_wri... | [
"public",
"static",
"function",
"reset_database",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"is_null",
"(",
"self",
"::",
"$",
"lastdbwrites",
")",
"and",
"self",
"::",
"$",
"lastdbwrites",
"==",
"$",
"DB",
"->",
"perf_get_writes",
"(",
... | Reset all database tables to default values.
@static
@return bool true if reset done, false if skipped | [
"Reset",
"all",
"database",
"tables",
"to",
"default",
"values",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L302-L316 |
213,754 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.bootstrap_init | public static function bootstrap_init() {
global $CFG, $SITE, $DB, $FULLME;
// backup the globals
self::$globals['_SERVER'] = $_SERVER;
self::$globals['CFG'] = clone($CFG);
self::$globals['SITE'] = clone($SITE);
self::$globals['DB'] = $DB;
self::$globals['FULLME'... | php | public static function bootstrap_init() {
global $CFG, $SITE, $DB, $FULLME;
// backup the globals
self::$globals['_SERVER'] = $_SERVER;
self::$globals['CFG'] = clone($CFG);
self::$globals['SITE'] = clone($SITE);
self::$globals['DB'] = $DB;
self::$globals['FULLME'... | [
"public",
"static",
"function",
"bootstrap_init",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"SITE",
",",
"$",
"DB",
",",
"$",
"FULLME",
";",
"// backup the globals",
"self",
"::",
"$",
"globals",
"[",
"'_SERVER'",
"]",
"=",
"$",
"_SERVER",
";",
"s... | Called during bootstrap only!
@internal
@static
@return void | [
"Called",
"during",
"bootstrap",
"only!"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L324-L336 |
213,755 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.get_global_backup | public static function get_global_backup($name) {
if ($name === 'DB') {
// no cloning of database object,
// we just need the original reference, not original state
return self::$globals['DB'];
}
if (isset(self::$globals[$name])) {
if (is_object(se... | php | public static function get_global_backup($name) {
if ($name === 'DB') {
// no cloning of database object,
// we just need the original reference, not original state
return self::$globals['DB'];
}
if (isset(self::$globals[$name])) {
if (is_object(se... | [
"public",
"static",
"function",
"get_global_backup",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"'DB'",
")",
"{",
"// no cloning of database object,",
"// we just need the original reference, not original state",
"return",
"self",
"::",
"$",
"globals",
... | Returns original state of global variable.
@static
@param string $name
@return mixed | [
"Returns",
"original",
"state",
"of",
"global",
"variable",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L354-L369 |
213,756 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.drop_site | public static function drop_site($displayprogress = false) {
global $DB, $CFG;
if (!self::is_test_site()) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, 'Can not drop non-test site!!');
}
// Purge dataroot
if ($displayprogress) {
echo "Purging d... | php | public static function drop_site($displayprogress = false) {
global $DB, $CFG;
if (!self::is_test_site()) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, 'Can not drop non-test site!!');
}
// Purge dataroot
if ($displayprogress) {
echo "Purging d... | [
"public",
"static",
"function",
"drop_site",
"(",
"$",
"displayprogress",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"CFG",
";",
"if",
"(",
"!",
"self",
"::",
"is_test_site",
"(",
")",
")",
"{",
"phpunit_bootstrap_error",
"(",
"PHPUNIT_EXITCODE... | Drop all test site data.
Note: To be used from CLI scripts only.
@static
@param bool $displayprogress if true, this method will echo progress information.
@return void may terminate execution with exit code | [
"Drop",
"all",
"test",
"site",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L411-L431 |
213,757 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.install_site | public static function install_site() {
global $DB, $CFG;
if (!self::is_test_site()) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, 'Can not install on non-test site!!');
}
if ($DB->get_tables()) {
list($errorcode, $message) = self::testing_ready_proble... | php | public static function install_site() {
global $DB, $CFG;
if (!self::is_test_site()) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, 'Can not install on non-test site!!');
}
if ($DB->get_tables()) {
list($errorcode, $message) = self::testing_ready_proble... | [
"public",
"static",
"function",
"install_site",
"(",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"CFG",
";",
"if",
"(",
"!",
"self",
"::",
"is_test_site",
"(",
")",
")",
"{",
"phpunit_bootstrap_error",
"(",
"PHPUNIT_EXITCODE_CONFIGERROR",
",",
"'Can not install o... | Perform a fresh test site installation
Note: To be used from CLI scripts only.
@static
@return void may terminate execution with exit code | [
"Perform",
"a",
"fresh",
"test",
"site",
"installation"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L441-L479 |
213,758 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.display_debugging_messages | public static function display_debugging_messages($return = false) {
if (empty(self::$debuggings)) {
return false;
}
$debugstring = '';
foreach(self::$debuggings as $debug) {
$debugstring .= 'Debugging: ' . $debug->message . "\n" . trim($debug->from) . "\n";
... | php | public static function display_debugging_messages($return = false) {
if (empty(self::$debuggings)) {
return false;
}
$debugstring = '';
foreach(self::$debuggings as $debug) {
$debugstring .= 'Debugging: ' . $debug->message . "\n" . trim($debug->from) . "\n";
... | [
"public",
"static",
"function",
"display_debugging_messages",
"(",
"$",
"return",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"debuggings",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"debugstring",
"=",
"''",
";",
"foreach",... | Prints out any debug messages accumulated during test execution.
@param bool $return true to return the messages or false to print them directly. Default false.
@return bool|string false if no debug messages, true if debug triggered or string of messages | [
"Prints",
"out",
"any",
"debug",
"messages",
"accumulated",
"during",
"test",
"execution",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L705-L720 |
213,759 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.start_message_redirection | public static function start_message_redirection() {
if (self::$messagesink) {
self::stop_message_redirection();
}
self::$messagesink = new phpunit_message_sink();
return self::$messagesink;
} | php | public static function start_message_redirection() {
if (self::$messagesink) {
self::stop_message_redirection();
}
self::$messagesink = new phpunit_message_sink();
return self::$messagesink;
} | [
"public",
"static",
"function",
"start_message_redirection",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"messagesink",
")",
"{",
"self",
"::",
"stop_message_redirection",
"(",
")",
";",
"}",
"self",
"::",
"$",
"messagesink",
"=",
"new",
"phpunit_message_sink... | Start message redirection.
Note: Do not call directly from tests,
use $sink = $this->redirectMessages() instead.
@return phpunit_message_sink | [
"Start",
"message",
"redirection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L730-L736 |
213,760 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.start_phpmailer_redirection | public static function start_phpmailer_redirection() {
if (self::$phpmailersink) {
// If an existing mailer sink is active, just clear it.
self::$phpmailersink->clear();
} else {
self::$phpmailersink = new phpunit_phpmailer_sink();
}
return self::$phpm... | php | public static function start_phpmailer_redirection() {
if (self::$phpmailersink) {
// If an existing mailer sink is active, just clear it.
self::$phpmailersink->clear();
} else {
self::$phpmailersink = new phpunit_phpmailer_sink();
}
return self::$phpm... | [
"public",
"static",
"function",
"start_phpmailer_redirection",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"phpmailersink",
")",
"{",
"// If an existing mailer sink is active, just clear it.",
"self",
"::",
"$",
"phpmailersink",
"->",
"clear",
"(",
")",
";",
"}",
... | Start phpmailer redirection.
Note: Do not call directly from tests,
use $sink = $this->redirectEmails() instead.
@return phpunit_phpmailer_sink | [
"Start",
"phpmailer",
"redirection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L779-L787 |
213,761 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.start_event_redirection | public static function start_event_redirection() {
if (self::$eventsink) {
self::stop_event_redirection();
}
self::$eventsink = new phpunit_event_sink();
return self::$eventsink;
} | php | public static function start_event_redirection() {
if (self::$eventsink) {
self::stop_event_redirection();
}
self::$eventsink = new phpunit_event_sink();
return self::$eventsink;
} | [
"public",
"static",
"function",
"start_event_redirection",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"eventsink",
")",
"{",
"self",
"::",
"stop_event_redirection",
"(",
")",
";",
"}",
"self",
"::",
"$",
"eventsink",
"=",
"new",
"phpunit_event_sink",
"(",
... | Start event redirection.
@private
Note: Do not call directly from tests,
use $sink = $this->redirectEvents() instead.
@return phpunit_event_sink | [
"Start",
"event",
"redirection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L831-L837 |
213,762 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.event_triggered | public static function event_triggered(\core\event\base $event) {
if (self::$eventsink) {
self::$eventsink->add_event($event);
}
} | php | public static function event_triggered(\core\event\base $event) {
if (self::$eventsink) {
self::$eventsink->add_event($event);
}
} | [
"public",
"static",
"function",
"event_triggered",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"base",
"$",
"event",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"eventsink",
")",
"{",
"self",
"::",
"$",
"eventsink",
"->",
"add_event",
"(",
"$",
"event",
")",
... | To be called from \core\event\base only!
@private
@param \core\event\base $event record from event_read table
@return bool true means send event, false means event "sent" to sink. | [
"To",
"be",
"called",
"from",
"\\",
"core",
"\\",
"event",
"\\",
"base",
"only!"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L869-L873 |
213,763 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.run_all_adhoc_tasks | public static function run_all_adhoc_tasks() {
$now = time();
while (($task = \core\task\manager::get_next_adhoc_task($now)) !== null) {
try {
$task->execute();
\core\task\manager::adhoc_task_complete($task);
} catch (Exception $e) {
... | php | public static function run_all_adhoc_tasks() {
$now = time();
while (($task = \core\task\manager::get_next_adhoc_task($now)) !== null) {
try {
$task->execute();
\core\task\manager::adhoc_task_complete($task);
} catch (Exception $e) {
... | [
"public",
"static",
"function",
"run_all_adhoc_tasks",
"(",
")",
"{",
"$",
"now",
"=",
"time",
"(",
")",
";",
"while",
"(",
"(",
"$",
"task",
"=",
"\\",
"core",
"\\",
"task",
"\\",
"manager",
"::",
"get_next_adhoc_task",
"(",
"$",
"now",
")",
")",
"!... | Executes all adhoc tasks in the queue. Useful for testing asynchronous behaviour.
@return void | [
"Executes",
"all",
"adhoc",
"tasks",
"in",
"the",
"queue",
".",
"Useful",
"for",
"testing",
"asynchronous",
"behaviour",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L895-L905 |
213,764 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.get_filter_config | protected static function get_filter_config(array $whitelists, array $excludelists) : string {
$filters = '';
if (!empty($whitelists)) {
$filters .= self::pad("<whitelist>", 2);
foreach ($whitelists as $line) {
$filters .= self::pad($line, 3);
}
... | php | protected static function get_filter_config(array $whitelists, array $excludelists) : string {
$filters = '';
if (!empty($whitelists)) {
$filters .= self::pad("<whitelist>", 2);
foreach ($whitelists as $line) {
$filters .= self::pad($line, 3);
}
... | [
"protected",
"static",
"function",
"get_filter_config",
"(",
"array",
"$",
"whitelists",
",",
"array",
"$",
"excludelists",
")",
":",
"string",
"{",
"$",
"filters",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"whitelists",
")",
")",
"{",
"$",
"f... | Get the filter config for the supplied whitelist and excludelist configuration.
@param array[] $whitelists The list of files/folders in the whitelist.
@param array[] $excludelists The list of files/folders in the excludelist.
@return string | [
"Get",
"the",
"filter",
"config",
"for",
"the",
"supplied",
"whitelist",
"and",
"excludelist",
"configuration",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L948-L966 |
213,765 | moodle/moodle | lib/phpunit/classes/util.php | phpunit_util.get_coverage_info | protected static function get_coverage_info(string $fulldir): ?phpunit_coverage_info {
$coverageconfig = "{$fulldir}/tests/coverage.php";
if (file_exists($coverageconfig)) {
$coverageinfo = require($coverageconfig);
if (!$coverageinfo instanceof phpunit_coverage_info) {
... | php | protected static function get_coverage_info(string $fulldir): ?phpunit_coverage_info {
$coverageconfig = "{$fulldir}/tests/coverage.php";
if (file_exists($coverageconfig)) {
$coverageinfo = require($coverageconfig);
if (!$coverageinfo instanceof phpunit_coverage_info) {
... | [
"protected",
"static",
"function",
"get_coverage_info",
"(",
"string",
"$",
"fulldir",
")",
":",
"?",
"phpunit_coverage_info",
"{",
"$",
"coverageconfig",
"=",
"\"{$fulldir}/tests/coverage.php\"",
";",
"if",
"(",
"file_exists",
"(",
"$",
"coverageconfig",
")",
")",
... | Get the phpunit_coverage_info for the specified plugin or subsystem directory.
@param string $fulldir The directory to find the coverage info file in.
@return phpunit_coverage_info | [
"Get",
"the",
"phpunit_coverage_info",
"for",
"the",
"specified",
"plugin",
"or",
"subsystem",
"directory",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpunit/classes/util.php#L974-L986 |
213,766 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Search/Query.php | Horde_Imap_Client_Search_Query.charset | public function charset($charset, $convert = true)
{
$oldcharset = $this->_charset;
$this->_charset = Horde_String::upper($charset);
if (!$convert || ($oldcharset == $this->_charset)) {
return;
}
foreach (array('and', 'or') as $item) {
if (isset($thi... | php | public function charset($charset, $convert = true)
{
$oldcharset = $this->_charset;
$this->_charset = Horde_String::upper($charset);
if (!$convert || ($oldcharset == $this->_charset)) {
return;
}
foreach (array('and', 'or') as $item) {
if (isset($thi... | [
"public",
"function",
"charset",
"(",
"$",
"charset",
",",
"$",
"convert",
"=",
"true",
")",
"{",
"$",
"oldcharset",
"=",
"$",
"this",
"->",
"_charset",
";",
"$",
"this",
"->",
"_charset",
"=",
"Horde_String",
"::",
"upper",
"(",
"$",
"charset",
")",
... | Sets the charset of the search text.
@param string $charset The charset to use for the search.
@param boolean $convert Convert existing text values?
@throws Horde_Imap_Client_Exception_SearchCharset | [
"Sets",
"the",
"charset",
"of",
"the",
"search",
"text",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Search/Query.php#L81-L109 |
213,767 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Search/Query.php | Horde_Imap_Client_Search_Query._addFuzzy | protected function _addFuzzy($add, &$temp)
{
if ($add) {
if (!$temp['exts']->query('SEARCH', 'FUZZY')) {
throw new Horde_Imap_Client_Exception_NoSupportExtension('SEARCH=FUZZY');
}
$temp['cmds']->add('FUZZY');
$temp['exts_used'][] = 'SEARCH=FUZ... | php | protected function _addFuzzy($add, &$temp)
{
if ($add) {
if (!$temp['exts']->query('SEARCH', 'FUZZY')) {
throw new Horde_Imap_Client_Exception_NoSupportExtension('SEARCH=FUZZY');
}
$temp['cmds']->add('FUZZY');
$temp['exts_used'][] = 'SEARCH=FUZ... | [
"protected",
"function",
"_addFuzzy",
"(",
"$",
"add",
",",
"&",
"$",
"temp",
")",
"{",
"if",
"(",
"$",
"add",
")",
"{",
"if",
"(",
"!",
"$",
"temp",
"[",
"'exts'",
"]",
"->",
"query",
"(",
"'SEARCH'",
",",
"'FUZZY'",
")",
")",
"{",
"throw",
"n... | Adds fuzzy modifier to search keys.
@param boolean $add Add the fuzzy modifier?
@param array $temp Temporary build data.
@throws Horde_Imap_Client_Exception_NoSupport_Extension | [
"Adds",
"fuzzy",
"modifier",
"to",
"search",
"keys",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Search/Query.php#L495-L504 |
213,768 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Search/Query.php | Horde_Imap_Client_Search_Query.headerText | public function headerText($header, $text, $not = false,
array $opts = array())
{
if (!isset($this->_search['header'])) {
$this->_search['header'] = array();
}
$this->_search['header'][] = array_filter(array(
'fuzzy' => !empty($opts['fu... | php | public function headerText($header, $text, $not = false,
array $opts = array())
{
if (!isset($this->_search['header'])) {
$this->_search['header'] = array();
}
$this->_search['header'][] = array_filter(array(
'fuzzy' => !empty($opts['fu... | [
"public",
"function",
"headerText",
"(",
"$",
"header",
",",
"$",
"text",
",",
"$",
"not",
"=",
"false",
",",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_search",
"[",
"'header'",
"]"... | Search for text in the header of a message.
@param string $header The header field.
@param string $text The search text.
@param boolean $not If true, do a 'NOT' search of $text.
@param array $opts Additional options:
- fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server
MUST support RFC 6203. | [
"Search",
"for",
"text",
"in",
"the",
"header",
"of",
"a",
"message",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Search/Query.php#L577-L589 |
213,769 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Search/Query.php | Horde_Imap_Client_Search_Query.text | public function text($text, $bodyonly = true, $not = false,
array $opts = array())
{
if (!isset($this->_search['text'])) {
$this->_search['text'] = array();
}
$this->_search['text'][] = array_filter(array(
'fuzzy' => !empty($opts['fuzzy']),
... | php | public function text($text, $bodyonly = true, $not = false,
array $opts = array())
{
if (!isset($this->_search['text'])) {
$this->_search['text'] = array();
}
$this->_search['text'][] = array_filter(array(
'fuzzy' => !empty($opts['fuzzy']),
... | [
"public",
"function",
"text",
"(",
"$",
"text",
",",
"$",
"bodyonly",
"=",
"true",
",",
"$",
"not",
"=",
"false",
",",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_search",
"[",
"'te... | Search for text in either the entire message, or just the body.
@param string $text The search text.
@param string $bodyonly If true, only search in the body of the
message. If false, also search in the headers.
@param boolean $not If true, do a 'NOT' search of $text.
@param array $opts Additional opt... | [
"Search",
"for",
"text",
"in",
"either",
"the",
"entire",
"message",
"or",
"just",
"the",
"body",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Search/Query.php#L602-L615 |
213,770 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Search/Query.php | Horde_Imap_Client_Search_Query.ids | public function ids(Horde_Imap_Client_Ids $ids, $not = false,
array $opts = array())
{
$this->_search['ids'] = array_filter(array(
'fuzzy' => !empty($opts['fuzzy']),
'ids' => $ids,
'not' => $not
));
} | php | public function ids(Horde_Imap_Client_Ids $ids, $not = false,
array $opts = array())
{
$this->_search['ids'] = array_filter(array(
'fuzzy' => !empty($opts['fuzzy']),
'ids' => $ids,
'not' => $not
));
} | [
"public",
"function",
"ids",
"(",
"Horde_Imap_Client_Ids",
"$",
"ids",
",",
"$",
"not",
"=",
"false",
",",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_search",
"[",
"'ids'",
"]",
"=",
"array_filter",
"(",
"array",
"("... | Search for messages within a given UID range. Only one message range
can be specified per query.
@param Horde_Imap_Client_Ids $ids The list of UIDs to search.
@param boolean $not If true, do a 'NOT' search of the
UIDs.
@param array $opts Additional options:
- fuzzy: (boolean) If true, p... | [
"Search",
"for",
"messages",
"within",
"a",
"given",
"UID",
"range",
".",
"Only",
"one",
"message",
"range",
"can",
"be",
"specified",
"per",
"query",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Search/Query.php#L653-L661 |
213,771 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Search/Query.php | Horde_Imap_Client_Search_Query.dateSearch | public function dateSearch($date, $range, $header = true, $not = false,
array $opts = array())
{
if (!isset($this->_search['date'])) {
$this->_search['date'] = array();
}
// We should really be storing the raw DateTime object as data,
// bu... | php | public function dateSearch($date, $range, $header = true, $not = false,
array $opts = array())
{
if (!isset($this->_search['date'])) {
$this->_search['date'] = array();
}
// We should really be storing the raw DateTime object as data,
// bu... | [
"public",
"function",
"dateSearch",
"(",
"$",
"date",
",",
"$",
"range",
",",
"$",
"header",
"=",
"true",
",",
"$",
"not",
"=",
"false",
",",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->... | Search for messages within a date range.
@param mixed $date DateTime or Horde_Date object.
@param string $range Either:
- Horde_Imap_Client_Search_Query::DATE_BEFORE
- Horde_Imap_Client_Search_Query::DATE_ON
- Horde_Imap_Client_Search_Query::DATE_SINCE
@param boolean $header If true, search using the date in the ... | [
"Search",
"for",
"messages",
"within",
"a",
"date",
"range",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Search/Query.php#L679-L697 |
213,772 | moodle/moodle | lib/classes/task/logmanager.php | logmanager.start_logging | public static function start_logging(task_base $task) {
global $DB;
if (!self::should_log()) {
return;
}
// We register a shutdown handler to ensure that logs causing any failures are correctly disposed of.
// Note: This must happen before the per-request directory ... | php | public static function start_logging(task_base $task) {
global $DB;
if (!self::should_log()) {
return;
}
// We register a shutdown handler to ensure that logs causing any failures are correctly disposed of.
// Note: This must happen before the per-request directory ... | [
"public",
"static",
"function",
"start_logging",
"(",
"task_base",
"$",
"task",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"self",
"::",
"should_log",
"(",
")",
")",
"{",
"return",
";",
"}",
"// We register a shutdown handler to ensure that logs causing... | Create a new task logger for the specified task, and prepare for logging.
@param \core\task\task_base $task The task being run | [
"Create",
"a",
"new",
"task",
"logger",
"for",
"the",
"specified",
"task",
"and",
"prepare",
"for",
"logging",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logmanager.php#L84-L134 |
213,773 | moodle/moodle | lib/classes/task/logmanager.php | logmanager.should_log | protected static function should_log() : bool {
global $CFG;
// Respect the config setting.
if (isset($CFG->task_logmode) && empty($CFG->task_logmode)) {
return false;
}
$loggerclass = self::get_logger_classname();
if (empty($loggerclass)) {
retu... | php | protected static function should_log() : bool {
global $CFG;
// Respect the config setting.
if (isset($CFG->task_logmode) && empty($CFG->task_logmode)) {
return false;
}
$loggerclass = self::get_logger_classname();
if (empty($loggerclass)) {
retu... | [
"protected",
"static",
"function",
"should_log",
"(",
")",
":",
"bool",
"{",
"global",
"$",
"CFG",
";",
"// Respect the config setting.",
"if",
"(",
"isset",
"(",
"$",
"CFG",
"->",
"task_logmode",
")",
"&&",
"empty",
"(",
"$",
"CFG",
"->",
"task_logmode",
... | Whether logging is possible and should be happening.
@return bool | [
"Whether",
"logging",
"is",
"possible",
"and",
"should",
"be",
"happening",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logmanager.php#L141-L155 |
213,774 | moodle/moodle | lib/classes/task/logmanager.php | logmanager.uses_standard_settings | public static function uses_standard_settings() : bool {
$classname = self::get_logger_classname();
if (!class_exists($classname)) {
return false;
}
if (is_a($classname, database_logger::class, true)) {
return true;
}
return false;
} | php | public static function uses_standard_settings() : bool {
$classname = self::get_logger_classname();
if (!class_exists($classname)) {
return false;
}
if (is_a($classname, database_logger::class, true)) {
return true;
}
return false;
} | [
"public",
"static",
"function",
"uses_standard_settings",
"(",
")",
":",
"bool",
"{",
"$",
"classname",
"=",
"self",
"::",
"get_logger_classname",
"(",
")",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"classname",
")",
")",
"{",
"return",
"false",
";",
... | Whether to use the standard settings form. | [
"Whether",
"to",
"use",
"the",
"standard",
"settings",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logmanager.php#L188-L199 |
213,775 | moodle/moodle | lib/classes/task/logmanager.php | logmanager.get_url_for_task_class | public static function get_url_for_task_class(string $classname) : \moodle_url {
$loggerclass = self::get_logger_classname();
return $loggerclass::get_url_for_task_class($classname);
} | php | public static function get_url_for_task_class(string $classname) : \moodle_url {
$loggerclass = self::get_logger_classname();
return $loggerclass::get_url_for_task_class($classname);
} | [
"public",
"static",
"function",
"get_url_for_task_class",
"(",
"string",
"$",
"classname",
")",
":",
"\\",
"moodle_url",
"{",
"$",
"loggerclass",
"=",
"self",
"::",
"get_logger_classname",
"(",
")",
";",
"return",
"$",
"loggerclass",
"::",
"get_url_for_task_class"... | Get any URL available for viewing relevant task log reports.
@param string $classname The task class to fetch for
@return \moodle_url | [
"Get",
"any",
"URL",
"available",
"for",
"viewing",
"relevant",
"task",
"log",
"reports",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logmanager.php#L207-L211 |
213,776 | moodle/moodle | lib/classes/task/logmanager.php | logmanager.is_current_output_buffer | protected static function is_current_output_buffer() : bool {
if (empty(self::$taskloginfo)) {
return false;
}
if ($ob = ob_get_status()) {
return 'core\\task\\logmanager::add_line' == $ob['name'];
}
return false;
} | php | protected static function is_current_output_buffer() : bool {
if (empty(self::$taskloginfo)) {
return false;
}
if ($ob = ob_get_status()) {
return 'core\\task\\logmanager::add_line' == $ob['name'];
}
return false;
} | [
"protected",
"static",
"function",
"is_current_output_buffer",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"taskloginfo",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"ob",
"=",
"ob_get_status",
"(",
")",
")",... | Whether we are the current log collector.
@return bool | [
"Whether",
"we",
"are",
"the",
"current",
"log",
"collector",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logmanager.php#L218-L228 |
213,777 | moodle/moodle | lib/classes/task/logmanager.php | logmanager.is_capturing | protected static function is_capturing() : bool {
$buffers = ob_get_status(true);
foreach ($buffers as $ob) {
if ('core\\task\\logmanager::add_line' == $ob['name']) {
return true;
}
}
return false;
} | php | protected static function is_capturing() : bool {
$buffers = ob_get_status(true);
foreach ($buffers as $ob) {
if ('core\\task\\logmanager::add_line' == $ob['name']) {
return true;
}
}
return false;
} | [
"protected",
"static",
"function",
"is_capturing",
"(",
")",
":",
"bool",
"{",
"$",
"buffers",
"=",
"ob_get_status",
"(",
"true",
")",
";",
"foreach",
"(",
"$",
"buffers",
"as",
"$",
"ob",
")",
"{",
"if",
"(",
"'core\\\\task\\\\logmanager::add_line'",
"==",
... | Whether we are capturing at all.
@return bool | [
"Whether",
"we",
"are",
"capturing",
"at",
"all",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logmanager.php#L235-L244 |
213,778 | moodle/moodle | lib/classes/task/logmanager.php | logmanager.finalise_log | public static function finalise_log(bool $failed = false) {
global $CFG, $DB, $PERF;
if (!self::should_log()) {
return;
}
if (!self::is_capturing()) {
// Not capturing anything.
return;
}
// Ensure that all logs are closed.
$... | php | public static function finalise_log(bool $failed = false) {
global $CFG, $DB, $PERF;
if (!self::should_log()) {
return;
}
if (!self::is_capturing()) {
// Not capturing anything.
return;
}
// Ensure that all logs are closed.
$... | [
"public",
"static",
"function",
"finalise_log",
"(",
"bool",
"$",
"failed",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
",",
"$",
"PERF",
";",
"if",
"(",
"!",
"self",
"::",
"should_log",
"(",
")",
")",
"{",
"return",
";",
"}",
"... | Finish writing for the current task.
@param bool $failed | [
"Finish",
"writing",
"for",
"the",
"current",
"task",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logmanager.php#L251-L306 |
213,779 | moodle/moodle | lib/classes/task/logmanager.php | logmanager.add_line | public static function add_line(string $log) : string {
if (empty(self::$taskloginfo)) {
return $log;
}
if (empty(self::$fh)) {
return $log;
}
if (self::is_current_output_buffer()) {
fwrite(self::$fh, $log);
}
return $log;
... | php | public static function add_line(string $log) : string {
if (empty(self::$taskloginfo)) {
return $log;
}
if (empty(self::$fh)) {
return $log;
}
if (self::is_current_output_buffer()) {
fwrite(self::$fh, $log);
}
return $log;
... | [
"public",
"static",
"function",
"add_line",
"(",
"string",
"$",
"log",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"taskloginfo",
")",
")",
"{",
"return",
"$",
"log",
";",
"}",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
... | Add a log record to the task log.
@param string $log
@return string | [
"Add",
"a",
"log",
"record",
"to",
"the",
"task",
"log",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logmanager.php#L326-L340 |
213,780 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/ContentSets.php | HTMLPurifier_ContentSets.generateChildDef | public function generateChildDef(&$def, $module)
{
if (!empty($def->child)) { // already done!
return;
}
$content_model = $def->content_model;
if (is_string($content_model)) {
// Assume that $this->keys is alphanumeric
$def->content_model = preg_re... | php | public function generateChildDef(&$def, $module)
{
if (!empty($def->child)) { // already done!
return;
}
$content_model = $def->content_model;
if (is_string($content_model)) {
// Assume that $this->keys is alphanumeric
$def->content_model = preg_re... | [
"public",
"function",
"generateChildDef",
"(",
"&",
"$",
"def",
",",
"$",
"module",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"def",
"->",
"child",
")",
")",
"{",
"// already done!",
"return",
";",
"}",
"$",
"content_model",
"=",
"$",
"def",
"->",... | Accepts a definition; generates and assigns a ChildDef for it
@param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef reference
@param HTMLPurifier_HTMLModule $module Module that defined the ElementDef | [
"Accepts",
"a",
"definition",
";",
"generates",
"and",
"assigns",
"a",
"ChildDef",
"for",
"it"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/ContentSets.php#L83-L100 |
213,781 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/Update.php | Update.createUpdateOptions | private function createUpdateOptions()
{
$updateOptions = [
'multi' => $this->options['multi'],
'upsert' => $this->options['upsert'],
];
if (isset($this->options['arrayFilters'])) {
$updateOptions['arrayFilters'] = $this->options['arrayFilters'];
... | php | private function createUpdateOptions()
{
$updateOptions = [
'multi' => $this->options['multi'],
'upsert' => $this->options['upsert'],
];
if (isset($this->options['arrayFilters'])) {
$updateOptions['arrayFilters'] = $this->options['arrayFilters'];
... | [
"private",
"function",
"createUpdateOptions",
"(",
")",
"{",
"$",
"updateOptions",
"=",
"[",
"'multi'",
"=>",
"$",
"this",
"->",
"options",
"[",
"'multi'",
"]",
",",
"'upsert'",
"=>",
"$",
"this",
"->",
"options",
"[",
"'upsert'",
"]",
",",
"]",
";",
"... | Create options for the update command.
Note that these options are different from the bulk write options, which
are created in createExecuteOptions().
@return array | [
"Create",
"options",
"for",
"the",
"update",
"command",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/Update.php#L228-L244 |
213,782 | moodle/moodle | lib/ddl/mysql_sql_generator.php | mysql_sql_generator.guess_antelope_row_size | public function guess_antelope_row_size(array $columns) {
if (empty($columns)) {
return 0;
}
$size = 0;
$first = reset($columns);
if (count($columns) > 1) {
// Do not start with zero because we need to cover changes of field types and
// thi... | php | public function guess_antelope_row_size(array $columns) {
if (empty($columns)) {
return 0;
}
$size = 0;
$first = reset($columns);
if (count($columns) > 1) {
// Do not start with zero because we need to cover changes of field types and
// thi... | [
"public",
"function",
"guess_antelope_row_size",
"(",
"array",
"$",
"columns",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"columns",
")",
")",
"{",
"return",
"0",
";",
"}",
"$",
"size",
"=",
"0",
";",
"$",
"first",
"=",
"reset",
"(",
"$",
"columns",
"... | Calculate proximate row size when using InnoDB tables in Antelope row format.
Note: the returned value is a bit higher to compensate for errors and changes of column data types.
@param xmldb_field[]|database_column_info[] $columns
@return int approximate row size in bytes | [
"Calculate",
"proximate",
"row",
"size",
"when",
"using",
"InnoDB",
"tables",
"in",
"Antelope",
"row",
"format",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/mysql_sql_generator.php#L135-L196 |
213,783 | moodle/moodle | backup/util/structure/base_optigroup.class.php | base_optigroup.set_parent | protected function set_parent($element) {
parent::set_parent($element);
// Force condition param calculation in all children
foreach ($this->get_children() as $child) {
$child->set_condition($child->get_condition_param(), $child->get_condition_value());
}
} | php | protected function set_parent($element) {
parent::set_parent($element);
// Force condition param calculation in all children
foreach ($this->get_children() as $child) {
$child->set_condition($child->get_condition_param(), $child->get_condition_value());
}
} | [
"protected",
"function",
"set_parent",
"(",
"$",
"element",
")",
"{",
"parent",
"::",
"set_parent",
"(",
"$",
"element",
")",
";",
"// Force condition param calculation in all children",
"foreach",
"(",
"$",
"this",
"->",
"get_children",
"(",
")",
"as",
"$",
"ch... | Set the parent of the optigroup and, at the same time, process all the
condition params in all the childs | [
"Set",
"the",
"parent",
"of",
"the",
"optigroup",
"and",
"at",
"the",
"same",
"time",
"process",
"all",
"the",
"condition",
"params",
"in",
"all",
"the",
"childs"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/structure/base_optigroup.class.php#L122-L128 |
213,784 | moodle/moodle | backup/util/structure/base_optigroup.class.php | base_optigroup.add_used | protected function add_used($element) {
$newused = array();
// Iterate over all the element useds, filling $newused and
// observing the multiple setting
foreach ($element->get_used() as $used) {
if (!in_array($used, $this->get_used())) { // it's a new one, add to $newused ar... | php | protected function add_used($element) {
$newused = array();
// Iterate over all the element useds, filling $newused and
// observing the multiple setting
foreach ($element->get_used() as $used) {
if (!in_array($used, $this->get_used())) { // it's a new one, add to $newused ar... | [
"protected",
"function",
"add_used",
"(",
"$",
"element",
")",
"{",
"$",
"newused",
"=",
"array",
"(",
")",
";",
"// Iterate over all the element useds, filling $newused and",
"// observing the multiple setting",
"foreach",
"(",
"$",
"element",
"->",
"get_used",
"(",
... | Recalculate all the used elements in the optigroup, observing
restrictions and passing the new used to outer level | [
"Recalculate",
"all",
"the",
"used",
"elements",
"in",
"the",
"optigroup",
"observing",
"restrictions",
"and",
"passing",
"the",
"new",
"used",
"to",
"outer",
"level"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/structure/base_optigroup.class.php#L134-L154 |
213,785 | moodle/moodle | completion/criteria/completion_criteria_date.php | completion_criteria_date.update_date | public static function update_date($courseid, $timeshift) {
if ($criteria = self::fetch(array('course' => $courseid))) {
$criteria->timeend = $criteria->timeend + $timeshift;
$criteria->update();
}
} | php | public static function update_date($courseid, $timeshift) {
if ($criteria = self::fetch(array('course' => $courseid))) {
$criteria->timeend = $criteria->timeend + $timeshift;
$criteria->update();
}
} | [
"public",
"static",
"function",
"update_date",
"(",
"$",
"courseid",
",",
"$",
"timeshift",
")",
"{",
"if",
"(",
"$",
"criteria",
"=",
"self",
"::",
"fetch",
"(",
"array",
"(",
"'course'",
"=>",
"$",
"courseid",
")",
")",
")",
"{",
"$",
"criteria",
"... | Shift the date when resetting course.
@param int $courseid the course id
@param int $timeshift number of seconds to shift date
@return boolean was the operation successful? | [
"Shift",
"the",
"date",
"when",
"resetting",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/criteria/completion_criteria_date.php#L224-L229 |
213,786 | moodle/moodle | lib/ltiprovider/src/ToolProvider/Context.php | Context.initialize | public function initialize()
{
$this->title = '';
$this->settings = array();
$this->created = null;
$this->updated = null;
} | php | public function initialize()
{
$this->title = '';
$this->settings = array();
$this->created = null;
$this->updated = null;
} | [
"public",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"title",
"=",
"''",
";",
"$",
"this",
"->",
"settings",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"created",
"=",
"null",
";",
"$",
"this",
"->",
"updated",
"=",
"null",
... | Initialise the context. | [
"Initialise",
"the",
"context",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/Context.php#L101-L109 |
213,787 | moodle/moodle | lib/ltiprovider/src/ToolProvider/Context.php | Context.save | public function save()
{
$ok = $this->getDataConnector()->saveContext($this);
if ($ok) {
$this->settingsChanged = false;
}
return $ok;
} | php | public function save()
{
$ok = $this->getDataConnector()->saveContext($this);
if ($ok) {
$this->settingsChanged = false;
}
return $ok;
} | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"ok",
"=",
"$",
"this",
"->",
"getDataConnector",
"(",
")",
"->",
"saveContext",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
"ok",
")",
"{",
"$",
"this",
"->",
"settingsChanged",
"=",
"false",
";",
... | Save the context to the database.
@return boolean True if the context was successfully saved. | [
"Save",
"the",
"context",
"to",
"the",
"database",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/Context.php#L128-L138 |
213,788 | moodle/moodle | lib/ltiprovider/src/ToolProvider/Context.php | Context.getSetting | public function getSetting($name, $default = '')
{
if (array_key_exists($name, $this->settings)) {
$value = $this->settings[$name];
} else {
$value = $default;
}
return $value;
} | php | public function getSetting($name, $default = '')
{
if (array_key_exists($name, $this->settings)) {
$value = $this->settings[$name];
} else {
$value = $default;
}
return $value;
} | [
"public",
"function",
"getSetting",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"''",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"settings",
")",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"settings",
"[... | Get a setting value.
@param string $name Name of setting
@param string $default Value to return if the setting does not exist (optional, default is an empty string)
@return string Setting value | [
"Get",
"a",
"setting",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/Context.php#L248-L259 |
213,789 | moodle/moodle | lib/ltiprovider/src/ToolProvider/Context.php | Context.getToolSettings | public function getToolSettings($mode = Service\ToolSettings::MODE_CURRENT_LEVEL, $simple = true)
{
$url = $this->getSetting('custom_context_setting_url');
$service = new Service\ToolSettings($this, $url, $simple);
$response = $service->get($mode);
return $response;
} | php | public function getToolSettings($mode = Service\ToolSettings::MODE_CURRENT_LEVEL, $simple = true)
{
$url = $this->getSetting('custom_context_setting_url');
$service = new Service\ToolSettings($this, $url, $simple);
$response = $service->get($mode);
return $response;
} | [
"public",
"function",
"getToolSettings",
"(",
"$",
"mode",
"=",
"Service",
"\\",
"ToolSettings",
"::",
"MODE_CURRENT_LEVEL",
",",
"$",
"simple",
"=",
"true",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getSetting",
"(",
"'custom_context_setting_url'",
")",
... | Get Tool Settings.
@param int $mode Mode for request (optional, default is current level only)
@param boolean $simple True if all the simple media type is to be used (optional, default is true)
@return mixed The array of settings if successful, otherwise false | [
"Get",
"Tool",
"Settings",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/Context.php#L346-L355 |
213,790 | moodle/moodle | privacy/classes/local/request/approved_userlist.php | approved_userlist.create_from_userlist | public static function create_from_userlist(userlist $userlist) : approved_userlist {
$newlist = new static($userlist->get_context(), $userlist->get_component(), $userlist->get_userids());
return $newlist;
} | php | public static function create_from_userlist(userlist $userlist) : approved_userlist {
$newlist = new static($userlist->get_context(), $userlist->get_component(), $userlist->get_userids());
return $newlist;
} | [
"public",
"static",
"function",
"create_from_userlist",
"(",
"userlist",
"$",
"userlist",
")",
":",
"approved_userlist",
"{",
"$",
"newlist",
"=",
"new",
"static",
"(",
"$",
"userlist",
"->",
"get_context",
"(",
")",
",",
"$",
"userlist",
"->",
"get_component"... | Create an approved userlist from a userlist.
@param userlist $userlist The source list
@return approved_userlist The newly created approved userlist. | [
"Create",
"an",
"approved",
"userlist",
"from",
"a",
"userlist",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/approved_userlist.php#L56-L60 |
213,791 | moodle/moodle | filter/glossary/filter.php | filter_glossary.get_all_concepts | protected function get_all_concepts() {
global $USER;
if ($this->cache === null) {
$this->cache = cache::make_from_params(cache_store::MODE_REQUEST, 'filter', 'glossary');
}
// Try to get current course.
$coursectx = $this->context->get_course_context(false);
... | php | protected function get_all_concepts() {
global $USER;
if ($this->cache === null) {
$this->cache = cache::make_from_params(cache_store::MODE_REQUEST, 'filter', 'glossary');
}
// Try to get current course.
$coursectx = $this->context->get_course_context(false);
... | [
"protected",
"function",
"get_all_concepts",
"(",
")",
"{",
"global",
"$",
"USER",
";",
"if",
"(",
"$",
"this",
"->",
"cache",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"cache",
"=",
"cache",
"::",
"make_from_params",
"(",
"cache_store",
"::",
"MODE_RE... | Get all the concepts for this context.
@return filterobject[] the concepts, and filterobjects. | [
"Get",
"all",
"the",
"concepts",
"for",
"this",
"context",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/filter/glossary/filter.php#L53-L114 |
213,792 | moodle/moodle | lib/mustache/src/Mustache/Cache/NoopCache.php | Mustache_Cache_NoopCache.cache | public function cache($key, $value)
{
$this->log(
Mustache_Logger::WARNING,
'Template cache disabled, evaluating "{className}" class at runtime',
array('className' => $key)
);
eval('?>' . $value);
} | php | public function cache($key, $value)
{
$this->log(
Mustache_Logger::WARNING,
'Template cache disabled, evaluating "{className}" class at runtime',
array('className' => $key)
);
eval('?>' . $value);
} | [
"public",
"function",
"cache",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"Mustache_Logger",
"::",
"WARNING",
",",
"'Template cache disabled, evaluating \"{className}\" class at runtime'",
",",
"array",
"(",
"'className'",
"=>",
"... | Loads the compiled Mustache Template class without caching.
@param string $key
@param string $value | [
"Loads",
"the",
"compiled",
"Mustache",
"Template",
"class",
"without",
"caching",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/Cache/NoopCache.php#L38-L46 |
213,793 | moodle/moodle | admin/tool/dataprivacy/classes/expiry_info.php | expiry_info.is_any_expired | public function is_any_expired() : bool {
if ($this->is_fully_expired()) {
return true;
}
if (!empty($this->get_expired_roles())) {
return true;
}
if ($this->is_default_expired()) {
return true;
}
return false;
} | php | public function is_any_expired() : bool {
if ($this->is_fully_expired()) {
return true;
}
if (!empty($this->get_expired_roles())) {
return true;
}
if ($this->is_default_expired()) {
return true;
}
return false;
} | [
"public",
"function",
"is_any_expired",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"is_fully_expired",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"get_expired_roles",
"(",
")",
")",... | Whether any part of this context has expired.
@return bool | [
"Whether",
"any",
"part",
"of",
"this",
"context",
"has",
"expired",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/expiry_info.php#L88-L102 |
213,794 | moodle/moodle | admin/tool/dataprivacy/classes/expiry_info.php | expiry_info.get_unprotected_overridden_roles | public function get_unprotected_overridden_roles() : array {
$allroles = array_merge($this->expired, $this->unexpired);
return array_diff($allroles, $this->protectedroles);
} | php | public function get_unprotected_overridden_roles() : array {
$allroles = array_merge($this->expired, $this->unexpired);
return array_diff($allroles, $this->protectedroles);
} | [
"public",
"function",
"get_unprotected_overridden_roles",
"(",
")",
":",
"array",
"{",
"$",
"allroles",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"expired",
",",
"$",
"this",
"->",
"unexpired",
")",
";",
"return",
"array_diff",
"(",
"$",
"allroles",
",",
... | Get a list of all overridden roles which are unprotected.
@return int[] | [
"Get",
"a",
"list",
"of",
"all",
"overridden",
"roles",
"which",
"are",
"unprotected",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/expiry_info.php#L168-L172 |
213,795 | moodle/moodle | admin/tool/dataprivacy/classes/expiry_info.php | expiry_info.merge_with_child | public function merge_with_child(expiry_info $child) : expiry_info {
if ($child->is_fully_expired()) {
return $this;
}
// If the child is not fully expired, then none of the parents can be either.
$this->fullyexpired = false;
// Remove any role in this node which is... | php | public function merge_with_child(expiry_info $child) : expiry_info {
if ($child->is_fully_expired()) {
return $this;
}
// If the child is not fully expired, then none of the parents can be either.
$this->fullyexpired = false;
// Remove any role in this node which is... | [
"public",
"function",
"merge_with_child",
"(",
"expiry_info",
"$",
"child",
")",
":",
"expiry_info",
"{",
"if",
"(",
"$",
"child",
"->",
"is_fully_expired",
"(",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"// If the child is not fully expired, then none of th... | Merge this expiry_info object with another belonging to a child context in order to set the 'safest' heritage.
It is not possible to delete any part of a context that is not deleted by a parent.
So if a course's retention policy has been reached, then only parts where the children have also expired can be
deleted.
@p... | [
"Merge",
"this",
"expiry_info",
"object",
"with",
"another",
"belonging",
"to",
"a",
"child",
"context",
"in",
"order",
"to",
"set",
"the",
"safest",
"heritage",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/expiry_info.php#L184-L206 |
213,796 | moodle/moodle | lib/mlbackend/php/phpml/src/Phpml/Math/LinearAlgebra/LUDecomposition.php | LUDecomposition.getL | public function getL()
{
$L = [];
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
if ($i > $j) {
$L[$i][$j] = $this->LU[$i][$j];
} elseif ($i == $j) {
$L[$i][$j] = 1.0;
} else ... | php | public function getL()
{
$L = [];
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
if ($i > $j) {
$L[$i][$j] = $this->LU[$i][$j];
} elseif ($i == $j) {
$L[$i][$j] = 1.0;
} else ... | [
"public",
"function",
"getL",
"(",
")",
"{",
"$",
"L",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"m",
";",
"++",
"$",
"i",
")",
"{",
"for",
"(",
"$",
"j",
"=",
"0",
";",
"$",
"j",
"<",
... | Get lower triangular factor.
@return Matrix Lower triangular factor | [
"Get",
"lower",
"triangular",
"factor",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mlbackend/php/phpml/src/Phpml/Math/LinearAlgebra/LUDecomposition.php#L139-L154 |
213,797 | moodle/moodle | question/classes/bank/search/tag_condition.php | tag_condition.display_options | public function display_options() {
global $OUTPUT;
$tags = \core_tag_tag::get_tags_by_area_in_contexts('core_question', 'question', $this->contexts);
$tagoptions = array_map(function($tag) {
return [
'id' => $tag->id,
'name' => $tag->name,
... | php | public function display_options() {
global $OUTPUT;
$tags = \core_tag_tag::get_tags_by_area_in_contexts('core_question', 'question', $this->contexts);
$tagoptions = array_map(function($tag) {
return [
'id' => $tag->id,
'name' => $tag->name,
... | [
"public",
"function",
"display_options",
"(",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"tags",
"=",
"\\",
"core_tag_tag",
"::",
"get_tags_by_area_in_contexts",
"(",
"'core_question'",
",",
"'question'",
",",
"$",
"this",
"->",
"contexts",
")",
";",
"$",
... | Print HTML to display the list of tags to filter by. | [
"Print",
"HTML",
"to",
"display",
"the",
"list",
"of",
"tags",
"to",
"filter",
"by",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/bank/search/tag_condition.php#L106-L122 |
213,798 | moodle/moodle | lib/dml/oci_native_moodle_database.php | oci_native_moodle_database.parse_query | protected function parse_query($sql) {
$stmt = oci_parse($this->oci, $sql);
if ($stmt == false) {
throw new dml_connection_exception('Can not parse sql query'); //TODO: maybe add better info
}
return $stmt;
} | php | protected function parse_query($sql) {
$stmt = oci_parse($this->oci, $sql);
if ($stmt == false) {
throw new dml_connection_exception('Can not parse sql query'); //TODO: maybe add better info
}
return $stmt;
} | [
"protected",
"function",
"parse_query",
"(",
"$",
"sql",
")",
"{",
"$",
"stmt",
"=",
"oci_parse",
"(",
"$",
"this",
"->",
"oci",
",",
"$",
"sql",
")",
";",
"if",
"(",
"$",
"stmt",
"==",
"false",
")",
"{",
"throw",
"new",
"dml_connection_exception",
"... | Prepare the statement for execution
@throws dml_connection_exception
@param string $sql
@return resource | [
"Prepare",
"the",
"statement",
"for",
"execution"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/oci_native_moodle_database.php#L352-L358 |
213,799 | moodle/moodle | lib/dml/oci_native_moodle_database.php | oci_native_moodle_database.tweak_param_names | protected function tweak_param_names($sql, array $params) {
if (empty($params)) {
return array($sql, $params);
}
$newparams = array();
$searcharr = array(); // search => replace pairs
foreach ($params as $name => $value) {
// Keep the name within the 30 c... | php | protected function tweak_param_names($sql, array $params) {
if (empty($params)) {
return array($sql, $params);
}
$newparams = array();
$searcharr = array(); // search => replace pairs
foreach ($params as $name => $value) {
// Keep the name within the 30 c... | [
"protected",
"function",
"tweak_param_names",
"(",
"$",
"sql",
",",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"params",
")",
")",
"{",
"return",
"array",
"(",
"$",
"sql",
",",
"$",
"params",
")",
";",
"}",
"$",
"newparams",
"=... | Make sure there are no reserved words in param names...
@param string $sql
@param array $params
@return array ($sql, $params) updated query and parameters | [
"Make",
"sure",
"there",
"are",
"no",
"reserved",
"words",
"in",
"param",
"names",
"..."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/oci_native_moodle_database.php#L366-L388 |
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.