Skip to content

Commit

Permalink
Merge pull request #399 from kaltura/MOODLE_400_DEV_ILMS_540
Browse files Browse the repository at this point in the history
Moodle 400 dev ilms 540
  • Loading branch information
roileviK authored Jun 5, 2023
2 parents 373b64b + 95164cf commit 9bce9e5
Show file tree
Hide file tree
Showing 25 changed files with 150 additions and 93 deletions.
8 changes: 4 additions & 4 deletions blocks/kalturamediagallery/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2022041905;
$plugin->release = 'Kaltura release 4.4.4';
$plugin->version = 2022041906;
$plugin->release = 'Kaltura release 4.4.5';
$plugin->requires = 2022041902;
$plugin->component = 'block_kalturamediagallery';
$plugin->dependencies = array(
'local_kaltura' => 2022041905,
'local_kalturamediagallery' => 2022041905
'local_kaltura' => 2022041906,
'local_kalturamediagallery' => 2022041906
);
2 changes: 1 addition & 1 deletion filter/kaltura/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function filter_kaltura_callback($link) {
'height' => $height,
'class' => 'kaltura-player-iframe',
'allowfullscreen' => 'true',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *;',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;',
'src' => $url->out(false),
'frameborder' => '0'
));
Expand Down
6 changes: 3 additions & 3 deletions filter/kaltura/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
*/
defined('MOODLE_INTERNAL') || die();

$plugin->version = 2022041905; //version date YYYYMMDDXX 10 represent 3.0 for future option to moodle use 2 digit version
$plugin->version = 2022041906; //version date YYYYMMDDXX 10 represent 3.0 for future option to moodle use 2 digit version
$plugin->component = 'filter_kaltura';
$plugin->release = 'Kaltura release 4.4.4';
$plugin->release = 'Kaltura release 4.4.5';
$plugin->requires = 2022041902;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array(
'local_kaltura' => 2022041905
'local_kaltura' => 2022041906
);
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$ltibrowseUrl = new moodle_url('ltibrowse.php', $params);
?>

<iframe allow="autoplay *; fullscreen *; encrypted-media *; camera *; microphone *;" id="kafIframe" src="<?php echo $ltibrowseUrl->out(); ?>" width="100%" height="600" style="border: 0;" allowfullscreen>
<iframe allow="autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;" id="kafIframe" src="<?php echo $ltibrowseUrl->out(); ?>" width="100%" height="600" style="border: 0;" allowfullscreen>
</iframe>
<script>
var buttonJs = window.opener.buttonJs;
Expand Down
6 changes: 3 additions & 3 deletions lib/editor/atto/plugins/kalturamedia/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2022041905; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 'Kaltura release 4.4.4';
$plugin->version = 2022041906; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 'Kaltura release 4.4.5';
$plugin->requires = 2022041902; // Requires this Moodle version.
$plugin->component = 'atto_kalturamedia'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array(
'local_kaltura' => 2022041905
'local_kaltura' => 2022041906
);
6 changes: 3 additions & 3 deletions lib/editor/tinymce/plugins/kalturamedia/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2022041905;
$plugin->release = 'Kaltura release 4.4.4';
$plugin->version = 2022041906;
$plugin->release = 'Kaltura release 4.4.5';
// Required Moodle version.
$plugin->requires = 2022041902;
// Full name of the plugin (used for diagnostics).
$plugin->component = 'tinymce_kalturamedia';
$plugin->dependencies = array(
'local_kaltura' => 2022041905
'local_kaltura' => 2022041906
);
50 changes: 25 additions & 25 deletions local/kaltura/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,38 @@
die('Direct access to this script is forbidden.');
}

$plugin->version = 2022041905;
$plugin->version = 2022041906;
$plugin->component = 'local_kaltura';
$plugin->release = 'Kaltura release 4.4.4';
$plugin->release = 'Kaltura release 4.4.5';
$plugin->requires = 2022041902;
$plugin->maturity = MATURITY_STABLE;

