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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
219,000 | moodle/moodle | admin/tool/dataprivacy/classes/purpose.php | purpose.after_update | protected function after_update($result) {
$cache = \cache::make('tool_dataprivacy', 'purpose');
$cache->set($this->get('id'), $this->to_record());
} | php | protected function after_update($result) {
$cache = \cache::make('tool_dataprivacy', 'purpose');
$cache->set($this->get('id'), $this->to_record());
} | [
"protected",
"function",
"after_update",
"(",
"$",
"result",
")",
"{",
"$",
"cache",
"=",
"\\",
"cache",
"::",
"make",
"(",
"'tool_dataprivacy'",
",",
"'purpose'",
")",
";",
"$",
"cache",
"->",
"set",
"(",
"$",
"this",
"->",
"get",
"(",
"'id'",
")",
... | Updates the cache record.
@param bool $result
@return null | [
"Updates",
"the",
"cache",
"record",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/purpose.php#L144-L147 |
219,001 | moodle/moodle | mod/workshop/form/numerrors/backup/moodle1/lib.php | moodle1_workshopform_numerrors_handler.on_elements_end | public function on_elements_end() {
foreach ($this->mappings as $mapping) {
$this->write_xml('workshopform_numerrors_map', $mapping, array('/workshopform_numerrors_map/id'));
}
foreach ($this->dimensions as $dimension) {
$this->write_xml('workshopform_numerrors_dimensio... | php | public function on_elements_end() {
foreach ($this->mappings as $mapping) {
$this->write_xml('workshopform_numerrors_map', $mapping, array('/workshopform_numerrors_map/id'));
}
foreach ($this->dimensions as $dimension) {
$this->write_xml('workshopform_numerrors_dimensio... | [
"public",
"function",
"on_elements_end",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"mappings",
"as",
"$",
"mapping",
")",
"{",
"$",
"this",
"->",
"write_xml",
"(",
"'workshopform_numerrors_map'",
",",
"$",
"mapping",
",",
"array",
"(",
"'/workshopfor... | Writes gathered mappings and dimensions | [
"Writes",
"gathered",
"mappings",
"and",
"dimensions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/numerrors/backup/moodle1/lib.php#L89-L98 |
219,002 | moodle/moodle | lib/mustache/src/Mustache/HelperCollection.php | Mustache_HelperCollection.get | public function get($name)
{
if (!$this->has($name)) {
throw new Mustache_Exception_UnknownHelperException($name);
}
return $this->helpers[$name];
} | php | public function get($name)
{
if (!$this->has($name)) {
throw new Mustache_Exception_UnknownHelperException($name);
}
return $this->helpers[$name];
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"Mustache_Exception_UnknownHelperException",
"(",
"$",
"name",
")",
";",
"}",
"return",
"$",
"this",
"... | Get a helper by name.
@throws Mustache_Exception_UnknownHelperException If helper does not exist
@param string $name
@return mixed Helper | [
"Get",
"a",
"helper",
"by",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/HelperCollection.php#L90-L97 |
219,003 | moodle/moodle | lib/mustache/src/Mustache/HelperCollection.php | Mustache_HelperCollection.remove | public function remove($name)
{
if (!$this->has($name)) {
throw new Mustache_Exception_UnknownHelperException($name);
}
unset($this->helpers[$name]);
} | php | public function remove($name)
{
if (!$this->has($name)) {
throw new Mustache_Exception_UnknownHelperException($name);
}
unset($this->helpers[$name]);
} | [
"public",
"function",
"remove",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"Mustache_Exception_UnknownHelperException",
"(",
"$",
"name",
")",
";",
"}",
"unset",
"(",
"$",
"t... | Check whether a given helper is present in the collection.
@throws Mustache_Exception_UnknownHelperException if the requested helper is not present
@param string $name | [
"Check",
"whether",
"a",
"given",
"helper",
"is",
"present",
"in",
"the",
"collection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/HelperCollection.php#L144-L151 |
219,004 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Socket/ClientSort.php | Horde_Imap_Client_Socket_ClientSort._sortString | protected function _sortString(&$sorted)
{
if (empty($this->_collator)) {
asort($sorted, SORT_LOCALE_STRING);
} else {
$this->_collator->asort($sorted, Collator::SORT_STRING);
}
} | php | protected function _sortString(&$sorted)
{
if (empty($this->_collator)) {
asort($sorted, SORT_LOCALE_STRING);
} else {
$this->_collator->asort($sorted, Collator::SORT_STRING);
}
} | [
"protected",
"function",
"_sortString",
"(",
"&",
"$",
"sorted",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_collator",
")",
")",
"{",
"asort",
"(",
"$",
"sorted",
",",
"SORT_LOCALE_STRING",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
... | Sort an array of strings based on current locale.
@param array &$sorted Array of strings. | [
"Sort",
"an",
"array",
"of",
"strings",
"based",
"on",
"current",
"locale",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Socket/ClientSort.php#L364-L371 |
219,005 | moodle/moodle | lib/mustache/src/Mustache/Context.php | Mustache_Context.findDot | public function findDot($id)
{
$chunks = explode('.', $id);
$first = array_shift($chunks);
$value = $this->findVariableInStack($first, $this->stack);
foreach ($chunks as $chunk) {
if ($value === '') {
return $value;
}
$value = $... | php | public function findDot($id)
{
$chunks = explode('.', $id);
$first = array_shift($chunks);
$value = $this->findVariableInStack($first, $this->stack);
foreach ($chunks as $chunk) {
if ($value === '') {
return $value;
}
$value = $... | [
"public",
"function",
"findDot",
"(",
"$",
"id",
")",
"{",
"$",
"chunks",
"=",
"explode",
"(",
"'.'",
",",
"$",
"id",
")",
";",
"$",
"first",
"=",
"array_shift",
"(",
"$",
"chunks",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"findVariableInSta... | Find a 'dot notation' variable in the Context stack.
Note that dot notation traversal bubbles through scope differently than the regular find method. After finding
the initial chunk of the dotted name, each subsequent chunk is searched for only within the value of the previous
result. For example, given the following ... | [
"Find",
"a",
"dot",
"notation",
"variable",
"in",
"the",
"Context",
"stack",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/Context.php#L127-L142 |
219,006 | moodle/moodle | lib/mustache/src/Mustache/Context.php | Mustache_Context.findAnchoredDot | public function findAnchoredDot($id)
{
$chunks = explode('.', $id);
$first = array_shift($chunks);
if ($first !== '') {
throw new Mustache_Exception_InvalidArgumentException(sprintf('Unexpected id for findAnchoredDot: %s', $id));
}
$value = $this->last();
... | php | public function findAnchoredDot($id)
{
$chunks = explode('.', $id);
$first = array_shift($chunks);
if ($first !== '') {
throw new Mustache_Exception_InvalidArgumentException(sprintf('Unexpected id for findAnchoredDot: %s', $id));
}
$value = $this->last();
... | [
"public",
"function",
"findAnchoredDot",
"(",
"$",
"id",
")",
"{",
"$",
"chunks",
"=",
"explode",
"(",
"'.'",
",",
"$",
"id",
")",
";",
"$",
"first",
"=",
"array_shift",
"(",
"$",
"chunks",
")",
";",
"if",
"(",
"$",
"first",
"!==",
"''",
")",
"{"... | Find an 'anchored dot notation' variable in the Context stack.
This is the same as findDot(), except it looks in the top of the context
stack for the first value, rather than searching the whole context stack
and starting from there.
@see Mustache_Context::findDot
@throws Mustache_Exception_InvalidArgumentException ... | [
"Find",
"an",
"anchored",
"dot",
"notation",
"variable",
"in",
"the",
"Context",
"stack",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/Context.php#L159-L178 |
219,007 | moodle/moodle | lib/mustache/src/Mustache/Context.php | Mustache_Context.findInBlock | public function findInBlock($id)
{
foreach ($this->blockStack as $context) {
if (array_key_exists($id, $context)) {
return $context[$id];
}
}
return '';
} | php | public function findInBlock($id)
{
foreach ($this->blockStack as $context) {
if (array_key_exists($id, $context)) {
return $context[$id];
}
}
return '';
} | [
"public",
"function",
"findInBlock",
"(",
"$",
"id",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"blockStack",
"as",
"$",
"context",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"id",
",",
"$",
"context",
")",
")",
"{",
"return",
"$",
"context... | Find an argument in the block context stack.
@param string $id
@return mixed Variable value, or '' if not found | [
"Find",
"an",
"argument",
"in",
"the",
"block",
"context",
"stack",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/Context.php#L187-L196 |
219,008 | moodle/moodle | lib/mustache/src/Mustache/Context.php | Mustache_Context.findVariableInStack | private function findVariableInStack($id, array $stack)
{
for ($i = count($stack) - 1; $i >= 0; $i--) {
$frame = &$stack[$i];
switch (gettype($frame)) {
case 'object':
if (!($frame instanceof Closure)) {
// Note that is_cal... | php | private function findVariableInStack($id, array $stack)
{
for ($i = count($stack) - 1; $i >= 0; $i--) {
$frame = &$stack[$i];
switch (gettype($frame)) {
case 'object':
if (!($frame instanceof Closure)) {
// Note that is_cal... | [
"private",
"function",
"findVariableInStack",
"(",
"$",
"id",
",",
"array",
"$",
"stack",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"stack",
")",
"-",
"1",
";",
"$",
"i",
">=",
"0",
";",
"$",
"i",
"--",
")",
"{",
"$",
"frame",
"... | Helper function to find a variable in the Context stack.
@see Mustache_Context::find
@param string $id Variable name
@param array $stack Context stack
@return mixed Variable value, or '' if not found | [
"Helper",
"function",
"to",
"find",
"a",
"variable",
"in",
"the",
"Context",
"stack",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/Context.php#L208-L241 |
219,009 | moodle/moodle | lib/adodb/drivers/adodb-netezza.inc.php | ADORecordSet_netezza._initrs | function _initrs()
{
global $ADODB_COUNTRECS;
$this->_numOfRows = ($ADODB_COUNTRECS)? @pg_num_rows($this->_queryID):-1;
$this->_numOfFields = @pg_num_fields($this->_queryID);
} | php | function _initrs()
{
global $ADODB_COUNTRECS;
$this->_numOfRows = ($ADODB_COUNTRECS)? @pg_num_rows($this->_queryID):-1;
$this->_numOfFields = @pg_num_fields($this->_queryID);
} | [
"function",
"_initrs",
"(",
")",
"{",
"global",
"$",
"ADODB_COUNTRECS",
";",
"$",
"this",
"->",
"_numOfRows",
"=",
"(",
"$",
"ADODB_COUNTRECS",
")",
"?",
"@",
"pg_num_rows",
"(",
"$",
"this",
"->",
"_queryID",
")",
":",
"-",
"1",
";",
"$",
"this",
"-... | _initrs modified to disable blob handling | [
"_initrs",
"modified",
"to",
"disable",
"blob",
"handling"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/drivers/adodb-netezza.inc.php#L150-L155 |
219,010 | moodle/moodle | lib/phpexcel/PHPExcel/Writer/OpenDocument/Settings.php | PHPExcel_Writer_OpenDocument_Settings.write | public function write(PHPExcel $pPHPExcel = null)
{
if (!$pPHPExcel) {
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
}
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_X... | php | public function write(PHPExcel $pPHPExcel = null)
{
if (!$pPHPExcel) {
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
}
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_X... | [
"public",
"function",
"write",
"(",
"PHPExcel",
"$",
"pPHPExcel",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"pPHPExcel",
")",
"{",
"$",
"pPHPExcel",
"=",
"$",
"this",
"->",
"getParentWriter",
"(",
")",
"->",
"getPHPExcel",
"(",
")",
";",
"}",
"$",
... | Write settings.xml to XML format
@param PHPExcel $pPHPExcel
@return string XML Output
@throws PHPExcel_Writer_Exception | [
"Write",
"settings",
".",
"xml",
"to",
"XML",
"format"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/OpenDocument/Settings.php#L37-L75 |
219,011 | moodle/moodle | lib/classes/task/logging_trait.php | logging_trait.get_trace | protected function get_trace() {
if (null === $this->trace) {
$this->trace = new \text_progress_trace();
$this->tracestats = new \stdClass();
}
return $this->trace;
} | php | protected function get_trace() {
if (null === $this->trace) {
$this->trace = new \text_progress_trace();
$this->tracestats = new \stdClass();
}
return $this->trace;
} | [
"protected",
"function",
"get_trace",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"trace",
")",
"{",
"$",
"this",
"->",
"trace",
"=",
"new",
"\\",
"text_progress_trace",
"(",
")",
";",
"$",
"this",
"->",
"tracestats",
"=",
"new",
"\\"... | Get the progress_trace.
@return \progress_trace | [
"Get",
"the",
"progress_trace",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logging_trait.php#L53-L60 |
219,012 | moodle/moodle | lib/classes/task/logging_trait.php | logging_trait.log_start | protected function log_start($message, $depth = 0) {
$this->log($message, $depth);
if (defined('MDL_PERFTOLOG') && MDL_PERFTOLOG) {
$this->tracestats->$depth = [
'mem' => memory_get_usage(),
'time' => microtime(),
];
}
} | php | protected function log_start($message, $depth = 0) {
$this->log($message, $depth);
if (defined('MDL_PERFTOLOG') && MDL_PERFTOLOG) {
$this->tracestats->$depth = [
'mem' => memory_get_usage(),
'time' => microtime(),
];
}
} | [
"protected",
"function",
"log_start",
"(",
"$",
"message",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"$",
"message",
",",
"$",
"depth",
")",
";",
"if",
"(",
"defined",
"(",
"'MDL_PERFTOLOG'",
")",
"&&",
"MDL_PERFTOLOG",
")... | Log a start message to the progress tracer.
@param string $message
@param int $depth | [
"Log",
"a",
"start",
"message",
"to",
"the",
"progress",
"tracer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logging_trait.php#L79-L88 |
219,013 | moodle/moodle | lib/classes/task/logging_trait.php | logging_trait.log_finish | protected function log_finish($message, $depth = 0) {
$this->log($message, $depth);
if (isset($this->tracestats->$depth)) {
$startstats = $this->tracestats->$depth;
$this->log(
sprintf("Time taken %s, memory total: %s, Memory growth: %s, Memory peak: %s",
... | php | protected function log_finish($message, $depth = 0) {
$this->log($message, $depth);
if (isset($this->tracestats->$depth)) {
$startstats = $this->tracestats->$depth;
$this->log(
sprintf("Time taken %s, memory total: %s, Memory growth: %s, Memory peak: %s",
... | [
"protected",
"function",
"log_finish",
"(",
"$",
"message",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"$",
"message",
",",
"$",
"depth",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"tracestats",
"->",
"$",
"d... | Log an end message to the progress tracer.
@param string $message
@param int $depth | [
"Log",
"an",
"end",
"message",
"to",
"the",
"progress",
"tracer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/logging_trait.php#L96-L111 |
219,014 | moodle/moodle | badges/criteria/award_criteria_activity.php | award_criteria_activity.get_mod_instance | private function get_mod_instance($cmid) {
global $DB;
$rec = $DB->get_record_sql("SELECT md.name
FROM {course_modules} cm,
{modules} md
WHERE cm.id = ? AND
md.id = cm.m... | php | private function get_mod_instance($cmid) {
global $DB;
$rec = $DB->get_record_sql("SELECT md.name
FROM {course_modules} cm,
{modules} md
WHERE cm.id = ? AND
md.id = cm.m... | [
"private",
"function",
"get_mod_instance",
"(",
"$",
"cmid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"rec",
"=",
"$",
"DB",
"->",
"get_record_sql",
"(",
"\"SELECT md.name\n FROM {course_modules} cm,\n {modules}... | Gets the module instance from the database and returns it.
If no module instance exists this function returns false.
@return stdClass|bool | [
"Gets",
"the",
"module",
"instance",
"from",
"the",
"database",
"and",
"returns",
"it",
".",
"If",
"no",
"module",
"instance",
"exists",
"this",
"function",
"returns",
"false",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/criteria/award_criteria_activity.php#L66-L79 |
219,015 | moodle/moodle | badges/criteria/award_criteria_activity.php | award_criteria_activity.get_details | public function get_details($short = '') {
global $DB, $OUTPUT;
$output = array();
foreach ($this->params as $p) {
$mod = self::get_mod_instance($p['module']);
if (!$mod) {
$str = $OUTPUT->error_text(get_string('error:nosuchmod', 'badges'));
} ... | php | public function get_details($short = '') {
global $DB, $OUTPUT;
$output = array();
foreach ($this->params as $p) {
$mod = self::get_mod_instance($p['module']);
if (!$mod) {
$str = $OUTPUT->error_text(get_string('error:nosuchmod', 'badges'));
} ... | [
"public",
"function",
"get_details",
"(",
"$",
"short",
"=",
"''",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"OUTPUT",
";",
"$",
"output",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"p",
")",
"{",
"$",
"... | Get criteria description for displaying to users
@return string | [
"Get",
"criteria",
"description",
"for",
"displaying",
"to",
"users"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/criteria/award_criteria_activity.php#L86-L107 |
219,016 | moodle/moodle | admin/tool/analytics/classes/clihelper.php | clihelper.list_models | public static function list_models() {
cli_heading("List of models");
echo str_pad(get_string('modelid', 'tool_analytics'), 15, ' ') . ' ' . str_pad(get_string('name'), 50, ' ') .
' ' . str_pad(get_string('status'), 15, ' ') . "\n";
$models = \core_analytics\manager::get_all_models()... | php | public static function list_models() {
cli_heading("List of models");
echo str_pad(get_string('modelid', 'tool_analytics'), 15, ' ') . ' ' . str_pad(get_string('name'), 50, ' ') .
' ' . str_pad(get_string('status'), 15, ' ') . "\n";
$models = \core_analytics\manager::get_all_models()... | [
"public",
"static",
"function",
"list_models",
"(",
")",
"{",
"cli_heading",
"(",
"\"List of models\"",
")",
";",
"echo",
"str_pad",
"(",
"get_string",
"(",
"'modelid'",
",",
"'tool_analytics'",
")",
",",
"15",
",",
"' '",
")",
".",
"' '",
".",
"str_pad",
... | List all models in the system. To be used from cli scripts.
@return void | [
"List",
"all",
"models",
"in",
"the",
"system",
".",
"To",
"be",
"used",
"from",
"cli",
"scripts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/analytics/classes/clihelper.php#L43-L54 |
219,017 | moodle/moodle | competency/classes/course_competency.php | course_competency.get_courses_with_competency_and_user | public static function get_courses_with_competency_and_user($competencyid, $userid) {
global $CFG, $DB;
if (!$plugins = explode(',', $CFG->enrol_plugins_enabled)) {
return array();
}
$ctxfields = \context_helper::get_preload_record_columns_sql('ctx');
list($plugins,... | php | public static function get_courses_with_competency_and_user($competencyid, $userid) {
global $CFG, $DB;
if (!$plugins = explode(',', $CFG->enrol_plugins_enabled)) {
return array();
}
$ctxfields = \context_helper::get_preload_record_columns_sql('ctx');
list($plugins,... | [
"public",
"static",
"function",
"get_courses_with_competency_and_user",
"(",
"$",
"competencyid",
",",
"$",
"userid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"if",
"(",
"!",
"$",
"plugins",
"=",
"explode",
"(",
"','",
",",
"$",
"CFG",
"->",
... | Return the courses where both competency and user are.
A user is considered being in a course when they are enrolled, the enrolment is valid,
the enrolment instance is enabled, and the enrolment plugin is enabled..
@param int $competencyid The competency ID.
@param int $userid The user ID.
@return array Indexed by co... | [
"Return",
"the",
"courses",
"where",
"both",
"competency",
"and",
"user",
"are",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/course_competency.php#L99-L140 |
219,018 | moodle/moodle | competency/classes/course_competency.php | course_competency.get_ruleoutcome_list | public static function get_ruleoutcome_list() {
static $list = null;
if ($list === null) {
$list = array(
self::OUTCOME_NONE => self::get_ruleoutcome_name(self::OUTCOME_NONE),
self::OUTCOME_EVIDENCE => self::get_ruleoutcome_name(self::OUTCOME_EVIDENCE),
... | php | public static function get_ruleoutcome_list() {
static $list = null;
if ($list === null) {
$list = array(
self::OUTCOME_NONE => self::get_ruleoutcome_name(self::OUTCOME_NONE),
self::OUTCOME_EVIDENCE => self::get_ruleoutcome_name(self::OUTCOME_EVIDENCE),
... | [
"public",
"static",
"function",
"get_ruleoutcome_list",
"(",
")",
"{",
"static",
"$",
"list",
"=",
"null",
";",
"if",
"(",
"$",
"list",
"===",
"null",
")",
"{",
"$",
"list",
"=",
"array",
"(",
"self",
"::",
"OUTCOME_NONE",
"=>",
"self",
"::",
"get_rule... | Return a list of rules.
@return array Indexed by outcome value. | [
"Return",
"a",
"list",
"of",
"rules",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/course_competency.php#L147-L159 |
219,019 | moodle/moodle | competency/classes/course_competency.php | course_competency.list_courses_min | public static function list_courses_min($competencyid) {
global $DB;
$results = $DB->get_records_sql('SELECT course.id as id, course.visible as visible
FROM {' . self::TABLE . '} coursecomp
JOIN {course} course
... | php | public static function list_courses_min($competencyid) {
global $DB;
$results = $DB->get_records_sql('SELECT course.id as id, course.visible as visible
FROM {' . self::TABLE . '} coursecomp
JOIN {course} course
... | [
"public",
"static",
"function",
"list_courses_min",
"(",
"$",
"competencyid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"results",
"=",
"$",
"DB",
"->",
"get_records_sql",
"(",
"'SELECT course.id as id, course.visible as visible\n FR... | Return the course IDs and visible flags that include this competency.
Only the ids and visible flag are returned, for the full records use list_courses.
@param int $competencyid The competency id
@return array containing courseid and visible. | [
"Return",
"the",
"course",
"IDs",
"and",
"visible",
"flags",
"that",
"include",
"this",
"competency",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/course_competency.php#L225-L235 |
219,020 | moodle/moodle | competency/classes/course_competency.php | course_competency.list_courses | public static function list_courses($competencyid) {
global $DB;
$results = $DB->get_records_sql('SELECT course.id, course.visible, course.shortname, course.idnumber,
course.fullname, course.summary, course.summaryformat, course.startdate,
... | php | public static function list_courses($competencyid) {
global $DB;
$results = $DB->get_records_sql('SELECT course.id, course.visible, course.shortname, course.idnumber,
course.fullname, course.summary, course.summaryformat, course.startdate,
... | [
"public",
"static",
"function",
"list_courses",
"(",
"$",
"competencyid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"results",
"=",
"$",
"DB",
"->",
"get_records_sql",
"(",
"'SELECT course.id, course.visible, course.shortname, course.idnumber,\n ... | Return partial course records foreach course that contains this competency.
@param int $competencyid The competency id
@return array[stdClass] Array of course records containg id, visible, shortname, idnumber, fullname | [
"Return",
"partial",
"course",
"records",
"foreach",
"course",
"that",
"contains",
"this",
"competency",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/course_competency.php#L243-L255 |
219,021 | moodle/moodle | competency/classes/course_competency.php | course_competency.count_competencies | public static function count_competencies($courseid) {
global $DB;
$sql = 'SELECT COUNT(comp.id)
FROM {' . self::TABLE . '} coursecomp
JOIN {' . competency::TABLE . '} comp
ON coursecomp.competencyid = comp.id
WHERE coursecomp.cou... | php | public static function count_competencies($courseid) {
global $DB;
$sql = 'SELECT COUNT(comp.id)
FROM {' . self::TABLE . '} coursecomp
JOIN {' . competency::TABLE . '} comp
ON coursecomp.competencyid = comp.id
WHERE coursecomp.cou... | [
"public",
"static",
"function",
"count_competencies",
"(",
"$",
"courseid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"'SELECT COUNT(comp.id)\n FROM {'",
".",
"self",
"::",
"TABLE",
".",
"'} coursecomp\n JOIN {'",
".",
"com... | Count the competencies in this course.
@param int $courseid The course id
@return int | [
"Count",
"the",
"competencies",
"in",
"this",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/course_competency.php#L263-L276 |
219,022 | moodle/moodle | competency/classes/course_competency.php | course_competency.list_competencies | public static function list_competencies($courseid) {
global $DB;
$sql = 'SELECT comp.*
FROM {' . competency::TABLE . '} comp
JOIN {' . self::TABLE . '} coursecomp
ON coursecomp.competencyid = comp.id
WHERE coursecomp.courseid = ?... | php | public static function list_competencies($courseid) {
global $DB;
$sql = 'SELECT comp.*
FROM {' . competency::TABLE . '} comp
JOIN {' . self::TABLE . '} coursecomp
ON coursecomp.competencyid = comp.id
WHERE coursecomp.courseid = ?... | [
"public",
"static",
"function",
"list_competencies",
"(",
"$",
"courseid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"'SELECT comp.*\n FROM {'",
".",
"competency",
"::",
"TABLE",
".",
"'} comp\n JOIN {'",
".",
"self",
"::... | List the competencies in this course.
@param int $courseid The course id
@return competency[] Indexed by competency ID. | [
"List",
"the",
"competencies",
"in",
"this",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/course_competency.php#L284-L304 |
219,023 | moodle/moodle | competency/classes/course_competency.php | course_competency.get_course_competency | public static function get_course_competency($courseid, $competencyid) {
global $DB;
$sql = 'SELECT crscomp.*
FROM {' . self::TABLE . '} crscomp
WHERE crscomp.courseid = ? AND crscomp.competencyid = ?';
$params = array($courseid, $competencyid);
$resu... | php | public static function get_course_competency($courseid, $competencyid) {
global $DB;
$sql = 'SELECT crscomp.*
FROM {' . self::TABLE . '} crscomp
WHERE crscomp.courseid = ? AND crscomp.competencyid = ?';
$params = array($courseid, $competencyid);
$resu... | [
"public",
"static",
"function",
"get_course_competency",
"(",
"$",
"courseid",
",",
"$",
"competencyid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"'SELECT crscomp.*\n FROM {'",
".",
"self",
"::",
"TABLE",
".",
"'} crscomp\n ... | Get the specified course_competency in this course.
@param int $courseid The course id
@param int $competencyid The competency id
@return course_competency | [
"Get",
"the",
"specified",
"course_competency",
"in",
"this",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/course_competency.php#L355-L369 |
219,024 | moodle/moodle | competency/classes/course_competency.php | course_competency.list_course_competencies | public static function list_course_competencies($courseid) {
global $DB;
$sql = 'SELECT coursecomp.*
FROM {' . self::TABLE . '} coursecomp
JOIN {' . competency::TABLE . '} comp
ON coursecomp.competencyid = comp.id
WHERE coursecomp... | php | public static function list_course_competencies($courseid) {
global $DB;
$sql = 'SELECT coursecomp.*
FROM {' . self::TABLE . '} coursecomp
JOIN {' . competency::TABLE . '} comp
ON coursecomp.competencyid = comp.id
WHERE coursecomp... | [
"public",
"static",
"function",
"list_course_competencies",
"(",
"$",
"courseid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"'SELECT coursecomp.*\n FROM {'",
".",
"self",
"::",
"TABLE",
".",
"'} coursecomp\n JOIN {'",
".",
... | List the course_competencies in this course.
@param int $courseid The course id
@return course_competency[] | [
"List",
"the",
"course_competencies",
"in",
"this",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/course_competency.php#L377-L396 |
219,025 | moodle/moodle | backup/util/plan/backup_structure_step.class.php | backup_structure_step.add_plugin_structure | protected function add_plugin_structure($plugintype, $element, $multiple) {
global $CFG;
// Check the requested plugintype is a valid one
if (!array_key_exists($plugintype, core_component::get_plugin_types($plugintype))) {
throw new backup_step_exception('incorrect_plugin_type', $... | php | protected function add_plugin_structure($plugintype, $element, $multiple) {
global $CFG;
// Check the requested plugintype is a valid one
if (!array_key_exists($plugintype, core_component::get_plugin_types($plugintype))) {
throw new backup_step_exception('incorrect_plugin_type', $... | [
"protected",
"function",
"add_plugin_structure",
"(",
"$",
"plugintype",
",",
"$",
"element",
",",
"$",
"multiple",
")",
"{",
"global",
"$",
"CFG",
";",
"// Check the requested plugintype is a valid one",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"plugintype",
... | Add plugin structure to any element in the structure backup tree
@param string $plugintype type of plugin as defined by core_component::get_plugin_types()
@param backup_nested_element $element element in the structure backup tree that
we are going to add plugin information to
@param bool $multiple to define if multipl... | [
"Add",
"plugin",
"structure",
"to",
"any",
"element",
"in",
"the",
"structure",
"backup",
"tree"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/plan/backup_structure_step.class.php#L137-L163 |
219,026 | moodle/moodle | backup/util/plan/backup_structure_step.class.php | backup_structure_step.add_subplugin_structure | protected function add_subplugin_structure($subplugintype, $element, $multiple, $plugintype = null, $pluginname = null) {
global $CFG;
// This global declaration is required, because where we do require_once($backupfile);
// That file may in turn try to do require_once($CFG->dirroot ...).
... | php | protected function add_subplugin_structure($subplugintype, $element, $multiple, $plugintype = null, $pluginname = null) {
global $CFG;
// This global declaration is required, because where we do require_once($backupfile);
// That file may in turn try to do require_once($CFG->dirroot ...).
... | [
"protected",
"function",
"add_subplugin_structure",
"(",
"$",
"subplugintype",
",",
"$",
"element",
",",
"$",
"multiple",
",",
"$",
"plugintype",
"=",
"null",
",",
"$",
"pluginname",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"// This global declaration... | Add subplugin structure for a given plugin to any element in the structure backup tree.
This method allows the injection of subplugins (of a specified plugin) data to any
element in any backup structure.
NOTE: Initially subplugins were only available for activities (mod), so only the
{@link backup_activity_structure_... | [
"Add",
"subplugin",
"structure",
"for",
"a",
"given",
"plugin",
"to",
"any",
"element",
"in",
"the",
"structure",
"backup",
"tree",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/plan/backup_structure_step.class.php#L185-L244 |
219,027 | moodle/moodle | analytics/classes/local/time_splitting/periodic.php | periodic.get_training_ranges | public function get_training_ranges() {
// Cloning the array.
$trainingranges = $this->ranges;
foreach ($trainingranges as $rangeindex => $range) {
if (!$this->ready_to_train($range)) {
unset($trainingranges[$rangeindex]);
}
}
return $tra... | php | public function get_training_ranges() {
// Cloning the array.
$trainingranges = $this->ranges;
foreach ($trainingranges as $rangeindex => $range) {
if (!$this->ready_to_train($range)) {
unset($trainingranges[$rangeindex]);
}
}
return $tra... | [
"public",
"function",
"get_training_ranges",
"(",
")",
"{",
"// Cloning the array.",
"$",
"trainingranges",
"=",
"$",
"this",
"->",
"ranges",
";",
"foreach",
"(",
"$",
"trainingranges",
"as",
"$",
"rangeindex",
"=>",
"$",
"range",
")",
"{",
"if",
"(",
"!",
... | Overwritting as the last range may be for prediction.
@return array | [
"Overwritting",
"as",
"the",
"last",
"range",
"may",
"be",
"for",
"prediction",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/local/time_splitting/periodic.php#L108-L119 |
219,028 | moodle/moodle | analytics/classes/local/time_splitting/periodic.php | periodic.get_next_range | protected function get_next_range(\DateTimeImmutable $next) {
$end = $next->getTimestamp();
$start = $next->sub($this->periodicity())->getTimestamp();
if ($start < $this->analysable->get_start()) {
// We skip the first range generated as its start is prior to the analysable start.
... | php | protected function get_next_range(\DateTimeImmutable $next) {
$end = $next->getTimestamp();
$start = $next->sub($this->periodicity())->getTimestamp();
if ($start < $this->analysable->get_start()) {
// We skip the first range generated as its start is prior to the analysable start.
... | [
"protected",
"function",
"get_next_range",
"(",
"\\",
"DateTimeImmutable",
"$",
"next",
")",
"{",
"$",
"end",
"=",
"$",
"next",
"->",
"getTimestamp",
"(",
")",
";",
"$",
"start",
"=",
"$",
"next",
"->",
"sub",
"(",
"$",
"this",
"->",
"periodicity",
"("... | The next range is based on the past period.
@param \DateTimeImmutable $next
@return array | [
"The",
"next",
"range",
"is",
"based",
"on",
"the",
"past",
"period",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/local/time_splitting/periodic.php#L127-L142 |
219,029 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/Watch.php | Watch.createAggregate | private function createAggregate()
{
$pipeline = $this->pipeline;
array_unshift($pipeline, ['$changeStream' => (object) $this->changeStreamOptions]);
return new Aggregate($this->databaseName, $this->collectionName, $pipeline, $this->aggregateOptions);
} | php | private function createAggregate()
{
$pipeline = $this->pipeline;
array_unshift($pipeline, ['$changeStream' => (object) $this->changeStreamOptions]);
return new Aggregate($this->databaseName, $this->collectionName, $pipeline, $this->aggregateOptions);
} | [
"private",
"function",
"createAggregate",
"(",
")",
"{",
"$",
"pipeline",
"=",
"$",
"this",
"->",
"pipeline",
";",
"array_unshift",
"(",
"$",
"pipeline",
",",
"[",
"'$changeStream'",
"=>",
"(",
"object",
")",
"$",
"this",
"->",
"changeStreamOptions",
"]",
... | Create the aggregate command for creating a change stream.
This method is also used to recreate the aggregate command when resuming.
@return Aggregate | [
"Create",
"the",
"aggregate",
"command",
"for",
"creating",
"a",
"change",
"stream",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/Watch.php#L226-L232 |
219,030 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/Watch.php | Watch.executeAggregate | private function executeAggregate(Server $server)
{
/* If we've already captured an operation time or the server does not
* support returning an operation time (e.g. MongoDB 3.6), execute the
* aggregation directly and return its cursor. */
if ($this->operationTime !== null || ! \M... | php | private function executeAggregate(Server $server)
{
/* If we've already captured an operation time or the server does not
* support returning an operation time (e.g. MongoDB 3.6), execute the
* aggregation directly and return its cursor. */
if ($this->operationTime !== null || ! \M... | [
"private",
"function",
"executeAggregate",
"(",
"Server",
"$",
"server",
")",
"{",
"/* If we've already captured an operation time or the server does not\n * support returning an operation time (e.g. MongoDB 3.6), execute the\n * aggregation directly and return its cursor. */",
"... | Execute the aggregate command and optionally capture its operation time.
@param Server $server
@return Cursor | [
"Execute",
"the",
"aggregate",
"command",
"and",
"optionally",
"capture",
"its",
"operation",
"time",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/Watch.php#L267-L285 |
219,031 | moodle/moodle | blocks/rss_client/editfeed.php | feed_edit_form.autodiscover_feed_url | public static function autodiscover_feed_url($url){
$rss = new moodle_simplepie();
$rss->set_feed_url($url);
$rss->set_autodiscovery_level(SIMPLEPIE_LOCATOR_ALL);
// When autodiscovering an RSS feed, simplepie will try lots of
// rss links on a page, so set t... | php | public static function autodiscover_feed_url($url){
$rss = new moodle_simplepie();
$rss->set_feed_url($url);
$rss->set_autodiscovery_level(SIMPLEPIE_LOCATOR_ALL);
// When autodiscovering an RSS feed, simplepie will try lots of
// rss links on a page, so set t... | [
"public",
"static",
"function",
"autodiscover_feed_url",
"(",
"$",
"url",
")",
"{",
"$",
"rss",
"=",
"new",
"moodle_simplepie",
"(",
")",
";",
"$",
"rss",
"->",
"set_feed_url",
"(",
"$",
"url",
")",
";",
"$",
"rss",
"->",
"set_autodiscovery_level",
"(",
... | Autodiscovers a feed url from a given url, to be used by the formslibs
filter function
Uses simplepie with autodiscovery set to maximum level to try and find
a feed to subscribe to.
See: http://simplepie.org/wiki/reference/simplepie/set_autodiscovery_level
@param string URL to autodiscover a url
@return string URL of... | [
"Autodiscovers",
"a",
"feed",
"url",
"from",
"a",
"given",
"url",
"to",
"be",
"used",
"by",
"the",
"formslibs",
"filter",
"function"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/rss_client/editfeed.php#L129-L145 |
219,032 | moodle/moodle | mod/url/classes/external.php | mod_url_external.get_urls_by_courses | public static function get_urls_by_courses($courseids = array()) {
$warnings = array();
$returnedurls = array();
$params = array(
'courseids' => $courseids,
);
$params = self::validate_parameters(self::get_urls_by_courses_parameters(), $params);
$mycourses ... | php | public static function get_urls_by_courses($courseids = array()) {
$warnings = array();
$returnedurls = array();
$params = array(
'courseids' => $courseids,
);
$params = self::validate_parameters(self::get_urls_by_courses_parameters(), $params);
$mycourses ... | [
"public",
"static",
"function",
"get_urls_by_courses",
"(",
"$",
"courseids",
"=",
"array",
"(",
")",
")",
"{",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"returnedurls",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'courseid... | Returns a list of urls in a provided list of courses.
If no list is provided all urls that the user can view will be returned.
@param array $courseids course ids
@return array of warnings and urls
@since Moodle 3.3 | [
"Returns",
"a",
"list",
"of",
"urls",
"in",
"a",
"provided",
"list",
"of",
"courses",
".",
"If",
"no",
"list",
"is",
"provided",
"all",
"urls",
"that",
"the",
"user",
"can",
"view",
"will",
"be",
"returned",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/url/classes/external.php#L131-L173 |
219,033 | moodle/moodle | mod/url/classes/external.php | mod_url_external.get_urls_by_courses_returns | public static function get_urls_by_courses_returns() {
return new external_single_structure(
array(
'urls' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARA... | php | public static function get_urls_by_courses_returns() {
return new external_single_structure(
array(
'urls' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARA... | [
"public",
"static",
"function",
"get_urls_by_courses_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'urls'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>... | Describes the get_urls_by_courses return value.
@return external_single_structure
@since Moodle 3.3 | [
"Describes",
"the",
"get_urls_by_courses",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/url/classes/external.php#L181-L209 |
219,034 | moodle/moodle | backup/util/dbops/restore_controller_dbops.class.php | restore_controller_dbops.save_controller | public static function save_controller($controller, $checksum, $includeobj = true, $cleanobj = false) {
global $DB;
// Check we are going to save one backup_controller
if (! $controller instanceof restore_controller) {
throw new backup_controller_exception('restore_controller_expecte... | php | public static function save_controller($controller, $checksum, $includeobj = true, $cleanobj = false) {
global $DB;
// Check we are going to save one backup_controller
if (! $controller instanceof restore_controller) {
throw new backup_controller_exception('restore_controller_expecte... | [
"public",
"static",
"function",
"save_controller",
"(",
"$",
"controller",
",",
"$",
"checksum",
",",
"$",
"includeobj",
"=",
"true",
",",
"$",
"cleanobj",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
";",
"// Check we are going to save one backup_controller",
"... | Send one restore controller to DB
@param restore_controller $controller controller to send to DB
@param string $checksum hash of the controller to be checked
@param bool $includeobj to decide if the object itself must be updated (true) or no (false)
@param bool $cleanobj to decide if the object itself must be cleaned ... | [
"Send",
"one",
"restore",
"controller",
"to",
"DB"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/restore_controller_dbops.class.php#L45-L90 |
219,035 | moodle/moodle | backup/util/dbops/restore_controller_dbops.class.php | restore_controller_dbops.apply_config_defaults | public static function apply_config_defaults(restore_controller $controller) {
$settings = array(
'restore_general_users' => 'users',
'restore_general_enrolments' => 'enrolments',
'restore_general_role_assignments' => 'role_assignments',
'r... | php | public static function apply_config_defaults(restore_controller $controller) {
$settings = array(
'restore_general_users' => 'users',
'restore_general_enrolments' => 'enrolments',
'restore_general_role_assignments' => 'role_assignments',
'r... | [
"public",
"static",
"function",
"apply_config_defaults",
"(",
"restore_controller",
"$",
"controller",
")",
"{",
"$",
"settings",
"=",
"array",
"(",
"'restore_general_users'",
"=>",
"'users'",
",",
"'restore_general_enrolments'",
"=>",
"'enrolments'",
",",
"'restore_gen... | Sets the default values for the settings in a restore operation
@param restore_controller $controller | [
"Sets",
"the",
"default",
"values",
"for",
"the",
"settings",
"in",
"a",
"restore",
"operation"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/restore_controller_dbops.class.php#L143-L214 |
219,036 | moodle/moodle | backup/util/dbops/restore_controller_dbops.class.php | restore_controller_dbops.get_setting_default | private static function get_setting_default($config, $setting) {
$value = get_config('restore', $config);
if (in_array($setting->get_name(), ['course_fullname', 'course_shortname', 'course_startdate']) &&
$setting->get_ui() instanceof backup_setting_ui_defaultcustom) {
// Sp... | php | private static function get_setting_default($config, $setting) {
$value = get_config('restore', $config);
if (in_array($setting->get_name(), ['course_fullname', 'course_shortname', 'course_startdate']) &&
$setting->get_ui() instanceof backup_setting_ui_defaultcustom) {
// Sp... | [
"private",
"static",
"function",
"get_setting_default",
"(",
"$",
"config",
",",
"$",
"setting",
")",
"{",
"$",
"value",
"=",
"get_config",
"(",
"'restore'",
",",
"$",
"config",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"setting",
"->",
"get_name",
"(",... | Returns the default value to be used for a setting from the admin restore config
@param string $config
@param backup_setting $setting
@return mixed | [
"Returns",
"the",
"default",
"value",
"to",
"be",
"used",
"for",
"a",
"setting",
"from",
"the",
"admin",
"restore",
"config"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/restore_controller_dbops.class.php#L223-L246 |
219,037 | moodle/moodle | backup/util/dbops/restore_controller_dbops.class.php | restore_controller_dbops.force_enable_settings | private static function force_enable_settings(restore_controller $controller, array $settings) {
$plan = $controller->get_plan();
foreach ($settings as $config => $settingname) {
$value = true;
if ($plan->setting_exists($settingname)) {
$setting = $plan->get_setti... | php | private static function force_enable_settings(restore_controller $controller, array $settings) {
$plan = $controller->get_plan();
foreach ($settings as $config => $settingname) {
$value = true;
if ($plan->setting_exists($settingname)) {
$setting = $plan->get_setti... | [
"private",
"static",
"function",
"force_enable_settings",
"(",
"restore_controller",
"$",
"controller",
",",
"array",
"$",
"settings",
")",
"{",
"$",
"plan",
"=",
"$",
"controller",
"->",
"get_plan",
"(",
")",
";",
"foreach",
"(",
"$",
"settings",
"as",
"$",... | Turn these settings on. No defaults from admin settings.
@param restore_controller $controller
@param array $settings a map from admin config names to setting names (Config name => Setting name) | [
"Turn",
"these",
"settings",
"on",
".",
"No",
"defaults",
"from",
"admin",
"settings",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/restore_controller_dbops.class.php#L254-L270 |
219,038 | moodle/moodle | admin/tool/usertours/classes/step.php | step.load_from_record | public static function load_from_record($record, $clean = false) {
$step = new self();
return $step->reload_from_record($record, $clean);
} | php | public static function load_from_record($record, $clean = false) {
$step = new self();
return $step->reload_from_record($record, $clean);
} | [
"public",
"static",
"function",
"load_from_record",
"(",
"$",
"record",
",",
"$",
"clean",
"=",
"false",
")",
"{",
"$",
"step",
"=",
"new",
"self",
"(",
")",
";",
"return",
"$",
"step",
"->",
"reload_from_record",
"(",
"$",
"record",
",",
"$",
"clean",... | Load the step instance.
@param stdClass $record The step record to be loaded.
@param boolean $clean Clean the values.
@return step | [
"Load",
"the",
"step",
"instance",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/step.php#L105-L108 |
219,039 | moodle/moodle | admin/tool/usertours/classes/step.php | step.reload_from_record | protected function reload_from_record($record, $clean = false) {
$this->id = $record->id;
$this->tourid = $record->tourid;
if ($clean) {
$this->title = clean_param($record->title, PARAM_TEXT);
$this->content = clean_text($record->content);
} el... | php | protected function reload_from_record($record, $clean = false) {
$this->id = $record->id;
$this->tourid = $record->tourid;
if ($clean) {
$this->title = clean_param($record->title, PARAM_TEXT);
$this->content = clean_text($record->content);
} el... | [
"protected",
"function",
"reload_from_record",
"(",
"$",
"record",
",",
"$",
"clean",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"$",
"record",
"->",
"id",
";",
"$",
"this",
"->",
"tourid",
"=",
"$",
"record",
"->",
"tourid",
";",
"if",
... | Reload the current step from the supplied record.
@param stdClass $record The step record to be loaded.
@param boolean $clean Clean the values.
@return step | [
"Reload",
"the",
"current",
"step",
"from",
"the",
"supplied",
"record",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/step.php#L140-L157 |
219,040 | moodle/moodle | admin/tool/usertours/classes/step.php | step.get_tour | public function get_tour() {
if ($this->tour === null) {
$this->tour = tour::instance($this->tourid);
}
return $this->tour;
} | php | public function get_tour() {
if ($this->tour === null) {
$this->tour = tour::instance($this->tourid);
}
return $this->tour;
} | [
"public",
"function",
"get_tour",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"tour",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"tour",
"=",
"tour",
"::",
"instance",
"(",
"$",
"this",
"->",
"tourid",
")",
";",
"}",
"return",
"$",
"this",
"->"... | Get the Tour instance that this step belongs to.
@return tour | [
"Get",
"the",
"Tour",
"instance",
"that",
"this",
"step",
"belongs",
"to",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/step.php#L182-L187 |
219,041 | moodle/moodle | admin/tool/usertours/classes/step.php | step.set_tourid | public function set_tourid($value) {
$this->tourid = $value;
$this->tour = null;
$this->dirty = true;
return $this;
} | php | public function set_tourid($value) {
$this->tourid = $value;
$this->tour = null;
$this->dirty = true;
return $this;
} | [
"public",
"function",
"set_tourid",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"tourid",
"=",
"$",
"value",
";",
"$",
"this",
"->",
"tour",
"=",
"null",
";",
"$",
"this",
"->",
"dirty",
"=",
"true",
";",
"return",
"$",
"this",
";",
"}"
] | Set the id of the tour.
@param int $value The id of the tour.
@return self | [
"Set",
"the",
"id",
"of",
"the",
"tour",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/step.php#L195-L201 |
219,042 | moodle/moodle | admin/tool/usertours/classes/step.php | step.set_title | public function set_title($value) {
$this->title = clean_text($value);
$this->dirty = true;
return $this;
} | php | public function set_title($value) {
$this->title = clean_text($value);
$this->dirty = true;
return $this;
} | [
"public",
"function",
"set_title",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"title",
"=",
"clean_text",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"dirty",
"=",
"true",
";",
"return",
"$",
"this",
";",
"}"
] | Set the title for this step.
@param string $value The new title to use.
@return $this | [
"Set",
"the",
"title",
"for",
"this",
"step",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/step.php#L218-L223 |
219,043 | moodle/moodle | admin/tool/usertours/classes/step.php | step.set_content | public function set_content($value) {
$this->content = clean_text($value);
$this->dirty = true;
return $this;
} | php | public function set_content($value) {
$this->content = clean_text($value);
$this->dirty = true;
return $this;
} | [
"public",
"function",
"set_content",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"content",
"=",
"clean_text",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"dirty",
"=",
"true",
";",
"return",
"$",
"this",
";",
"}"
] | Set the content value for this step.
@param string $value The new content to use.
@return $this | [
"Set",
"the",
"content",
"value",
"for",
"this",
"step",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/step.php#L240-L245 |
219,044 | moodle/moodle | admin/tool/usertours/classes/step.php | step.to_record | public function to_record() {
return (object) array(
'id' => $this->id,
'tourid' => $this->tourid,
'title' => $this->title,
'content' => $this->content,
'targettype' => $this->targettype,
'targetvalue' =... | php | public function to_record() {
return (object) array(
'id' => $this->id,
'tourid' => $this->tourid,
'title' => $this->title,
'content' => $this->content,
'targettype' => $this->targettype,
'targetvalue' =... | [
"public",
"function",
"to_record",
"(",
")",
"{",
"return",
"(",
"object",
")",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"id",
",",
"'tourid'",
"=>",
"$",
"this",
"->",
"tourid",
",",
"'title'",
"=>",
"$",
"this",
"->",
"title",
",",
"'content'... | Prepare this step for saving to the database.
@return object | [
"Prepare",
"this",
"step",
"for",
"saving",
"to",
"the",
"database",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/step.php#L440-L451 |
219,045 | moodle/moodle | admin/tool/usertours/classes/step.php | step.handle_form_submission | public function handle_form_submission(local\forms\editstep &$mform, \stdClass $data) {
$this->set_title($data->title);
$this->set_content($data->content);
$this->set_targettype($data->targettype);
$this->set_targetvalue($this->get_target()->get_value_from_form($data));
foreach... | php | public function handle_form_submission(local\forms\editstep &$mform, \stdClass $data) {
$this->set_title($data->title);
$this->set_content($data->content);
$this->set_targettype($data->targettype);
$this->set_targetvalue($this->get_target()->get_value_from_form($data));
foreach... | [
"public",
"function",
"handle_form_submission",
"(",
"local",
"\\",
"forms",
"\\",
"editstep",
"&",
"$",
"mform",
",",
"\\",
"stdClass",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"set_title",
"(",
"$",
"data",
"->",
"title",
")",
";",
"$",
"this",
"->"... | Handle submission of the step editing form.
@param local\forms\editstep $mform The sumitted form.
@param stdClass $data The submitted data.
@return $this | [
"Handle",
"submission",
"of",
"the",
"step",
"editing",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/step.php#L626-L651 |
219,046 | moodle/moodle | admin/tool/usertours/classes/step.php | step.get_string_from_input | public static function get_string_from_input($string) {
$string = trim($string);
if (preg_match('|^([a-zA-Z][a-zA-Z0-9\.:/_-]*),([a-zA-Z][a-zA-Z0-9\.:/_-]*)$|', $string, $matches)) {
if ($matches[2] === 'moodle') {
$matches[2] = 'core';
}
if (get_str... | php | public static function get_string_from_input($string) {
$string = trim($string);
if (preg_match('|^([a-zA-Z][a-zA-Z0-9\.:/_-]*),([a-zA-Z][a-zA-Z0-9\.:/_-]*)$|', $string, $matches)) {
if ($matches[2] === 'moodle') {
$matches[2] = 'core';
}
if (get_str... | [
"public",
"static",
"function",
"get_string_from_input",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"trim",
"(",
"$",
"string",
")",
";",
"if",
"(",
"preg_match",
"(",
"'|^([a-zA-Z][a-zA-Z0-9\\.:/_-]*),([a-zA-Z][a-zA-Z0-9\\.:/_-]*)$|'",
",",
"$",
"string",
... | Attempt to fetch any matching langstring if the string is in the
format identifier,component.
@param string $string
@return string | [
"Attempt",
"to",
"fetch",
"any",
"matching",
"langstring",
"if",
"the",
"string",
"is",
"in",
"the",
"format",
"identifier",
"component",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/step.php#L660-L674 |
219,047 | moodle/moodle | lib/pear/HTML/QuickForm/group.php | HTML_QuickForm_group.setValue | function setValue($value)
{
$this->_createElementsIfNotExist();
foreach (array_keys($this->_elements) as $key) {
if (!$this->_appendName) {
$v = $this->_elements[$key]->_findValue($value);
if (null !== $v) {
$this->_elements[$key]->onQu... | php | function setValue($value)
{
$this->_createElementsIfNotExist();
foreach (array_keys($this->_elements) as $key) {
if (!$this->_appendName) {
$v = $this->_elements[$key]->_findValue($value);
if (null !== $v) {
$this->_elements[$key]->onQu... | [
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_createElementsIfNotExist",
"(",
")",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"_elements",
")",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",... | Sets values for group's elements
@param mixed Values for group's elements
@since 1.0
@access public
@return void | [
"Sets",
"values",
"for",
"group",
"s",
"elements"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/group.php#L161-L183 |
219,048 | moodle/moodle | lib/pear/HTML/QuickForm/group.php | HTML_QuickForm_group.getValue | function getValue()
{
$value = null;
foreach (array_keys($this->_elements) as $key) {
$element =& $this->_elements[$key];
switch ($element->getType()) {
case 'radio':
$v = $element->getChecked()? $element->getValue(): null;
... | php | function getValue()
{
$value = null;
foreach (array_keys($this->_elements) as $key) {
$element =& $this->_elements[$key];
switch ($element->getType()) {
case 'radio':
$v = $element->getChecked()? $element->getValue(): null;
... | [
"function",
"getValue",
"(",
")",
"{",
"$",
"value",
"=",
"null",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"_elements",
")",
"as",
"$",
"key",
")",
"{",
"$",
"element",
"=",
"&",
"$",
"this",
"->",
"_elements",
"[",
"$",
"key",
... | Returns the value of the group
@since 1.0
@access public
@return mixed | [
"Returns",
"the",
"value",
"of",
"the",
"group"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/group.php#L195-L227 |
219,049 | moodle/moodle | lib/pear/HTML/QuickForm/group.php | HTML_QuickForm_group.setElements | function setElements($elements)
{
$this->_elements = array_values($elements);
if ($this->_flagFrozen) {
$this->freeze();
}
} | php | function setElements($elements)
{
$this->_elements = array_values($elements);
if ($this->_flagFrozen) {
$this->freeze();
}
} | [
"function",
"setElements",
"(",
"$",
"elements",
")",
"{",
"$",
"this",
"->",
"_elements",
"=",
"array_values",
"(",
"$",
"elements",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_flagFrozen",
")",
"{",
"$",
"this",
"->",
"freeze",
"(",
")",
";",
"}",
... | Sets the grouped elements
@param array $elements Array of elements
@since 1.1
@access public
@return void | [
"Sets",
"the",
"grouped",
"elements"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/group.php#L240-L246 |
219,050 | moodle/moodle | lib/pear/HTML/QuickForm/group.php | HTML_QuickForm_group.getGroupType | function getGroupType()
{
$this->_createElementsIfNotExist();
$prevType = '';
foreach (array_keys($this->_elements) as $key) {
$type = $this->_elements[$key]->getType();
if ($type != $prevType && $prevType != '') {
return 'mixed';
}
... | php | function getGroupType()
{
$this->_createElementsIfNotExist();
$prevType = '';
foreach (array_keys($this->_elements) as $key) {
$type = $this->_elements[$key]->getType();
if ($type != $prevType && $prevType != '') {
return 'mixed';
}
... | [
"function",
"getGroupType",
"(",
")",
"{",
"$",
"this",
"->",
"_createElementsIfNotExist",
"(",
")",
";",
"$",
"prevType",
"=",
"''",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"_elements",
")",
"as",
"$",
"key",
")",
"{",
"$",
"type",
... | Gets the group type based on its elements
Will return 'mixed' if elements contained in the group
are of different types.
@access public
@return string group elements type | [
"Gets",
"the",
"group",
"type",
"based",
"on",
"its",
"elements",
"Will",
"return",
"mixed",
"if",
"elements",
"contained",
"in",
"the",
"group",
"are",
"of",
"different",
"types",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/group.php#L275-L287 |
219,051 | moodle/moodle | lib/pear/HTML/QuickForm/group.php | HTML_QuickForm_group.toHtml | function toHtml()
{
include_once('HTML/QuickForm/Renderer/Default.php');
$renderer = new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate('{element}');
$this->accept($renderer);
return $renderer->toHtml();
} | php | function toHtml()
{
include_once('HTML/QuickForm/Renderer/Default.php');
$renderer = new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate('{element}');
$this->accept($renderer);
return $renderer->toHtml();
} | [
"function",
"toHtml",
"(",
")",
"{",
"include_once",
"(",
"'HTML/QuickForm/Renderer/Default.php'",
")",
";",
"$",
"renderer",
"=",
"new",
"HTML_QuickForm_Renderer_Default",
"(",
")",
";",
"$",
"renderer",
"->",
"setElementTemplate",
"(",
"'{element}'",
")",
";",
"... | Returns Html for the group
@since 1.0
@access public
@return string | [
"Returns",
"Html",
"for",
"the",
"group"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/group.php#L299-L306 |
219,052 | moodle/moodle | lib/pear/HTML/QuickForm/group.php | HTML_QuickForm_group.getElementName | function getElementName($index)
{
$this->_createElementsIfNotExist();
$elementName = false;
if (is_int($index) && isset($this->_elements[$index])) {
$elementName = $this->_elements[$index]->getName();
if (isset($elementName) && $elementName == '') {
$e... | php | function getElementName($index)
{
$this->_createElementsIfNotExist();
$elementName = false;
if (is_int($index) && isset($this->_elements[$index])) {
$elementName = $this->_elements[$index]->getName();
if (isset($elementName) && $elementName == '') {
$e... | [
"function",
"getElementName",
"(",
"$",
"index",
")",
"{",
"$",
"this",
"->",
"_createElementsIfNotExist",
"(",
")",
";",
"$",
"elementName",
"=",
"false",
";",
"if",
"(",
"is_int",
"(",
"$",
"index",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"_eleme... | Returns the element name inside the group such as found in the html form
@param mixed $index Element name or element index in the group
@since 3.0
@access public
@return mixed string with element name, false if not found | [
"Returns",
"the",
"element",
"name",
"inside",
"the",
"group",
"such",
"as",
"found",
"in",
"the",
"html",
"form"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/group.php#L319-L350 |
219,053 | moodle/moodle | admin/tool/dataprivacy/classes/context_instance.php | context_instance.get_record_by_contextid | public static function get_record_by_contextid($contextid, $exception = true) {
global $DB;
if (!$record = $DB->get_record(self::TABLE, array('contextid' => $contextid))) {
if (!$exception) {
return false;
} else {
throw new \dml_missing_record_ex... | php | public static function get_record_by_contextid($contextid, $exception = true) {
global $DB;
if (!$record = $DB->get_record(self::TABLE, array('contextid' => $contextid))) {
if (!$exception) {
return false;
} else {
throw new \dml_missing_record_ex... | [
"public",
"static",
"function",
"get_record_by_contextid",
"(",
"$",
"contextid",
",",
"$",
"exception",
"=",
"true",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"$",
"record",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"self",
"::",
"TABLE",
","... | Returns an instance by contextid.
@param mixed $contextid
@param mixed $exception
@return null | [
"Returns",
"an",
"instance",
"by",
"contextid",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/context_instance.php#L81-L93 |
219,054 | moodle/moodle | admin/tool/uploadcourse/classes/step2_form.php | tool_uploadcourse_step2_form.add_action_buttons | public function add_action_buttons($cancel = true, $submitlabel = null) {
$mform =& $this->_form;
$buttonarray = array();
$buttonarray[] = &$mform->createElement('submit', 'showpreview', get_string('preview', 'tool_uploadcourse'));
$buttonarray[] = &$mform->createElement('submit', 'submi... | php | public function add_action_buttons($cancel = true, $submitlabel = null) {
$mform =& $this->_form;
$buttonarray = array();
$buttonarray[] = &$mform->createElement('submit', 'showpreview', get_string('preview', 'tool_uploadcourse'));
$buttonarray[] = &$mform->createElement('submit', 'submi... | [
"public",
"function",
"add_action_buttons",
"(",
"$",
"cancel",
"=",
"true",
",",
"$",
"submitlabel",
"=",
"null",
")",
"{",
"$",
"mform",
"=",
"&",
"$",
"this",
"->",
"_form",
";",
"$",
"buttonarray",
"=",
"array",
"(",
")",
";",
"$",
"buttonarray",
... | Add actopm buttons.
@param bool $cancel whether to show cancel button, default true
@param string $submitlabel label for submit button, defaults to get_string('savechanges')
@return void | [
"Add",
"actopm",
"buttons",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/uploadcourse/classes/step2_form.php#L195-L203 |
219,055 | moodle/moodle | admin/tool/uploadcourse/classes/step2_form.php | tool_uploadcourse_step2_form.definition_after_data | public function definition_after_data() {
$mform = $this->_form;
// The default end date depends on the course format.
$format = course_get_format((object)array('format' => get_config('moodlecourse', 'format')));
// Check if course end date form field should be enabled by default.
... | php | public function definition_after_data() {
$mform = $this->_form;
// The default end date depends on the course format.
$format = course_get_format((object)array('format' => get_config('moodlecourse', 'format')));
// Check if course end date form field should be enabled by default.
... | [
"public",
"function",
"definition_after_data",
"(",
")",
"{",
"$",
"mform",
"=",
"$",
"this",
"->",
"_form",
";",
"// The default end date depends on the course format.",
"$",
"format",
"=",
"course_get_format",
"(",
"(",
"object",
")",
"array",
"(",
"'format'",
"... | Sets the enddate default after set_data is called. | [
"Sets",
"the",
"enddate",
"default",
"after",
"set_data",
"is",
"called",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/uploadcourse/classes/step2_form.php#L208-L222 |
219,056 | moodle/moodle | course/externallib.php | core_course_external.delete_modules | public static function delete_modules($cmids) {
global $CFG, $DB;
// Require course file containing the course delete module function.
require_once($CFG->dirroot . "/course/lib.php");
// Clean the parameters.
$params = self::validate_parameters(self::delete_modules_parameters()... | php | public static function delete_modules($cmids) {
global $CFG, $DB;
// Require course file containing the course delete module function.
require_once($CFG->dirroot . "/course/lib.php");
// Clean the parameters.
$params = self::validate_parameters(self::delete_modules_parameters()... | [
"public",
"static",
"function",
"delete_modules",
"(",
"$",
"cmids",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"// Require course file containing the course delete module function.",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"\"/course/lib.php\... | Deletes a list of provided module instances.
@param array $cmids the course module ids
@since Moodle 2.5 | [
"Deletes",
"a",
"list",
"of",
"provided",
"module",
"instances",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L2242-L2274 |
219,057 | moodle/moodle | course/externallib.php | core_course_external.view_course | public static function view_course($courseid, $sectionnumber = 0) {
global $CFG;
require_once($CFG->dirroot . "/course/lib.php");
$params = self::validate_parameters(self::view_course_parameters(),
array(
... | php | public static function view_course($courseid, $sectionnumber = 0) {
global $CFG;
require_once($CFG->dirroot . "/course/lib.php");
$params = self::validate_parameters(self::view_course_parameters(),
array(
... | [
"public",
"static",
"function",
"view_course",
"(",
"$",
"courseid",
",",
"$",
"sectionnumber",
"=",
"0",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"\"/course/lib.php\"",
")",
";",
"$",
"params",
"=",
"se... | Trigger the course viewed event.
@param int $courseid id of course
@param int $sectionnumber sectionnumber (0, 1, 2...)
@return array of warnings and status result
@since Moodle 2.9
@throws moodle_exception | [
"Trigger",
"the",
"course",
"viewed",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L2310-L2344 |
219,058 | moodle/moodle | course/externallib.php | core_course_external.get_activities_overview | public static function get_activities_overview($courseids) {
global $USER;
// Parameter validation.
$params = self::validate_parameters(self::get_activities_overview_parameters(), array('courseids' => $courseids));
$courseoverviews = array();
list($courses, $warnings) = externa... | php | public static function get_activities_overview($courseids) {
global $USER;
// Parameter validation.
$params = self::validate_parameters(self::get_activities_overview_parameters(), array('courseids' => $courseids));
$courseoverviews = array();
list($courses, $warnings) = externa... | [
"public",
"static",
"function",
"get_activities_overview",
"(",
"$",
"courseids",
")",
"{",
"global",
"$",
"USER",
";",
"// Parameter validation.",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_activities_overview_parameters",
"(",
... | Return activities overview for the given courses.
@deprecated since 3.3
@todo The final deprecation of this function will take place in Moodle 3.7 - see MDL-57487.
@param array $courseids a list of course ids
@return array of warnings and the activities overview
@since Moodle 3.2
@throws moodle_exception | [
"Return",
"activities",
"overview",
"for",
"the",
"given",
"courses",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L2935-L2982 |
219,059 | moodle/moodle | course/externallib.php | core_course_external.get_user_navigation_options | public static function get_user_navigation_options($courseids) {
global $CFG;
require_once($CFG->dirroot . '/course/lib.php');
// Parameter validation.
$params = self::validate_parameters(self::get_user_navigation_options_parameters(), array('courseids' => $courseids));
$courseo... | php | public static function get_user_navigation_options($courseids) {
global $CFG;
require_once($CFG->dirroot . '/course/lib.php');
// Parameter validation.
$params = self::validate_parameters(self::get_user_navigation_options_parameters(), array('courseids' => $courseids));
$courseo... | [
"public",
"static",
"function",
"get_user_navigation_options",
"(",
"$",
"courseids",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/course/lib.php'",
")",
";",
"// Parameter validation.",
"$",
"params",
"=",
"self... | Return a list of navigation options in a set of courses that are avaialable or not for the current user.
@param array $courseids a list of course ids
@return array of warnings and the options availability
@since Moodle 3.2
@throws moodle_exception | [
"Return",
"a",
"list",
"of",
"navigation",
"options",
"in",
"a",
"set",
"of",
"courses",
"that",
"are",
"avaialable",
"or",
"not",
"for",
"the",
"current",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L3046-L3083 |
219,060 | moodle/moodle | course/externallib.php | core_course_external.get_user_administration_options | public static function get_user_administration_options($courseids) {
global $CFG;
require_once($CFG->dirroot . '/course/lib.php');
// Parameter validation.
$params = self::validate_parameters(self::get_user_administration_options_parameters(), array('courseids' => $courseids));
... | php | public static function get_user_administration_options($courseids) {
global $CFG;
require_once($CFG->dirroot . '/course/lib.php');
// Parameter validation.
$params = self::validate_parameters(self::get_user_administration_options_parameters(), array('courseids' => $courseids));
... | [
"public",
"static",
"function",
"get_user_administration_options",
"(",
"$",
"courseids",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/course/lib.php'",
")",
";",
"// Parameter validation.",
"$",
"params",
"=",
"... | Return a list of administration options in a set of courses that are available or not for the current user.
@param array $courseids a list of course ids
@return array of warnings and the options availability
@since Moodle 3.2
@throws moodle_exception | [
"Return",
"a",
"list",
"of",
"administration",
"options",
"in",
"a",
"set",
"of",
"courses",
"that",
"are",
"available",
"or",
"not",
"for",
"the",
"current",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L3136-L3169 |
219,061 | moodle/moodle | course/externallib.php | core_course_external.check_updates | public static function check_updates($courseid, $tocheck, $filter = array()) {
global $CFG, $DB;
require_once($CFG->dirroot . "/course/lib.php");
$params = self::validate_parameters(
self::check_updates_parameters(),
array(
'courseid' => $courseid,
... | php | public static function check_updates($courseid, $tocheck, $filter = array()) {
global $CFG, $DB;
require_once($CFG->dirroot . "/course/lib.php");
$params = self::validate_parameters(
self::check_updates_parameters(),
array(
'courseid' => $courseid,
... | [
"public",
"static",
"function",
"check_updates",
"(",
"$",
"courseid",
",",
"$",
"tocheck",
",",
"$",
"filter",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"\"/co... | Check if there is updates affecting the user for the given course and contexts.
Right now only modules are supported.
This WS calls mod_check_updates_since for each module to check if there is any update the user should we aware of.
@param int $courseid the list of modules to check
@param array $tocheck the list of mo... | [
"Check",
"if",
"there",
"is",
"updates",
"affecting",
"the",
"user",
"for",
"the",
"given",
"course",
"and",
"contexts",
".",
"Right",
"now",
"only",
"modules",
"are",
"supported",
".",
"This",
"WS",
"calls",
"mod_check_updates_since",
"for",
"each",
"module",... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L3378-L3428 |
219,062 | moodle/moodle | course/externallib.php | core_course_external.get_updates_since | public static function get_updates_since($courseid, $since, $filter = array()) {
global $CFG, $DB;
$params = self::validate_parameters(
self::get_updates_since_parameters(),
array(
'courseid' => $courseid,
'since' => $since,
'filte... | php | public static function get_updates_since($courseid, $since, $filter = array()) {
global $CFG, $DB;
$params = self::validate_parameters(
self::get_updates_since_parameters(),
array(
'courseid' => $courseid,
'since' => $since,
'filte... | [
"public",
"static",
"function",
"get_updates_since",
"(",
"$",
"courseid",
",",
"$",
"since",
",",
"$",
"filter",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",... | Check if there are updates affecting the user for the given course since the given time stamp.
This function is a wrapper of self::check_updates for retrieving all the updates since a given time for all the activities.
@param int $courseid the list of modules to check
@param int $since check updates since this time s... | [
"Check",
"if",
"there",
"are",
"updates",
"affecting",
"the",
"user",
"for",
"the",
"given",
"course",
"since",
"the",
"given",
"time",
"stamp",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L3497-L3527 |
219,063 | moodle/moodle | course/externallib.php | core_course_external.get_module | public static function get_module($id, $sectionreturn = null) {
global $PAGE;
// Validate and normalize parameters.
$params = self::validate_parameters(self::get_module_parameters(),
array('id' => $id, 'sectionreturn' => $sectionreturn));
$id = $params['id'];
$section... | php | public static function get_module($id, $sectionreturn = null) {
global $PAGE;
// Validate and normalize parameters.
$params = self::validate_parameters(self::get_module_parameters(),
array('id' => $id, 'sectionreturn' => $sectionreturn));
$id = $params['id'];
$section... | [
"public",
"static",
"function",
"get_module",
"(",
"$",
"id",
",",
"$",
"sectionreturn",
"=",
"null",
")",
"{",
"global",
"$",
"PAGE",
";",
"// Validate and normalize parameters.",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"ge... | Returns html for displaying one activity module on course page
@since Moodle 3.3
@param int $id
@param null|int $sectionreturn
@return string | [
"Returns",
"html",
"for",
"displaying",
"one",
"activity",
"module",
"on",
"course",
"page"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L3690-L3716 |
219,064 | moodle/moodle | course/externallib.php | core_course_external.edit_section | public static function edit_section($action, $id, $sectionreturn) {
global $DB;
// Validate and normalize parameters.
$params = self::validate_parameters(self::edit_section_parameters(),
array('action' => $action, 'id' => $id, 'sectionreturn' => $sectionreturn));
$action = $p... | php | public static function edit_section($action, $id, $sectionreturn) {
global $DB;
// Validate and normalize parameters.
$params = self::validate_parameters(self::edit_section_parameters(),
array('action' => $action, 'id' => $id, 'sectionreturn' => $sectionreturn));
$action = $p... | [
"public",
"static",
"function",
"edit_section",
"(",
"$",
"action",
",",
"$",
"id",
",",
"$",
"sectionreturn",
")",
"{",
"global",
"$",
"DB",
";",
"// Validate and normalize parameters.",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
":... | Performs one of the edit section actions
@since Moodle 3.3
@param string $action
@param int $id section id
@param int $sectionreturn section to return to
@return string | [
"Performs",
"one",
"of",
"the",
"edit",
"section",
"actions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L3752-L3771 |
219,065 | moodle/moodle | course/externallib.php | core_course_external.set_favourite_courses | public static function set_favourite_courses(
array $courses
) {
global $USER;
$params = self::validate_parameters(self::set_favourite_courses_parameters(),
array(
'courses' => $courses
)
);
$warnings = [];
$ufservice = \core... | php | public static function set_favourite_courses(
array $courses
) {
global $USER;
$params = self::validate_parameters(self::set_favourite_courses_parameters(),
array(
'courses' => $courses
)
);
$warnings = [];
$ufservice = \core... | [
"public",
"static",
"function",
"set_favourite_courses",
"(",
"array",
"$",
"courses",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"set_favourite_courses_parameters",
"(",
")",
",",
"array",
... | Set the course favourite status for an array of courses.
@param array $courses List with course id's and favourite status.
@return array Array with an array of favourite courses. | [
"Set",
"the",
"course",
"favourite",
"status",
"for",
"an",
"array",
"of",
"courses",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L3959-L4031 |
219,066 | moodle/moodle | course/externallib.php | core_course_external.get_recent_courses | public static function get_recent_courses(int $userid = 0, int $limit = 0, int $offset = 0, string $sort = null) {
global $USER, $PAGE;
if (empty($userid)) {
$userid = $USER->id;
}
$params = self::validate_parameters(self::get_recent_courses_parameters(),
array(... | php | public static function get_recent_courses(int $userid = 0, int $limit = 0, int $offset = 0, string $sort = null) {
global $USER, $PAGE;
if (empty($userid)) {
$userid = $USER->id;
}
$params = self::validate_parameters(self::get_recent_courses_parameters(),
array(... | [
"public",
"static",
"function",
"get_recent_courses",
"(",
"int",
"$",
"userid",
"=",
"0",
",",
"int",
"$",
"limit",
"=",
"0",
",",
"int",
"$",
"offset",
"=",
"0",
",",
"string",
"$",
"sort",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
",",
"$",
... | Get last accessed courses adding additional course information like images.
@param int $userid User id from which the courses will be obtained
@param int $limit Restrict result set to this amount
@param int $offset Skip this number of records from the start of the result set
@param string|null $sort SQL string for sor... | [
"Get",
"last",
"accessed",
"courses",
"adding",
"additional",
"course",
"information",
"like",
"images",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/externallib.php#L4073-L4115 |
219,067 | moodle/moodle | question/type/truefalse/backup/moodle2/restore_qtype_truefalse_plugin.class.php | restore_qtype_truefalse_plugin.recode_legacy_state_answer | public function recode_legacy_state_answer($state) {
$answer = $state->answer;
$result = '';
if ($answer) {
$result = $this->get_mappingid('question_answer', $answer);
}
return $result;
} | php | public function recode_legacy_state_answer($state) {
$answer = $state->answer;
$result = '';
if ($answer) {
$result = $this->get_mappingid('question_answer', $answer);
}
return $result;
} | [
"public",
"function",
"recode_legacy_state_answer",
"(",
"$",
"state",
")",
"{",
"$",
"answer",
"=",
"$",
"state",
"->",
"answer",
";",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"$",
"answer",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"get_map... | Given one question_states record, return the answer
recoded pointing to all the restored stuff for truefalse questions
if not empty, answer is one question_answers->id | [
"Given",
"one",
"question_states",
"record",
"return",
"the",
"answer",
"recoded",
"pointing",
"to",
"all",
"the",
"restored",
"stuff",
"for",
"truefalse",
"questions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/truefalse/backup/moodle2/restore_qtype_truefalse_plugin.class.php#L88-L95 |
219,068 | moodle/moodle | lib/classes/grading_external.php | core_grading_external.get_definitions_parameters | public static function get_definitions_parameters() {
return new external_function_parameters(
array(
'cmids' => new external_multiple_structure(
new external_value(PARAM_INT, 'course module id'), '1 or more course module ids'),
'areaname' => n... | php | public static function get_definitions_parameters() {
return new external_function_parameters(
array(
'cmids' => new external_multiple_structure(
new external_value(PARAM_INT, 'course module id'), '1 or more course module ids'),
'areaname' => n... | [
"public",
"static",
"function",
"get_definitions_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'cmids'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'course module i... | Describes the parameters for get_definitions
@return external_function_parameters
@since Moodle 2.5 | [
"Describes",
"the",
"parameters",
"for",
"get_definitions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/grading_external.php#L41-L50 |
219,069 | moodle/moodle | lib/classes/grading_external.php | core_grading_external.grading_area | private static function grading_area() {
return new external_single_structure(
array (
'cmid' => new external_value(PARAM_INT, 'course module id'),
'contextid' => new external_value(PARAM_INT, 'context id'),
'component' => new external_value(PARAM_... | php | private static function grading_area() {
return new external_single_structure(
array (
'cmid' => new external_value(PARAM_INT, 'course module id'),
'contextid' => new external_value(PARAM_INT, 'context id'),
'component' => new external_value(PARAM_... | [
"private",
"static",
"function",
"grading_area",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'cmid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'course module id'",
")",
",",
"'contextid'",
"=>",
"new",
"external_v... | Creates a grading area
@return external_single_structure
@since Moodle 2.5 | [
"Creates",
"a",
"grading",
"area"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/grading_external.php#L224-L235 |
219,070 | moodle/moodle | lib/classes/grading_external.php | core_grading_external.definition | private static function definition() {
global $CFG;
$definition = array();
$definition['id'] = new external_value(PARAM_INT, 'definition id', VALUE_OPTIONAL);
$definition['method'] = new external_value(PARAM_TEXT, 'method');
$definition['name'] ... | php | private static function definition() {
global $CFG;
$definition = array();
$definition['id'] = new external_value(PARAM_INT, 'definition id', VALUE_OPTIONAL);
$definition['method'] = new external_value(PARAM_TEXT, 'method');
$definition['name'] ... | [
"private",
"static",
"function",
"definition",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"definition",
"=",
"array",
"(",
")",
";",
"$",
"definition",
"[",
"'id'",
"]",
"=",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'definition id'",
",",
"VA... | creates a grading form definition
@return external_single_structure
@since Moodle 2.5 | [
"creates",
"a",
"grading",
"form",
"definition"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/grading_external.php#L242-L270 |
219,071 | moodle/moodle | lib/classes/grading_external.php | core_grading_external.grading_instance | private static function grading_instance() {
global $CFG;
$instance = array();
$instance['id'] = new external_value(PARAM_INT, 'instance id');
$instance['raterid'] = new external_value(PARAM_INT, 'rater id');
$instance['itemid'] = new external_... | php | private static function grading_instance() {
global $CFG;
$instance = array();
$instance['id'] = new external_value(PARAM_INT, 'instance id');
$instance['raterid'] = new external_value(PARAM_INT, 'rater id');
$instance['itemid'] = new external_... | [
"private",
"static",
"function",
"grading_instance",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"instance",
"=",
"array",
"(",
")",
";",
"$",
"instance",
"[",
"'id'",
"]",
"=",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'instance id'",
")",
";"... | Creates a grading instance
@return external_single_structure
@since Moodle 2.6 | [
"Creates",
"a",
"grading",
"instance"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/grading_external.php#L406-L430 |
219,072 | moodle/moodle | lib/classes/grading_external.php | core_grading_external.save_definitions | public static function save_definitions($areas) {
$params = self::validate_parameters(self::save_definitions_parameters(),
array('areas' => $areas));
foreach ($params['areas'] as $area) {
$context = context::instance_by_id($area['contextid']);
... | php | public static function save_definitions($areas) {
$params = self::validate_parameters(self::save_definitions_parameters(),
array('areas' => $areas));
foreach ($params['areas'] as $area) {
$context = context::instance_by_id($area['contextid']);
... | [
"public",
"static",
"function",
"save_definitions",
"(",
"$",
"areas",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"save_definitions_parameters",
"(",
")",
",",
"array",
"(",
"'areas'",
"=>",
"$",
"areas",
")",
")",
... | Saves the areas and definitions
@param array $areas array of areas containing definitions to be saved
@return null
@throws invalid_parameter_exception
@since Moodle 2.8 | [
"Saves",
"the",
"areas",
"and",
"definitions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/grading_external.php#L468-L489 |
219,073 | moodle/moodle | lib/classes/grading_external.php | core_grading_external.create_definition_object | private static function create_definition_object($definition) {
global $CFG;
$method = $definition['method'];
$definitionobject = new stdClass();
foreach ($definition as $key => $value) {
if (!is_array($value)) {
$definitionobject->$key = $value;
... | php | private static function create_definition_object($definition) {
global $CFG;
$method = $definition['method'];
$definitionobject = new stdClass();
foreach ($definition as $key => $value) {
if (!is_array($value)) {
$definitionobject->$key = $value;
... | [
"private",
"static",
"function",
"create_definition_object",
"(",
"$",
"definition",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"method",
"=",
"$",
"definition",
"[",
"'method'",
"]",
";",
"$",
"definitionobject",
"=",
"new",
"stdClass",
"(",
")",
";",
"for... | Creates a definition stdClass object using the values from the definition
array that is passed in as a parameter
@param array $definition
@return stdClass definition object
@since Moodle 2.8 | [
"Creates",
"a",
"definition",
"stdClass",
"object",
"using",
"the",
"values",
"from",
"the",
"definition",
"array",
"that",
"is",
"passed",
"in",
"as",
"a",
"parameter"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/grading_external.php#L509-L547 |
219,074 | moodle/moodle | lib/google/src/Google/Http/Request.php | Google_Http_Request.enableGzip | public function enableGzip()
{
$this->setRequestHeaders(array("Accept-Encoding" => "gzip"));
$this->canGzip = true;
$this->setUserAgent($this->userAgent);
} | php | public function enableGzip()
{
$this->setRequestHeaders(array("Accept-Encoding" => "gzip"));
$this->canGzip = true;
$this->setUserAgent($this->userAgent);
} | [
"public",
"function",
"enableGzip",
"(",
")",
"{",
"$",
"this",
"->",
"setRequestHeaders",
"(",
"array",
"(",
"\"Accept-Encoding\"",
"=>",
"\"gzip\"",
")",
")",
";",
"$",
"this",
"->",
"canGzip",
"=",
"true",
";",
"$",
"this",
"->",
"setUserAgent",
"(",
... | Enable support for gzipped responses with this request. | [
"Enable",
"support",
"for",
"gzipped",
"responses",
"with",
"this",
"request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Http/Request.php#L92-L97 |
219,075 | moodle/moodle | lib/google/src/Google/Http/Request.php | Google_Http_Request.disableGzip | public function disableGzip()
{
if (
isset($this->requestHeaders['accept-encoding']) &&
$this->requestHeaders['accept-encoding'] == "gzip"
) {
unset($this->requestHeaders['accept-encoding']);
}
$this->canGzip = false;
$this->userAgent = str_replace(self::GZIP_UA, "", $this->u... | php | public function disableGzip()
{
if (
isset($this->requestHeaders['accept-encoding']) &&
$this->requestHeaders['accept-encoding'] == "gzip"
) {
unset($this->requestHeaders['accept-encoding']);
}
$this->canGzip = false;
$this->userAgent = str_replace(self::GZIP_UA, "", $this->u... | [
"public",
"function",
"disableGzip",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"requestHeaders",
"[",
"'accept-encoding'",
"]",
")",
"&&",
"$",
"this",
"->",
"requestHeaders",
"[",
"'accept-encoding'",
"]",
"==",
"\"gzip\"",
")",
"{",
"uns... | Disable support for gzip responses with this request. | [
"Disable",
"support",
"for",
"gzip",
"responses",
"with",
"this",
"request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Http/Request.php#L102-L112 |
219,076 | moodle/moodle | lib/google/src/Google/Http/Request.php | Google_Http_Request.setUserAgent | public function setUserAgent($userAgent)
{
$this->userAgent = $userAgent;
if ($this->canGzip) {
$this->userAgent = $userAgent . self::GZIP_UA;
}
} | php | public function setUserAgent($userAgent)
{
$this->userAgent = $userAgent;
if ($this->canGzip) {
$this->userAgent = $userAgent . self::GZIP_UA;
}
} | [
"public",
"function",
"setUserAgent",
"(",
"$",
"userAgent",
")",
"{",
"$",
"this",
"->",
"userAgent",
"=",
"$",
"userAgent",
";",
"if",
"(",
"$",
"this",
"->",
"canGzip",
")",
"{",
"$",
"this",
"->",
"userAgent",
"=",
"$",
"userAgent",
".",
"self",
... | Set the User-Agent Header.
@param string $userAgent The User-Agent. | [
"Set",
"the",
"User",
"-",
"Agent",
"Header",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Http/Request.php#L362-L368 |
219,077 | moodle/moodle | lib/google/src/Google/Http/Request.php | Google_Http_Request.getCacheKey | public function getCacheKey()
{
$key = $this->getUrl();
if (isset($this->accessKey)) {
$key .= $this->accessKey;
}
if (isset($this->requestHeaders['authorization'])) {
$key .= $this->requestHeaders['authorization'];
}
return md5($key);
} | php | public function getCacheKey()
{
$key = $this->getUrl();
if (isset($this->accessKey)) {
$key .= $this->accessKey;
}
if (isset($this->requestHeaders['authorization'])) {
$key .= $this->requestHeaders['authorization'];
}
return md5($key);
} | [
"public",
"function",
"getCacheKey",
"(",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getUrl",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"accessKey",
")",
")",
"{",
"$",
"key",
".=",
"$",
"this",
"->",
"accessKey",
";",
"}",
... | Returns a cache key depending on if this was an OAuth signed request
in which case it will use the non-signed url and access key to make this
cache key unique per authenticated user, else use the plain request url
@return string The md5 hash of the request cache key. | [
"Returns",
"a",
"cache",
"key",
"depending",
"on",
"if",
"this",
"was",
"an",
"OAuth",
"signed",
"request",
"in",
"which",
"case",
"it",
"will",
"use",
"the",
"non",
"-",
"signed",
"url",
"and",
"access",
"key",
"to",
"make",
"this",
"cache",
"key",
"u... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Http/Request.php#L384-L397 |
219,078 | moodle/moodle | lib/google/src/Google/Http/Request.php | Google_Http_Request.maybeMoveParametersToBody | public function maybeMoveParametersToBody()
{
if ($this->getRequestMethod() == "POST" && empty($this->postBody)) {
$this->setRequestHeaders(
array(
"content-type" =>
"application/x-www-form-urlencoded; charset=UTF-8"
)
);
$this->setPostBody($this->... | php | public function maybeMoveParametersToBody()
{
if ($this->getRequestMethod() == "POST" && empty($this->postBody)) {
$this->setRequestHeaders(
array(
"content-type" =>
"application/x-www-form-urlencoded; charset=UTF-8"
)
);
$this->setPostBody($this->... | [
"public",
"function",
"maybeMoveParametersToBody",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRequestMethod",
"(",
")",
"==",
"\"POST\"",
"&&",
"empty",
"(",
"$",
"this",
"->",
"postBody",
")",
")",
"{",
"$",
"this",
"->",
"setRequestHeaders",
"(",
... | If we're POSTing and have no body to send, we can send the query
parameters in there, which avoids length issues with longer query
params. | [
"If",
"we",
"re",
"POSTing",
"and",
"have",
"no",
"body",
"to",
"send",
"we",
"can",
"send",
"the",
"query",
"parameters",
"in",
"there",
"which",
"avoids",
"length",
"issues",
"with",
"longer",
"query",
"params",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Http/Request.php#L491-L503 |
219,079 | moodle/moodle | mod/wiki/parser/markups/nwiki.php | nwiki_parser.italic_tag_rule | protected function italic_tag_rule($match) {
$text = $match[1];
if(strlen($match[2]) == 5) {
$text .= "''";
}
$this->rules($text, array('only' => array('bold')));
if(strpos($text, "''") !== false) {
$text = str_replace("''", $this->protect("''"), ... | php | protected function italic_tag_rule($match) {
$text = $match[1];
if(strlen($match[2]) == 5) {
$text .= "''";
}
$this->rules($text, array('only' => array('bold')));
if(strpos($text, "''") !== false) {
$text = str_replace("''", $this->protect("''"), ... | [
"protected",
"function",
"italic_tag_rule",
"(",
"$",
"match",
")",
"{",
"$",
"text",
"=",
"$",
"match",
"[",
"1",
"]",
";",
"if",
"(",
"strlen",
"(",
"$",
"match",
"[",
"2",
"]",
")",
"==",
"5",
")",
"{",
"$",
"text",
".=",
"\"''\"",
";",
"}",... | Bold and italic similar to creole... | [
"Bold",
"and",
"italic",
"similar",
"to",
"creole",
"..."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/parser/markups/nwiki.php#L191-L203 |
219,080 | moodle/moodle | user/filters/profilefield.php | user_filter_profilefield.get_profile_fields | public function get_profile_fields() {
global $DB;
if (!$fields = $DB->get_records('user_info_field', null, 'shortname', 'id,shortname')) {
return null;
}
$res = array(0 => get_string('anyfield', 'filters'));
foreach ($fields as $k => $v) {
$res[$k] = $v->... | php | public function get_profile_fields() {
global $DB;
if (!$fields = $DB->get_records('user_info_field', null, 'shortname', 'id,shortname')) {
return null;
}
$res = array(0 => get_string('anyfield', 'filters'));
foreach ($fields as $k => $v) {
$res[$k] = $v->... | [
"public",
"function",
"get_profile_fields",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"$",
"fields",
"=",
"$",
"DB",
"->",
"get_records",
"(",
"'user_info_field'",
",",
"null",
",",
"'shortname'",
",",
"'id,shortname'",
")",
")",
"{",
"ret... | Returns an array of custom profile fields
@return array of profile fields | [
"Returns",
"an",
"array",
"of",
"custom",
"profile",
"fields"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/filters/profilefield.php#L75-L85 |
219,081 | moodle/moodle | mod/quiz/report/overview/overview_table.php | quiz_overview_table.compute_average_row | public function compute_average_row($label, \core\dml\sql_join $usersjoins) {
global $DB;
list($fields, $from, $where, $params) = $this->base_sql($usersjoins);
$record = $DB->get_record_sql("
SELECT AVG(quizaouter.sumgrades) AS grade, COUNT(quizaouter.sumgrades) AS numaveraged
... | php | public function compute_average_row($label, \core\dml\sql_join $usersjoins) {
global $DB;
list($fields, $from, $where, $params) = $this->base_sql($usersjoins);
$record = $DB->get_record_sql("
SELECT AVG(quizaouter.sumgrades) AS grade, COUNT(quizaouter.sumgrades) AS numaveraged
... | [
"public",
"function",
"compute_average_row",
"(",
"$",
"label",
",",
"\\",
"core",
"\\",
"dml",
"\\",
"sql_join",
"$",
"usersjoins",
")",
"{",
"global",
"$",
"DB",
";",
"list",
"(",
"$",
"fields",
",",
"$",
"from",
",",
"$",
"where",
",",
"$",
"param... | Calculate the average overall and question scores for a set of attempts at the quiz.
@param string $label the title ot use for this row.
@param \core\dml\sql_join $usersjoins to indicate a set of users.
@return array of table cells that make up the average row. | [
"Calculate",
"the",
"average",
"overall",
"and",
"question",
"scores",
"for",
"a",
"set",
"of",
"attempts",
"at",
"the",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/overview_table.php#L102-L143 |
219,082 | moodle/moodle | mod/quiz/report/overview/overview_table.php | quiz_overview_table.add_average_row | protected function add_average_row($label, \core\dml\sql_join $usersjoins) {
$averagerow = $this->compute_average_row($label, $usersjoins);
$this->add_data_keyed($averagerow);
} | php | protected function add_average_row($label, \core\dml\sql_join $usersjoins) {
$averagerow = $this->compute_average_row($label, $usersjoins);
$this->add_data_keyed($averagerow);
} | [
"protected",
"function",
"add_average_row",
"(",
"$",
"label",
",",
"\\",
"core",
"\\",
"dml",
"\\",
"sql_join",
"$",
"usersjoins",
")",
"{",
"$",
"averagerow",
"=",
"$",
"this",
"->",
"compute_average_row",
"(",
"$",
"label",
",",
"$",
"usersjoins",
")",
... | Add an average grade row for a set of users.
@param string $label the title ot use for this row.
@param \core\dml\sql_join $usersjoins (joins, wheres, params) for the users to average over. | [
"Add",
"an",
"average",
"grade",
"row",
"for",
"a",
"set",
"of",
"users",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/overview_table.php#L151-L154 |
219,083 | moodle/moodle | mod/quiz/report/overview/overview_table.php | quiz_overview_table.format_average | protected function format_average($record, $question = false) {
if (is_null($record->grade)) {
$average = '-';
} else if ($question) {
$average = quiz_format_question_grade($this->quiz, $record->grade);
} else {
$average = quiz_format_grade($this->quiz, $recor... | php | protected function format_average($record, $question = false) {
if (is_null($record->grade)) {
$average = '-';
} else if ($question) {
$average = quiz_format_question_grade($this->quiz, $record->grade);
} else {
$average = quiz_format_grade($this->quiz, $recor... | [
"protected",
"function",
"format_average",
"(",
"$",
"record",
",",
"$",
"question",
"=",
"false",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"record",
"->",
"grade",
")",
")",
"{",
"$",
"average",
"=",
"'-'",
";",
"}",
"else",
"if",
"(",
"$",
"ques... | Format an entry in an average row.
@param object $record with fields grade and numaveraged.
@param bool $question true if this is a question score, false if it is an overall score.
@return string HTML fragment for an average score (with number of things included in the average). | [
"Format",
"an",
"entry",
"in",
"an",
"average",
"row",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/overview_table.php#L192-L212 |
219,084 | moodle/moodle | mod/quiz/report/overview/overview_table.php | quiz_overview_table.get_regraded_questions | protected function get_regraded_questions() {
global $DB;
$qubaids = $this->get_qubaids_condition();
$regradedqs = $DB->get_records_select('quiz_overview_regrades',
'questionusageid ' . $qubaids->usage_id_in(), $qubaids->usage_id_in_params());
return quiz_report_index_by... | php | protected function get_regraded_questions() {
global $DB;
$qubaids = $this->get_qubaids_condition();
$regradedqs = $DB->get_records_select('quiz_overview_regrades',
'questionusageid ' . $qubaids->usage_id_in(), $qubaids->usage_id_in_params());
return quiz_report_index_by... | [
"protected",
"function",
"get_regraded_questions",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"qubaids",
"=",
"$",
"this",
"->",
"get_qubaids_condition",
"(",
")",
";",
"$",
"regradedqs",
"=",
"$",
"DB",
"->",
"get_records_select",
"(",
"'quiz_overview_regr... | Get all the questions in all the attempts being displayed that need regrading.
@return array A two dimensional array $questionusageid => $slot => $regradeinfo. | [
"Get",
"all",
"the",
"questions",
"in",
"all",
"the",
"attempts",
"being",
"displayed",
"that",
"need",
"regrading",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/overview_table.php#L365-L372 |
219,085 | moodle/moodle | lib/classes/output/icon_system_fontawesome.php | icon_system_fontawesome.get_icon_name_map | public function get_icon_name_map() {
if ($this->map === []) {
$cache = \cache::make('core', 'fontawesomeiconmapping');
$this->map = $cache->get('mapping');
if (empty($this->map)) {
$this->map = $this->get_core_icon_map();
$callback = 'get_fo... | php | public function get_icon_name_map() {
if ($this->map === []) {
$cache = \cache::make('core', 'fontawesomeiconmapping');
$this->map = $cache->get('mapping');
if (empty($this->map)) {
$this->map = $this->get_core_icon_map();
$callback = 'get_fo... | [
"public",
"function",
"get_icon_name_map",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"map",
"===",
"[",
"]",
")",
"{",
"$",
"cache",
"=",
"\\",
"cache",
"::",
"make",
"(",
"'core'",
",",
"'fontawesomeiconmapping'",
")",
";",
"$",
"this",
"->",
"ma... | Overridable function to get a mapping of all icons.
Default is to do no mapping. | [
"Overridable",
"function",
"to",
"get",
"a",
"mapping",
"of",
"all",
"icons",
".",
"Default",
"is",
"to",
"do",
"no",
"mapping",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/output/icon_system_fontawesome.php#L416-L439 |
219,086 | moodle/moodle | lib/spout/src/Spout/Reader/Wrapper/XMLReader.php | XMLReader.openFileInZip | public function openFileInZip($zipFilePath, $fileInsideZipPath)
{
$wasOpenSuccessful = false;
$realPathURI = $this->getRealPathURIForFileInZip($zipFilePath, $fileInsideZipPath);
// We need to check first that the file we are trying to read really exist because:
// - PHP emits a war... | php | public function openFileInZip($zipFilePath, $fileInsideZipPath)
{
$wasOpenSuccessful = false;
$realPathURI = $this->getRealPathURIForFileInZip($zipFilePath, $fileInsideZipPath);
// We need to check first that the file we are trying to read really exist because:
// - PHP emits a war... | [
"public",
"function",
"openFileInZip",
"(",
"$",
"zipFilePath",
",",
"$",
"fileInsideZipPath",
")",
"{",
"$",
"wasOpenSuccessful",
"=",
"false",
";",
"$",
"realPathURI",
"=",
"$",
"this",
"->",
"getRealPathURIForFileInZip",
"(",
"$",
"zipFilePath",
",",
"$",
"... | Opens the XML Reader to read a file located inside a ZIP file.
@param string $zipFilePath Path to the ZIP file
@param string $fileInsideZipPath Relative or absolute path of the file inside the zip
@return bool TRUE on success or FALSE on failure | [
"Opens",
"the",
"XML",
"Reader",
"to",
"read",
"a",
"file",
"located",
"inside",
"a",
"ZIP",
"file",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Reader/Wrapper/XMLReader.php#L27-L40 |
219,087 | moodle/moodle | lib/spout/src/Spout/Reader/Wrapper/XMLReader.php | XMLReader.fileExistsWithinZip | protected function fileExistsWithinZip($zipStreamURI)
{
$doesFileExists = false;
$pattern = '/zip:\/\/([^#]+)#(.*)/';
if (preg_match($pattern, $zipStreamURI, $matches)) {
$zipFilePath = $matches[1];
$innerFilePath = $matches[2];
$zip = new \ZipArchive();... | php | protected function fileExistsWithinZip($zipStreamURI)
{
$doesFileExists = false;
$pattern = '/zip:\/\/([^#]+)#(.*)/';
if (preg_match($pattern, $zipStreamURI, $matches)) {
$zipFilePath = $matches[1];
$innerFilePath = $matches[2];
$zip = new \ZipArchive();... | [
"protected",
"function",
"fileExistsWithinZip",
"(",
"$",
"zipStreamURI",
")",
"{",
"$",
"doesFileExists",
"=",
"false",
";",
"$",
"pattern",
"=",
"'/zip:\\/\\/([^#]+)#(.*)/'",
";",
"if",
"(",
"preg_match",
"(",
"$",
"pattern",
",",
"$",
"zipStreamURI",
",",
"... | Returns whether the file at the given location exists
@param string $zipStreamURI URI of a zip stream, e.g. "zip://file.zip#path/inside.xml"
@return bool TRUE if the file exists, FALSE otherwise | [
"Returns",
"whether",
"the",
"file",
"at",
"the",
"given",
"location",
"exists"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Reader/Wrapper/XMLReader.php#L61-L78 |
219,088 | moodle/moodle | lib/spout/src/Spout/Reader/Wrapper/XMLReader.php | XMLReader.readUntilNodeFound | public function readUntilNodeFound($nodeName)
{
do {
$wasReadSuccessful = $this->read();
$isNotPositionedOnStartingNode = !$this->isPositionedOnStartingNode($nodeName);
} while ($wasReadSuccessful && $isNotPositionedOnStartingNode);
return $wasReadSuccessful;
} | php | public function readUntilNodeFound($nodeName)
{
do {
$wasReadSuccessful = $this->read();
$isNotPositionedOnStartingNode = !$this->isPositionedOnStartingNode($nodeName);
} while ($wasReadSuccessful && $isNotPositionedOnStartingNode);
return $wasReadSuccessful;
} | [
"public",
"function",
"readUntilNodeFound",
"(",
"$",
"nodeName",
")",
"{",
"do",
"{",
"$",
"wasReadSuccessful",
"=",
"$",
"this",
"->",
"read",
"(",
")",
";",
"$",
"isNotPositionedOnStartingNode",
"=",
"!",
"$",
"this",
"->",
"isPositionedOnStartingNode",
"("... | Read until the element with the given name is found, or the end of the file.
@param string $nodeName Name of the node to find
@return bool TRUE on success or FALSE on failure
@throws \Box\Spout\Reader\Exception\XMLProcessingException If an error/warning occurred | [
"Read",
"until",
"the",
"element",
"with",
"the",
"given",
"name",
"is",
"found",
"or",
"the",
"end",
"of",
"the",
"file",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Reader/Wrapper/XMLReader.php#L105-L113 |
219,089 | moodle/moodle | lib/horde/framework/Horde/Crypt/Blowfish/Base.php | Horde_Crypt_Blowfish_Base._pad | protected function _pad($text, $ignore = false)
{
$blocksize = Horde_Crypt_Blowfish::BLOCKSIZE;
$padding = $blocksize - (strlen($text) % $blocksize);
return ($ignore && ($padding == $blocksize))
? $text
: $text . str_repeat(chr($padding), $padding);
} | php | protected function _pad($text, $ignore = false)
{
$blocksize = Horde_Crypt_Blowfish::BLOCKSIZE;
$padding = $blocksize - (strlen($text) % $blocksize);
return ($ignore && ($padding == $blocksize))
? $text
: $text . str_repeat(chr($padding), $padding);
} | [
"protected",
"function",
"_pad",
"(",
"$",
"text",
",",
"$",
"ignore",
"=",
"false",
")",
"{",
"$",
"blocksize",
"=",
"Horde_Crypt_Blowfish",
"::",
"BLOCKSIZE",
";",
"$",
"padding",
"=",
"$",
"blocksize",
"-",
"(",
"strlen",
"(",
"$",
"text",
")",
"%",... | Pad text to match blocksize length.
@param string $text Unpadded text.
@param boolean $ignore Don't pad if already at blocksize length.
@return string Padded text. | [
"Pad",
"text",
"to",
"match",
"blocksize",
"length",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Crypt/Blowfish/Base.php#L106-L114 |
219,090 | moodle/moodle | lib/spout/src/Spout/Writer/XLSX/Helper/StyleHelper.php | StyleHelper.registerStyle | public function registerStyle($style)
{
$registeredStyle = parent::registerStyle($style);
$this->registerFill($registeredStyle);
$this->registerBorder($registeredStyle);
return $registeredStyle;
} | php | public function registerStyle($style)
{
$registeredStyle = parent::registerStyle($style);
$this->registerFill($registeredStyle);
$this->registerBorder($registeredStyle);
return $registeredStyle;
} | [
"public",
"function",
"registerStyle",
"(",
"$",
"style",
")",
"{",
"$",
"registeredStyle",
"=",
"parent",
"::",
"registerStyle",
"(",
"$",
"style",
")",
";",
"$",
"this",
"->",
"registerFill",
"(",
"$",
"registeredStyle",
")",
";",
"$",
"this",
"->",
"r... | XLSX specific operations on the registered styles
@param \Box\Spout\Writer\Style\Style $style
@return \Box\Spout\Writer\Style\Style | [
"XLSX",
"specific",
"operations",
"on",
"the",
"registered",
"styles"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Helper/StyleHelper.php#L51-L57 |
219,091 | moodle/moodle | lib/spout/src/Spout/Writer/XLSX/Helper/StyleHelper.php | StyleHelper.registerFill | protected function registerFill($style)
{
$styleId = $style->getId();
// Currently - only solid backgrounds are supported
// so $backgroundColor is a scalar value (RGB Color)
$backgroundColor = $style->getBackgroundColor();
if ($backgroundColor) {
$isBackgroundC... | php | protected function registerFill($style)
{
$styleId = $style->getId();
// Currently - only solid backgrounds are supported
// so $backgroundColor is a scalar value (RGB Color)
$backgroundColor = $style->getBackgroundColor();
if ($backgroundColor) {
$isBackgroundC... | [
"protected",
"function",
"registerFill",
"(",
"$",
"style",
")",
"{",
"$",
"styleId",
"=",
"$",
"style",
"->",
"getId",
"(",
")",
";",
"// Currently - only solid backgrounds are supported",
"// so $backgroundColor is a scalar value (RGB Color)",
"$",
"backgroundColor",
"=... | Register a fill definition
@param \Box\Spout\Writer\Style\Style $style | [
"Register",
"a",
"fill",
"definition"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Helper/StyleHelper.php#L64-L90 |
219,092 | moodle/moodle | lib/spout/src/Spout/Writer/XLSX/Helper/StyleHelper.php | StyleHelper.registerBorder | protected function registerBorder($style)
{
$styleId = $style->getId();
if ($style->shouldApplyBorder()) {
$border = $style->getBorder();
$serializedBorder = serialize($border);
$isBorderAlreadyRegistered = isset($this->registeredBorders[$serializedBorder]);
... | php | protected function registerBorder($style)
{
$styleId = $style->getId();
if ($style->shouldApplyBorder()) {
$border = $style->getBorder();
$serializedBorder = serialize($border);
$isBorderAlreadyRegistered = isset($this->registeredBorders[$serializedBorder]);
... | [
"protected",
"function",
"registerBorder",
"(",
"$",
"style",
")",
"{",
"$",
"styleId",
"=",
"$",
"style",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"$",
"style",
"->",
"shouldApplyBorder",
"(",
")",
")",
"{",
"$",
"border",
"=",
"$",
"style",
"->",
... | Register a border definition
@param \Box\Spout\Writer\Style\Style $style | [
"Register",
"a",
"border",
"definition"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Helper/StyleHelper.php#L97-L120 |
219,093 | moodle/moodle | admin/renderer.php | core_admin_renderer.install_licence_page | public function install_licence_page() {
global $CFG;
$output = '';
$copyrightnotice = text_to_html(get_string('gpl3'));
$copyrightnotice = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $copyrightnotice); // extremely ugly validation hack
$continue = new si... | php | public function install_licence_page() {
global $CFG;
$output = '';
$copyrightnotice = text_to_html(get_string('gpl3'));
$copyrightnotice = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $copyrightnotice); // extremely ugly validation hack
$continue = new si... | [
"public",
"function",
"install_licence_page",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"output",
"=",
"''",
";",
"$",
"copyrightnotice",
"=",
"text_to_html",
"(",
"get_string",
"(",
"'gpl3'",
")",
")",
";",
"$",
"copyrightnotice",
"=",
"str_replace",
... | Display the 'Do you acknowledge the terms of the GPL' page. The first page
during install.
@return string HTML to output. | [
"Display",
"the",
"Do",
"you",
"acknowledge",
"the",
"terms",
"of",
"the",
"GPL",
"page",
".",
"The",
"first",
"page",
"during",
"install",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/renderer.php#L39-L58 |
219,094 | moodle/moodle | admin/renderer.php | core_admin_renderer.upgrade_stale_php_files_page | public function upgrade_stale_php_files_page() {
$output = '';
$output .= $this->header();
$output .= $this->heading(get_string('upgradestalefiles', 'admin'));
$output .= $this->box_start('generalbox', 'notice');
$output .= format_text(get_string('upgradestalefilesinfo', 'admin',... | php | public function upgrade_stale_php_files_page() {
$output = '';
$output .= $this->header();
$output .= $this->heading(get_string('upgradestalefiles', 'admin'));
$output .= $this->box_start('generalbox', 'notice');
$output .= format_text(get_string('upgradestalefilesinfo', 'admin',... | [
"public",
"function",
"upgrade_stale_php_files_page",
"(",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"header",
"(",
")",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"heading",
"(",
"get_string",
"(",
"'upgradestale... | Display page explaining proper upgrade process,
there can not be any PHP file leftovers...
@return string HTML to output. | [
"Display",
"page",
"explaining",
"proper",
"upgrade",
"process",
"there",
"can",
"not",
"be",
"any",
"PHP",
"file",
"leftovers",
"..."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/renderer.php#L66-L78 |
219,095 | moodle/moodle | admin/renderer.php | core_admin_renderer.install_environment_page | public function install_environment_page($maturity, $envstatus, $environment_results, $release) {
global $CFG;
$output = '';
$output .= $this->header();
$output .= $this->maturity_warning($maturity);
$output .= $this->heading("Moodle $release");
$output .= $this->release... | php | public function install_environment_page($maturity, $envstatus, $environment_results, $release) {
global $CFG;
$output = '';
$output .= $this->header();
$output .= $this->maturity_warning($maturity);
$output .= $this->heading("Moodle $release");
$output .= $this->release... | [
"public",
"function",
"install_environment_page",
"(",
"$",
"maturity",
",",
"$",
"envstatus",
",",
"$",
"environment_results",
",",
"$",
"release",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->... | Display the 'environment check' page that is displayed during install.
@param int $maturity
@param boolean $envstatus final result of the check (true/false)
@param array $environment_results array of results gathered
@param string $release moodle release
@return string HTML to output. | [
"Display",
"the",
"environment",
"check",
"page",
"that",
"is",
"displayed",
"during",
"install",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/renderer.php#L88-L109 |
219,096 | moodle/moodle | admin/renderer.php | core_admin_renderer.unsatisfied_dependencies_page | public function unsatisfied_dependencies_page($version, array $failed, moodle_url $reloadurl) {
$output = '';
$output .= $this->header();
$output .= $this->heading(get_string('pluginscheck', 'admin'));
$output .= $this->warning(get_string('pluginscheckfailed', 'admin', array('pluginslis... | php | public function unsatisfied_dependencies_page($version, array $failed, moodle_url $reloadurl) {
$output = '';
$output .= $this->header();
$output .= $this->heading(get_string('pluginscheck', 'admin'));
$output .= $this->warning(get_string('pluginscheckfailed', 'admin', array('pluginslis... | [
"public",
"function",
"unsatisfied_dependencies_page",
"(",
"$",
"version",
",",
"array",
"$",
"failed",
",",
"moodle_url",
"$",
"reloadurl",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"header",
"(",
")",
";",
"$",
... | Displays the list of plugins with unsatisfied dependencies
@param double|string|int $version Moodle on-disk version
@param array $failed list of plugins with unsatisfied dependecies
@param moodle_url $reloadurl URL of the page to recheck the dependencies
@return string HTML | [
"Displays",
"the",
"list",
"of",
"plugins",
"with",
"unsatisfied",
"dependencies"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/renderer.php#L119-L132 |
219,097 | moodle/moodle | admin/renderer.php | core_admin_renderer.upgrade_confirm_page | public function upgrade_confirm_page($strnewversion, $maturity, $testsite) {
$output = '';
$continueurl = new moodle_url($this->page->url, array('confirmupgrade' => 1, 'cache' => 0));
$continue = new single_button($continueurl, get_string('continue'), 'get');
$cancelurl = new moodle_url... | php | public function upgrade_confirm_page($strnewversion, $maturity, $testsite) {
$output = '';
$continueurl = new moodle_url($this->page->url, array('confirmupgrade' => 1, 'cache' => 0));
$continue = new single_button($continueurl, get_string('continue'), 'get');
$cancelurl = new moodle_url... | [
"public",
"function",
"upgrade_confirm_page",
"(",
"$",
"strnewversion",
",",
"$",
"maturity",
",",
"$",
"testsite",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"continueurl",
"=",
"new",
"moodle_url",
"(",
"$",
"this",
"->",
"page",
"->",
"url",
",",
... | Display the 'You are about to upgrade Moodle' page. The first page
during upgrade.
@param string $strnewversion
@param int $maturity
@param string $testsite
@return string HTML to output. | [
"Display",
"the",
"You",
"are",
"about",
"to",
"upgrade",
"Moodle",
"page",
".",
"The",
"first",
"page",
"during",
"upgrade",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/renderer.php#L142-L156 |
219,098 | moodle/moodle | admin/renderer.php | core_admin_renderer.upgrade_environment_page | public function upgrade_environment_page($release, $envstatus, $environment_results) {
global $CFG;
$output = '';
$output .= $this->header();
$output .= $this->heading("Moodle $release");
$output .= $this->release_notes_link();
$output .= $this->environment_check_table($... | php | public function upgrade_environment_page($release, $envstatus, $environment_results) {
global $CFG;
$output = '';
$output .= $this->header();
$output .= $this->heading("Moodle $release");
$output .= $this->release_notes_link();
$output .= $this->environment_check_table($... | [
"public",
"function",
"upgrade_environment_page",
"(",
"$",
"release",
",",
"$",
"envstatus",
",",
"$",
"environment_results",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"header",
"(",
")",... | Display the environment page during the upgrade process.
@param string $release
@param boolean $envstatus final result of env check (true/false)
@param array $environment_results array of results gathered
@return string HTML to output. | [
"Display",
"the",
"environment",
"page",
"during",
"the",
"upgrade",
"process",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/renderer.php#L165-L191 |
219,099 | moodle/moodle | admin/renderer.php | core_admin_renderer.upgrade_plugin_check_page | public function upgrade_plugin_check_page(core_plugin_manager $pluginman, \core\update\checker $checker,
$version, $showallplugins, $reloadurl, $continueurl) {
$output = '';
$output .= $this->header();
$output .= $this->box_start('generalbox', 'plugins-check-page');
$output... | php | public function upgrade_plugin_check_page(core_plugin_manager $pluginman, \core\update\checker $checker,
$version, $showallplugins, $reloadurl, $continueurl) {
$output = '';
$output .= $this->header();
$output .= $this->box_start('generalbox', 'plugins-check-page');
$output... | [
"public",
"function",
"upgrade_plugin_check_page",
"(",
"core_plugin_manager",
"$",
"pluginman",
",",
"\\",
"core",
"\\",
"update",
"\\",
"checker",
"$",
"checker",
",",
"$",
"version",
",",
"$",
"showallplugins",
",",
"$",
"reloadurl",
",",
"$",
"continueurl",
... | Display the upgrade page that lists all the plugins that require attention.
@param core_plugin_manager $pluginman provides information about the plugins.
@param \core\update\checker $checker provides information about available updates.
@param int $version the version of the Moodle code from version.php.
@param bool $s... | [
"Display",
"the",
"upgrade",
"page",
"that",
"lists",
"all",
"the",
"plugins",
"that",
"require",
"attention",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/renderer.php#L203-L229 |
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.