Skip to content

Commit ba12403

Browse files
committed
Merge branch '1.10.x' into 1.10.2-rc
2 parents 6cab236 + b4f436f commit ba12403

File tree

9 files changed

+248
-80
lines changed

9 files changed

+248
-80
lines changed

documentation/changelog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h1>Chamilo&nbsp;Changelog</h1>
4848

4949
<a name="1.10.2"></a>
5050

51-
<h1>Chamilo 1.10.2 - Alsted, 21st of December 2015</h1>
51+
<h1>Chamilo 1.10.2 - Alsted, 22nd of December 2015</h1>
5252
<h3>Release notes - summary</h3>
5353
<p>Chamilo 1.10.2 is a minor, bugfix version of the 1.10.x branch, with a few new features and bugfixes on top of 1.10.0. Notably, this version enables the migration from 1.9.x to 1.10.2 (many bugs were reported in the migration from 1.9.x to 1.10.0, which were fixed within the 2 months to this minor version).</p>
5454
<h3>Release name</h3>

main/document/showinframes.php

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
}
105105

106106
$pathinfo = pathinfo($header_file);
107-
$jplayer_supported_files = array('mp4', 'ogv','flv');
107+
$jplayer_supported_files = array('mp4', 'ogv', 'flv', 'm4v');
108108
$jplayer_supported = false;
109109

110110
if (in_array(strtolower($pathinfo['extension']), $jplayer_supported_files)) {
@@ -250,33 +250,40 @@ function init() {
250250
}
251251

252252
$execute_iframe = true;
253-
254253
if ($jplayer_supported) {
255254
$extension = api_strtolower($pathinfo['extension']);
255+
if ($extension == 'mp4') {
256+
$extension = 'm4v';
257+
}
256258
$js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
257259
$htmlHeadXtra[] = '<link rel="stylesheet" href="'.$js_path.'jquery-jplayer/skin/blue.monday/css/jplayer.blue.monday.css" type="text/css">';
258260
$htmlHeadXtra[] = '<script type="text/javascript" src="'.$js_path.'jquery-jplayer/jplayer/jquery.jplayer.min.js"></script>';
259261

260-
$jquery = ' $("#jquery_jplayer_1").jPlayer({
261-
ready: function() {
262-
$(this).jPlayer("setMedia", {
263-
'.$extension.' : "'.$document_data['direct_url'].'"
264-
});
265-
},
266-
errorAlerts: false,
267-
warningAlerts: false,
268-
swfPath: "'.$js_path.'jquery-jplayer/jplayer/",
269-
//supplied: "m4a, oga, mp3, ogg, wav",
270-
supplied: "'.$extension.'",
271-
//wmode: "window",
272-
solution: "flash, html", // Do not change this setting
273-
cssSelectorAncestor: "#jp_container_1",
274-
});';
262+
$jquery = '
263+
$("#jquery_jplayer_1").jPlayer({
264+
ready: function() {
265+
$(this).jPlayer("setMedia", {
266+
'.$extension.' : "'.$document_data['direct_url'].'"
267+
});
268+
},
269+
cssSelectorAncestor: "#jp_container_1",
270+
swfPath: "'.$js_path.'jquery-jplayer/jplayer/",
271+
supplied: "'.$extension.'",
272+
useStateClassSkin: true,
273+
autoBlur: false,
274+
keyEnabled: false,
275+
remainingDuration: true,
276+
toggleDuration: true,
277+
solution: "html, flash",
278+
errorAlerts: false,
279+
warningAlerts: false
280+
});
281+
';
275282

