Skip to content
Snippets Groups Projects
Commit 099e4826 authored by Dennis Ahrens's avatar Dennis Ahrens
Browse files

HsH Fiddles at this plugin. :-|

parent f276b0a2
Branches hsh_3.10
No related tags found
No related merge requests found
......@@ -57,6 +57,7 @@ class filter_opencast extends moodle_text_filter {
// Looking for tags.
$matches = preg_split('/(<[^>]*>)/i', $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
$loginhtml = '';
if ($matches) {
$renderer = $PAGE->get_renderer('filter_opencast');
......@@ -64,7 +65,7 @@ class filter_opencast extends moodle_text_filter {
$loggedin = true;
if (!self::$loginrendered) {
// Login and set cookie.
filter_opencast_login();
$loginhtml = filter_opencast_login();
$loggedin = false;
self::$loginrendered = true;
}
......@@ -113,6 +114,6 @@ class filter_opencast extends moodle_text_filter {
}
// Return the same string except processed by the above.
return $text;
return $loginhtml . $text;
}
}
......@@ -33,4 +33,3 @@ $string['setting_engageurl'] = 'URL of the Opencast Engage server';
$string['setting_engageurl_desc'] = 'If empty, the base URL of the admin tool is used.';
$string['setting_playerurl'] = 'URL of the Opencast player';
$string['setting_playerurl_desc'] = 'Relative URL of the Opencast player, e.g. /engage/theodul/ui/core.html for the Theodul Pass Player.';
\ No newline at end of file
$string['to_the_video'] = 'Watch the video';
\ No newline at end of file
......@@ -48,10 +48,12 @@ function filter_opencast_login() {
// Render form.
$renderer = $PAGE->get_renderer('filter_opencast');
echo $renderer->render_lti_form($endpoint, $params);
$html = $renderer->render_lti_form($endpoint, $params);
// Submit form.
$PAGE->requires->js_call_amd('filter_opencast/form', 'init');
return $html;
}
/**
......
......@@ -30,5 +30,5 @@
<iframe data-frameSrc="{{src}}" width="95%" height="455px" class="ocplayer" allowfullscreen="true"></iframe>
{{/loggedin}}
{{! Print the link to the video. }}
<a style="display:block;" target="_blank" href="{{link}}">{{#str}} to_the_video, filter_opencast {{/str}}</a>
<a style="display:block;" target="_blank" href="{{link}}">Zum Video</a>
......@@ -19,14 +19,14 @@
*
* @package filter
* @subpackage opencastfilter
* @copyright 2018 Tamara Gunkel, 2020 Nina Herrmann
* @copyright 2018 Tamara Gunkel
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->maturity = MATURITY_RC;
$plugin->version = 2018031902; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2018031904; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2017050500; // Requires this Moodle version.
$plugin->component = 'filter_opencast'; // Full name of the plugin.
$plugin->dependencies = array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment