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,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_admin_presets/export_import
Template for export and import options.
Example context (json):
{
"export":
{
"id": "button1",
"method": "get",
"url": "http://example.org/export",
"label": "Create preset",
"actions": []
},
"import":
{
"id": "button2",
"method": "get",
"url": "http://example.org/import",
"label": "Import preset",
"actions": []
}
}
}}
<div class="mt-2 mb-1 float-right">
{{#export}}{{> core/single_button}}{{/export}}
{{#import}}{{> core/single_button}}{{/import}}
</div>
@@ -0,0 +1,53 @@
{{!
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_admin_presets/local/tables/actual_value_settings_table
Template for actual setting value table.
Example context (json):
{
"caption": "Applied settings",
"settings": [
{
"plugin": "quiz",
"visiblename": "Decimal places in grades",
"visiblevalue": "2"
}
]
}
}}
<table class="generaltable boxaligncenter admin_presets_skipped">
<caption class="accesshide">{{{caption}}}</caption>
<thead>
<tr>
<th scope="col">{{#str}}settingname, tool_admin_presets{{/str}}</th>
<th scope="col">{{#str}}plugin{{/str}}</th>
<th scope="col">{{#str}}actualvalue, tool_admin_presets{{/str}}</th>
</tr>
</thead>
<tbody>
{{#settings}}
<tr>
<td>{{{visiblename}}}</td>
<td>{{{plugin}}}</td>
<td>{{{visiblevalue}}}</td>
</tr>
{{/settings}}
</tbody>
</table>
@@ -0,0 +1,66 @@
{{!
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_admin_presets/local/tables/old_and_new_value_settings_table
Template for setting comparison table, showing old and new values.
Context variables required for this template:
* beforeapplying - Whether the preset has been already applied or not.
Example context (json):
{
"caption": "Applied settings",
"settings": [
{
"plugin": "quiz",
"visiblename": "Decimal places in grades",
"oldvisiblevalue": "0",
"visiblevalue": "2"
}
]
}
}}
<table class="generaltable boxaligncenter admin_presets_applied">
<caption class="accesshide">{{{caption}}}</caption>
<thead>
<tr>
<th scope="col" class="w-50">{{#str}}settingname, tool_admin_presets{{/str}}</th>
<th scope="col" class="w-25">{{#str}}plugin{{/str}}</th>
<th scope="col">
{{^beforeapplying}}
{{#str}}oldvalue, tool_admin_presets{{/str}}
{{/beforeapplying}}
{{#beforeapplying}}
{{#str}}currentvalue, tool_admin_presets{{/str}}
{{/beforeapplying}}
</th>
<th scope="col">{{#str}}newvalue, tool_admin_presets{{/str}}</th>
</tr>
</thead>
<tbody>
{{#settings}}
<tr>
<td>{{{visiblename}}}</td>
<td>{{{plugin}}}</td>
<td>{{{oldvisiblevalue}}}</td>
<td>{{{visiblevalue}}}</td>
</tr>
{{/settings}}
</tbody>
</table>
@@ -0,0 +1,64 @@
{{!
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_admin_presets/preset_applications_list
Template for preset applications list.
Example context (json):
{
"noapplications": 0,
"applications": {
"show": 1,
"caption": "Applied settings",
"settings": [
{
"timeapplied": "Thursday, 9 September 2021, 3:18 PM",
"user": "Joseba Cilarte",
"action": "http://example.com/admin/tool/admin_presets/index.php?action=rollback&mode=execute&id=43"
}
]
}
}
}}
{{^noapplications}}
<div id="id_nopresets" class="box py-3 generalbox">
<p id="{{uniqid}}">{{#str}}nopresets, tool_admin_presets{{/str}}</p>
</div>
{{/noapplications}}
{{#noapplications}}
<table class="generaltable boxaligncenter">
<caption class="accesshide">{{#str}}presetapplicationslisttable, tool_admin_presets{{/str}}</caption>
<thead>
<tr>
<th scope="col">{{#str}}timeapplied, tool_admin_presets{{/str}}</th>
<th scope="col">{{#str}}user{{/str}}</th>
<th scope="col">{{#str}}actions{{/str}}</th>
</tr>
</thead>
<tbody>
{{#applications}}
<tr>
<td>{{{timeapplied}}}</td>
<td>{{{user}}}</td>
<td><a href="{{action}}">{{#str}}rollback, tool_admin_presets{{/str}}</a></td>
</tr>
{{/applications}}
</tbody>
</table>
{{/noapplications}}
@@ -0,0 +1,79 @@
{{!
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_admin_presets/presets_list
Template for presets list.
Context variables required for this template:
* nopresets - Whether presets list is empty or not.
* showactions - Whether the actions should be displayed or not.
* presets - Presets to display in the list, with information such as name, description or author.
Example context (json):
{
"nopresets": 0,
"showactions": 1
}
}}
{{#nopresets}}
<div id="id_nopresets" class="box py-3 generalbox">
<p id="{{uniqid}}">{{#str}}nopresets, tool_admin_presets{{/str}}</p>
</div>
{{/nopresets}}
{{^nopresets}}
<table class="generaltable boxaligncenter mb-5">
<caption class="accesshide">{{#str}}presetslisttable, tool_admin_presets{{/str}}</caption>
<thead>
<tr>
<th scope="col">{{#str}}name{{/str}}</th>
<th scope="col">{{#str}}description{{/str}}</th>
{{^showactions}}
<th scope="col">{{#str}}presetmoodlerelease, tool_admin_presets{{/str}}</th>
<th scope="col">{{#str}}author, tool_admin_presets{{/str}}</th>
<th scope="col">{{#str}}site, tool_admin_presets{{/str}}</th>
<th scope="col">{{#str}}created, tool_admin_presets{{/str}}</th>
<th scope="col">{{#str}}imported, tool_admin_presets{{/str}}</th>
{{/showactions}}
{{#showactions}}
<th scope="col" aria-label="{{#str}}actions{{/str}}"></th>
{{/showactions}}
</tr>
</thead>
<tbody>
{{#presets}}
<tr>
<td>{{{name}}}</td>
<td>{{{description}}}</td>
{{^showactions}}
<td>{{{release}}}</td>
<td>{{{author}}}</td>
<td>{{{site}}}</td>
<td>{{{timecreated}}}</td>
<td>{{{timeimported}}}</td>
{{/showactions}}
{{#showactions}}
<td>
{{#actions}}{{> core/action_menu}}{{/actions}}
</td>
{{/showactions}}
</tr>
{{/presets}}
</tbody>
</table>
{{/nopresets}}
@@ -0,0 +1,59 @@
{{!
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_admin_presets/settings_application
Template for preset loading result.
Example context (json):
{
"nopresets": 0,
"showactions": 1
}
}}
{{#appliedchanges.show}}
{{#appliedchanges.message}}
{{> core/notification_success}}
{{/appliedchanges.message}}
{{#appliedchanges.heading}}
<h3>{{{.}}}</h3>
{{/appliedchanges.heading}}
{{#appliedchanges}}{{> tool_admin_presets/local/tables/old_and_new_value_settings_table}}{{/appliedchanges}}
{{/appliedchanges.show}}
{{^appliedchanges.show}}
{{#appliedchanges}}
{{> core/notification_warning}}
{{/appliedchanges}}
{{/appliedchanges.show}}
{{#skippedchanges.show}}
{{#skippedchanges.heading}}
<h3>
<a data-toggle="collapse" href="#collapseSkippedChanges" role="button" aria-expanded="false" aria-controls="collapseSkippedChanges">
{{{.}}}
</a>
</h3>
{{/skippedchanges.heading}}
{{#skippedchanges}}
<div class="collapse" id="collapseSkippedChanges">
{{> tool_admin_presets/local/tables/actual_value_settings_table}}
</div>
{{/skippedchanges}}
{{/skippedchanges.show}}
@@ -0,0 +1,36 @@
{{!
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_admin_presets/settings_rollback
Template for rolling preset back result.
Example context (json):
{
"nopresets": 0,
"showactions": 1
}
}}
{{#appliedchanges.show}}
<div class="alert alert-success">{{#str}}rollbackresults, tool_admin_presets{{/str}}</div>
{{#appliedchanges}}{{> tool_admin_presets/local/tables/old_and_new_value_settings_table}}{{/appliedchanges}}
{{/appliedchanges.show}}
{{#skippedchanges.show}}
<div class="alert alert-info">{{#str}}rollbackfailures, tool_admin_presets{{/str}}</div>
{{#skippedchanges}}{{> tool_admin_presets/local/tables/old_and_new_value_settings_table}}{{/skippedchanges}}
{{/skippedchanges.show}}