global $DB;
try {
global $DB;

$localKalturaPluginVersionRecord = $DB->get_records_select('config_plugins', "plugin = 'local_kaltura' AND name = 'version'");
$localKalturaPluginVersionRecord = $DB->get_records_select('config_plugins', "plugin = 'local_kaltura' AND name = 'version'");

$kalturaPluginVersion = "";
if ($localKalturaPluginVersionRecord) {
$localKalturaPluginVersionRecordValue = array_pop($localKalturaPluginVersionRecord);
$kalturaPluginVersion = $localKalturaPluginVersionRecordValue->value;
}
$kalturaPluginVersion = "";
if ($localKalturaPluginVersionRecord) {
$localKalturaPluginVersionRecordValue = array_pop($localKalturaPluginVersionRecord);
$kalturaPluginVersion = $localKalturaPluginVersionRecordValue->value;
}

$updatedVersion = null;
if ($kalturaPluginVersion == 20210620311) {
$updatedVersion = 2021051700;
}
else if ($kalturaPluginVersion == 20201215310 || $kalturaPluginVersion == 20210620310) {
$updatedVersion = 2020110900;
}
else if ($kalturaPluginVersion == 2020070539 || $kalturaPluginVersion == 2020121539 || $kalturaPluginVersion == 2021062039) {
$updatedVersion = 2020061500;
}
$updatedVersion = null;
if ($kalturaPluginVersion == 20210620311) {
$updatedVersion = 2021051700;
} else if ($kalturaPluginVersion == 20201215310 || $kalturaPluginVersion == 20210620310) {
$updatedVersion = 2020110900;
} else if ($kalturaPluginVersion == 2020070539 || $kalturaPluginVersion == 2020121539 || $kalturaPluginVersion == 2021062039) {
$updatedVersion = 2020061500;
}

if (!empty($updatedVersion)) {
$pluginsRecords = $DB->get_records_select('config_plugins', "plugin in ('local_kaltura', 'local_kalturamediagallery', 'local_mymedia', 'atto_kalturamedia','block_kalturamediagallery','filter_kaltura','tinymce_kalturamedia','mod_kalvidassign','mod_kalvidres') AND name = 'version' AND value = '$kalturaPluginVersion'");
if (!empty($updatedVersion)) {
$pluginsRecords = $DB->get_records_select('config_plugins', "plugin in ('local_kaltura', 'local_kalturamediagallery', 'local_mymedia', 'atto_kalturamedia','block_kalturamediagallery','filter_kaltura','tinymce_kalturamedia','mod_kalvidassign','mod_kalvidres') AND name = 'version' AND value = '$kalturaPluginVersion'");

foreach ($pluginsRecords as $record) {
$record->value = $updatedVersion;
$DB->update_record('config_plugins', $record);
foreach ($pluginsRecords as $record) {
$record->value = $updatedVersion;
$DB->update_record('config_plugins', $record);
}
}
}
} catch (Exception $e) {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
YUI.add('moodle-local_kaltura-ltitinymcepanel', function (Y, NAME) {

YUI.add('moodle-local_kaltura-ltitinymcepanel', function (Y, NAME) {

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -74,7 +74,7 @@ Y.extend(LTITINYMCEPANEL, Y.Base, {
this.contextid = Y.one('#lti_launch_context_id').get('value');
}

var content = '<iframe id="lti_view_element" height="'+iframeheight+'px" width="100%" src="'+url+'&amp;contextid='+this.contextid+'" allow="autoplay *; fullscreen *; encrypted-media *; camera *; microphone *;"></iframe>';
var content = '<iframe id="lti_view_element" height="'+iframeheight+'px" width="100%" src="'+url+'&amp;contextid='+this.contextid+'" allow="autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;"></iframe>';
Y.one('#'+iframeid).setContent(content);
},

Expand Down Expand Up @@ -128,6 +128,6 @@ M.local_kaltura = M.local_kaltura || {};
M.local_kaltura.init = function(params) {
return new LTITINYMCEPANEL(params);
};


}, '@VERSION@', {"requires": ["base", "node", "panel", "node-event-simulate"]});


}, '@VERSION@', {"requires": ["base", "node", "panel", "node-event-simulate"]});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
YUI.add('moodle-local_kaltura-ltitinymcepanel', function (Y, NAME) {

YUI.add('moodle-local_kaltura-ltitinymcepanel', function (Y, NAME) {

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -74,7 +74,7 @@ Y.extend(LTITINYMCEPANEL, Y.Base, {
this.contextid = Y.one('#lti_launch_context_id').get('value');
}

var content = '<iframe id="lti_view_element" height="'+iframeheight+'px" width="100%" src="'+url+'&amp;contextid='+this.contextid+'" allow="autoplay *; fullscreen *; encrypted-media *; camera *; microphone *;"></iframe>';
var content = '<iframe id="lti_view_element" height="'+iframeheight+'px" width="100%" src="'+url+'&amp;contextid='+this.contextid+'" allow="autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;"></iframe>';
Y.one('#'+iframeid).setContent(content);
},

Expand Down Expand Up @@ -128,6 +128,6 @@ M.local_kaltura = M.local_kaltura || {};
M.local_kaltura.init = function(params) {
return new LTITINYMCEPANEL(params);
};


}, '@VERSION@', {"requires": ["base", "node", "panel", "node-event-simulate"]});


}, '@VERSION@', {"requires": ["base", "node", "panel", "node-event-simulate"]});
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Y.extend(LTITINYMCEPANEL, Y.Base, {
this.contextid = Y.one('#lti_launch_context_id').get('value');
}

var content = '<iframe id="lti_view_element" height="'+iframeheight+'px" width="100%" src="'+url+'&amp;contextid='+this.contextid+'" allow="autoplay *; fullscreen *; encrypted-media *; camera *; microphone *;"></iframe>';
var content = '<iframe id="lti_view_element" height="'+iframeheight+'px" width="100%" src="'+url+'&amp;contextid='+this.contextid+'" allow="autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;"></iframe>';
Y.one('#'+iframeid).setContent(content);
},

Expand Down
6 changes: 3 additions & 3 deletions local/kalturamediagallery/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
die('Direct access to this script is forbidden.');
}

$plugin->version = 2022041905;
$plugin->version = 2022041906;
$plugin->component = 'local_kalturamediagallery';
$plugin->release = 'Kaltura release 4.4.4';
$plugin->release = 'Kaltura release 4.4.5';
$plugin->requires = 2022041902;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array(
'local_kaltura' => 2022041905
'local_kaltura' => 2022041906
);
5 changes: 5 additions & 0 deletions local/mymedia/lang/en/local_mymedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@
$string['mymedia:view'] = 'View My Media page';
$string['nav_mymedia'] = 'My Media';
$string['pluginname'] = 'My Media';
$string['setting_heading_desc'] = 'Settings';
$string['link_location'] = 'Link location';
$string['link_location_desc'] = 'Choose where My Media link is displayed';
$string['link_location_top_menu'] = 'Top navigation menu';
$string['link_location_side_menu'] = 'Side navigation menu';
$string['privacy:metadata'] = 'My Media plugin does not store any personal data.';
29 changes: 17 additions & 12 deletions local/mymedia/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
* @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net
*/

define('LOCAL_KALTURAMYMEDIA_LINK_LOCATION_TOP_NAVIGATION_MENU', 0);
define('LOCAL_KALTURAMYMEDIA_LINK_LOCATION_SIDE_NAVIGATION_MENU', 1);

/**
* This function adds my media links to the navigation block
* @param global_navigation $navigation a global_navigation object
Expand All @@ -44,23 +47,25 @@ function local_mymedia_extend_navigation($navigation) {
}
}

$nodehome = $navigation->get('home');
if (empty($nodehome)){
$nodehome = $navigation;
}
$context = context_user::instance($USER->id);

if (!has_capability('local/mymedia:view', $context, $USER)) {
return;
}

$menuHeaderStr = get_string('nav_mymedia', 'local_mymedia');

if (strpos($CFG->custommenuitems,$menuHeaderStr) !== false) {
//My Media is already part of the config, no need to add it again.
return;
}
if (get_config('local_mymedia', 'link_location') == LOCAL_KALTURAMYMEDIA_LINK_LOCATION_SIDE_NAVIGATION_MENU) {
$nodehome = $navigation->get('home');
if (empty($nodehome)){
$nodehome = $navigation;
}
$mymedia = get_string('nav_mymedia', 'local_mymedia');
$icon = new pix_icon('my-media', '', 'local_mymedia');
$nodemymedia = $nodehome->add($mymedia, new moodle_url('/local/mymedia/mymedia.php'), navigation_node::NODETYPE_LEAF, $mymedia, 'mymedia', $icon);
$nodemymedia->showinflatnavigation = true;
return;
}

$myMediaStr = "\n$menuHeaderStr|/local/mymedia/mymedia.php";
$CFG->custommenuitems .= $myMediaStr;
$menuHeaderStr = get_string('nav_mymedia', 'local_mymedia');
$myMediaStr = "\n$menuHeaderStr|/local/mymedia/mymedia.php";
$CFG->custommenuitems .= $myMediaStr;
}
2 changes: 1 addition & 1 deletion local/mymedia/mymedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'width' => '100%',
'allowfullscreen' => 'true',
'src' => 'lti_launch.php',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *;',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;',
);
echo html_writer::tag('iframe', '', $attr);

Expand Down
57 changes: 57 additions & 0 deletions local/mymedia/settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?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/>.

/*
* @package local
* @subpackage mymedia
*
*/

defined('MOODLE_INTERNAL') || die('Invalid access');

global $CFG;
require_once $CFG->dirroot. '/local/mymedia/lib.php';

if ($hassiteconfig) {
$settings = new admin_settingpage(
'local_mymedia',
get_string('pluginname', 'local_mymedia')
);

//heading
$setting = new admin_setting_heading(
'heading',
'', get_string('setting_heading_desc', 'local_mymedia')
);
$setting->plugin = 'local_mymedia';
$settings->add($setting);

//link location
$setting = new admin_setting_configselect(
'link_location',
get_string('link_location', 'local_mymedia'),
get_string('link_location_desc', 'local_mymedia'),
LOCAL_KALTURAMYMEDIA_LINK_LOCATION_TOP_NAVIGATION_MENU,
array(
LOCAL_KALTURAMYMEDIA_LINK_LOCATION_TOP_NAVIGATION_MENU => get_string('link_location_top_menu', 'local_mymedia'),
LOCAL_KALTURAMYMEDIA_LINK_LOCATION_SIDE_NAVIGATION_MENU => get_string('link_location_side_menu', 'local_mymedia'),
)
);
$setting->plugin = 'local_mymedia';
$settings->add($setting);

$ADMIN->add('localplugins', $settings);
}
6 changes: 3 additions & 3 deletions local/mymedia/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
die('Direct access to this script is forbidden.');
}

