';
+ echo $OUTPUT->render_from_template('core_admin/settings', $context);
} else {
if ($PAGE->user_allowed_editing()) {
@@ -121,23 +124,23 @@ if (empty($SITE->fullname)) {
// ---------------------------------------------------------------------------------------------------------------
- echo '';
+ echo $OUTPUT->render_from_template('core_admin/settings', $context);
}
$PAGE->requires->yui_module('moodle-core-formchangechecker',
diff --git a/admin/templates/setting.mustache b/admin/templates/setting.mustache
new file mode 100644
index 00000000000..33e760d7f1d
--- /dev/null
+++ b/admin/templates/setting.mustache
@@ -0,0 +1,43 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting.
+}}
+
+
+
+ {{{name}}}
+
+
+ {{#error}}
+
{{error}}
+ {{/error}}
+ {{{element}}}
+ {{#default}}
+
{{{default}}}
+ {{/default}}
+
+
{{{description}}}
+
diff --git a/admin/templates/setting_configcheckbox.mustache b/admin/templates/setting_configcheckbox.mustache
new file mode 100644
index 00000000000..6d363ed7322
--- /dev/null
+++ b/admin/templates/setting_configcheckbox.mustache
@@ -0,0 +1,23 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configdirectory.
+}}
+
+
+
+
diff --git a/admin/templates/setting_configcolourpicker.mustache b/admin/templates/setting_configcolourpicker.mustache
new file mode 100644
index 00000000000..0ad6ec65997
--- /dev/null
+++ b/admin/templates/setting_configcolourpicker.mustache
@@ -0,0 +1,30 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configcolourpicker.
+}}
+
diff --git a/admin/templates/setting_configdirectory.mustache b/admin/templates/setting_configdirectory.mustache
new file mode 100644
index 00000000000..5ea2cd7374b
--- /dev/null
+++ b/admin/templates/setting_configdirectory.mustache
@@ -0,0 +1,20 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configdirectory.
+}}
+{{>core_admin/setting_configfile}}
diff --git a/admin/templates/setting_configduration.mustache b/admin/templates/setting_configduration.mustache
new file mode 100644
index 00000000000..1d7f3e79013
--- /dev/null
+++ b/admin/templates/setting_configduration.mustache
@@ -0,0 +1,29 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configduration.
+}}
+
+
+
+
+
+
diff --git a/admin/templates/setting_configempty.mustache b/admin/templates/setting_configempty.mustache
new file mode 100644
index 00000000000..ec391e9cc9c
--- /dev/null
+++ b/admin/templates/setting_configempty.mustache
@@ -0,0 +1,22 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configempty.
+}}
+
+
+
diff --git a/admin/templates/setting_configexecutable.mustache b/admin/templates/setting_configexecutable.mustache
new file mode 100644
index 00000000000..c93134a879f
--- /dev/null
+++ b/admin/templates/setting_configexecutable.mustache
@@ -0,0 +1,20 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configexecutable.
+}}
+{{>core_admin/setting_configfile}}
diff --git a/admin/templates/setting_configfile.mustache b/admin/templates/setting_configfile.mustache
new file mode 100644
index 00000000000..e2bb3b76d52
--- /dev/null
+++ b/admin/templates/setting_configfile.mustache
@@ -0,0 +1,31 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configfile.
+}}
+
+
diff --git a/admin/templates/setting_confightmleditor.mustache b/admin/templates/setting_confightmleditor.mustache
new file mode 100644
index 00000000000..dbfd3fa48bc
--- /dev/null
+++ b/admin/templates/setting_confightmleditor.mustache
@@ -0,0 +1,20 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting confightmleditor.
+}}
+{{>core_admin/setting_configtextarea}}
diff --git a/admin/templates/setting_configmulticheckbox.mustache b/admin/templates/setting_configmulticheckbox.mustache
new file mode 100644
index 00000000000..ed31eeaee5e
--- /dev/null
+++ b/admin/templates/setting_configmulticheckbox.mustache
@@ -0,0 +1,32 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configmulticheckbox.
+}}
+
+
+ {{#hasoptions}}
+
+ {{#options}}
+
+
+
+
+ {{/options}}
+
+ {{/hasoptions}}
+
diff --git a/admin/templates/setting_configmultiselect.mustache b/admin/templates/setting_configmultiselect.mustache
new file mode 100644
index 00000000000..88baa846d64
--- /dev/null
+++ b/admin/templates/setting_configmultiselect.mustache
@@ -0,0 +1,28 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configmultiselect.
+}}
+
+
+
+
+
diff --git a/admin/templates/setting_configpasswordunmask.mustache b/admin/templates/setting_configpasswordunmask.mustache
new file mode 100644
index 00000000000..dd5c0becc52
--- /dev/null
+++ b/admin/templates/setting_configpasswordunmask.mustache
@@ -0,0 +1,57 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configpasswordunmask.
+}}
+
+
+
+
+{{#js}}
+(function() {
+ var id = '{{id}}';
+ var unmaskid = id + 'unmask';
+ var unmaskdivid = id + 'unmaskdiv';
+ var unmaskstr = {{#quote}}{{#str}}unmaskpassword, form{{/str}}{{/quote}};
+ var is_ie = (navigator.userAgent.toLowerCase().indexOf("msie") != -1);
+
+ document.getElementById(id).setAttribute("autocomplete", "off");
+
+ var unmaskdiv = document.getElementById(unmaskdivid);
+
+ var unmaskchb = document.createElement("input");
+ unmaskchb.setAttribute("type", "checkbox");
+ unmaskchb.setAttribute("id", unmaskid);
+ unmaskchb.onchange = function() {unmaskPassword(id);};
+ unmaskdiv.appendChild(unmaskchb);
+
+ var unmasklbl = document.createElement("label");
+ unmasklbl.innerHTML = unmaskstr;
+ if (is_ie) {
+ unmasklbl.setAttribute("htmlFor", unmaskid);
+ } else {
+ unmasklbl.setAttribute("for", unmaskid);
+ }
+ unmaskdiv.appendChild(unmasklbl);
+
+ if (is_ie) {
+ // Ugly hack to work around the famous onchange IE bug.
+ unmaskchb.onclick = function() {this.blur();};
+ unmaskdiv.onclick = function() {this.blur();};
+ }
+})()
+{{/js}}
diff --git a/admin/templates/setting_configselect.mustache b/admin/templates/setting_configselect.mustache
new file mode 100644
index 00000000000..199f5291adf
--- /dev/null
+++ b/admin/templates/setting_configselect.mustache
@@ -0,0 +1,27 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configselect.
+}}
+
+
+
+
diff --git a/admin/templates/setting_configtext.mustache b/admin/templates/setting_configtext.mustache
new file mode 100644
index 00000000000..3d99fc37912
--- /dev/null
+++ b/admin/templates/setting_configtext.mustache
@@ -0,0 +1,22 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configtext.
+}}
+
+
+
diff --git a/admin/templates/setting_configtextarea.mustache b/admin/templates/setting_configtextarea.mustache
new file mode 100644
index 00000000000..5c620554ccf
--- /dev/null
+++ b/admin/templates/setting_configtextarea.mustache
@@ -0,0 +1,22 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configtextarea.
+}}
+
+
+
diff --git a/admin/templates/setting_configtime.mustache b/admin/templates/setting_configtime.mustache
new file mode 100644
index 00000000000..a17aefbfe42
--- /dev/null
+++ b/admin/templates/setting_configtime.mustache
@@ -0,0 +1,34 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting configtime.
+}}
+
+
+ :
+
+
+
+
diff --git a/admin/templates/setting_courselist_frontpage.mustache b/admin/templates/setting_courselist_frontpage.mustache
new file mode 100644
index 00000000000..d50192401b4
--- /dev/null
+++ b/admin/templates/setting_courselist_frontpage.mustache
@@ -0,0 +1,29 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting courselist_frontpage.
+}}
+
+ {{#selects}}
+
+
+ {{/selects}}
+
diff --git a/admin/templates/setting_devicedetectregex.mustache b/admin/templates/setting_devicedetectregex.mustache
new file mode 100644
index 00000000000..1cdeb8e5965
--- /dev/null
+++ b/admin/templates/setting_devicedetectregex.mustache
@@ -0,0 +1,39 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting devicedetectregex.
+}}
+
diff --git a/admin/templates/setting_emoticons.mustache b/admin/templates/setting_emoticons.mustache
new file mode 100644
index 00000000000..cdd7a1b6173
--- /dev/null
+++ b/admin/templates/setting_emoticons.mustache
@@ -0,0 +1,51 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting emoticons.
+}}
+
diff --git a/admin/templates/setting_flag.mustache b/admin/templates/setting_flag.mustache
new file mode 100644
index 00000000000..85ad557f08f
--- /dev/null
+++ b/admin/templates/setting_flag.mustache
@@ -0,0 +1,21 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting flag.
+}}
+
+
\ No newline at end of file
diff --git a/admin/templates/setting_gradecat_combo.mustache b/admin/templates/setting_gradecat_combo.mustache
new file mode 100644
index 00000000000..1016373f1c8
--- /dev/null
+++ b/admin/templates/setting_gradecat_combo.mustache
@@ -0,0 +1,31 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting gradecat_combo.
+}}
+
+
+
+
+
+
+
+
diff --git a/admin/templates/setting_heading.mustache b/admin/templates/setting_heading.mustache
new file mode 100644
index 00000000000..05b1f21f616
--- /dev/null
+++ b/admin/templates/setting_heading.mustache
@@ -0,0 +1,25 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting heading.
+}}
+{{#title}}
+
{{title}}
+{{/title}}
+{{#description}}
+
{{{descriptionformatted}}}
+{{/description}}
diff --git a/admin/templates/setting_special_calendar_weekend.mustache b/admin/templates/setting_special_calendar_weekend.mustache
new file mode 100644
index 00000000000..10259e0fc95
--- /dev/null
+++ b/admin/templates/setting_special_calendar_weekend.mustache
@@ -0,0 +1,40 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Setting special_calendar_weekend.
+}}
+
+
+
+
+ {{#days}}
+
+
+
+ {{/days}}
+
+
+
+
+ {{#days}}
+
+
+
+ {{/days}}
+
+
+
diff --git a/admin/templates/settings.mustache b/admin/templates/settings.mustache
new file mode 100644
index 00000000000..30be66142b8
--- /dev/null
+++ b/admin/templates/settings.mustache
@@ -0,0 +1,38 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ Settings.
+}}
+
diff --git a/lib/adminlib.php b/lib/adminlib.php
index af6015fb967..1938e70733e 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -2017,15 +2017,18 @@ class admin_setting_flag {
* @return string - The html for the checkbox.
*/
public function output_setting_flag(admin_setting $setting) {
+ global $OUTPUT;
+
$value = $setting->get_setting_flag_value($this);
- $output = ' ' .
- ' ';
- return $output;
+
+ $context = new stdClass();
+ $context->id = $setting->get_id() . '_' . $this->get_shortname();
+ $context->name = $setting->get_full_name() . '_' . $this->get_shortname();
+ $context->value = 1;
+ $context->checked = $value ? true : false;
+ $context->label = $this->get_displayname();
+
+ return $OUTPUT->render_from_template('core_admin/setting_flag', $context);
}
}
@@ -2079,14 +2082,11 @@ class admin_setting_heading extends admin_setting {
*/
public function output_html($data, $query='') {
global $OUTPUT;
- $return = '';
- if ($this->visiblename != '') {
- $return .= $OUTPUT->heading($this->visiblename, 3, 'main');
- }
- if ($this->description != '') {
- $return .= $OUTPUT->box(highlight($query, markdown_to_html($this->description)), 'generalbox formsettingheading');
- }
- return $return;
+ $context = new stdClass();
+ $context->title = $this->visiblename;
+ $context->description = $this->description;
+ $context->descriptionformatted = highlight($query, markdown_to_html($this->description));
+ return $OUTPUT->render_from_template('core_admin/setting_heading', $context);
}
}
@@ -2177,11 +2177,18 @@ class admin_setting_configtext extends admin_setting {
* @return string Returns an XHTML string
*/
public function output_html($data, $query='') {
- $default = $this->get_defaultsetting();
+ global $OUTPUT;
- return format_admin_setting($this, $this->visiblename,
- '',
- $this->description, true, '', $default, $query);
+ $default = $this->get_defaultsetting();
+ $context = (object) [
+ 'size' => $this->size,
+ 'id' => $this->get_id(),
+ 'name' => $this->get_full_name(),
+ 'value' => $data
+ ];
+ $element = $OUTPUT->render_from_template('core_admin/setting_configtext', $context);
+
+ return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $default, $query);
}
}
@@ -2271,16 +2278,24 @@ class admin_setting_configtextarea extends admin_setting_configtext {
* @return string XHTML string for the editor
*/
public function output_html($data, $query='') {
- $default = $this->get_defaultsetting();
+ global $OUTPUT;
+ $default = $this->get_defaultsetting();
$defaultinfo = $default;
if (!is_null($default) and $default !== '') {
$defaultinfo = "\n".$default;
}
- return format_admin_setting($this, $this->visiblename,
- '',
- $this->description, true, '', $defaultinfo, $query);
+ $context = (object) [
+ 'cols' => $this->cols,
+ 'rows' => $this->rows,
+ 'id' => $this->get_id(),
+ 'name' => $this->get_full_name(),
+ 'value' => $data
+ ];
+ $element = $OUTPUT->render_from_template('core_admin/setting_configtextarea', $context);
+
+ return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $defaultinfo, $query);
}
}
@@ -2288,9 +2303,7 @@ class admin_setting_configtextarea extends admin_setting_configtext {
/**
* General text area with html editor.
*/
-class admin_setting_confightmleditor extends admin_setting_configtext {
- private $rows;
- private $cols;
+class admin_setting_confightmleditor extends admin_setting_configtextarea {
/**
* @param string $name
@@ -2300,9 +2313,7 @@ class admin_setting_confightmleditor extends admin_setting_configtext {
* @param mixed $paramtype
*/
public function __construct($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW, $cols='60', $rows='8') {
- $this->rows = $rows;
- $this->cols = $cols;
- parent::__construct($name, $visiblename, $description, $defaultsetting, $paramtype);
+ parent::__construct($name, $visiblename, $description, $defaultsetting, $paramtype, $cols, $rows);
editors_head_setup();
}
@@ -2314,20 +2325,10 @@ class admin_setting_confightmleditor extends admin_setting_configtext {
* @return string XHTML string for the editor
*/
public function output_html($data, $query='') {
- $default = $this->get_defaultsetting();
-
- $defaultinfo = $default;
- if (!is_null($default) and $default !== '') {
- $defaultinfo = "\n".$default;
- }
-
$editor = editors_get_preferred_editor(FORMAT_HTML);
$editor->set_text($data);
$editor->use_editor($this->get_id(), array('noclean'=>true));
-
- return format_admin_setting($this, $this->visiblename,
- '',
- $this->description, true, '', $defaultinfo, $query);
+ return parent::output_html($data, $query);
}
}
@@ -2375,41 +2376,15 @@ class admin_setting_configpasswordunmask extends admin_setting_configtext {
* @return string XHTML field
*/
public function output_html($data, $query='') {
- $id = $this->get_id();
- $unmask = get_string('unmaskpassword', 'form');
- $unmaskjs = '';
- return format_admin_setting($this, $this->visiblename,
- '