-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Thies
committed
Feb 8, 2024
1 parent
2f09bab
commit 15252ff
Showing
19 changed files
with
260 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
// 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/>. | ||
|
||
/** | ||
* Renderer for tool_mediatime | ||
* | ||
* @package tool_mediatime | ||
* @copyright 2024 bdecent gmbh <https://bdecent.de> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace tool_mediatime\output; | ||
|
||
use plugin_renderer_base; | ||
use renderable; | ||
|
||
/** | ||
* Renderer for tool_mediatime | ||
* | ||
* @copyright 2024 bdecent gmbh <https://bdecent.de> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class renderer extends plugin_renderer_base { | ||
|
||
/** | ||
* Overrides the parent so that templatable widgets are handled even without their explicit render method. | ||
* | ||
* @param renderable $widget | ||
* @return string | ||
* @throws \moodle_exception | ||
*/ | ||
public function render(renderable $widget) { | ||
|
||
$namespacedclassname = get_class($widget); | ||
$parts = []; | ||
if ($parts = explode('\\', $namespacedclassname)) { | ||
$plainclassname = $parts[array_key_last($parts)]; | ||
$namespacecomponent = $parts[array_key_first($parts)]; | ||
$rendermethod = 'render_'.$plainclassname; | ||
|
||
if (method_exists($this, $rendermethod)) { | ||
// Explicit rendering method exists, fall back to the default behaviour. | ||
return parent::render($widget); | ||
} | ||
|
||
$interfaces = class_implements($namespacedclassname); | ||
|
||
if (isset($interfaces['templatable'])) { | ||
// Default implementation of template-based rendering. | ||
$data = $widget->export_for_template($this); | ||
|
||
if (method_exists($widget, 'get_template_name')) { | ||
$templatename = $widget->get_template_name(); | ||
} else { | ||
$templatename = $plainclassname; | ||
} | ||
|
||
if (method_exists($widget, 'get_component_name')) { | ||
$component = $widget->get_component_name(); | ||
} else if (count($parts) > 1) { | ||
$component = $namespacecomponent; | ||
} else { | ||
$component = 'core'; | ||
} | ||
|
||
return parent::render_from_template($component . '/' . $templatename, $data); | ||
|
||
} else { | ||
return parent::render($widget); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
// 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/>. | ||
|
||
/** | ||
* Subplugin definitions for the Video Time module. | ||
* | ||
* @package tool_mediatime | ||
* @copyright 2024 bdecent gmbh <https://bdecent.de> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
$subplugins = (array) json_decode(file_get_contents(__DIR__ . "/subplugins.json"))->plugintypes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
define([], function () { | ||
window.requirejs.config({ | ||
paths: { | ||
"tus": M.cfg.wwwroot + '/admin/tool/mediatime/source/streamio/js/tus', | ||
}, | ||
shim: { | ||
'tus': {exports: 'tus'}, | ||
} | ||
}); | ||
}); |
Oops, something went wrong.