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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
212,900 | moodle/moodle | lib/outputrenderers.php | core_renderer.render_login_signup_form | public function render_login_signup_form($form) {
global $SITE;
$context = $form->export_for_template($this);
$url = $this->get_logo_url();
if ($url) {
$url = $url->out(false);
}
$context['logourl'] = $url;
$context['sitename'] = format_string($SITE->... | php | public function render_login_signup_form($form) {
global $SITE;
$context = $form->export_for_template($this);
$url = $this->get_logo_url();
if ($url) {
$url = $url->out(false);
}
$context['logourl'] = $url;
$context['sitename'] = format_string($SITE->... | [
"public",
"function",
"render_login_signup_form",
"(",
"$",
"form",
")",
"{",
"global",
"$",
"SITE",
";",
"$",
"context",
"=",
"$",
"form",
"->",
"export_for_template",
"(",
"$",
"this",
")",
";",
"$",
"url",
"=",
"$",
"this",
"->",
"get_logo_url",
"(",
... | Render the login signup form into a nice template for the theme.
@param mform $form
@return string | [
"Render",
"the",
"login",
"signup",
"form",
"into",
"a",
"nice",
"template",
"for",
"the",
"theme",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/outputrenderers.php#L4627-L4640 |
212,901 | moodle/moodle | lib/outputrenderers.php | core_renderer.render_progress_bar | public function render_progress_bar(progress_bar $bar) {
global $PAGE;
$data = $bar->export_for_template($this);
return $this->render_from_template('core/progress_bar', $data);
} | php | public function render_progress_bar(progress_bar $bar) {
global $PAGE;
$data = $bar->export_for_template($this);
return $this->render_from_template('core/progress_bar', $data);
} | [
"public",
"function",
"render_progress_bar",
"(",
"progress_bar",
"$",
"bar",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"data",
"=",
"$",
"bar",
"->",
"export_for_template",
"(",
"$",
"this",
")",
";",
"return",
"$",
"this",
"->",
"render_from_template",
... | Renders a progress bar.
Do not use $OUTPUT->render($bar), instead use progress_bar::create().
@param progress_bar $bar The bar.
@return string HTML fragment | [
"Renders",
"a",
"progress",
"bar",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/outputrenderers.php#L4674-L4678 |
212,902 | moodle/moodle | lib/outputrenderers.php | core_renderer_cli.heading | public function heading($text, $level = 2, $classes = 'main', $id = null) {
$text .= "\n";
switch ($level) {
case 1:
return '=>' . $text;
case 2:
return '-->' . $text;
default:
return $text;
}
} | php | public function heading($text, $level = 2, $classes = 'main', $id = null) {
$text .= "\n";
switch ($level) {
case 1:
return '=>' . $text;
case 2:
return '-->' . $text;
default:
return $text;
}
} | [
"public",
"function",
"heading",
"(",
"$",
"text",
",",
"$",
"level",
"=",
"2",
",",
"$",
"classes",
"=",
"'main'",
",",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"text",
".=",
"\"\\n\"",
";",
"switch",
"(",
"$",
"level",
")",
"{",
"case",
"1",
":... | Returns a template fragment representing a Heading.
@param string $text The text of the heading
@param int $level The level of importance of the heading
@param string $classes A space-separated list of CSS classes
@param string $id An optional ID
@return string A template fragment for a heading | [
"Returns",
"a",
"template",
"fragment",
"representing",
"a",
"Heading",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/outputrenderers.php#L4712-L4722 |
212,903 | moodle/moodle | lib/outputrenderers.php | core_renderer_ajax.header | public function header() {
// unfortunately YUI iframe upload does not support application/json
if (!empty($_FILES)) {
@header('Content-type: text/plain; charset=utf-8');
if (!core_useragent::supports_json_contenttype()) {
@header('X-Content-Type-Options: nosniff'... | php | public function header() {
// unfortunately YUI iframe upload does not support application/json
if (!empty($_FILES)) {
@header('Content-type: text/plain; charset=utf-8');
if (!core_useragent::supports_json_contenttype()) {
@header('X-Content-Type-Options: nosniff'... | [
"public",
"function",
"header",
"(",
")",
"{",
"// unfortunately YUI iframe upload does not support application/json",
"if",
"(",
"!",
"empty",
"(",
"$",
"_FILES",
")",
")",
"{",
"@",
"header",
"(",
"'Content-type: text/plain; charset=utf-8'",
")",
";",
"if",
"(",
"... | Prepares the start of an AJAX output. | [
"Prepares",
"the",
"start",
"of",
"an",
"AJAX",
"output",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/outputrenderers.php#L4863-L4884 |
212,904 | moodle/moodle | lib/outputrenderers.php | core_renderer_maintenance.confirm | public function confirm($message, $continue, $cancel) {
// We need plain styling of confirm boxes on upgrade because we don't know which stylesheet we have (it could be
// from any previous version of Moodle).
if ($continue instanceof single_button) {
$continue->primary = true;
... | php | public function confirm($message, $continue, $cancel) {
// We need plain styling of confirm boxes on upgrade because we don't know which stylesheet we have (it could be
// from any previous version of Moodle).
if ($continue instanceof single_button) {
$continue->primary = true;
... | [
"public",
"function",
"confirm",
"(",
"$",
"message",
",",
"$",
"continue",
",",
"$",
"cancel",
")",
"{",
"// We need plain styling of confirm boxes on upgrade because we don't know which stylesheet we have (it could be",
"// from any previous version of Moodle).",
"if",
"(",
"$"... | Overridden confirm message for upgrades.
@param string $message The question to ask the user
@param single_button|moodle_url|string $continue The single_button component representing the Continue answer.
@param single_button|moodle_url|string $cancel The single_button component representing the Cancel answer.
@return ... | [
"Overridden",
"confirm",
"message",
"for",
"upgrades",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/outputrenderers.php#L5043-L5074 |
212,905 | moodle/moodle | lib/lessphp/Tree/Mixin/Call.php | Less_Tree_Mixin_Call.Format | private function Format($args){
$message = array();
if( $args ){
foreach($args as $a){
$argValue = '';
if( $a['name'] ){
$argValue .= $a['name'] . ':';
}
if( is_object($a['value']) ){
$argValue .= $a['value']->toCSS();
}else{
$argValue .= '???';
}
$message[] = $argValue... | php | private function Format($args){
$message = array();
if( $args ){
foreach($args as $a){
$argValue = '';
if( $a['name'] ){
$argValue .= $a['name'] . ':';
}
if( is_object($a['value']) ){
$argValue .= $a['value']->toCSS();
}else{
$argValue .= '???';
}
$message[] = $argValue... | [
"private",
"function",
"Format",
"(",
"$",
"args",
")",
"{",
"$",
"message",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"args",
")",
"{",
"foreach",
"(",
"$",
"args",
"as",
"$",
"a",
")",
"{",
"$",
"argValue",
"=",
"''",
";",
"if",
"(",
"$"... | Format the args for use in exception messages | [
"Format",
"the",
"args",
"for",
"use",
"in",
"exception",
"messages"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/lessphp/Tree/Mixin/Call.php#L157-L174 |
212,906 | moodle/moodle | lib/lessphp/Tree/Mixin/Call.php | Less_Tree_Mixin_Call.IsRecursive | private function IsRecursive( $env, $mixin ){
foreach($env->frames as $recur_frame){
if( !($mixin instanceof Less_Tree_Mixin_Definition) ){
if( $mixin === $recur_frame ){
return true;
}
if( isset($recur_frame->originalRuleset) && $mixin->ruleset_id === $recur_frame->originalRuleset ){
retu... | php | private function IsRecursive( $env, $mixin ){
foreach($env->frames as $recur_frame){
if( !($mixin instanceof Less_Tree_Mixin_Definition) ){
if( $mixin === $recur_frame ){
return true;
}
if( isset($recur_frame->originalRuleset) && $mixin->ruleset_id === $recur_frame->originalRuleset ){
retu... | [
"private",
"function",
"IsRecursive",
"(",
"$",
"env",
",",
"$",
"mixin",
")",
"{",
"foreach",
"(",
"$",
"env",
"->",
"frames",
"as",
"$",
"recur_frame",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"mixin",
"instanceof",
"Less_Tree_Mixin_Definition",
")",
")",
... | Are we in a recursive mixin call?
@return bool | [
"Are",
"we",
"in",
"a",
"recursive",
"mixin",
"call?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/lessphp/Tree/Mixin/Call.php#L182-L198 |
212,907 | moodle/moodle | privacy/classes/local/request/contextlist_collection.php | contextlist_collection.add_contextlist | public function add_contextlist(contextlist_base $contextlist) {
$component = $contextlist->get_component();
if (empty($component)) {
throw new \moodle_exception("The contextlist must have a component set");
}
if (isset($this->contextlists[$component])) {
throw ne... | php | public function add_contextlist(contextlist_base $contextlist) {
$component = $contextlist->get_component();
if (empty($component)) {
throw new \moodle_exception("The contextlist must have a component set");
}
if (isset($this->contextlists[$component])) {
throw ne... | [
"public",
"function",
"add_contextlist",
"(",
"contextlist_base",
"$",
"contextlist",
")",
"{",
"$",
"component",
"=",
"$",
"contextlist",
"->",
"get_component",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"component",
")",
")",
"{",
"throw",
"new",
"\\",... | Add a contextlist to this collection.
@param contextlist_base $contextlist the contextlist to export.
@return $this | [
"Add",
"a",
"contextlist",
"to",
"this",
"collection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/contextlist_collection.php#L77-L89 |
212,908 | moodle/moodle | privacy/classes/local/request/contextlist_collection.php | contextlist_collection.get_contextlist_for_component | public function get_contextlist_for_component(string $component) {
if (isset($this->contextlists[$component])) {
return $this->contextlists[$component];
}
return null;
} | php | public function get_contextlist_for_component(string $component) {
if (isset($this->contextlists[$component])) {
return $this->contextlists[$component];
}
return null;
} | [
"public",
"function",
"get_contextlist_for_component",
"(",
"string",
"$",
"component",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"contextlists",
"[",
"$",
"component",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"contextlists",
"[",
"$",
... | Get the contextlist for the specified component.
@param string $component the frankenstyle name of the component to fetch for.
@return contextlist_base|null | [
"Get",
"the",
"contextlist",
"for",
"the",
"specified",
"component",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/contextlist_collection.php#L107-L113 |
212,909 | moodle/moodle | lib/phpexcel/PHPExcel/Writer/Excel2007/Rels.php | PHPExcel_Writer_Excel2007_Rels.writeRelationships | public function writeRelationships(PHPExcel $pPHPExcel = null)
{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachi... | php | public function writeRelationships(PHPExcel $pPHPExcel = null)
{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachi... | [
"public",
"function",
"writeRelationships",
"(",
"PHPExcel",
"$",
"pPHPExcel",
"=",
"null",
")",
"{",
"// Create XML writer",
"$",
"objWriter",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"getParentWriter",
"(",
")",
"->",
"getUseDiskCaching",
"(",
")",
... | Write relationships to XML format
@param PHPExcel $pPHPExcel
@return string XML Output
@throws PHPExcel_Writer_Exception | [
"Write",
"relationships",
"to",
"XML",
"format"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/Excel2007/Rels.php#L37-L102 |
212,910 | moodle/moodle | lib/phpexcel/PHPExcel/Writer/Excel2007/Rels.php | PHPExcel_Writer_Excel2007_Rels.writeDrawingRelationships | public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false)
{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter... | php | public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false)
{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter... | [
"public",
"function",
"writeDrawingRelationships",
"(",
"PHPExcel_Worksheet",
"$",
"pWorksheet",
"=",
"null",
",",
"&",
"$",
"chartRef",
",",
"$",
"includeCharts",
"=",
"false",
")",
"{",
"// Create XML writer",
"$",
"objWriter",
"=",
"null",
";",
"if",
"(",
"... | Write drawing relationships to XML format
@param PHPExcel_Worksheet $pWorksheet
@param int &$chartRef Chart ID
@param boolean $includeCharts Flag indicating if we should write charts
@return string XML Output
@throws PHPExcel_Writer_Excep... | [
"Write",
"drawing",
"relationships",
"to",
"XML",
"format"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Writer/Excel2007/Rels.php#L300-L354 |
212,911 | moodle/moodle | admin/tool/dataprivacy/classes/form/purpose.php | purpose.add_field | protected function add_field(\stdClass $data) {
foreach ($data->fields as $field) {
$this->_form->addElement($field);
}
if (!empty($data->helps)) {
foreach ($data->helps as $fieldname => $helpdata) {
$help = array_merge([$fieldname], $helpdata);
... | php | protected function add_field(\stdClass $data) {
foreach ($data->fields as $field) {
$this->_form->addElement($field);
}
if (!empty($data->helps)) {
foreach ($data->helps as $fieldname => $helpdata) {
$help = array_merge([$fieldname], $helpdata);
... | [
"protected",
"function",
"add_field",
"(",
"\\",
"stdClass",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"this",
"->",
"_form",
"->",
"addElement",
"(",
"$",
"field",
")",
";",
"}",
"if",
"... | Add a fieldset to the current form.
@param \stdClass $data | [
"Add",
"a",
"fieldset",
"to",
"the",
"current",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/purpose.php#L90-L120 |
212,912 | moodle/moodle | admin/tool/dataprivacy/classes/form/purpose.php | purpose.filter_data_for_persistent | public function filter_data_for_persistent($data) {
$data = parent::filter_data_for_persistent($data);
$classname = static::$persistentclass;
$properties = $classname::properties_definition();
$data = (object) array_filter((array) $data, function($value, $key) use ($properties) {
... | php | public function filter_data_for_persistent($data) {
$data = parent::filter_data_for_persistent($data);
$classname = static::$persistentclass;
$properties = $classname::properties_definition();
$data = (object) array_filter((array) $data, function($value, $key) use ($properties) {
... | [
"public",
"function",
"filter_data_for_persistent",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"parent",
"::",
"filter_data_for_persistent",
"(",
"$",
"data",
")",
";",
"$",
"classname",
"=",
"static",
"::",
"$",
"persistentclass",
";",
"$",
"properties",
... | Converts fields.
@param \stdClass $data
@return \stdClass | [
"Converts",
"fields",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/purpose.php#L229-L240 |
212,913 | moodle/moodle | admin/tool/dataprivacy/classes/form/purpose.php | purpose.get_lawful_base_field | protected function get_lawful_base_field(string $prefix = '') : \stdClass {
$fieldname = "{$prefix}lawfulbases";
$data = (object) [
'fields' => [],
];
$bases = [];
foreach (\tool_dataprivacy\purpose::GDPR_ART_6_1_ITEMS as $article) {
$key = 'gdpr_art_6_1... | php | protected function get_lawful_base_field(string $prefix = '') : \stdClass {
$fieldname = "{$prefix}lawfulbases";
$data = (object) [
'fields' => [],
];
$bases = [];
foreach (\tool_dataprivacy\purpose::GDPR_ART_6_1_ITEMS as $article) {
$key = 'gdpr_art_6_1... | [
"protected",
"function",
"get_lawful_base_field",
"(",
"string",
"$",
"prefix",
"=",
"''",
")",
":",
"\\",
"stdClass",
"{",
"$",
"fieldname",
"=",
"\"{$prefix}lawfulbases\"",
";",
"$",
"data",
"=",
"(",
"object",
")",
"[",
"'fields'",
"=>",
"[",
"]",
",",
... | Get the mform field for lawful bases.
@param string $prefix The prefix to apply to the field
@return \stdClass | [
"Get",
"the",
"mform",
"field",
"for",
"lawful",
"bases",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/purpose.php#L300-L329 |
212,914 | moodle/moodle | admin/tool/dataprivacy/classes/form/purpose.php | purpose.get_retention_period_fields | protected function get_retention_period_fields(string $prefix = '') : \stdClass {
$prefix = "{$prefix}retentionperiod";
$data = (object) [
'fields' => [],
'types' => [],
];
$number = $this->_form->createElement('text', "{$prefix}number", null, ['size' => 8]);
... | php | protected function get_retention_period_fields(string $prefix = '') : \stdClass {
$prefix = "{$prefix}retentionperiod";
$data = (object) [
'fields' => [],
'types' => [],
];
$number = $this->_form->createElement('text', "{$prefix}number", null, ['size' => 8]);
... | [
"protected",
"function",
"get_retention_period_fields",
"(",
"string",
"$",
"prefix",
"=",
"''",
")",
":",
"\\",
"stdClass",
"{",
"$",
"prefix",
"=",
"\"{$prefix}retentionperiod\"",
";",
"$",
"data",
"=",
"(",
"object",
")",
"[",
"'fields'",
"=>",
"[",
"]",
... | Get the retention period fields.
@param string $prefix The name of the main field, and prefix for the subfields.
@return \stdClass | [
"Get",
"the",
"retention",
"period",
"fields",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/purpose.php#L376-L406 |
212,915 | moodle/moodle | admin/tool/dataprivacy/classes/form/purpose.php | purpose.get_protected_field | protected function get_protected_field(string $prefix = '') : \stdClass {
$fieldname = "{$prefix}protected";
return (object) [
'fields' => [
$this->_form->createElement(
'advcheckbox',
$fieldname,
get_st... | php | protected function get_protected_field(string $prefix = '') : \stdClass {
$fieldname = "{$prefix}protected";
return (object) [
'fields' => [
$this->_form->createElement(
'advcheckbox',
$fieldname,
get_st... | [
"protected",
"function",
"get_protected_field",
"(",
"string",
"$",
"prefix",
"=",
"''",
")",
":",
"\\",
"stdClass",
"{",
"$",
"fieldname",
"=",
"\"{$prefix}protected\"",
";",
"return",
"(",
"object",
")",
"[",
"'fields'",
"=>",
"[",
"$",
"this",
"->",
"_f... | Get the mform field for the protected flag.
@param string $prefix The prefix to apply to the field
@return \stdClass | [
"Get",
"the",
"mform",
"field",
"for",
"the",
"protected",
"flag",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/purpose.php#L414-L427 |
212,916 | moodle/moodle | admin/tool/dataprivacy/classes/form/purpose.php | purpose.convert_fields | protected static function convert_fields(\stdClass $data) {
$data = parent::convert_fields($data);
if (!empty($data->lawfulbases) && is_array($data->lawfulbases)) {
$data->lawfulbases = implode(',', $data->lawfulbases);
}
if (!empty($data->sensitivedatareasons) && is_array($... | php | protected static function convert_fields(\stdClass $data) {
$data = parent::convert_fields($data);
if (!empty($data->lawfulbases) && is_array($data->lawfulbases)) {
$data->lawfulbases = implode(',', $data->lawfulbases);
}
if (!empty($data->sensitivedatareasons) && is_array($... | [
"protected",
"static",
"function",
"convert_fields",
"(",
"\\",
"stdClass",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"parent",
"::",
"convert_fields",
"(",
"$",
"data",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
"->",
"lawfulbases",
")",
"&&"... | Converts data to data suitable for storage.
@param \stdClass $data
@return \stdClass | [
"Converts",
"data",
"to",
"data",
"suitable",
"for",
"storage",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/purpose.php#L435-L451 |
212,917 | moodle/moodle | admin/tool/dataprivacy/classes/form/purpose.php | purpose.convert_existing_data_to_values | protected function convert_existing_data_to_values(\stdClass $data) : \stdClass {
$data->lawfulbases = explode(',', $data->lawfulbases);
if (!empty($data->sensitivedatareasons)) {
$data->sensitivedatareasons = explode(',', $data->sensitivedatareasons);
}
// Convert the singl... | php | protected function convert_existing_data_to_values(\stdClass $data) : \stdClass {
$data->lawfulbases = explode(',', $data->lawfulbases);
if (!empty($data->sensitivedatareasons)) {
$data->sensitivedatareasons = explode(',', $data->sensitivedatareasons);
}
// Convert the singl... | [
"protected",
"function",
"convert_existing_data_to_values",
"(",
"\\",
"stdClass",
"$",
"data",
")",
":",
"\\",
"stdClass",
"{",
"$",
"data",
"->",
"lawfulbases",
"=",
"explode",
"(",
"','",
",",
"$",
"data",
"->",
"lawfulbases",
")",
";",
"if",
"(",
"!",
... | Normalise any values stored in existing data.
@param \stdClass $data
@return \stdClass | [
"Normalise",
"any",
"values",
"stored",
"in",
"existing",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/purpose.php#L470-L483 |
212,918 | moodle/moodle | admin/tool/dataprivacy/classes/form/purpose.php | purpose.get_role_overrides_from_data | public function get_role_overrides_from_data(\stdClass $data) {
$overrides = [];
if (!empty($data->overrides)) {
$searchkey = 'roleoverride_';
for ($i = 0; $i < $data->overrides; $i++) {
$overridedata = (object) [];
foreach ((array) $data as $fiel... | php | public function get_role_overrides_from_data(\stdClass $data) {
$overrides = [];
if (!empty($data->overrides)) {
$searchkey = 'roleoverride_';
for ($i = 0; $i < $data->overrides; $i++) {
$overridedata = (object) [];
foreach ((array) $data as $fiel... | [
"public",
"function",
"get_role_overrides_from_data",
"(",
"\\",
"stdClass",
"$",
"data",
")",
"{",
"$",
"overrides",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
"->",
"overrides",
")",
")",
"{",
"$",
"searchkey",
"=",
"'roleoverride_'... | Fetch the role override data from the list of submitted data.
@param \stdClass $data The complete set of processed data
@return \stdClass[] The list of overrides | [
"Fetch",
"the",
"role",
"override",
"data",
"from",
"the",
"list",
"of",
"submitted",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/purpose.php#L491-L520 |
212,919 | moodle/moodle | admin/tool/dataprivacy/classes/form/purpose.php | purpose.extra_validation | protected function extra_validation($data, $files, array &$errors) {
$overrides = $this->get_role_overrides_from_data($data);
// Check role overrides to ensure that:
// - roles are unique; and
// - specifeid retention periods are numeric.
$seenroleids = [];
foreach ($ove... | php | protected function extra_validation($data, $files, array &$errors) {
$overrides = $this->get_role_overrides_from_data($data);
// Check role overrides to ensure that:
// - roles are unique; and
// - specifeid retention periods are numeric.
$seenroleids = [];
foreach ($ove... | [
"protected",
"function",
"extra_validation",
"(",
"$",
"data",
",",
"$",
"files",
",",
"array",
"&",
"$",
"errors",
")",
"{",
"$",
"overrides",
"=",
"$",
"this",
"->",
"get_role_overrides_from_data",
"(",
"$",
"data",
")",
";",
"// Check role overrides to ensu... | Define extra validation mechanims.
@param stdClass $data Data to validate.
@param array $files Array of files.
@param array $errors Currently reported errors.
@return array of additional errors, or overridden errors. | [
"Define",
"extra",
"validation",
"mechanims",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/form/purpose.php#L530-L550 |
212,920 | moodle/moodle | report/insights/classes/output/renderer.php | renderer.render_insights_list | protected function render_insights_list(renderable $renderable) {
$data = $renderable->export_for_template($this);
return parent::render_from_template('report_insights/insights_list', $data);
} | php | protected function render_insights_list(renderable $renderable) {
$data = $renderable->export_for_template($this);
return parent::render_from_template('report_insights/insights_list', $data);
} | [
"protected",
"function",
"render_insights_list",
"(",
"renderable",
"$",
"renderable",
")",
"{",
"$",
"data",
"=",
"$",
"renderable",
"->",
"export_for_template",
"(",
"$",
"this",
")",
";",
"return",
"parent",
"::",
"render_from_template",
"(",
"'report_insights/... | Renders the list of insights
@param renderable $renderable
@return string HTML | [
"Renders",
"the",
"list",
"of",
"insights"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/insights/classes/output/renderer.php#L48-L51 |
212,921 | moodle/moodle | report/insights/classes/output/renderer.php | renderer.render_insight | protected function render_insight(renderable $renderable) {
$data = $renderable->export_for_template($this);
return parent::render_from_template('report_insights/insight_details', $data);
} | php | protected function render_insight(renderable $renderable) {
$data = $renderable->export_for_template($this);
return parent::render_from_template('report_insights/insight_details', $data);
} | [
"protected",
"function",
"render_insight",
"(",
"renderable",
"$",
"renderable",
")",
"{",
"$",
"data",
"=",
"$",
"renderable",
"->",
"export_for_template",
"(",
"$",
"this",
")",
";",
"return",
"parent",
"::",
"render_from_template",
"(",
"'report_insights/insigh... | Renders an insight
@param renderable $renderable
@return string HTML | [
"Renders",
"an",
"insight"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/insights/classes/output/renderer.php#L59-L62 |
212,922 | moodle/moodle | report/insights/classes/output/renderer.php | renderer.render_model_disabled | public function render_model_disabled($insightinfo) {
global $OUTPUT, $PAGE;
// We don't want to disclose the name of the model if it has not been enabled.
$PAGE->set_title($insightinfo->contextname);
$PAGE->set_heading($insightinfo->contextname);
$output = $OUTPUT->header();
... | php | public function render_model_disabled($insightinfo) {
global $OUTPUT, $PAGE;
// We don't want to disclose the name of the model if it has not been enabled.
$PAGE->set_title($insightinfo->contextname);
$PAGE->set_heading($insightinfo->contextname);
$output = $OUTPUT->header();
... | [
"public",
"function",
"render_model_disabled",
"(",
"$",
"insightinfo",
")",
"{",
"global",
"$",
"OUTPUT",
",",
"$",
"PAGE",
";",
"// We don't want to disclose the name of the model if it has not been enabled.",
"$",
"PAGE",
"->",
"set_title",
"(",
"$",
"insightinfo",
"... | Model disabled info.
@param \stdClass $insightinfo
@return string HTML | [
"Model",
"disabled",
"info",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/insights/classes/output/renderer.php#L70-L82 |
212,923 | moodle/moodle | report/insights/classes/output/renderer.php | renderer.render_no_insights | public function render_no_insights(\context $context) {
global $OUTPUT, $PAGE;
// We don't want to disclose the name of the model if it has not been enabled.
$PAGE->set_title($context->get_context_name());
$PAGE->set_heading($context->get_context_name());
$output = $OUTPUT->hea... | php | public function render_no_insights(\context $context) {
global $OUTPUT, $PAGE;
// We don't want to disclose the name of the model if it has not been enabled.
$PAGE->set_title($context->get_context_name());
$PAGE->set_heading($context->get_context_name());
$output = $OUTPUT->hea... | [
"public",
"function",
"render_no_insights",
"(",
"\\",
"context",
"$",
"context",
")",
"{",
"global",
"$",
"OUTPUT",
",",
"$",
"PAGE",
";",
"// We don't want to disclose the name of the model if it has not been enabled.",
"$",
"PAGE",
"->",
"set_title",
"(",
"$",
"con... | Model without insights info.
@param \context $context
@return string HTML | [
"Model",
"without",
"insights",
"info",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/insights/classes/output/renderer.php#L90-L102 |
212,924 | moodle/moodle | lib/classes/string_manager_standard.php | core_string_manager_standard.load_component_strings | public function load_component_strings($component, $lang, $disablecache = false, $disablelocal = false) {
global $CFG;
list($plugintype, $pluginname) = core_component::normalize_component($component);
if ($plugintype === 'core' and is_null($pluginname)) {
$component = 'core';
... | php | public function load_component_strings($component, $lang, $disablecache = false, $disablelocal = false) {
global $CFG;
list($plugintype, $pluginname) = core_component::normalize_component($component);
if ($plugintype === 'core' and is_null($pluginname)) {
$component = 'core';
... | [
"public",
"function",
"load_component_strings",
"(",
"$",
"component",
",",
"$",
"lang",
",",
"$",
"disablecache",
"=",
"false",
",",
"$",
"disablelocal",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
";",
"list",
"(",
"$",
"plugintype",
",",
"$",
"plugi... | Load all strings for one component
@param string $component The module the string is associated with
@param string $lang
@param bool $disablecache Do not use caches, force fetching the strings from sources
@param bool $disablelocal Do not use customized strings in xx_local language packs
@return array of all string fo... | [
"Load",
"all",
"strings",
"for",
"one",
"component"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/string_manager_standard.php#L112-L213 |
212,925 | moodle/moodle | lib/classes/string_manager_standard.php | core_string_manager_standard.load_deprecated_strings | protected function load_deprecated_strings() {
global $CFG;
if ($this->cacheddeprecated !== null) {
return $this->cacheddeprecated;
}
$this->cacheddeprecated = array();
$content = '';
$filename = $CFG->dirroot . '/lang/en/deprecated.txt';
if (file_ex... | php | protected function load_deprecated_strings() {
global $CFG;
if ($this->cacheddeprecated !== null) {
return $this->cacheddeprecated;
}
$this->cacheddeprecated = array();
$content = '';
$filename = $CFG->dirroot . '/lang/en/deprecated.txt';
if (file_ex... | [
"protected",
"function",
"load_deprecated_strings",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"$",
"this",
"->",
"cacheddeprecated",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"cacheddeprecated",
";",
"}",
"$",
"this",
"->",
"cachedde... | Parses all deprecated.txt in all plugins lang locations and returns the list of deprecated strings.
Static variable is used for caching, this function is only called in dev environment.
@return array of deprecated strings in the same format they appear in deprecated.txt files: "identifier,component"
where component i... | [
"Parses",
"all",
"deprecated",
".",
"txt",
"in",
"all",
"plugins",
"lang",
"locations",
"and",
"returns",
"the",
"list",
"of",
"deprecated",
"strings",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/string_manager_standard.php#L223-L249 |
212,926 | moodle/moodle | lib/classes/string_manager_standard.php | core_string_manager_standard.string_deprecated | public function string_deprecated($identifier, $component) {
$deprecated = $this->load_deprecated_strings();
list($plugintype, $pluginname) = core_component::normalize_component($component);
$normcomponent = $pluginname ? ($plugintype . '_' . $pluginname) : $plugintype;
return isset($dep... | php | public function string_deprecated($identifier, $component) {
$deprecated = $this->load_deprecated_strings();
list($plugintype, $pluginname) = core_component::normalize_component($component);
$normcomponent = $pluginname ? ($plugintype . '_' . $pluginname) : $plugintype;
return isset($dep... | [
"public",
"function",
"string_deprecated",
"(",
"$",
"identifier",
",",
"$",
"component",
")",
"{",
"$",
"deprecated",
"=",
"$",
"this",
"->",
"load_deprecated_strings",
"(",
")",
";",
"list",
"(",
"$",
"plugintype",
",",
"$",
"pluginname",
")",
"=",
"core... | Has string been deprecated?
Usually checked only inside get_string() to display debug warnings.
@param string $identifier The identifier of the string to search for
@param string $component The module the string is associated with
@return bool true if deprecated | [
"Has",
"string",
"been",
"deprecated?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/string_manager_standard.php#L260-L265 |
212,927 | moodle/moodle | lib/classes/string_manager_standard.php | core_string_manager_standard.get_list_of_countries | public function get_list_of_countries($returnall = false, $lang = null) {
global $CFG;
if ($lang === null) {
$lang = current_language();
}
$countries = $this->load_component_strings('core_countries', $lang);
core_collator::asort($countries);
if (!$returnall ... | php | public function get_list_of_countries($returnall = false, $lang = null) {
global $CFG;
if ($lang === null) {
$lang = current_language();
}
$countries = $this->load_component_strings('core_countries', $lang);
core_collator::asort($countries);
if (!$returnall ... | [
"public",
"function",
"get_list_of_countries",
"(",
"$",
"returnall",
"=",
"false",
",",
"$",
"lang",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"$",
"lang",
"===",
"null",
")",
"{",
"$",
"lang",
"=",
"current_language",
"(",
")",
"... | Returns a localised list of all country names, sorted by localised name.
@param bool $returnall return all or just enabled
@param string $lang moodle translation language, null means use current
@return array two-letter country code => translated name. | [
"Returns",
"a",
"localised",
"list",
"of",
"all",
"country",
"names",
"sorted",
"by",
"localised",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/string_manager_standard.php#L421-L442 |
212,928 | moodle/moodle | lib/classes/string_manager_standard.php | core_string_manager_standard.translation_exists | public function translation_exists($lang, $includeall = true) {
$translations = $this->get_list_of_translations($includeall);
return isset($translations[$lang]);
} | php | public function translation_exists($lang, $includeall = true) {
$translations = $this->get_list_of_translations($includeall);
return isset($translations[$lang]);
} | [
"public",
"function",
"translation_exists",
"(",
"$",
"lang",
",",
"$",
"includeall",
"=",
"true",
")",
"{",
"$",
"translations",
"=",
"$",
"this",
"->",
"get_list_of_translations",
"(",
"$",
"includeall",
")",
";",
"return",
"isset",
"(",
"$",
"translations... | Checks if the translation exists for the language
@param string $lang moodle translation language code
@param bool $includeall include also disabled translations
@return bool true if exists | [
"Checks",
"if",
"the",
"translation",
"exists",
"for",
"the",
"language"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/string_manager_standard.php#L503-L506 |
212,929 | moodle/moodle | lib/classes/string_manager_standard.php | core_string_manager_standard.get_list_of_currencies | public function get_list_of_currencies($lang = null) {
if ($lang === null) {
$lang = current_language();
}
$currencies = $this->load_component_strings('core_currencies', $lang);
asort($currencies);
return $currencies;
} | php | public function get_list_of_currencies($lang = null) {
if ($lang === null) {
$lang = current_language();
}
$currencies = $this->load_component_strings('core_currencies', $lang);
asort($currencies);
return $currencies;
} | [
"public",
"function",
"get_list_of_currencies",
"(",
"$",
"lang",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"lang",
"===",
"null",
")",
"{",
"$",
"lang",
"=",
"current_language",
"(",
")",
";",
"}",
"$",
"currencies",
"=",
"$",
"this",
"->",
"load_compone... | Returns localised list of currencies.
@param string $lang moodle translation language, null means use current
@return array currency code => localised currency name | [
"Returns",
"localised",
"list",
"of",
"currencies",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/string_manager_standard.php#L592-L601 |
212,930 | moodle/moodle | lib/classes/string_manager_standard.php | core_string_manager_standard.reset_caches | public function reset_caches($phpunitreset = false) {
// Clear the on-disk disk with aggregated string files.
$this->cache->purge();
$this->menucache->purge();
if (!$phpunitreset) {
// Increment the revision counter.
$langrev = get_config('core', 'langrev');
... | php | public function reset_caches($phpunitreset = false) {
// Clear the on-disk disk with aggregated string files.
$this->cache->purge();
$this->menucache->purge();
if (!$phpunitreset) {
// Increment the revision counter.
$langrev = get_config('core', 'langrev');
... | [
"public",
"function",
"reset_caches",
"(",
"$",
"phpunitreset",
"=",
"false",
")",
"{",
"// Clear the on-disk disk with aggregated string files.",
"$",
"this",
"->",
"cache",
"->",
"purge",
"(",
")",
";",
"$",
"this",
"->",
"menucache",
"->",
"purge",
"(",
")",
... | Clears both in-memory and on-disk caches
@param bool $phpunitreset true means called from our PHPUnit integration test reset | [
"Clears",
"both",
"in",
"-",
"memory",
"and",
"on",
"-",
"disk",
"caches"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/string_manager_standard.php#L607-L629 |
212,931 | moodle/moodle | lib/classes/string_manager_standard.php | core_string_manager_standard.get_revision | public function get_revision() {
global $CFG;
if (empty($CFG->langstringcache)) {
return -1;
}
if (isset($CFG->langrev)) {
return (int)$CFG->langrev;
} else {
return -1;
}
} | php | public function get_revision() {
global $CFG;
if (empty($CFG->langstringcache)) {
return -1;
}
if (isset($CFG->langrev)) {
return (int)$CFG->langrev;
} else {
return -1;
}
} | [
"public",
"function",
"get_revision",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"langstringcache",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"CFG",
"->",
"langrev",
")",
... | Returns string revision counter, this is incremented after any string cache reset.
@return int lang string revision counter, -1 if unknown | [
"Returns",
"string",
"revision",
"counter",
"this",
"is",
"incremented",
"after",
"any",
"string",
"cache",
"reset",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/string_manager_standard.php#L651-L661 |
212,932 | moodle/moodle | lib/classes/string_manager_standard.php | core_string_manager_standard.populate_parent_languages | protected function populate_parent_languages($lang, array $stack = array()) {
// English does not have a parent language.
if ($lang === 'en') {
return $stack;
}
// Prevent circular dependency (and thence the infinitive recursion loop).
if (in_array($lang, $stack)) {... | php | protected function populate_parent_languages($lang, array $stack = array()) {
// English does not have a parent language.
if ($lang === 'en') {
return $stack;
}
// Prevent circular dependency (and thence the infinitive recursion loop).
if (in_array($lang, $stack)) {... | [
"protected",
"function",
"populate_parent_languages",
"(",
"$",
"lang",
",",
"array",
"$",
"stack",
"=",
"array",
"(",
")",
")",
"{",
"// English does not have a parent language.",
"if",
"(",
"$",
"lang",
"===",
"'en'",
")",
"{",
"return",
"$",
"stack",
";",
... | Helper method that recursively loads all parents of the given language.
@see self::get_language_dependencies()
@param string $lang language code
@param array $stack list of parent languages already populated in previous recursive calls
@return array list of all parents of the given language with the $lang itself added... | [
"Helper",
"method",
"that",
"recursively",
"loads",
"all",
"parents",
"of",
"the",
"given",
"language",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/string_manager_standard.php#L671-L697 |
212,933 | moodle/moodle | lib/horde/framework/Horde/Mime/Related.php | Horde_Mime_Related.cidReplace | public function cidReplace($text, $callback, $charset = 'UTF-8')
{
$dom = ($text instanceof Horde_Domhtml)
? $text
: new Horde_Domhtml($text, $charset);
foreach ($dom as $node) {
if ($node instanceof DOMElement) {
switch (Horde_String::lower($node... | php | public function cidReplace($text, $callback, $charset = 'UTF-8')
{
$dom = ($text instanceof Horde_Domhtml)
? $text
: new Horde_Domhtml($text, $charset);
foreach ($dom as $node) {
if ($node instanceof DOMElement) {
switch (Horde_String::lower($node... | [
"public",
"function",
"cidReplace",
"(",
"$",
"text",
",",
"$",
"callback",
",",
"$",
"charset",
"=",
"'UTF-8'",
")",
"{",
"$",
"dom",
"=",
"(",
"$",
"text",
"instanceof",
"Horde_Domhtml",
")",
"?",
"$",
"text",
":",
"new",
"Horde_Domhtml",
"(",
"$",
... | Scan for CID strings in HTML data and replace with data returned from
a callback method.
@param mixed $text The HTML text (can be Horde_Domhtml object).
@param callback $callback Callback method. Receives three arguments:
MIME ID, the attribute name containing the
content ID, and the node object. Expects
retu... | [
"Scan",
"for",
"CID",
"strings",
"in",
"HTML",
"data",
"and",
"replace",
"with",
"data",
"returned",
"from",
"a",
"callback",
"method",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Mime/Related.php#L117-L139 |
212,934 | moodle/moodle | cohort/edit_form.php | cohort_edit_form.definition | public function definition() {
global $CFG;
$mform = $this->_form;
$editoroptions = $this->_customdata['editoroptions'];
$cohort = $this->_customdata['data'];
$mform->addElement('text', 'name', get_string('name', 'cohort'), 'maxlength="254" size="50"');
$mform->addRule(... | php | public function definition() {
global $CFG;
$mform = $this->_form;
$editoroptions = $this->_customdata['editoroptions'];
$cohort = $this->_customdata['data'];
$mform->addElement('text', 'name', get_string('name', 'cohort'), 'maxlength="254" size="50"');
$mform->addRule(... | [
"public",
"function",
"definition",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"mform",
"=",
"$",
"this",
"->",
"_form",
";",
"$",
"editoroptions",
"=",
"$",
"this",
"->",
"_customdata",
"[",
"'editoroptions'",
"]",
";",
"$",
"cohort",
"=",
"$",
... | Define the cohort edit form | [
"Define",
"the",
"cohort",
"edit",
"form"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cohort/edit_form.php#L34-L74 |
212,935 | moodle/moodle | mnet/xmlrpc/client.php | mnet_xmlrpc_client.set_timeout | function set_timeout($timeout) {
if (!is_integer($timeout)) {
if (is_numeric($timeout)) {
$this->timeout = (integer)$timeout;
return true;
}
return false;
}
$this->timeout = $timeout;
return true;
} | php | function set_timeout($timeout) {
if (!is_integer($timeout)) {
if (is_numeric($timeout)) {
$this->timeout = (integer)$timeout;
return true;
}
return false;
}
$this->timeout = $timeout;
return true;
} | [
"function",
"set_timeout",
"(",
"$",
"timeout",
")",
"{",
"if",
"(",
"!",
"is_integer",
"(",
"$",
"timeout",
")",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"timeout",
")",
")",
"{",
"$",
"this",
"->",
"timeout",
"=",
"(",
"integer",
")",
"$",
... | Allow users to override the default timeout
@param int $timeout Request timeout in seconds
$return bool True if param is an integer or integer string | [
"Allow",
"users",
"to",
"override",
"the",
"default",
"timeout"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/xmlrpc/client.php#L48-L58 |
212,936 | moodle/moodle | mnet/xmlrpc/client.php | mnet_xmlrpc_client.add_param | function add_param($argument, $type = 'string') {
$allowed_types = array('none',
'empty',
'base64',
'boolean',
'datetime',
'double',
... | php | function add_param($argument, $type = 'string') {
$allowed_types = array('none',
'empty',
'base64',
'boolean',
'datetime',
'double',
... | [
"function",
"add_param",
"(",
"$",
"argument",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"$",
"allowed_types",
"=",
"array",
"(",
"'none'",
",",
"'empty'",
",",
"'base64'",
",",
"'boolean'",
",",
"'datetime'",
",",
"'double'",
",",
"'int'",
",",
"'i4'... | Add a parameter to the array of parameters.
@param string $argument A transport ID, as defined in lib.php
@param string $type The argument type, can be one of:
none
empty
base64
boolean
datetime
double
int
string
array
struct
In its weakly-typed wisdom, PHP will (currently)
ignore everything except datet... | [
"Add",
"a",
"parameter",
"to",
"the",
"array",
"of",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/xmlrpc/client.php#L98-L126 |
212,937 | moodle/moodle | mnet/xmlrpc/client.php | mnet_xmlrpc_client.permission_to_call | function permission_to_call($mnet_peer) {
global $DB, $CFG, $USER;
// Executing any system method is permitted.
$system_methods = array('system/listMethods', 'system/methodSignature', 'system/methodHelp', 'system/listServices');
if (in_array($this->method, $system_methods) ) {
... | php | function permission_to_call($mnet_peer) {
global $DB, $CFG, $USER;
// Executing any system method is permitted.
$system_methods = array('system/listMethods', 'system/methodSignature', 'system/methodHelp', 'system/listServices');
if (in_array($this->method, $system_methods) ) {
... | [
"function",
"permission_to_call",
"(",
"$",
"mnet_peer",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Executing any system method is permitted.",
"$",
"system_methods",
"=",
"array",
"(",
"'system/listMethods'",
",",
"'system/methodSign... | Check that we are permitted to call method on specified peer
@param object $mnet_peer A mnet_peer object with details of the remote host we're connecting to
@return bool True if we permit calls to method on specified peer, False otherwise. | [
"Check",
"that",
"we",
"are",
"permitted",
"to",
"call",
"method",
"on",
"specified",
"peer"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/xmlrpc/client.php#L322-L362 |
212,938 | moodle/moodle | mnet/xmlrpc/client.php | mnet_xmlrpc_client.prepare_http_request | function prepare_http_request ($mnet_peer) {
$this->uri = $mnet_peer->wwwroot . $mnet_peer->application->xmlrpc_server_url;
// Initialize request the target URL
$httprequest = curl_init($this->uri);
curl_setopt($httprequest, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($httpreq... | php | function prepare_http_request ($mnet_peer) {
$this->uri = $mnet_peer->wwwroot . $mnet_peer->application->xmlrpc_server_url;
// Initialize request the target URL
$httprequest = curl_init($this->uri);
curl_setopt($httprequest, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($httpreq... | [
"function",
"prepare_http_request",
"(",
"$",
"mnet_peer",
")",
"{",
"$",
"this",
"->",
"uri",
"=",
"$",
"mnet_peer",
"->",
"wwwroot",
".",
"$",
"mnet_peer",
"->",
"application",
"->",
"xmlrpc_server_url",
";",
"// Initialize request the target URL",
"$",
"httpreq... | Generate a curl handle and prepare it for sending to an mnet host
@param object $mnet_peer A mnet_peer object with details of the remote host the request will be sent to
@return cURL handle - the almost-ready-to-send http request | [
"Generate",
"a",
"curl",
"handle",
"and",
"prepare",
"it",
"for",
"sending",
"to",
"an",
"mnet",
"host"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/xmlrpc/client.php#L370-L392 |
212,939 | moodle/moodle | lib/classes/output/mustache_javascript_helper.php | mustache_javascript_helper.help | public function help($text, \Mustache_LambdaHelper $helper) {
$this->page->requires->js_amd_inline($helper->render($text));
} | php | public function help($text, \Mustache_LambdaHelper $helper) {
$this->page->requires->js_amd_inline($helper->render($text));
} | [
"public",
"function",
"help",
"(",
"$",
"text",
",",
"\\",
"Mustache_LambdaHelper",
"$",
"helper",
")",
"{",
"$",
"this",
"->",
"page",
"->",
"requires",
"->",
"js_amd_inline",
"(",
"$",
"helper",
"->",
"render",
"(",
"$",
"text",
")",
")",
";",
"}"
] | Add the block of text to the page requires so it is appended in the footer. The
content of the block can contain further mustache tags which will be resolved.
@param string $text The script content of the section.
@param \Mustache_LambdaHelper $helper Used to render the content of this block. | [
"Add",
"the",
"block",
"of",
"text",
"to",
"the",
"page",
"requires",
"so",
"it",
"is",
"appended",
"in",
"the",
"footer",
".",
"The",
"content",
"of",
"the",
"block",
"can",
"contain",
"further",
"mustache",
"tags",
"which",
"will",
"be",
"resolved",
".... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/output/mustache_javascript_helper.php#L56-L58 |
212,940 | moodle/moodle | admin/tool/analytics/classes/task/train_models.php | train_models.execute | public function execute() {
global $OUTPUT, $PAGE;
$models = \core_analytics\manager::get_all_models(true);
if (!$models) {
mtrace(get_string('errornoenabledmodels', 'tool_analytics'));
return;
}
foreach ($models as $model) {
if ($model->is_... | php | public function execute() {
global $OUTPUT, $PAGE;
$models = \core_analytics\manager::get_all_models(true);
if (!$models) {
mtrace(get_string('errornoenabledmodels', 'tool_analytics'));
return;
}
foreach ($models as $model) {
if ($model->is_... | [
"public",
"function",
"execute",
"(",
")",
"{",
"global",
"$",
"OUTPUT",
",",
"$",
"PAGE",
";",
"$",
"models",
"=",
"\\",
"core_analytics",
"\\",
"manager",
"::",
"get_all_models",
"(",
"true",
")",
";",
"if",
"(",
"!",
"$",
"models",
")",
"{",
"mtra... | Executes the prediction task.
@return void | [
"Executes",
"the",
"prediction",
"task",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/analytics/classes/task/train_models.php#L52-L85 |
212,941 | moodle/moodle | blocks/starredcourses/classes/external.php | block_starredcourses_external.get_starred_courses | public static function get_starred_courses($limit, $offset) {
global $USER, $PAGE;
$params = self::validate_parameters(self::get_starred_courses_parameters(), [
'limit' => $limit,
'offset' => $offset
]);
$limit = $params['limit'];
$offset = $params['offs... | php | public static function get_starred_courses($limit, $offset) {
global $USER, $PAGE;
$params = self::validate_parameters(self::get_starred_courses_parameters(), [
'limit' => $limit,
'offset' => $offset
]);
$limit = $params['limit'];
$offset = $params['offs... | [
"public",
"static",
"function",
"get_starred_courses",
"(",
"$",
"limit",
",",
"$",
"offset",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_starred_courses_parameters",
... | Get users starred courses.
@param int $limit Limit
@param int $offset Offset
@return array list of courses and warnings | [
"Get",
"users",
"starred",
"courses",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/starredcourses/classes/external.php#L62-L100 |
212,942 | moodle/moodle | mod/wiki/diff/diff_nwiki.php | WikiDiff.reverse | function reverse () {
$rev = $this;
$rev->edits = array();
foreach ($this->edits as $edit) {
$rev->edits[] = $edit->reverse();
}
return $rev;
} | php | function reverse () {
$rev = $this;
$rev->edits = array();
foreach ($this->edits as $edit) {
$rev->edits[] = $edit->reverse();
}
return $rev;
} | [
"function",
"reverse",
"(",
")",
"{",
"$",
"rev",
"=",
"$",
"this",
";",
"$",
"rev",
"->",
"edits",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"edits",
"as",
"$",
"edit",
")",
"{",
"$",
"rev",
"->",
"edits",
"[",
"]",
"="... | Compute reversed WikiDiff.
SYNOPSIS:
$diff = new WikiDiff($lines1, $lines2);
$rev = $diff->reverse();
@return object A WikiDiff object representing the inverse of the
original diff. | [
"Compute",
"reversed",
"WikiDiff",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/diff/diff_nwiki.php#L529-L536 |
212,943 | moodle/moodle | mod/wiki/diff/diff_nwiki.php | WikiDiff.orig | function orig() {
$lines = array();
foreach ($this->edits as $edit) {
if ($edit->orig)
array_splice($lines, sizeof($lines), 0, $edit->orig);
}
return $lines;
} | php | function orig() {
$lines = array();
foreach ($this->edits as $edit) {
if ($edit->orig)
array_splice($lines, sizeof($lines), 0, $edit->orig);
}
return $lines;
} | [
"function",
"orig",
"(",
")",
"{",
"$",
"lines",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"edits",
"as",
"$",
"edit",
")",
"{",
"if",
"(",
"$",
"edit",
"->",
"orig",
")",
"array_splice",
"(",
"$",
"lines",
",",
"sizeof",
... | Get the original set of lines.
This reconstructs the $from_lines parameter passed to the
constructor.
@return array The original sequence of strings. | [
"Get",
"the",
"original",
"set",
"of",
"lines",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/diff/diff_nwiki.php#L575-L583 |
212,944 | moodle/moodle | mod/wiki/diff/diff_nwiki.php | WikiDiff.closing | function closing() {
$lines = array();
foreach ($this->edits as $edit) {
if ($edit->closing)
array_splice($lines, sizeof($lines), 0, $edit->closing);
}
return $lines;
} | php | function closing() {
$lines = array();
foreach ($this->edits as $edit) {
if ($edit->closing)
array_splice($lines, sizeof($lines), 0, $edit->closing);
}
return $lines;
} | [
"function",
"closing",
"(",
")",
"{",
"$",
"lines",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"edits",
"as",
"$",
"edit",
")",
"{",
"if",
"(",
"$",
"edit",
"->",
"closing",
")",
"array_splice",
"(",
"$",
"lines",
",",
"sizeo... | Get the closing set of lines.
This reconstructs the $to_lines parameter passed to the
constructor.
@return array The sequence of strings. | [
"Get",
"the",
"closing",
"set",
"of",
"lines",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/diff/diff_nwiki.php#L593-L601 |
212,945 | moodle/moodle | mod/wiki/diff/diff_nwiki.php | WikiDiff._check | function _check ($from_lines, $to_lines) {
if (serialize($from_lines) != serialize($this->orig()))
trigger_error("Reconstructed original doesn't match", E_USER_ERROR);
if (serialize($to_lines) != serialize($this->closing()))
trigger_error("Reconstructed closing doesn't match", E_USER_ERROR);
... | php | function _check ($from_lines, $to_lines) {
if (serialize($from_lines) != serialize($this->orig()))
trigger_error("Reconstructed original doesn't match", E_USER_ERROR);
if (serialize($to_lines) != serialize($this->closing()))
trigger_error("Reconstructed closing doesn't match", E_USER_ERROR);
... | [
"function",
"_check",
"(",
"$",
"from_lines",
",",
"$",
"to_lines",
")",
"{",
"if",
"(",
"serialize",
"(",
"$",
"from_lines",
")",
"!=",
"serialize",
"(",
"$",
"this",
"->",
"orig",
"(",
")",
")",
")",
"trigger_error",
"(",
"\"Reconstructed original doesn'... | Check a WikiDiff for validity.
This is here only for debugging purposes. | [
"Check",
"a",
"WikiDiff",
"for",
"validity",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/diff/diff_nwiki.php#L608-L630 |
212,946 | moodle/moodle | mod/workshop/form/rubric/lib.php | workshop_rubric_strategy.delete_instance | public static function delete_instance($workshopid) {
global $DB;
$dimensions = $DB->get_records('workshopform_rubric', array('workshopid' => $workshopid), '', 'id');
$DB->delete_records_list('workshopform_rubric_levels', 'dimensionid', array_keys($dimensions));
$DB->delete_records('wor... | php | public static function delete_instance($workshopid) {
global $DB;
$dimensions = $DB->get_records('workshopform_rubric', array('workshopid' => $workshopid), '', 'id');
$DB->delete_records_list('workshopform_rubric_levels', 'dimensionid', array_keys($dimensions));
$DB->delete_records('wor... | [
"public",
"static",
"function",
"delete_instance",
"(",
"$",
"workshopid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"dimensions",
"=",
"$",
"DB",
"->",
"get_records",
"(",
"'workshopform_rubric'",
",",
"array",
"(",
"'workshopid'",
"=>",
"$",
"workshopid",
"... | Delete all data related to a given workshop module instance
@see workshop_delete_instance()
@param int $workshopid id of the workshop module instance being deleted
@return void | [
"Delete",
"all",
"data",
"related",
"to",
"a",
"given",
"workshop",
"module",
"instance"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/rubric/lib.php#L412-L419 |
212,947 | moodle/moodle | mod/workshop/form/rubric/lib.php | workshop_rubric_strategy.load_config | protected function load_config() {
global $DB;
if (!$config = $DB->get_record('workshopform_rubric_config', array('workshopid' => $this->workshop->id), 'layout')) {
$config = (object)array('layout' => 'list');
}
return $config;
} | php | protected function load_config() {
global $DB;
if (!$config = $DB->get_record('workshopform_rubric_config', array('workshopid' => $this->workshop->id), 'layout')) {
$config = (object)array('layout' => 'list');
}
return $config;
} | [
"protected",
"function",
"load_config",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"$",
"config",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'workshopform_rubric_config'",
",",
"array",
"(",
"'workshopid'",
"=>",
"$",
"this",
"->",
"workshop",... | Get the configuration for the current rubric strategy
@return object | [
"Get",
"the",
"configuration",
"for",
"the",
"current",
"rubric",
"strategy"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/rubric/lib.php#L470-L477 |
212,948 | moodle/moodle | mod/workshop/form/rubric/lib.php | workshop_rubric_strategy.get_current_assessment_data | protected function get_current_assessment_data(stdclass $assessment) {
global $DB;
if (empty($this->dimensions)) {
return array();
}
list($dimsql, $dimparams) = $DB->get_in_or_equal(array_keys($this->dimensions), SQL_PARAMS_NAMED);
// beware! the caller may rely on t... | php | protected function get_current_assessment_data(stdclass $assessment) {
global $DB;
if (empty($this->dimensions)) {
return array();
}
list($dimsql, $dimparams) = $DB->get_in_or_equal(array_keys($this->dimensions), SQL_PARAMS_NAMED);
// beware! the caller may rely on t... | [
"protected",
"function",
"get_current_assessment_data",
"(",
"stdclass",
"$",
"assessment",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"dimensions",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"list",
"(",
... | Returns the list of current grades filled by the reviewer indexed by dimensionid
@param stdClass $assessment Assessment record
@return array [int dimensionid] => stdclass workshop_grades record | [
"Returns",
"the",
"list",
"of",
"current",
"grades",
"filled",
"by",
"the",
"reviewer",
"indexed",
"by",
"dimensionid"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/rubric/lib.php#L571-L586 |
212,949 | moodle/moodle | mod/forum/classes/observer.php | mod_forum_observer.user_enrolment_deleted | public static function user_enrolment_deleted(\core\event\user_enrolment_deleted $event) {
global $DB;
// NOTE: this has to be as fast as possible.
// Get user enrolment info from event.
$cp = (object)$event->other['userenrolment'];
if ($cp->lastenrol) {
if (!$forums... | php | public static function user_enrolment_deleted(\core\event\user_enrolment_deleted $event) {
global $DB;
// NOTE: this has to be as fast as possible.
// Get user enrolment info from event.
$cp = (object)$event->other['userenrolment'];
if ($cp->lastenrol) {
if (!$forums... | [
"public",
"static",
"function",
"user_enrolment_deleted",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"user_enrolment_deleted",
"$",
"event",
")",
"{",
"global",
"$",
"DB",
";",
"// NOTE: this has to be as fast as possible.",
"// Get user enrolment info from event.",
"$",
"cp... | Triggered via user_enrolment_deleted event.
@param \core\event\user_enrolment_deleted $event | [
"Triggered",
"via",
"user_enrolment_deleted",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/observer.php#L37-L55 |
212,950 | moodle/moodle | mod/forum/classes/observer.php | mod_forum_observer.role_assigned | public static function role_assigned(\core\event\role_assigned $event) {
global $CFG, $DB;
$context = context::instance_by_id($event->contextid, MUST_EXIST);
// If contextlevel is course then only subscribe user. Role assignment
// at course level means user is enroled in course and ca... | php | public static function role_assigned(\core\event\role_assigned $event) {
global $CFG, $DB;
$context = context::instance_by_id($event->contextid, MUST_EXIST);
// If contextlevel is course then only subscribe user. Role assignment
// at course level means user is enroled in course and ca... | [
"public",
"static",
"function",
"role_assigned",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"role_assigned",
"$",
"event",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"$",
"context",
"=",
"context",
"::",
"instance_by_id",
"(",
"$",
"event",
"->",
... | Observer for role_assigned event.
@param \core\event\role_assigned $event
@return void | [
"Observer",
"for",
"role_assigned",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/observer.php#L63-L97 |
212,951 | moodle/moodle | mod/forum/classes/observer.php | mod_forum_observer.course_module_created | public static function course_module_created(\core\event\course_module_created $event) {
global $CFG;
if ($event->other['modulename'] === 'forum') {
// Include the forum library to make use of the forum_instance_created function.
require_once($CFG->dirroot . '/mod/forum/lib.php'... | php | public static function course_module_created(\core\event\course_module_created $event) {
global $CFG;
if ($event->other['modulename'] === 'forum') {
// Include the forum library to make use of the forum_instance_created function.
require_once($CFG->dirroot . '/mod/forum/lib.php'... | [
"public",
"static",
"function",
"course_module_created",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"course_module_created",
"$",
"event",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"$",
"event",
"->",
"other",
"[",
"'modulename'",
"]",
"===",
"'forum'",
... | Observer for \core\event\course_module_created event.
@param \core\event\course_module_created $event
@return void | [
"Observer",
"for",
"\\",
"core",
"\\",
"event",
"\\",
"course_module_created",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/observer.php#L105-L115 |
212,952 | moodle/moodle | mod/forum/classes/observer.php | mod_forum_observer.course_created | public static function course_created(\core\event\course_created $event) {
global $CFG;
$course = $event->get_record_snapshot('course', $event->objectid);
$format = course_get_format($course);
if ($format->supports_news() && !empty($course->newsitems)) {
require_once($CFG->d... | php | public static function course_created(\core\event\course_created $event) {
global $CFG;
$course = $event->get_record_snapshot('course', $event->objectid);
$format = course_get_format($course);
if ($format->supports_news() && !empty($course->newsitems)) {
require_once($CFG->d... | [
"public",
"static",
"function",
"course_created",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"course_created",
"$",
"event",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"course",
"=",
"$",
"event",
"->",
"get_record_snapshot",
"(",
"'course'",
",",
"$",
"event"... | Observer for \core\event\course_created event.
@param \core\event\course_created $event
@return void | [
"Observer",
"for",
"\\",
"core",
"\\",
"event",
"\\",
"course_created",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/observer.php#L123-L133 |
212,953 | moodle/moodle | blocks/html/backup/moodle2/restore_html_block_task.class.php | restore_html_block_decode_content.get_iterator | protected function get_iterator() {
global $DB;
// Build the SQL dynamically here
$fieldslist = 't.' . implode(', t.', $this->fields);
$sql = "SELECT t.id, $fieldslist
FROM {" . $this->tablename . "} t
JOIN {backup_ids_temp} b ON b.newitemid = t.id
... | php | protected function get_iterator() {
global $DB;
// Build the SQL dynamically here
$fieldslist = 't.' . implode(', t.', $this->fields);
$sql = "SELECT t.id, $fieldslist
FROM {" . $this->tablename . "} t
JOIN {backup_ids_temp} b ON b.newitemid = t.id
... | [
"protected",
"function",
"get_iterator",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"// Build the SQL dynamically here",
"$",
"fieldslist",
"=",
"'t.'",
".",
"implode",
"(",
"', t.'",
",",
"$",
"this",
"->",
"fields",
")",
";",
"$",
"sql",
"=",
"\"SELECT t.id,... | Temp storage for unserialized configdata | [
"Temp",
"storage",
"for",
"unserialized",
"configdata"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/html/backup/moodle2/restore_html_block_task.class.php#L69-L82 |
212,954 | moodle/moodle | lib/authlib.php | auth_plugin_base.get_custom_user_profile_fields | public function get_custom_user_profile_fields() {
global $DB;
// If already retrieved then return.
if (!is_null($this->customfields)) {
return $this->customfields;
}
$this->customfields = array();
if ($proffields = $DB->get_records('user_info_field')) {
... | php | public function get_custom_user_profile_fields() {
global $DB;
// If already retrieved then return.
if (!is_null($this->customfields)) {
return $this->customfields;
}
$this->customfields = array();
if ($proffields = $DB->get_records('user_info_field')) {
... | [
"public",
"function",
"get_custom_user_profile_fields",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"// If already retrieved then return.",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"customfields",
")",
")",
"{",
"return",
"$",
"this",
"->",
"customfields"... | Return custom user profile fields.
@return array list of custom fields. | [
"Return",
"custom",
"user",
"profile",
"fields",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/authlib.php#L600-L616 |
212,955 | moodle/moodle | lib/authlib.php | auth_plugin_base.get_identity_providers | public static function get_identity_providers($authsequence) {
global $SESSION;
$identityproviders = [];
foreach ($authsequence as $authname) {
$authplugin = get_auth_plugin($authname);
$wantsurl = (isset($SESSION->wantsurl)) ? $SESSION->wantsurl : '';
$ident... | php | public static function get_identity_providers($authsequence) {
global $SESSION;
$identityproviders = [];
foreach ($authsequence as $authname) {
$authplugin = get_auth_plugin($authname);
$wantsurl = (isset($SESSION->wantsurl)) ? $SESSION->wantsurl : '';
$ident... | [
"public",
"static",
"function",
"get_identity_providers",
"(",
"$",
"authsequence",
")",
"{",
"global",
"$",
"SESSION",
";",
"$",
"identityproviders",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"authsequence",
"as",
"$",
"authname",
")",
"{",
"$",
"authplugin"... | Return the list of enabled identity providers.
Each identity provider data contains the keys url, name and iconurl (or
icon). See the documentation of {@link auth_plugin_base::loginpage_idp_list()}
for detailed description of the returned structure.
@param array $authsequence site's auth sequence (list of auth plugin... | [
"Return",
"the",
"list",
"of",
"enabled",
"identity",
"providers",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/authlib.php#L724-L734 |
212,956 | moodle/moodle | lib/authlib.php | auth_plugin_base.prepare_identity_providers_for_output | public static function prepare_identity_providers_for_output($identityproviders, renderer_base $output) {
$data = [];
foreach ($identityproviders as $idp) {
if (!empty($idp['icon'])) {
// Pre-3.3 auth plugins provide icon as a pix_icon instance. New auth plugins (since 3.3) p... | php | public static function prepare_identity_providers_for_output($identityproviders, renderer_base $output) {
$data = [];
foreach ($identityproviders as $idp) {
if (!empty($idp['icon'])) {
// Pre-3.3 auth plugins provide icon as a pix_icon instance. New auth plugins (since 3.3) p... | [
"public",
"static",
"function",
"prepare_identity_providers_for_output",
"(",
"$",
"identityproviders",
",",
"renderer_base",
"$",
"output",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"identityproviders",
"as",
"$",
"idp",
")",
"{",
"if",
... | Prepare a list of identity providers for output.
@param array $identityproviders as returned by {@link self::get_identity_providers()}
@param renderer_base $output
@return array the identity providers ready for output | [
"Prepare",
"a",
"list",
"of",
"identity",
"providers",
"for",
"output",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/authlib.php#L743-L760 |
212,957 | moodle/moodle | lib/authlib.php | auth_plugin_base.get_password_change_info | public function get_password_change_info(stdClass $user) : array {
$site = get_site();
$systemcontext = context_system::instance();
$data = new stdClass();
$data->firstname = $user->firstname;
$data->lastname = $user->lastname;
$data->username = $user->username;
... | php | public function get_password_change_info(stdClass $user) : array {
$site = get_site();
$systemcontext = context_system::instance();
$data = new stdClass();
$data->firstname = $user->firstname;
$data->lastname = $user->lastname;
$data->username = $user->username;
... | [
"public",
"function",
"get_password_change_info",
"(",
"stdClass",
"$",
"user",
")",
":",
"array",
"{",
"$",
"site",
"=",
"get_site",
"(",
")",
";",
"$",
"systemcontext",
"=",
"context_system",
"::",
"instance",
"(",
")",
";",
"$",
"data",
"=",
"new",
"s... | Returns information on how the specified user can change their password.
@param stdClass $user A user object
@return string[] An array of strings with keys subject and message | [
"Returns",
"information",
"on",
"how",
"the",
"specified",
"user",
"can",
"change",
"their",
"password",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/authlib.php#L768-L799 |
212,958 | moodle/moodle | competency/classes/competency_rule_points.php | competency_rule_points.migrate_config | public static function migrate_config($config, $mappings) {
$ruleconfig = json_decode($config, true);
if (is_array($ruleconfig)) {
foreach ($ruleconfig['competencies'] as $key => $rulecomp) {
$rulecmpid = $rulecomp['id'];
if (array_key_exists($rulecmpid, $mapp... | php | public static function migrate_config($config, $mappings) {
$ruleconfig = json_decode($config, true);
if (is_array($ruleconfig)) {
foreach ($ruleconfig['competencies'] as $key => $rulecomp) {
$rulecmpid = $rulecomp['id'];
if (array_key_exists($rulecmpid, $mapp... | [
"public",
"static",
"function",
"migrate_config",
"(",
"$",
"config",
",",
"$",
"mappings",
")",
"{",
"$",
"ruleconfig",
"=",
"json_decode",
"(",
"$",
"config",
",",
"true",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"ruleconfig",
")",
")",
"{",
"forea... | Migrate rule config when duplicate competency based on mapping competencies ids.
@param string $config the config rule of a competency
@param array $mappings array that match the old competency ids with the new competencies
@return string | [
"Migrate",
"rule",
"config",
"when",
"duplicate",
"competency",
"based",
"on",
"mapping",
"competencies",
"ids",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/competency_rule_points.php#L201-L217 |
212,959 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getFullMsg | public function getFullMsg($stream = false)
{
return $this->_msgText(
$stream,
isset($this->_data[Horde_Imap_Client::FETCH_FULLMSG])
? $this->_data[Horde_Imap_Client::FETCH_FULLMSG]
: null
);
} | php | public function getFullMsg($stream = false)
{
return $this->_msgText(
$stream,
isset($this->_data[Horde_Imap_Client::FETCH_FULLMSG])
? $this->_data[Horde_Imap_Client::FETCH_FULLMSG]
: null
);
} | [
"public",
"function",
"getFullMsg",
"(",
"$",
"stream",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"_msgText",
"(",
"$",
"stream",
",",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_FULLMSG",
"]",
")",
"?",
... | Returns the full message.
@param boolean $stream Return as a stream?
@return mixed The full text of the entire message. | [
"Returns",
"the",
"full",
"message",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L62-L70 |
212,960 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getStructure | public function getStructure()
{
return isset($this->_data[Horde_Imap_Client::FETCH_STRUCTURE])
? clone $this->_data[Horde_Imap_Client::FETCH_STRUCTURE]
: new Horde_Mime_Part();
} | php | public function getStructure()
{
return isset($this->_data[Horde_Imap_Client::FETCH_STRUCTURE])
? clone $this->_data[Horde_Imap_Client::FETCH_STRUCTURE]
: new Horde_Mime_Part();
} | [
"public",
"function",
"getStructure",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_STRUCTURE",
"]",
")",
"?",
"clone",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_STRUCTURE",
... | Get the message structure.
@return Horde_Mime_Part $structure The base MIME part of the message. | [
"Get",
"the",
"message",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L87-L92 |
212,961 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.setHeaders | public function setHeaders($label, $data)
{
if ($data instanceof Horde_Stream) {
$data = $data->stream;
}
$this->_data[Horde_Imap_Client::FETCH_HEADERS][$label] = $data;
} | php | public function setHeaders($label, $data)
{
if ($data instanceof Horde_Stream) {
$data = $data->stream;
}
$this->_data[Horde_Imap_Client::FETCH_HEADERS][$label] = $data;
} | [
"public",
"function",
"setHeaders",
"(",
"$",
"label",
",",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"Horde_Stream",
")",
"{",
"$",
"data",
"=",
"$",
"data",
"->",
"stream",
";",
"}",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_C... | Set a header entry.
@param string $label The search label.
@param mixed $data Either a Horde_Mime_Headers object or the raw
header text. | [
"Set",
"a",
"header",
"entry",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L101-L107 |
212,962 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.setHeaderText | public function setHeaderText($id, $text)
{
$this->_data[Horde_Imap_Client::FETCH_HEADERTEXT][$id] = $this->_setMixed($text);
} | php | public function setHeaderText($id, $text)
{
$this->_data[Horde_Imap_Client::FETCH_HEADERTEXT][$id] = $this->_setMixed($text);
} | [
"public",
"function",
"setHeaderText",
"(",
"$",
"id",
",",
"$",
"text",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_HEADERTEXT",
"]",
"[",
"$",
"id",
"]",
"=",
"$",
"this",
"->",
"_setMixed",
"(",
"$",
"text",
")",
"... | Set a header text entry.
@param string $id The MIME ID.
@param mixed $text The header text, as either a string or stream
resource. | [
"Set",
"a",
"header",
"text",
"entry",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L136-L139 |
212,963 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.setMimeHeader | public function setMimeHeader($id, $text)
{
$this->_data[Horde_Imap_Client::FETCH_MIMEHEADER][$id] = $this->_setMixed($text);
} | php | public function setMimeHeader($id, $text)
{
$this->_data[Horde_Imap_Client::FETCH_MIMEHEADER][$id] = $this->_setMixed($text);
} | [
"public",
"function",
"setMimeHeader",
"(",
"$",
"id",
",",
"$",
"text",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_MIMEHEADER",
"]",
"[",
"$",
"id",
"]",
"=",
"$",
"this",
"->",
"_setMixed",
"(",
"$",
"text",
")",
"... | Set a MIME header entry.
@param string $id The MIME ID.
@param mixed $text The header text, as either a string or stream
resource. | [
"Set",
"a",
"MIME",
"header",
"entry",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L168-L171 |
212,964 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.setBodyPart | public function setBodyPart($id, $text, $decode = null)
{
$this->_data[Horde_Imap_Client::FETCH_BODYPART][$id] = array(
'd' => $decode,
't' => $this->_setMixed($text)
);
} | php | public function setBodyPart($id, $text, $decode = null)
{
$this->_data[Horde_Imap_Client::FETCH_BODYPART][$id] = array(
'd' => $decode,
't' => $this->_setMixed($text)
);
} | [
"public",
"function",
"setBodyPart",
"(",
"$",
"id",
",",
"$",
"text",
",",
"$",
"decode",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_BODYPART",
"]",
"[",
"$",
"id",
"]",
"=",
"array",
"(",
"'d'",
"=>",
... | Set a body part entry.
@param string $id The MIME ID.
@param mixed $text The body part text, as either a string or stream
resource.
@param string $decode Either '8bit', 'binary', or null. | [
"Set",
"a",
"body",
"part",
"entry",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L201-L207 |
212,965 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getBodyPart | public function getBodyPart($id, $stream = false)
{
return $this->_msgText(
$stream,
isset($this->_data[Horde_Imap_Client::FETCH_BODYPART][$id])
? $this->_data[Horde_Imap_Client::FETCH_BODYPART][$id]['t']
: null
);
} | php | public function getBodyPart($id, $stream = false)
{
return $this->_msgText(
$stream,
isset($this->_data[Horde_Imap_Client::FETCH_BODYPART][$id])
? $this->_data[Horde_Imap_Client::FETCH_BODYPART][$id]['t']
: null
);
} | [
"public",
"function",
"getBodyPart",
"(",
"$",
"id",
",",
"$",
"stream",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"_msgText",
"(",
"$",
"stream",
",",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_BODYPART",... | Get a body part entry.
@param string $id The MIME ID.
@param boolean $stream Return as a stream?
@return mixed The full text of the body part. | [
"Get",
"a",
"body",
"part",
"entry",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L217-L225 |
212,966 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.setBodyPartSize | public function setBodyPartSize($id, $size)
{
$this->_data[Horde_Imap_Client::FETCH_BODYPARTSIZE][$id] = intval($size);
} | php | public function setBodyPartSize($id, $size)
{
$this->_data[Horde_Imap_Client::FETCH_BODYPARTSIZE][$id] = intval($size);
} | [
"public",
"function",
"setBodyPartSize",
"(",
"$",
"id",
",",
"$",
"size",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_BODYPARTSIZE",
"]",
"[",
"$",
"id",
"]",
"=",
"intval",
"(",
"$",
"size",
")",
";",
"}"
] | Set the body part size for a body part.
@param string $id The MIME ID.
@param integer $size The size (in bytes). | [
"Set",
"the",
"body",
"part",
"size",
"for",
"a",
"body",
"part",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L247-L250 |
212,967 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getBodyPartSize | public function getBodyPartSize($id)
{
return isset($this->_data[Horde_Imap_Client::FETCH_BODYPARTSIZE][$id])
? $this->_data[Horde_Imap_Client::FETCH_BODYPARTSIZE][$id]
: null;
} | php | public function getBodyPartSize($id)
{
return isset($this->_data[Horde_Imap_Client::FETCH_BODYPARTSIZE][$id])
? $this->_data[Horde_Imap_Client::FETCH_BODYPARTSIZE][$id]
: null;
} | [
"public",
"function",
"getBodyPartSize",
"(",
"$",
"id",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_BODYPARTSIZE",
"]",
"[",
"$",
"id",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_... | Returns the body part size, if returned by the server.
@param string $id The MIME ID.
@return integer The body part size, in bytes. | [
"Returns",
"the",
"body",
"part",
"size",
"if",
"returned",
"by",
"the",
"server",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L259-L264 |
212,968 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.setBodyText | public function setBodyText($id, $text)
{
$this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id] = $this->_setMixed($text);
} | php | public function setBodyText($id, $text)
{
$this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id] = $this->_setMixed($text);
} | [
"public",
"function",
"setBodyText",
"(",
"$",
"id",
",",
"$",
"text",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_BODYTEXT",
"]",
"[",
"$",
"id",
"]",
"=",
"$",
"this",
"->",
"_setMixed",
"(",
"$",
"text",
")",
";",
... | Set a body text entry.
@param string $id The MIME ID.
@param mixed $text The body part text, as either a string or stream
resource. | [
"Set",
"a",
"body",
"text",
"entry",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L273-L276 |
212,969 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getBodyText | public function getBodyText($id = 0, $stream = false)
{
return $this->_msgText(
$stream,
isset($this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id])
? $this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id]
: null
);
} | php | public function getBodyText($id = 0, $stream = false)
{
return $this->_msgText(
$stream,
isset($this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id])
? $this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id]
: null
);
} | [
"public",
"function",
"getBodyText",
"(",
"$",
"id",
"=",
"0",
",",
"$",
"stream",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"_msgText",
"(",
"$",
"stream",
",",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FE... | Get a body text entry.
@param string $id The MIME ID.
@param boolean $stream Return as a stream?
@return mixed The full text of the body text. | [
"Get",
"a",
"body",
"text",
"entry",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L286-L294 |
212,970 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.setEnvelope | public function setEnvelope($data)
{
$this->_data[Horde_Imap_Client::FETCH_ENVELOPE] = is_array($data)
? new Horde_Imap_Client_Data_Envelope($data)
: $data;
} | php | public function setEnvelope($data)
{
$this->_data[Horde_Imap_Client::FETCH_ENVELOPE] = is_array($data)
? new Horde_Imap_Client_Data_Envelope($data)
: $data;
} | [
"public",
"function",
"setEnvelope",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_ENVELOPE",
"]",
"=",
"is_array",
"(",
"$",
"data",
")",
"?",
"new",
"Horde_Imap_Client_Data_Envelope",
"(",
"$",
"data",
")",
... | Set envelope data.
@param array $data The envelope data to pass to the Envelope object
constructor, or an Envelope object. | [
"Set",
"envelope",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L302-L307 |
212,971 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getEnvelope | public function getEnvelope()
{
return isset($this->_data[Horde_Imap_Client::FETCH_ENVELOPE])
? clone $this->_data[Horde_Imap_Client::FETCH_ENVELOPE]
: new Horde_Imap_Client_Data_Envelope();
} | php | public function getEnvelope()
{
return isset($this->_data[Horde_Imap_Client::FETCH_ENVELOPE])
? clone $this->_data[Horde_Imap_Client::FETCH_ENVELOPE]
: new Horde_Imap_Client_Data_Envelope();
} | [
"public",
"function",
"getEnvelope",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_ENVELOPE",
"]",
")",
"?",
"clone",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_ENVELOPE",
"]... | Get envelope data.
@return Horde_Imap_Client_Data_Envelope An envelope object. | [
"Get",
"envelope",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L314-L319 |
212,972 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getFlags | public function getFlags()
{
return isset($this->_data[Horde_Imap_Client::FETCH_FLAGS])
? $this->_data[Horde_Imap_Client::FETCH_FLAGS]
: array();
} | php | public function getFlags()
{
return isset($this->_data[Horde_Imap_Client::FETCH_FLAGS])
? $this->_data[Horde_Imap_Client::FETCH_FLAGS]
: array();
} | [
"public",
"function",
"getFlags",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_FLAGS",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_FLAGS",
"]",
":",
"array",... | Get IMAP flags.
@return array An array of IMAP flags (all flags in lowercase). | [
"Get",
"IMAP",
"flags",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L339-L344 |
212,973 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.setImapDate | public function setImapDate($date)
{
$this->_data[Horde_Imap_Client::FETCH_IMAPDATE] = is_object($date)
? $date
: new Horde_Imap_Client_DateTime($date);
} | php | public function setImapDate($date)
{
$this->_data[Horde_Imap_Client::FETCH_IMAPDATE] = is_object($date)
? $date
: new Horde_Imap_Client_DateTime($date);
} | [
"public",
"function",
"setImapDate",
"(",
"$",
"date",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_IMAPDATE",
"]",
"=",
"is_object",
"(",
"$",
"date",
")",
"?",
"$",
"date",
":",
"new",
"Horde_Imap_Client_DateTime",
"(",
"$... | Set IMAP internal date.
@param mixed $date Either a Horde_Imap_Client_DateTime object or a
date string. | [
"Set",
"IMAP",
"internal",
"date",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L352-L357 |
212,974 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getImapDate | public function getImapDate()
{
return isset($this->_data[Horde_Imap_Client::FETCH_IMAPDATE])
? clone $this->_data[Horde_Imap_Client::FETCH_IMAPDATE]
: new Horde_Imap_Client_DateTime();
} | php | public function getImapDate()
{
return isset($this->_data[Horde_Imap_Client::FETCH_IMAPDATE])
? clone $this->_data[Horde_Imap_Client::FETCH_IMAPDATE]
: new Horde_Imap_Client_DateTime();
} | [
"public",
"function",
"getImapDate",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_IMAPDATE",
"]",
")",
"?",
"clone",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_IMAPDATE",
"]... | Get internal IMAP date.
@return Horde_Imap_Client_DateTime A date object. | [
"Get",
"internal",
"IMAP",
"date",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L364-L369 |
212,975 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getSize | public function getSize()
{
return isset($this->_data[Horde_Imap_Client::FETCH_SIZE])
? $this->_data[Horde_Imap_Client::FETCH_SIZE]
: 0;
} | php | public function getSize()
{
return isset($this->_data[Horde_Imap_Client::FETCH_SIZE])
? $this->_data[Horde_Imap_Client::FETCH_SIZE]
: 0;
} | [
"public",
"function",
"getSize",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_SIZE",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_SIZE",
"]",
":",
"0",
";",... | Get message size.
@return integer The size of the message, in bytes. | [
"Get",
"message",
"size",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L386-L391 |
212,976 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getUid | public function getUid()
{
return isset($this->_data[Horde_Imap_Client::FETCH_UID])
? $this->_data[Horde_Imap_Client::FETCH_UID]
: null;
} | php | public function getUid()
{
return isset($this->_data[Horde_Imap_Client::FETCH_UID])
? $this->_data[Horde_Imap_Client::FETCH_UID]
: null;
} | [
"public",
"function",
"getUid",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_UID",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_UID",
"]",
":",
"null",
";",... | Get UID.
@return integer The message UID. | [
"Get",
"UID",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L408-L413 |
212,977 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getSeq | public function getSeq()
{
return isset($this->_data[Horde_Imap_Client::FETCH_SEQ])
? $this->_data[Horde_Imap_Client::FETCH_SEQ]
: null;
} | php | public function getSeq()
{
return isset($this->_data[Horde_Imap_Client::FETCH_SEQ])
? $this->_data[Horde_Imap_Client::FETCH_SEQ]
: null;
} | [
"public",
"function",
"getSeq",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_SEQ",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_SEQ",
"]",
":",
"null",
";",... | Get message sequence number.
@return integer The message sequence number. | [
"Get",
"message",
"sequence",
"number",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L430-L435 |
212,978 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.getModSeq | public function getModSeq()
{
return isset($this->_data[Horde_Imap_Client::FETCH_MODSEQ])
? $this->_data[Horde_Imap_Client::FETCH_MODSEQ]
: null;
} | php | public function getModSeq()
{
return isset($this->_data[Horde_Imap_Client::FETCH_MODSEQ])
? $this->_data[Horde_Imap_Client::FETCH_MODSEQ]
: null;
} | [
"public",
"function",
"getModSeq",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_MODSEQ",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_MODSEQ",
"]",
":",
"null... | Get the modified sequence value for the message.
@return integer The modseq value. | [
"Get",
"the",
"modified",
"sequence",
"value",
"for",
"the",
"message",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L452-L457 |
212,979 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.setDowngraded | public function setDowngraded($downgraded)
{
if ($downgraded) {
$this->_data[Horde_Imap_Client::FETCH_DOWNGRADED] = true;
} else {
unset($this->_data[Horde_Imap_Client::FETCH_DOWNGRADED]);
}
} | php | public function setDowngraded($downgraded)
{
if ($downgraded) {
$this->_data[Horde_Imap_Client::FETCH_DOWNGRADED] = true;
} else {
unset($this->_data[Horde_Imap_Client::FETCH_DOWNGRADED]);
}
} | [
"public",
"function",
"setDowngraded",
"(",
"$",
"downgraded",
")",
"{",
"if",
"(",
"$",
"downgraded",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"Horde_Imap_Client",
"::",
"FETCH_DOWNGRADED",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
... | Set the internationalized downgraded status for the message.
@since 2.11.0
@param boolean $downgraded True if at least one message component has
been downgraded. | [
"Set",
"the",
"internationalized",
"downgraded",
"status",
"for",
"the",
"message",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L467-L474 |
212,980 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch.merge | public function merge(Horde_Imap_Client_Data_Fetch $data)
{
$this->_data = array_replace_recursive(
$this->_data,
$data->getRawData()
);
} | php | public function merge(Horde_Imap_Client_Data_Fetch $data)
{
$this->_data = array_replace_recursive(
$this->_data,
$data->getRawData()
);
} | [
"public",
"function",
"merge",
"(",
"Horde_Imap_Client_Data_Fetch",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"_data",
"=",
"array_replace_recursive",
"(",
"$",
"this",
"->",
"_data",
",",
"$",
"data",
"->",
"getRawData",
"(",
")",
")",
";",
"}"
] | Merge a fetch object into this one.
@param Horde_Imap_Client_Data_Fetch $data A fetch object. | [
"Merge",
"a",
"fetch",
"object",
"into",
"this",
"one",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L505-L511 |
212,981 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch._msgText | protected function _msgText($stream, $data)
{
if ($data instanceof Horde_Stream) {
if ($stream) {
$data->rewind();
return $data->stream;
}
return strval($data);
}
if (is_resource($data)) {
rewind($data);
... | php | protected function _msgText($stream, $data)
{
if ($data instanceof Horde_Stream) {
if ($stream) {
$data->rewind();
return $data->stream;
}
return strval($data);
}
if (is_resource($data)) {
rewind($data);
... | [
"protected",
"function",
"_msgText",
"(",
"$",
"stream",
",",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"Horde_Stream",
")",
"{",
"if",
"(",
"$",
"stream",
")",
"{",
"$",
"data",
"->",
"rewind",
"(",
")",
";",
"return",
"$",
"dat... | Return text representation of a field.
@param boolean $stream Return as a stream?
@param mixed $data The field data (string or resource) or null if
field does not exist.
@return mixed Requested text representation. | [
"Return",
"text",
"representation",
"of",
"a",
"field",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L544-L573 |
212,982 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Data/Fetch.php | Horde_Imap_Client_Data_Fetch._getHeaders | protected function _getHeaders($id, $format, $key)
{
switch ($format) {
case self::HEADER_STREAM:
if (!isset($this->_data[$key][$id])) {
$data = null;
} elseif (is_object($this->_data[$key][$id])) {
switch ($key) {
case Horde_Im... | php | protected function _getHeaders($id, $format, $key)
{
switch ($format) {
case self::HEADER_STREAM:
if (!isset($this->_data[$key][$id])) {
$data = null;
} elseif (is_object($this->_data[$key][$id])) {
switch ($key) {
case Horde_Im... | [
"protected",
"function",
"_getHeaders",
"(",
"$",
"id",
",",
"$",
"format",
",",
"$",
"key",
")",
"{",
"switch",
"(",
"$",
"format",
")",
"{",
"case",
"self",
"::",
"HEADER_STREAM",
":",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_data",
"["... | Return representation of a header field.
@param string $id The header id.
@param integer $format The return format. If self::HEADER_PARSE,
returns a Horde_Mime_Headers object. If
self::HEADER_STREAM, returns a stream.
Otherwise, returns header text.
@param integer $key The array key where the data is stored... | [
"Return",
"representation",
"of",
"a",
"header",
"field",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Data/Fetch.php#L588-L649 |
212,983 | moodle/moodle | lib/editor/tinymce/plugins/pdw/lib.php | tinymce_pdw.update_init_params | protected function update_init_params(array &$params, context $context,
array $options = null) {
$rowsnumber = $this->count_button_rows($params);
if ($rowsnumber > 1) {
$this->add_button_before($params, 1, 'pdw_toggle', '');
$params['pdw_toggle_on'] = 1;
... | php | protected function update_init_params(array &$params, context $context,
array $options = null) {
$rowsnumber = $this->count_button_rows($params);
if ($rowsnumber > 1) {
$this->add_button_before($params, 1, 'pdw_toggle', '');
$params['pdw_toggle_on'] = 1;
... | [
"protected",
"function",
"update_init_params",
"(",
"array",
"&",
"$",
"params",
",",
"context",
"$",
"context",
",",
"array",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"rowsnumber",
"=",
"$",
"this",
"->",
"count_button_rows",
"(",
"$",
"params",
")",
... | Adds pdw toggle button if there are more than one row of buttons in TinyMCE
@param array $params TinyMCE init parameters array
@param context $context Context where editor is being shown
@param array $options Options for this editor | [
"Adds",
"pdw",
"toggle",
"button",
"if",
"there",
"are",
"more",
"than",
"one",
"row",
"of",
"buttons",
"in",
"TinyMCE"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/editor/tinymce/plugins/pdw/lib.php#L34-L46 |
212,984 | moodle/moodle | lib/odslib.class.php | MoodleODSWorkbook.add_worksheet | public function add_worksheet($name = '') {
$ws = new MoodleODSWorksheet($name, $this->worksheets);
$this->worksheets[] = $ws;
return $ws;
} | php | public function add_worksheet($name = '') {
$ws = new MoodleODSWorksheet($name, $this->worksheets);
$this->worksheets[] = $ws;
return $ws;
} | [
"public",
"function",
"add_worksheet",
"(",
"$",
"name",
"=",
"''",
")",
"{",
"$",
"ws",
"=",
"new",
"MoodleODSWorksheet",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"worksheets",
")",
";",
"$",
"this",
"->",
"worksheets",
"[",
"]",
"=",
"$",
"ws",
... | Create one Moodle Worksheet.
@param string $name Name of the sheet
@return MoodleODSWorksheet | [
"Create",
"one",
"Moodle",
"Worksheet",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/odslib.class.php#L52-L56 |
212,985 | moodle/moodle | lib/odslib.class.php | MoodleODSWorkbook.close | public function close() {
global $CFG;
require_once($CFG->libdir . '/filelib.php');
$writer = new MoodleODSWriter($this->worksheets);
$contents = $writer->get_file_content();
send_file($contents, $this->filename, 0, 0, true, true, $writer->get_ods_mimetype());
} | php | public function close() {
global $CFG;
require_once($CFG->libdir . '/filelib.php');
$writer = new MoodleODSWriter($this->worksheets);
$contents = $writer->get_file_content();
send_file($contents, $this->filename, 0, 0, true, true, $writer->get_ods_mimetype());
} | [
"public",
"function",
"close",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/filelib.php'",
")",
";",
"$",
"writer",
"=",
"new",
"MoodleODSWriter",
"(",
"$",
"this",
"->",
"worksheets",
")",
";",
"$"... | Close the Moodle Workbook. | [
"Close",
"the",
"Moodle",
"Workbook",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/odslib.class.php#L74-L82 |
212,986 | moodle/moodle | lib/odslib.class.php | MoodleODSWorksheet.write | public function write($row, $col, $token, $format = null) {
// Analyse what are we trying to send.
if (preg_match("/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/", $token)) {
// Match number
return $this->write_number($row, $col, $token, $format);
} elseif (preg_match... | php | public function write($row, $col, $token, $format = null) {
// Analyse what are we trying to send.
if (preg_match("/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/", $token)) {
// Match number
return $this->write_number($row, $col, $token, $format);
} elseif (preg_match... | [
"public",
"function",
"write",
"(",
"$",
"row",
",",
"$",
"col",
",",
"$",
"token",
",",
"$",
"format",
"=",
"null",
")",
"{",
"// Analyse what are we trying to send.",
"if",
"(",
"preg_match",
"(",
"\"/^([+-]?)(?=\\d|\\.\\d)\\d*(\\.\\d*)?([Ee]([+-]?\\d+))?$/\"",
",... | Write anything somewhere in the worksheet,
type will be automatically detected.
@param integer $row Zero indexed row
@param integer $col Zero indexed column
@param mixed $token What we are writing
@param mixed $format The XF format for the cell | [
"Write",
"anything",
"somewhere",
"in",
"the",
"worksheet",
"type",
"will",
"be",
"automatically",
"detected",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/odslib.class.php#L270-L297 |
212,987 | moodle/moodle | lib/odslib.class.php | MoodleODSFormat.set_align | public function set_align($location) {
if (in_array($location, array('left', 'centre', 'center', 'right', 'fill', 'merge', 'justify', 'equal_space'))) {
$this->set_h_align($location);
} else if (in_array($location, array('top', 'vcentre', 'vcenter', 'bottom', 'vjustify', 'vequal_space'))) {... | php | public function set_align($location) {
if (in_array($location, array('left', 'centre', 'center', 'right', 'fill', 'merge', 'justify', 'equal_space'))) {
$this->set_h_align($location);
} else if (in_array($location, array('top', 'vcentre', 'vcenter', 'bottom', 'vjustify', 'vequal_space'))) {... | [
"public",
"function",
"set_align",
"(",
"$",
"location",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"location",
",",
"array",
"(",
"'left'",
",",
"'centre'",
",",
"'center'",
",",
"'right'",
",",
"'fill'",
",",
"'merge'",
",",
"'justify'",
",",
"'equal_s... | Set the cell alignment of the format.
@param string $location alignment for the cell ('left', 'right', 'justify', etc...) | [
"Set",
"the",
"cell",
"alignment",
"of",
"the",
"format",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/odslib.class.php#L585-L592 |
212,988 | moodle/moodle | lib/odslib.class.php | MoodleODSFormat.parse_color | protected function parse_color($color) {
if (strpos($color, '#') === 0) {
// No conversion should be needed.
return $color;
}
if ($color > 7 and $color < 53) {
$numbers = array(
8 => 'black',
12 => 'blue',
16 =... | php | protected function parse_color($color) {
if (strpos($color, '#') === 0) {
// No conversion should be needed.
return $color;
}
if ($color > 7 and $color < 53) {
$numbers = array(
8 => 'black',
12 => 'blue',
16 =... | [
"protected",
"function",
"parse_color",
"(",
"$",
"color",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"color",
",",
"'#'",
")",
"===",
"0",
")",
"{",
"// No conversion should be needed.",
"return",
"$",
"color",
";",
"}",
"if",
"(",
"$",
"color",
">",
"7... | Standardise colour name.
@param mixed $color name of the color (i.e.: 'blue', 'red', etc..), or an integer (range is [8...63]).
@return string the RGB color value | [
"Standardise",
"colour",
"name",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/odslib.class.php#L751-L813 |
212,989 | moodle/moodle | lib/odslib.class.php | MoodleODSWriter.get_file_content | public function get_file_content() {
$dir = make_request_directory();
$filename = $dir . '/result.ods';
$files = [
'mimetype' => [$this->get_ods_mimetype()],
'content.xml' => [$this->get_ods_content($this->worksheets)],
'met... | php | public function get_file_content() {
$dir = make_request_directory();
$filename = $dir . '/result.ods';
$files = [
'mimetype' => [$this->get_ods_mimetype()],
'content.xml' => [$this->get_ods_content($this->worksheets)],
'met... | [
"public",
"function",
"get_file_content",
"(",
")",
"{",
"$",
"dir",
"=",
"make_request_directory",
"(",
")",
";",
"$",
"filename",
"=",
"$",
"dir",
".",
"'/result.ods'",
";",
"$",
"files",
"=",
"[",
"'mimetype'",
"=>",
"[",
"$",
"this",
"->",
"get_ods_m... | Fetch the file ocntnet for the ODS.
@return string | [
"Fetch",
"the",
"file",
"ocntnet",
"for",
"the",
"ODS",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/odslib.class.php#L836-L856 |
212,990 | moodle/moodle | cache/stores/mongodb/MongoDB/Exception/InvalidArgumentException.php | InvalidArgumentException.invalidType | public static function invalidType($name, $value, $expectedType)
{
return new static(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, is_object($value) ? get_class($value) : gettype($value)));
} | php | public static function invalidType($name, $value, $expectedType)
{
return new static(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, is_object($value) ? get_class($value) : gettype($value)));
} | [
"public",
"static",
"function",
"invalidType",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"expectedType",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'Expected %s to have type \"%s\" but found \"%s\"'",
",",
"$",
"name",
",",
"$",
"expectedTyp... | Thrown when an argument or option has an invalid type.
@param string $name Name of the argument or option
@param mixed $value Actual value (used to derive the type)
@param string $expectedType Expected type
@return self | [
"Thrown",
"when",
"an",
"argument",
"or",
"option",
"has",
"an",
"invalid",
"type",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Exception/InvalidArgumentException.php#L30-L33 |
212,991 | moodle/moodle | mod/lesson/backup/moodle2/restore_lesson_stepslib.php | restore_lesson_activity_structure_step.process_lesson_override | protected function process_lesson_override($data) {
global $DB;
$data = (object)$data;
$oldid = $data->id;
// Based on userinfo, we'll restore user overides or no.
$userinfo = $this->get_setting_value('userinfo');
// Skip user overrides if we are not restoring userinfo... | php | protected function process_lesson_override($data) {
global $DB;
$data = (object)$data;
$oldid = $data->id;
// Based on userinfo, we'll restore user overides or no.
$userinfo = $this->get_setting_value('userinfo');
// Skip user overrides if we are not restoring userinfo... | [
"protected",
"function",
"process_lesson_override",
"(",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"data",
"=",
"(",
"object",
")",
"$",
"data",
";",
"$",
"oldid",
"=",
"$",
"data",
"->",
"id",
";",
"// Based on userinfo, we'll restore user overi... | Process a lesson override restore
@param object $data The data in object form
@return void | [
"Process",
"a",
"lesson",
"override",
"restore"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/backup/moodle2/restore_lesson_stepslib.php#L200-L230 |
212,992 | moodle/moodle | lib/dml/moodle_database.php | moodle_database.get_driver_instance | public static function get_driver_instance($type, $library, $external = false) {
global $CFG;
$classname = $type.'_'.$library.'_moodle_database';
$libfile = "$CFG->libdir/dml/$classname.php";
if (!file_exists($libfile)) {
return null;
}
require_once($libf... | php | public static function get_driver_instance($type, $library, $external = false) {
global $CFG;
$classname = $type.'_'.$library.'_moodle_database';
$libfile = "$CFG->libdir/dml/$classname.php";
if (!file_exists($libfile)) {
return null;
}
require_once($libf... | [
"public",
"static",
"function",
"get_driver_instance",
"(",
"$",
"type",
",",
"$",
"library",
",",
"$",
"external",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"classname",
"=",
"$",
"type",
".",
"'_'",
".",
"$",
"library",
".",
"'_moodle_d... | Loads and returns a database instance with the specified type and library.
The loaded class is within lib/dml directory and of the form: $type.'_'.$library.'_moodle_database'
@param string $type Database driver's type. (eg: mysqli, pgsql, mssql, sqldrv, oci, etc.)
@param string $library Database driver's library (nat... | [
"Loads",
"and",
"returns",
"a",
"database",
"instance",
"with",
"the",
"specified",
"type",
"and",
"library",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/moodle_database.php#L189-L201 |
212,993 | moodle/moodle | lib/dml/moodle_database.php | moodle_database.export_dbconfig | public function export_dbconfig() {
$cfg = new stdClass();
$cfg->dbtype = $this->get_dbtype();
$cfg->dblibrary = $this->get_dblibrary();
$cfg->dbhost = $this->dbhost;
$cfg->dbname = $this->dbname;
$cfg->dbuser = $this->dbuser;
$cfg->dbpass = $this->... | php | public function export_dbconfig() {
$cfg = new stdClass();
$cfg->dbtype = $this->get_dbtype();
$cfg->dblibrary = $this->get_dblibrary();
$cfg->dbhost = $this->dbhost;
$cfg->dbname = $this->dbname;
$cfg->dbuser = $this->dbuser;
$cfg->dbpass = $this->... | [
"public",
"function",
"export_dbconfig",
"(",
")",
"{",
"$",
"cfg",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"cfg",
"->",
"dbtype",
"=",
"$",
"this",
"->",
"get_dbtype",
"(",
")",
";",
"$",
"cfg",
"->",
"dblibrary",
"=",
"$",
"this",
"->",
"get_... | Returns the db related part of config.php
@return stdClass | [
"Returns",
"the",
"db",
"related",
"part",
"of",
"config",
".",
"php"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/moodle_database.php#L262-L276 |
212,994 | moodle/moodle | lib/dml/moodle_database.php | moodle_database.store_settings | protected function store_settings($dbhost, $dbuser, $dbpass, $dbname, $prefix, array $dboptions=null) {
$this->dbhost = $dbhost;
$this->dbuser = $dbuser;
$this->dbpass = $dbpass;
$this->dbname = $dbname;
$this->prefix = $prefix;
$this->dboptions = (array)$d... | php | protected function store_settings($dbhost, $dbuser, $dbpass, $dbname, $prefix, array $dboptions=null) {
$this->dbhost = $dbhost;
$this->dbuser = $dbuser;
$this->dbpass = $dbpass;
$this->dbname = $dbname;
$this->prefix = $prefix;
$this->dboptions = (array)$d... | [
"protected",
"function",
"store_settings",
"(",
"$",
"dbhost",
",",
"$",
"dbuser",
",",
"$",
"dbpass",
",",
"$",
"dbname",
",",
"$",
"prefix",
",",
"array",
"$",
"dboptions",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"dbhost",
"=",
"$",
"dbhost",
";"... | Store various database settings
@param string $dbhost The database host.
@param string $dbuser The database user to connect as.
@param string $dbpass The password to use when connecting to the database.
@param string $dbname The name of the database being connected to.
@param mixed $prefix string means moodle db prefix... | [
"Store",
"various",
"database",
"settings"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/moodle_database.php#L312-L319 |
212,995 | moodle/moodle | lib/dml/moodle_database.php | moodle_database.get_settings_hash | protected function get_settings_hash() {
if (empty($this->settingshash)) {
$this->settingshash = md5($this->dbhost . $this->dbuser . $this->dbname . $this->prefix);
}
return $this->settingshash;
} | php | protected function get_settings_hash() {
if (empty($this->settingshash)) {
$this->settingshash = md5($this->dbhost . $this->dbuser . $this->dbname . $this->prefix);
}
return $this->settingshash;
} | [
"protected",
"function",
"get_settings_hash",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"settingshash",
")",
")",
"{",
"$",
"this",
"->",
"settingshash",
"=",
"md5",
"(",
"$",
"this",
"->",
"dbhost",
".",
"$",
"this",
"->",
"dbuser",
... | Returns a hash for the settings used during connection.
If not already requested it is generated and stored in a private property.
@return string | [
"Returns",
"a",
"hash",
"for",
"the",
"settings",
"used",
"during",
"connection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/moodle_database.php#L328-L333 |
212,996 | moodle/moodle | lib/dml/moodle_database.php | moodle_database.get_metacache | protected function get_metacache() {
if (!isset($this->metacache)) {
$properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
$this->metacache = cache::make('core', 'databasemeta', $properties);
}
return $this->metacache;
} | php | protected function get_metacache() {
if (!isset($this->metacache)) {
$properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
$this->metacache = cache::make('core', 'databasemeta', $properties);
}
return $this->metacache;
} | [
"protected",
"function",
"get_metacache",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"metacache",
")",
")",
"{",
"$",
"properties",
"=",
"array",
"(",
"'dbfamily'",
"=>",
"$",
"this",
"->",
"get_dbfamily",
"(",
")",
",",
"'settings... | Handle the creation and caching of the databasemeta information for all databases.
@return cache_application The databasemeta cachestore to complete operations on. | [
"Handle",
"the",
"creation",
"and",
"caching",
"of",
"the",
"databasemeta",
"information",
"for",
"all",
"databases",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/moodle_database.php#L340-L346 |
212,997 | moodle/moodle | lib/dml/moodle_database.php | moodle_database.get_temp_tables_cache | protected function get_temp_tables_cache() {
if (!isset($this->metacachetemp)) {
// Using connection data to prevent collisions when using the same temp table name with different db connections.
$properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_ha... | php | protected function get_temp_tables_cache() {
if (!isset($this->metacachetemp)) {
// Using connection data to prevent collisions when using the same temp table name with different db connections.
$properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_ha... | [
"protected",
"function",
"get_temp_tables_cache",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"metacachetemp",
")",
")",
"{",
"// Using connection data to prevent collisions when using the same temp table name with different db connections.",
"$",
"propert... | Handle the creation and caching of the temporary tables.
@return cache_application The temp_tables cachestore to complete operations on. | [
"Handle",
"the",
"creation",
"and",
"caching",
"of",
"the",
"temporary",
"tables",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/moodle_database.php#L353-L360 |
212,998 | moodle/moodle | lib/dml/moodle_database.php | moodle_database.get_transaction_start_backtrace | public function get_transaction_start_backtrace() {
if (!$this->transactions) {
return null;
}
$lowesttransaction = end($this->transactions);
return $lowesttransaction->get_backtrace();
} | php | public function get_transaction_start_backtrace() {
if (!$this->transactions) {
return null;
}
$lowesttransaction = end($this->transactions);
return $lowesttransaction->get_backtrace();
} | [
"public",
"function",
"get_transaction_start_backtrace",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"transactions",
")",
"{",
"return",
"null",
";",
"}",
"$",
"lowesttransaction",
"=",
"end",
"(",
"$",
"this",
"->",
"transactions",
")",
";",
"return... | Returns transaction trace for debugging purposes.
@private to be used by core only
@return array or null if not in transaction. | [
"Returns",
"transaction",
"trace",
"for",
"debugging",
"purposes",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/moodle_database.php#L381-L387 |
212,999 | moodle/moodle | lib/dml/moodle_database.php | moodle_database.query_start | protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
if ($this->loggingquery) {
return;
}
$this->last_sql = $sql;
$this->last_params = $params;
$this->last_type = $type;
$this->last_extrainfo = $extrainfo;
$t... | php | protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
if ($this->loggingquery) {
return;
}
$this->last_sql = $sql;
$this->last_params = $params;
$this->last_type = $type;
$this->last_extrainfo = $extrainfo;
$t... | [
"protected",
"function",
"query_start",
"(",
"$",
"sql",
",",
"array",
"$",
"params",
"=",
"null",
",",
"$",
"type",
",",
"$",
"extrainfo",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loggingquery",
")",
"{",
"return",
";",
"}",
"$",
"thi... | This should be called before each db query.
@param string $sql The query string.
@param array $params An array of parameters.
@param int $type The type of query. ( SQL_QUERY_SELECT | SQL_QUERY_AUX | SQL_QUERY_INSERT | SQL_QUERY_UPDATE | SQL_QUERY_STRUCTURE )
@param mixed $extrainfo This is here for any driver specific ... | [
"This",
"should",
"be",
"called",
"before",
"each",
"db",
"query",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/moodle_database.php#L423-L453 |
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.