$plugin->version = 2022041905;
$plugin->version = 2022041906;
$plugin->component = 'local_mymedia';
$plugin->release = 'Kaltura release 4.4.4';
$plugin->release = 'Kaltura release 4.4.5';
$plugin->requires = 2022041902;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array(
'local_kaltura' => 2022041905
'local_kaltura' => 2022041906
);
2 changes: 1 addition & 1 deletion mod/kalvidassign/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ public function display_video_container_markup($submission, $courseid, $cmid) {
'class' => 'kaltura-player-iframe',
'src' => ($url instanceof moodle_url) ? $url->out(false) : '',
'allowfullscreen' => 'true',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *;',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;',
'height' => '100%',
'width' => !empty($submission->width) ? $submission->width : ''
);
Expand Down
2 changes: 1 addition & 1 deletion mod/kalvidassign/single_submission_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function definition() {
'height' => $submission->height,
'width' => $submission->width,
'allowfullscreen' => 'true',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *;',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;',
);
$mform->addElement('html', html_writer::tag('iframe', '', $attr));
}
Expand Down
6 changes: 3 additions & 3 deletions mod/kalvidassign/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
die('Direct access to this script is forbidden.');
}

$plugin->version = 2022041905;
$plugin->version = 2022041906;
$plugin->component = 'mod_kalvidassign';
$plugin->release = 'Kaltura release 4.4.4';
$plugin->release = 'Kaltura release 4.4.5';
$plugin->requires = 2022041902;
$plugin->cron = 0;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array(
'local_kaltura' => 2022041905,
'local_kaltura' => 2022041906,
);
Loading

0 comments on commit 9bce9e5

Please sign in to comment.