Commit 10617d69 authored by Damyon Wiese's avatar Damyon Wiese Committed by Dan Poltawski
Browse files

MDL-55071 templates: Add correct docs for new templates

These are just the admin settings templates.

Part of MDL-55071
parent 5d9f0bb3
......@@ -15,7 +15,33 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting.
@template core_admin/setting
Admin setting template.
Context variables required for this template:
* labelfor - id of the form element
* title - Setting title
* override - Overridden message
* warning - Warning message
* name - Setting name
* error - Error message
* element - The Element HTML
* forceltr - Force this element to be displayed LTR
* default - Default value
Example context (json):
{
"title": "Setting title",
"labelfor": "id0",
"override": "Overidden",
"warning": "Warning",
"name": "Name",
"error": "Error",
"element": "Raw HTML",
"forceltr": false,
"default": "Default value"
}
}}
<div class="form-item clearfix" id="{{id}}">
<div class="form-label">
......
......@@ -15,7 +15,25 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configdirectory.
@template core_admin/setting_configcheckbox
Admin checkbox setting template.
Context variables required for this template:
* name - form element name
* no - no value
* value - yes value
* id - element id
* checked - boole
Example context (json):
{
"name": "test",
"no": "False",
"value": "True",
"id": "test0",
"checked": "checked"
}
}}
<div class="form-checkbox defaultsnext">
<input type="hidden" name="{{name}}" value="{{no}}">
......
......@@ -15,7 +15,25 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configcolourpicker.
@template core_admin/setting_configcolourpicker
Admin setting colour picker template.
Context variables required for this template:
* icon - optional icon context (see pix_icon)
* name - element name
* id - element id
* value - element value
* haspreviewconfig - show preview of selected color
Example context (json):
{
"icon": false,
"name": "name0",
"id": "id0",
"value": "#555655",
"haspreviewconfig": false
}
}}
<div class="form-colourpicker defaultsnext">
<div class="admin_colourpicker clearfix">
......
......@@ -15,6 +15,27 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configdirectory.
@template core_admin/setting_configdirectory
Admin directory setting template.
Context variables required for this template:
* name - form element name
* id - element id
* size - size of the field
* readonly - Make the field readonly
* value - value
* showvalidity - Show a green check if the path is readable
* valid - True if the path is readable
Example context (json):
{
"name": "test",
"value": "/my-super-secret-path/",
"id": "test0",
"readonly": true,
"showvalidity": true,
"valid": false
}
}}
{{>core_admin/setting_configfile}}
......@@ -15,7 +15,23 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configduration.
@template core_admin/setting_configduration
Admin duration setting template.
Context variables required for this template:
* name - form element name
* options - list of options for units containing name, value, selected
* value - yes
* id - element id
Example context (json):
{
"name": "test",
"value": "5",
"id": "test0",
"options": [ { "name": "Minutes", "value": "mins", "selected": true } ]
}
}}
<div class="form-duration defaultsnext">
<input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="text-ltr">
......
......@@ -15,7 +15,19 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configempty.
@template core_admin/setting_configempty
Admin empty setting template.
Context variables required for this template:
* name - form element name
* id - element id
Example context (json):
{
"name": "test",
"id": "test0"
}
}}
<div class="form-empty">
<input type="hidden" name="{{name}}" id="{{id}}" value="">
......
......@@ -15,6 +15,27 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configexecutable.
@template core_admin/setting_configexecutable
Admin executable setting template.
Context variables required for this template:
* name - form element name
* id - element id
* size - size of the field
* readonly - Make the field readonly
* value - value
* showvalidity - Show a green check if the path is readable
* valid - True if the path is readable
Example context (json):
{
"name": "test",
"value": "/usr/bin/cowsay",
"id": "test0",
"readonly": true,
"showvalidity": true,
"valid": false
}
}}
{{>core_admin/setting_configfile}}
......@@ -15,7 +15,28 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configfile.
@template core_admin/setting_configfile
Admin file setting template.
Context variables required for this template:
* name - form element name
* id - element id
* size - size of the field
* readonly - Make the field readonly
* value - value
* showvalidity - Show a green check if the path is readable
* valid - True if the path is readable
Example context (json):
{
"name": "test",
"value": "/my-super-secret-path/file",
"id": "test0",
"readonly": true,
"showvalidity": true,
"valid": false
}
}}
<div class="form-file defaultsnext">
<input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" class="text-ltr" {{#readonly}}readonly{{/readonly}}>
......
......@@ -15,6 +15,25 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting confightmleditor.
@template core_admin/setting_confightmleditor
Admin htmleditor setting template.
Context variables required for this template:
* rows - number of rows
* cols - number of cols
* id - element id
* name - element name
* value - default text
* forceltr - always ltr
Example context (json):
{
"name": "test",
"id": "test0",
"value": "Your aims are high, and you are capable of much.",
"rows": 5,
"cols": 30
}
}}
{{>core_admin/setting_configtextarea}}
......@@ -15,7 +15,21 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configmulticheckbox.
@template core_admin/setting_configmulticheckbox
Admin multicheckbox setting template.
Context variables required for this template:
* name - form element name
* hasoptions - there are some options
* options - list of options containing name, key, id, checked, label
Example context (json):
{
"name": "test",
"hasoptions": true,
"options": [ { "name": "Option", "key": "k1", "id": "id0", "checked": true, "label": "Option label"} ]
}
}}
<div class="form-multicheckbox">
<input type="hidden" name="{{name}}[xxxxx]" value="1">
......
......@@ -15,7 +15,24 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configmultiselect.
@template core_admin/setting_configmultiselect
Admin multiselect setting template.
Context variables required for this template:
* name - form element name
* id - element id
* size - element size
* options - list of options containing name, value, selected
Example context (json):
{
"name": "test",
"id": "test0",
"size": "3",
"options": [ { "name": "Option 1", "value": "V", "selected": true },
{ "name": "Option 2", "value": "V", "selected": true } ]
}
}}
<div class="form-select">
<input type="hidden" name="{{name}}[xxxxx]" value="1">
......
......@@ -15,7 +15,23 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configpasswordunmask.
@template core_admin/setting_configpasswordunmask
Admin password unmask setting template.
Context variables required for this template:
* name - form element name
* size - form element size
* value - form element value
* id - element id
Example context (json):
{
"name": "test",
"id": "test0",
"size": "8",
"value": "secret"
}
}}
<div class="form-password">
<input type="password" name="{{name}}" size="{{size}}" id="{{id}}" value="{{value}}">
......
......@@ -15,7 +15,24 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configselect.
@template core_admin/setting_configselect
Admin select setting template.
Context variables required for this template:
* name - form element name
* id - element id
* options - list of options containing name, value, selected
Example context (json):
{
"name": "test",
"id": "test0",
"options": [
{ "name": "Option 1", "value": "V", "selected": true },
{ "name": "Option 2", "value": "V", "selected": true }
]
}
}}
<div class="form-select defaultsnext">
<select id="{{id}}" name="{{name}}">
......
......@@ -15,7 +15,27 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configtext.
@template core_admin/setting_configtext
Admin text setting template.
Context variables required for this template:
* name - form element name
* id - element id
* value - element value
* size - element size
* forceltr - always display as ltr
* attributes - list of additional attributes containing name, value
Example context (json):
{
"name": "test",
"id": "test0",
"value": "A tall, dark stranger will have more fun than you.",
"size": "21",
"forceltr": false,
"attributes": [ { "name": "readonly", "value": "readonly" } ]
}
}}
<div class="form-text defaultsnext">
<input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="{{#forceltr}}text-ltr{{/forceltr}}" {{#attributes}} {{name}}="{{value}}"{{/attributes}}>
......
......@@ -15,7 +15,26 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configtextarea.
@template core_admin/setting_configtextarea
Admin textarea setting template.
Context variables required for this template:
* name - form element name
* id - element id
* rows - number of rows
* cols - number of cols
* value - default value
* forceltr - always display as ltr
Example context (json):
{
"name": "test",
"cols": "30",
"rows": "3",
"value": "Excellent day for putting Slinkies on an escalator.",
"id": "test0"
}
}}
<div class="form-textarea">
<textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="{{#forceltr}}text-ltr{{/forceltr}}">{{value}}</textarea>
......
......@@ -15,7 +15,29 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting configtime.
@template core_admin/setting_configtime
Admin time setting template.
Context variables required for this template:
* name - form element name
* id - element id
* hours - list of valid hour options containing name, value, selected
* minutes - list of valid minute options containing name, value, selected
Example context (json):
{
"name": "test",
"id": "test0",
"minutes": [
{ "name": "00", "value": "0", "selected": true },
{ "name": "01", "value": "1", "selected": false }
],
"hours": [
{ "name": "1", "value": "1", "selected": true },
{ "name": "2", "value": "2", "selected": false }
]
}
}}
<div class="form-time defaultsnext text-ltr">
<label class="accesshide" for="{{id}}h">{{#str}}hours{{/str}}</label>
......
......@@ -15,7 +15,27 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting courselist_frontpage.
@template core_admin/setting_courselist_frontpage
Admin courselist_frontpage setting template.
Context variables required for this template:
* selects list of select objects containing id, name, key and options.
options is another nested list of items containing name, value and selected
Example context (json):
{
"selects": [
{
"id": "i1",
"name": "s1",
"key": "k1",
"options": [
{ "name": "Fish", "value": "snapper", "selected": true }
]
}
]
}
}}
<div class="form-group">
{{#selects}}
......
......@@ -15,7 +15,19 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting devicedetectregex.
@template core_admin/setting_devicedetectregex
Admin devicedetectregex setting template.
Context variables required for this template:
* expressions - List of expressions containing index, name, expression and value
Example context (json):
{
"expressions": [
{ "index": "i1", "name": "Name", "expression": "/bird|yellow/", "value": "Canary" }
]
}
}}
<table class="generaltable">
<thead>
......
......@@ -15,7 +15,22 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting emoticons.
@template core_admin/setting_emoticons
Admin emoticons setting template.
Context variables required for this template:
* name - form element name
* id - element id
Example context (json):
{
"emoticons": [
{ "fields": [
{ "name": "Smile", "field": "f1", "value": ":)" }
]}
]
}
}}
<div class="form-group">
<table id="emoticonsetting" class="admintable generaltable">
......
......@@ -15,7 +15,24 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Setting flag.
@template core_admin/setting_flag
Admin flag setting template.
Context variables required for this template:
* name - form element name
* value - form element value
* checked - is it checked
* id - element id
* label - element label
Example context (json):
{
"name": "test",
"id": "test0",
"checked": true,
"label": "Do you like crackers?"
}
}}
<input type="checkbox" name="{{name}}" value="{{value}}" id="{{id}}" {{#checked}}checked{{/checked}}>
<label for="{{id}}">{{label}}</label>
\ No newline at end of file
<label for="{{id}}">{{label}}</label>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment