Skip to content

Commit

Permalink
Merge pull request #50 from kaltura/MOODLE_27_DEV
Browse files Browse the repository at this point in the history
Merge 2.7 DEV branch into STABLE
  • Loading branch information
gonenradai committed Sep 21, 2015
2 parents f4414ee + 7669a41 commit 75b5d8d
Show file tree
Hide file tree
Showing 47 changed files with 659 additions and 85 deletions.
6 changes: 3 additions & 3 deletions filter/kaltura/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
*/
defined('MOODLE_INTERNAL') || die();

$plugin->version = 2015021107;
$plugin->release = 'Kaltura release 4.0.04';
$plugin->version = 2015090707;
$plugin->release = 'Kaltura release 4.0.07';
$plugin->requires = 2014050800;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array(
'local_kaltura' => 2015021107
'local_kaltura' => 2015090707
);
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 = 2015021107; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 'Kaltura release 4.0.04';
$plugin->version = 2015090707; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 'Kaltura release 4.0.07';
$plugin->requires = 2014050800; // Requires this Moodle version.
$plugin->component = 'atto_kalturamedia'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array(
'local_kaltura' => 2015021107
'local_kaltura' => 2015090707
);
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ function insertMedia() {
var url = '';
var parser = document.createElement('a');
parser.href = form.source.value;
url = token + parser.pathname + parser.search;
var elementPathName = parser.pathname.charAt(0) == '/' ? parser.pathname : '/' + parser.pathname;
url = token + elementPathName + parser.search;
var content = '<a href="http://'+url+'">tinymce-kalturamedia-embed||'+form.video_title.value+'||'+form.width.value+'||'+form.height.value+'</a>';
ed.execCommand('mceInsertContent', false, content);
tinyMCEPopup.close();
Expand Down
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 = 2015021107;
$plugin->release = 'Kaltura release 4.0.04';
$plugin->version = 2015090707;
$plugin->release = 'Kaltura release 4.0.07';
// Required Moodle version.
$plugin->requires = 2014050800;
// Full name of the plugin (used for diagnostics).
$plugin->component = 'tinymce_kalturamedia';
$plugin->dependencies = array(
'local_kaltura' => 2015021107
'local_kaltura' => 2015090707
);
3 changes: 2 additions & 1 deletion local/kaltura/attobsepreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
$PAGE->set_pagelayout('embedded');
echo $OUTPUT->header();
$playurl = urldecode($url);

echo html_writer::tag('h2', get_string('preview', 'local_kaltura'));
?>
<h2>Preview</h2>
<div id="KalturaAttoPreview"></div>
<script>
var data = {
Expand Down
6 changes: 3 additions & 3 deletions local/kaltura/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ function xmldb_local_kaltura_upgrade($oldversion) {
}

// Kaltura savepoint reached.
upgrade_plugin_savepoint(true, 2015021107, 'local', 'kaltura');
upgrade_plugin_savepoint(true, 2015090707, 'local', 'kaltura');
$savePointDone = true;
}

if (!$savePointDone && $oldversion < 2015021107) {
if (!$savePointDone && $oldversion < 2015090707) {
// Kaltura savepoint reached.
upgrade_plugin_savepoint(true, 2015021107, 'local', 'kaltura');
upgrade_plugin_savepoint(true, 2015090707, 'local', 'kaltura');
}
return true;
}
3 changes: 2 additions & 1 deletion local/kaltura/download_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
$output = fopen('php://output', 'w');

// output the column headings
fputcsv($output, array('Request/Response', 'Time', 'Module', 'Endpoint', 'Data (JSON)'));
fputcsv($output, array(get_string('request', 'local_kaltura'), get_string('time', 'local_kaltura'),
get_string('module', 'local_kaltura'), get_string('endpoint', 'local_kaltura'), get_string('data', 'local_kaltura')));

foreach ($rs as $record) {
$record->data = json_encode(unserialize($record->data));
Expand Down
6 changes: 6 additions & 0 deletions local/kaltura/lang/en/local_kaltura.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
$string['admin_secret_desc'] = 'Enter the admin secret for your account.';
$string['cancelbtn'] = 'Cancel';
$string['categories_created'] = 'Number of categories created:';
$string['data'] = 'Data (JSON)';
$string['delete_logs'] = 'Purge all logs';
$string['download_logs_title'] = 'Download logs';
$string['download_log_range'] = 'Download logs newer than selected date';
$string['endpoint'] = 'Endpoint';
$string['entries_migrated'] = 'The number of entries migrated:';
$string['insertbtn'] = 'Embed media';
$string['invalid_url'] = 'Invalid URL';
Expand All @@ -53,14 +55,18 @@
$string['migration_start_over_redirect'] = 'The migration statistics and last known location has been restarted.';
$string['migration_start_time'] = 'The migration was originally started at:';
$string['missing_required_info'] = 'Warning: the Partner id or Admin secret is empty. The Kaltura plug-ins will not work.';
$string['module'] = 'Module';
$string['no_records'] = 'No records returned.';
$string['original_kafcategory'] = 'The KAF category selected for migration.';
$string['partner_id'] = 'Partner id';
$string['partner_id_desc'] = 'Enter the partner id for your account.';
$string['pluginname'] = 'Kaltura package libraries';
$string['preview'] = 'Preview';
$string['records_deleted'] = 'All Kaltura log records were deleted.';
$string['request'] = 'Request/Response';
$string['server_uri'] = 'Server URI';
$string['server_uri_desc'] = 'Type in the server URI you want to connect to. Otherwise just type in the default settings (This setting is used for migration purposes).';
$string['startover'] = 'Restart migration';
$string['time'] = 'Time';
$string['trace_log'] = 'Enable trace logging';
$string['trace_log_desc'] = 'If enabled, all requests and responses to and from Kaltura are logged. These logs can be used by Kaltura support to diagnose any problems encountered. Enabling this setting may affect Moodle performance. You may download a CSV file of the logs from <a href="{$a}">here</a>.';
3 changes: 2 additions & 1 deletion local/kaltura/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ function local_kaltura_request_lti_launch($ltirequest, $withblocks = true, $edit

// Add custom parameters
$requestparams['custom_publishdata'] = local_kaltura_get_kaf_publishing_data();
$requestparams['custom_publishdata_encoded'] = '1';

// Specific settings for video presentation requests.
if (isset($ltirequest['custom_disable_add_new'])) {
Expand Down Expand Up @@ -504,7 +505,7 @@ function local_kaltura_get_kaf_publishing_data() {
// Return an array with no pre-defined keys to structure the JSON the way Kaltura needs it to be.
$json->courses = array_values($json->courses);

return json_encode($json);
return base64_encode(json_encode($json));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion local/kaltura/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
$showtitle = optional_param('showTitle', '', PARAM_TEXT);
$showdescription = optional_param('showDescription', '', PARAM_TEXT);
$showtags = optional_param('showTags', '', PARAM_TEXT);
$showdescription = optional_param('showDuration', '', PARAM_TEXT);
$showduration = optional_param('showDuration', '', PARAM_TEXT);
$showowner = optional_param('showOwner', '', PARAM_TEXT);
$player = optional_param('player', '', PARAM_TEXT);
$size = optional_param('size', '', PARAM_TEXT);
Expand Down Expand Up @@ -81,6 +81,7 @@
$metadata->tags = $tags;
$metadata->showtitle = $showtitle;
$metadata->showdescription = $showdescription;
$metadata->showduration = $showduration;
$metadata->showowner = $showowner;
$metadata->player = $player;
$metadata->size = $size;
Expand Down
4 changes: 2 additions & 2 deletions local/kaltura/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
die('Direct access to this script is forbidden.');
}

$plugin->version = 2015021107;
$plugin->version = 2015090707;
$plugin->component = 'local_kaltura';
$plugin->release = 'Kaltura release 4.0.04';
$plugin->release = 'Kaltura release 4.0.07';
$plugin->requires = 2014050800;
$plugin->maturity = MATURITY_STABLE;
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ Y.extend(LTICONTAINER, Y.Base, {
*/
ltiframe: null,

/**
* The width of the entry
* @property width
* @type {int}
* @default null
*/
width: null,

/**
* The height of the entry
* @property height
* @type {int}
* @default null
*/
height: null,

/**
* Init function for the checkboxselection module
* @property params
Expand All @@ -97,6 +113,12 @@ Y.extend(LTICONTAINER, Y.Base, {
init : function(params) {
var bodynode = Y.one('body[class~='+params.bodyclass+']');

if(params.height && params.width)
{
this.height = params.height;
this.width = params.width;
}

this.lastheight = params.lastheight;
this.padding = params.padding;
this.viewportheight = bodynode.get('winHeight');
Expand Down Expand Up @@ -136,6 +158,13 @@ Y.extend(LTICONTAINER, Y.Base, {
}
}
}

// if we have the entry's dimensions - use them to adjust the iframe size.
if(this.height && this.width)
{
this.ltiframe.setStyle('width', this.width+'px');
this.ltiframe.setStyle('height', this.height+'px');
}
}
},
{
Expand Down

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
Expand Up @@ -89,6 +89,22 @@ Y.extend(LTICONTAINER, Y.Base, {
*/
ltiframe: null,

/**
* The width of the entry
* @property width
* @type {int}
* @default null
*/
width: null,

/**
* The height of the entry
* @property height
* @type {int}
* @default null
*/
height: null,

/**
* Init function for the checkboxselection module
* @property params
Expand All @@ -97,6 +113,12 @@ Y.extend(LTICONTAINER, Y.Base, {
init : function(params) {
var bodynode = Y.one('body[class~='+params.bodyclass+']');

if(params.height && params.width)
{
this.height = params.height;
this.width = params.width;
}

this.lastheight = params.lastheight;
this.padding = params.padding;
this.viewportheight = bodynode.get('winHeight');
Expand Down Expand Up @@ -136,6 +158,13 @@ Y.extend(LTICONTAINER, Y.Base, {
}
}
}

// if we have the entry's dimensions - use them to adjust the iframe size.
if(this.height && this.width)
{
this.ltiframe.setStyle('width', this.width+'px');
this.ltiframe.setStyle('height', this.height+'px');
}
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,16 @@ Y.extend(LTIPANELMEDIAASSIGNMENT, Y.Base, {
this.panelheight = parseInt(height, 10) + 45;
this.panelwidth = parseInt(width, 10) + 23;

this.panelbodycontent = "<iframe id='panelcontentframe' height='"+height+"px' width='"+width+"px' "+
"allowfullscreen='true' webkitallowfullscreen='true' mozallowfullscreen='true' src='"+url+"'></iframe>";
width += 'px';

if (Y.UA.ipod !== 0 || Y.UA.ipad !== 0 || Y.UA.iphone !== 0 || Y.UA.android !== 0 || Y.UA.mobile !== null) {
this.panelwidth = '80%';
width = '100%';
}

this.panelbodycontent = "<iframe id='panelcontentframe' height='"+height+"px' width='"+width+"' "+
"allowfullscreen='true' webkitallowfullscreen='true' mozallowfullscreen='true' src='"+url+"'></iframe>";


// If the panel has not yet been initialized.
if (null === this.panel) {
Expand Down Expand Up @@ -415,7 +423,7 @@ Y.extend(LTISUBMISSIONREVIEW, Y.Base, {
var source, height, width;
// Test if the target is an anchor tag or img tag.
if (e.target.test('a')) {
source = e.target.getAttribute('href');alert(e.target);
source = e.target.getAttribute('href');
height = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=height]').get('value');
width = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=width]').get('value');
} else {
Expand Down
Loading

0 comments on commit 75b5d8d

Please sign in to comment.