276283
$htmlHeadXtra[] = '<script>
277284
$(document).ready( function() {
278285
//Experimental changes to preview mp3, ogg files
279-
'.$jquery.'
286+
'.$jquery.'
280287
});
281288
</script>';
282289
$execute_iframe = false;
@@ -356,9 +363,13 @@ function init() {
356363
echo '</div>';
357364

358365
if ($jplayer_supported) {
359-
echo '<br /><div class="span12" style="margin:0 auto; width:100%; text-align:center;">';
366+
echo '<br />';
367+
echo '<div class="col-md-3 col-md-offset-3">';
360368
echo DocumentManager::generate_video_preview($document_data);
361369
echo '</div>';
370+
371+
// media_element blocks jplayer disable it
372+
Display::$global_template->assign('show_media_element', 0);
362373
}
363374

364375
if ($is_freemind_available) {
@@ -442,7 +453,7 @@ function getMap(map){
442453
$content = Security::remove_XSS(file_get_contents($file_url_sys));
443454
echo $content;
444455
} else {
445-
echo '<iframe id="mainFrame" name="mainFrame" border="0" frameborder="0" scrolling="no" style="width:100%;" height="600" src="'.$file_url_web.'&rand='.mt_rand(1, 10000).'" height="500" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>';
456+
echo '<iframe id="mainFrame" name="mainFrame" border="0" frameborder="0" scrolling="no" style="width:100%;" height="600" src="'.$file_url_web.'&rand='.mt_rand(1, 10000).'" height="500" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>';
446457
}
447458
}
448459
Display::display_footer();

main/inc/lib/display.lib.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class Display
2222
{
23-
/* The main template*/
23+
/** @var Template */
2424
public static $global_template;
2525
public static $preview_style = null;
2626

@@ -756,12 +756,12 @@ public static function return_icon(
756756
}
757757

758758
$icon = api_get_cdn_path($icon);
759-
759+
760760
if ($return_only_path) {
761761
return $icon;
762-
762+
763763
}
764-
764+
765765
$img = self::img($icon, $alt_text, $additional_attributes);
766766
if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) {
767767
if ($show_text) {

main/inc/lib/document.lib.php

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3199,46 +3199,43 @@ static function generate_media_preview($i, $type = 'simple')
31993199
* @param array $document_data
32003200
* @return string
32013201
*/
3202-
static function generate_video_preview($document_data = array())
3202+
public static function generate_video_preview($document_data = array())
32033203
{
3204+
//<button class="jp-video-play-icon" role="button" tabindex="0">play</button>
32043205
$html = '
3205-
<div id="jp_container_1" class="jp-video">
3206+
<div id="jp_container_1" class="jp-video" role="application" aria-label="media player">
32063207
<div class="jp-type-single">
32073208
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
32083209
<div class="jp-gui">
32093210
<div class="jp-video-play">
3210-
<a href="javascript:;" class="jp-video-play-icon" tabindex="1">play</a>
32113211
</div>
32123212
<div class="jp-interface">
32133213
<div class="jp-progress">
32143214
<div class="jp-seek-bar">
32153215
<div class="jp-play-bar"></div>
32163216
</div>
32173217
</div>
3218-
<div class="jp-current-time"></div>
3218+
<div class="jp-current-time" role="timer" aria-label="time">&nbsp;</div>
3219+
<div class="jp-duration" role="timer" aria-label="duration">&nbsp;</div>
32193220
<div class="jp-controls-holder">
3220-
<ul class="jp-controls">
3221-
<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
3222-
<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
3223-
<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
3224-
<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
3225-
<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
3226-
<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
3227-
</ul>
3221+
<div class="jp-controls">
3222+
<button class="jp-play" role="button" tabindex="0">play</button>
3223+
<button class="jp-stop" role="button" tabindex="0">stop</button>
3224+
</div>
3225+
<div class="jp-volume-controls">
3226+
<button class="jp-mute" role="button" tabindex="0">mute</button>
3227+
<button class="jp-volume-max" role="button" tabindex="0">max volume</button>
32283228
<div class="jp-volume-bar">
32293229
<div class="jp-volume-bar-value"></div>
32303230
</div>
3231-
<ul class="jp-toggles">
3232-
<li><a href="javascript:;" class="jp-full-screen" tabindex="1" title="full screen">full screen</a></li>
3233-
<li><a href="javascript:;" class="jp-restore-screen" tabindex="1" title="restore screen">restore screen</a></li>
3234-
<li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
3235-
<li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>
3236-
</ul>
3231+
</div>
3232+
<div class="jp-toggles">
3233+
<button class="jp-repeat" role="button" tabindex="0">repeat</button>
3234+
<button class="jp-full-screen" role="button" tabindex="0">full screen</button>
3235+
</div>
32373236
</div>
3238-
<div class="jp-title">
3239-
<ul>
3240-
<li>' . $document_data['title'] . '</li>
3241-
</ul>
3237+
<div class="jp-details">
3238+
<div class="jp-title" aria-label="title">&nbsp;</div>
32423239
</div>
32433240
</div>
32443241
</div>

main/newscorm/learnpath.class.php

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ public function delete($courseInfo = null, $id = null, $delete = 'keep')
11041104
*/
11051105
public function delete_children_items($id)
11061106
{
1107-
$course_id = api_get_course_int_id();
1107+
$course_id = $this->course_info['real_id'];
11081108
if ($this->debug > 0) {
11091109
error_log('New LP - In learnpath::delete_children_items(' . $id . ')', 0);
11101110
}
@@ -4534,7 +4534,7 @@ public function set_name($name = null)
45344534
$this->name = $name;
45354535
$lp_table = Database :: get_course_table(TABLE_LP_MAIN);
45364536
$lp_id = $this->get_id();
4537-
$course_id = api_get_course_int_id();
4537+
$course_id = $this->course_info['real_id'];
45384538
$sql = "UPDATE $lp_table SET
45394539
name = '" . Database::escape_string($this->name). "'
45404540
WHERE c_id = ".$course_id." AND id = '$lp_id'";
@@ -5983,18 +5983,39 @@ public function create_document($courseInfo, $content = '', $title = '', $extens
59835983
$tmp_filename = $filename . '_' . ++ $i;
59845984

59855985
$filename = $tmp_filename . '.'.$extension;
5986-
$content = stripslashes($content);
5987-
5988-
$content = str_replace(api_get_path(WEB_COURSE_PATH), api_get_path(REL_PATH).'courses/', $content);
5986+
if ($extension == 'html') {
5987+
$content = stripslashes($content);
5988+
$content = str_replace(
5989+
api_get_path(WEB_COURSE_PATH),
5990+
api_get_path(REL_PATH).'courses/',
5991+
$content
5992+
);
59895993

5990-
// Change the path of mp3 to absolute.
5994+
// Change the path of mp3 to absolute.
59915995

5992-
// The first regexp deals with :// urls.
5993-
$content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $courseInfo['path'] . '/document/', $content);
5994-
// The second regexp deals with audio/ urls.
5995-
$content = preg_replace("|(flashvars=\"file=)([^/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $courseInfo['path'] . '/document/$2/', $content);
5996-
// For flv player: To prevent edition problem with firefox, we have to use a strange tip (don't blame me please).
5997-
$content = str_replace('</body>', '<style type="text/css">body{}</style></body>', $content);
5996+
// The first regexp deals with :// urls.
5997+
$content = preg_replace(
5998+
"|(flashvars=\"file=)([^:/]+)/|",
5999+
"$1".api_get_path(
6000+
REL_COURSE_PATH
6001+
).$courseInfo['path'].'/document/',
6002+
$content
6003+
);
6004+
// The second regexp deals with audio/ urls.
6005+
$content = preg_replace(
6006+
"|(flashvars=\"file=)([^/]+)/|",
6007+
"$1".api_get_path(
6008+
REL_COURSE_PATH
6009+
).$courseInfo['path'].'/document/$2/',
6010+
$content
6011+
);
6012+
// For flv player: To prevent edition problem with firefox, we have to use a strange tip (don't blame me please).
6013+
$content = str_replace(
6014+
'</body>',
6015+
'<style type="text/css">body{}</style></body>',
6016+
$content
6017+
);
6018+
}
59986019

59996020
if (!file_exists($filepath . $filename)) {
60006021
if ($fp = @ fopen($filepath . $filename, 'w')) {

main/newscorm/scorm.class.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ public function __construct($course_code = null, $resource_id = null, $user_id =
4141
if ($this->debug > 0) {
4242
error_log('New LP - scorm::scorm('.$course_code.','.$resource_id.','.$user_id.') - In scorm constructor', 0);
4343
}
44-
if (!empty($course_code) && !empty($resource_id) && !empty($user_id)) {
45-
parent::__construct($course_code, $resource_id, $user_id);
46-
}
44+
45+
parent::__construct($course_code, $resource_id, $user_id);
4746
}
4847

4948
/**

main/webservices/client_soap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
// third party user id
7070
'original_user_id_value' => $random_user_id,
7171
'secret_key' => $secret_key,
72-
//Extra fields
72+
// Extra fields
7373
'extra' => array(
7474
array('field_name' => 'ruc', 'field_value' => '123'),
7575
array('field_name' => 'DNI', 'field_value' => '4200000')

0 commit comments

Comments
 (0)