first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,50 @@
{{!
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 <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_templatelibrary/display_template
Moodle template to display another template.
The purpose of this template is to put scafolding in the page, so the javascript can fetch templates and
insert them into this part of the page.
Classes required for JS:
* none
Data attributes required for JS:
* data-region
Context variables required for this template:
* none
Example context (json):
{ }
}}
<div data-region="displaytemplate">
<h3 data-region="displaytemplateheader">{{#str}}notemplateselected, tool_templatelibrary{{/str}}</h3>
<div>
<h4>{{#str}}example, tool_templatelibrary{{/str}}</h4>
<div data-region="displaytemplateexample">
-
</div>
</div>
<div>
<h4>{{#str}}documentation, tool_templatelibrary{{/str}}</h4>
<pre data-region="displaytemplatesource"> - </pre>
</div>
</div>
@@ -0,0 +1,108 @@
{{!
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 <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_templatelibrary/list_templates_page
Moodle template to the template library
The purpose of this template is build the entire page for the template library (by including smaller templates).
Classes required for JS:
* none
Data attributes required for JS:
* data-region, data-field
Context variables required for this template:
* allcomponents - array of components containing templates. Each component has a name and a component attribute.
}}
{{!
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 <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_templatelibrary/list_templates_page
Moodle template to the template library
The purpose of this template is build the entire page for the template library (by including smaller templates).
Classes required for JS:
* none
Data attributes required for JS:
* data-region, data-field
Context variables required for this template:
* allcomponents - array of components containing templates. Each component has a name and a component attribute.
}}
<div data-region="list-templates">
<form class="form-horizontal">
{{< core_form/element-template }}
{{$label}}
<div class="col-form-label">{{#str}}component, tool_templatelibrary{{/str}}</div>
{{/label}}
{{$element}}
<select id="selectcomponent" name="component" class="form-control" data-field="component">
<option value="">{{#str}}all, tool_templatelibrary{{/str}}</option>
{{#allcomponents}}
<optgroup label="{{type}}">
{{#plugins}}
<option value="{{component}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/plugins}}
</optgroup>
{{/allcomponents}}
</select>
{{/element}}
{{/ core_form/element-template }}
{{< core_form/element-template }}
{{$element}}
{{< core/search_input_auto }}
{{$label}}
{{#str}} search, tool_templatelibrary {{/str}}
{{/label}}
{{$value}}{{ search }}{{/value}}
{{/ core/search_input_auto }}
{{/element}}
{{/ core_form/element-template }}
</form>
<hr/>
{{> tool_templatelibrary/search_results }}
<hr/>
{{> tool_templatelibrary/display_template }}
</div>
{{#js}}
require(['tool_templatelibrary/search', 'tool_templatelibrary/display']);
{{/js}}
@@ -0,0 +1,46 @@
{{!
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 <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_templatelibrary/search_results
Moodle template to display results of template search.
This template gets rendered by javascript when it has searched for templates.
Classes required for JS:
* none
Data attributes required for JS:
* data-region, data-templatename
Context variables required for this template:
* templates - And array of template names.
Example context (json):
{ "templates" : [ "core/pix_icon", "tool_templatelibrary/display_template" ] }
}}
<div data-region="searchresults" aria-live="off" class="no-overflow" style="max-height: 10em">
{{^templates}}
<p class="text-warning">{{#str}}noresults, tool_templatelibrary{{/str}}</p>
{{/templates}}
<ul>
{{#templates}}
<li data-templatename="{{.}}"><a href="#">{{.}}</a></li>
{{/templates}}
</ul>
</div>