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
+34
View File
@@ -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 <http://www.gnu.org/licenses/>.
}}
{{!
@template core_h5p/h5pdiv
This template will render an div for h5p content.
Variables required for this template:
* h5pid - The database id for the H5P content
Example context (json):
{
"h5pid": 123
}
}}
<div class="h5p-content-wrapper">
<div class="h5p-content" data-content-id="{{h5pid}}"></div>
</div>
+45
View File
@@ -0,0 +1,45 @@
{{!
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 core_h5p/h5peditor
Displays the H5P Editor form.
Classes required for JS:
* editor_display
Data attributes required for JS:
* none
Context variables required for this template:
* none
Example context (json):
{
}
}}
<div class="h5p-editor-wrapper" id="editor-region-{{uniqid}}">
<div class="h5p-editor">
{{> core/loading }}
</div>
</div>
<div class="h5p-editor-upload"></div>
{{#js}}
require(['core_h5p/editor_display'], function(Editor) {
Editor.init("editor-region-{{uniqid}}");
});
{{/js}}
+71
View File
@@ -0,0 +1,71 @@
{{!
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 core_h5p/h5pembed
This template will render the embed code shown in the H5P content embed popup.
H5P implements iframe autoheight but if the content is not available it does
not work and we need ensure a minimum height using javascript. Otherwise the user
will not see the error.
Variables required for this template:
* embedurl - The URL with the H5P file to embed
* editurl - The URL for the edit button; if it's empty, the edit button won't be displayed.
Example context (json):
{
"embedurl": "http://example.com/h5p/embed.php?url=testurl",
"editurl": "http://example.com/h5p/embed.php?url=testurl&edit=1",
"extraactions": [
{
"text": "View attempts (2)",
"url": "http://example.com/mod/h5pactivity/report.php?a=1",
"icon": {
"key": "i\/chartbar",
"component": "core",
"title": ""
}
}
]
}
}}
<div class="d-flex justify-content-end mb-3">
{{#extraactions}}
<a href="{{url}}" class="btn text-primary">
{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}
{{text}}
</a>
{{/extraactions}}
{{#editurl}}
<a href="{{editurl}}" class="btn text-primary">
{{#pix}}i/edit, core{{/pix}}
{{#str}}editcontent, core_h5p{{/str}}
</a>
{{/editurl}}
</div>
<iframe
src="{{embedurl}}"
name="h5player"
width=":w"
height=":h"
allowfullscreen="allowfullscreen"
class="h5p-player w-100 border-0"
style="height: 0px;"
id="{{uniqid}}-h5player"
></iframe>
+69
View File
@@ -0,0 +1,69 @@
{{!
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 core_h5p/h5perror
This template will render the embed code shown in the H5P content embed popup.
Note: this mustache is part of the H5P player and requires '/h5p/js/embed.js' already loaded.
Variables required for this template:
* h5picon - The icon
* message - The error messages to display.
Example context (json):
{
"embedurl": "http://example.com/h5p/embed.php?url=testurl"
}
}}
<div class="d-flex h-100 position-relative align-items-center bg-light h5pmessages">
<div class="position-absolute py-2 bg-secondary" style="top: 0px; left: 0px; right: 0px;">
<div class="container">
{{#h5picon}}
<img src="{{{.}}}" class="h5picon" alt="{{#str}}h5p, core_h5p{{/str}}" style="width: 50px; height: auto; opacity: 0.5">
{{/h5picon}}
</div>
</div>
<div class="container mt-5">
{{#exception}}
<div class="alert alert-block fade in alert-danger my-2" role="alert">
{{ . }}
</div>
{{/exception}}
{{#info}}
<div class="alert alert-block fade in alert-info my-2" role="alert">
{{ . }}
</div>
{{/info}}
{{#error}}
<div class="alert alert-block fade in alert-warning my-2" role="alert">
{{#code}} {{ . }} : {{/code}} {{ message }}
</div>
{{/error}}
</div>
</div>
{{#js}}
(function() {
if (typeof H5PEmbedCommunicator !== 'undefined') {
H5PEmbedCommunicator.send('resize', {
scrollHeight: document.body.scrollHeight
});
}
})();
{{/js}}
+35
View File
@@ -0,0 +1,35 @@
{{!
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 core_h5p/h5piframe
This template will render an iframe for h5p content.
Variables required for this template:
* h5pid - The database id for the H5P content
Example context (json):
{
"h5pid": 123
}
}}
<div class="h5p-iframe-wrapper">
<iframe id="h5p-iframe-{{h5pid}}" class="h5p-iframe" data-content-id="{{h5pid}}"
style="height:1px; min-width: 100%" src="about:blank">
</iframe>
</div>
+148
View File
@@ -0,0 +1,148 @@
{{!
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 core_h5p/h5plibraries
Example context (json):
{
"contenttypes": [
{
"title": "Accordion",
"major_version": 1,
"minor_version:": 0,
"patch_version:": 0,
"runnable": 1,
"icon": "icon.svg",
"enabled": true,
"toggleenabledurl": "http://myserver.cat/h5p/libraries.php?id=26&action=disable"
},
{
"title": "Collage",
"major_version": 0,
"minor_version:": 3,
"patch_version:": 1,
"runnable": 1,
"enabled": true,
"toggleenabledurl": "http://myserver.cat/h5p/libraries.php?id=37&action=disable"
},
{
"title": "FontAwesome",
"major_version": 4,
"minor_version:": 5,
"patch_version:": 0,
"runnable": 1,
"icon": "icon.svg",
"enabled": false,
"toggleenabledurl": "http://myserver.cat/h5p/libraries.php?id=54&action=enable"
}
]
}
}}
<h3 class="mt-3">{{#str}} installedh5p, h5p {{/str}}</h3>
<ul class="nav nav-tabs mb-3" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="contenttypes-tab" data-toggle="tab" href="#contenttypes" role="tab" aria-controls="contenttypes" aria-selected="true">
{{#str}} installedcontenttypes, h5p {{/str}}
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="libraries-tab" data-toggle="tab" href="#libraries" role="tab" aria-controls="libraries" aria-selected="false">
{{#str}} installedcontentlibraries, h5p {{/str}}
</a>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="contenttypes" role="tabpanel" aria-labelledby="contenttypes-tab">
<div class="overview px-3 mb-5">
<table class="admintable generaltable" id="h5pcontenttypes">
<thead>
<tr>
<th style="width: 5%">{{#str}}enable, core{{/str}}</th>
<th>{{#str}}description, core{{/str}}</th>
<th>{{#str}}version, core{{/str}}</th>
<th aria-label="{{#str}}actions, core_h5p{{/str}}"></th>
</tr>
</thead>
<tbody>
{{#contenttypes}}
{{#runnable}}
<tr class="">
<td class="text-center">
{{#enabled}}
<a href="{{{toggleenabledurl}}}" aria-label="{{#str}}disable, core{{/str}}">{{#pix}}t/hide, core,{{#str}}disable{{/str}}{{/pix}}</a>
{{/enabled}}
{{^enabled}}
<a href="{{{toggleenabledurl}}}" aria-label="{{#str}}enable, core{{/str}}">{{#pix}}t/show, core,{{#str}}enable{{/str}}{{/pix}}</a>
{{/enabled}}
</td>
<td>
{{#icon}}
<img alt=""
class="icon iconsize-big"
src="{{{ icon }}}">
{{/icon}}
{{^icon}}
{{#pix}} b/h5p_library, core {{/pix}}
{{/icon}}
{{{ title }}}
</td>
<td>{{{ major_version }}}.{{{ minor_version }}}.{{{ patch_version }}}</td>
<td>
{{#actionmenu}}
{{>core/action_menu}}
{{/actionmenu}}
</td>
</tr>
{{/runnable}}
{{/contenttypes}}
</tbody>
</table>
</div>
</div>
<div class="tab-pane fade" id="libraries" role="tabpanel" aria-labelledby="libraries-tab">
<div class="overview px-3 mb-5">
<table class="admintable generaltable" id="h5plibraries">
<thead>
<tr>
<th>{{#str}}description, core{{/str}}</th>
<th>{{#str}}version, core{{/str}}</th>
<th aria-label="{{#str}}actions, core_h5p{{/str}}"></th>
</tr>
</thead>
<tbody>
{{#contenttypes}}
{{^runnable}}
<tr class="">
<td>
{{{ title }}}
</td>
<td>{{{ major_version }}}.{{{ minor_version }}}.{{{ patch_version }}}</td>
<td>
{{#actionmenu}}
{{>core/action_menu}}
{{/actionmenu}}
</td>
</tr>
{{/runnable}}
{{/contenttypes}}
</tbody>
</table>
</div>
</div>
</div>
+32
View File
@@ -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 <http://www.gnu.org/licenses/>.
}}
{{!
@template core_h5p/h5presize
This template will render the resize JS code.
Variables required for this template:
* resizeurl - The database id for the H5P content
Example context (json):
{
"resizeurl": "http://example.com/lib/h5p/js/h5p-resizer.js"
}
}}
<script src="{{resizeurl}}"></script>
+62
View File
@@ -0,0 +1,62 @@
{{!
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 core_h5p/h5ptoolsoverview
Example context (json):
{
"tools": [
{
"tool": "h5ptasks",
"tool_description": "h5ptasks_description",
"link": "https://example.com/admin/tool/task/scheduledtasks.php",
"status": "On",
"status_class": "bade bg-success text-white",
"status_action": "<a href=\"admin/tool/task/schedule_task.php?task=core_task_h5p_get_content_types_task\">Run now</a>"
},
{
"tool": "h5ptasks",
"tool_description": "h5ptasks_description",
"link": "https://example.com/admin/filters.php",
"status": "Off",
"status_class": "bade bg-danger text-white"
}
]
}
}}
<table class="admintable generaltable" id="h5ptools">
<thead>
<tr>
<th>{{#str}} feature, h5p {{/str}}</th>
<th class="text-center">{{#str}} status, h5p {{/str}}</th>
<th>{{#str}} description, h5p {{/str}}</th>
</tr>
</thead>
<tbody>
{{#tools}}
<tr class="">
<td><a href="{{{ link }}}" title="{{#str}} settings {{/str}}">{{{ tool }}}</a></td>
<td class="text-center">
<div class="{{{ status_class }}}">{{{ status }}}</div>
{{#status_action}}<div>{{{ status_action }}}</div>{{/status_action}}
</td>
<td>{{{ tool_description }}}</td>
</tr>
{{/tools}}
</tbody>
</table>