Skip to content

Commit

Permalink
Merge branch '1.10.x' into 1.10.2-rc
Browse files Browse the repository at this point in the history
  • Loading branch information
ywarnier committed Dec 22, 2015
2 parents 6cab236 + b4f436f commit ba12403
Show file tree
Hide file tree
Showing 9 changed files with 248 additions and 80 deletions.
2 changes: 1 addition & 1 deletion documentation/changelog.html
Expand Up @@ -48,7 +48,7 @@ <h1>Chamilo&nbsp;Changelog</h1>

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

<h1>Chamilo 1.10.2 - Alsted, 21st of December 2015</h1>
<h1>Chamilo 1.10.2 - Alsted, 22nd of December 2015</h1>
<h3>Release notes - summary</h3>
<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>
<h3>Release name</h3>
Expand Down
51 changes: 31 additions & 20 deletions main/document/showinframes.php
Expand Up @@ -104,7 +104,7 @@
}

$pathinfo = pathinfo($header_file);
$jplayer_supported_files = array('mp4', 'ogv','flv');
$jplayer_supported_files = array('mp4', 'ogv', 'flv', 'm4v');
$jplayer_supported = false;

if (in_array(strtolower($pathinfo['extension']), $jplayer_supported_files)) {
Expand Down Expand Up @@ -250,33 +250,40 @@ function init() {
}

$execute_iframe = true;

if ($jplayer_supported) {
$extension = api_strtolower($pathinfo['extension']);
if ($extension == 'mp4') {
$extension = 'm4v';
}
$js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
$htmlHeadXtra[] = '<link rel="stylesheet" href="'.$js_path.'jquery-jplayer/skin/blue.monday/css/jplayer.blue.monday.css" type="text/css">';
$htmlHeadXtra[] = '<script type="text/javascript" src="'.$js_path.'jquery-jplayer/jplayer/jquery.jplayer.min.js"></script>';

$jquery = ' $("#jquery_jplayer_1").jPlayer({
ready: function() {
$(this).jPlayer("setMedia", {
'.$extension.' : "'.$document_data['direct_url'].'"
});
},
errorAlerts: false,
warningAlerts: false,
swfPath: "'.$js_path.'jquery-jplayer/jplayer/",
//supplied: "m4a, oga, mp3, ogg, wav",
supplied: "'.$extension.'",
//wmode: "window",
solution: "flash, html", // Do not change this setting
cssSelectorAncestor: "#jp_container_1",
});';
$jquery = '
$("#jquery_jplayer_1").jPlayer({
ready: function() {
$(this).jPlayer("setMedia", {
'.$extension.' : "'.$document_data['direct_url'].'"
});
},
cssSelectorAncestor: "#jp_container_1",
swfPath: "'.$js_path.'jquery-jplayer/jplayer/",
supplied: "'.$extension.'",
useStateClassSkin: true,
autoBlur: false,
keyEnabled: false,
remainingDuration: true,
toggleDuration: true,
solution: "html, flash",
errorAlerts: false,
warningAlerts: false
});
';

$htmlHeadXtra[] = '<script>
$(document).ready( function() {
//Experimental changes to preview mp3, ogg files
'.$jquery.'
'.$jquery.'
});
</script>';
$execute_iframe = false;
Expand Down Expand Up @@ -356,9 +363,13 @@ function init() {
echo '</div>';

if ($jplayer_supported) {
echo '<br /><div class="span12" style="margin:0 auto; width:100%; text-align:center;">';
echo '<br />';
echo '<div class="col-md-3 col-md-offset-3">';
echo DocumentManager::generate_video_preview($document_data);
echo '</div>';

// media_element blocks jplayer disable it
Display::$global_template->assign('show_media_element', 0);
}

if ($is_freemind_available) {
Expand Down Expand Up @@ -442,7 +453,7 @@ function getMap(map){
$content = Security::remove_XSS(file_get_contents($file_url_sys));
echo $content;
} else {
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>';
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>';
}
}
Display::display_footer();
8 changes: 4 additions & 4 deletions main/inc/lib/display.lib.php
Expand Up @@ -20,7 +20,7 @@
*/
class Display
{
/* The main template*/
/** @var Template */
public static $global_template;
public static $preview_style = null;

Expand Down Expand Up @@ -756,12 +756,12 @@ public static function return_icon(
}

$icon = api_get_cdn_path($icon);

if ($return_only_path) {
return $icon;

}

$img = self::img($icon, $alt_text, $additional_attributes);
if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) {
if ($show_text) {
Expand Down
41 changes: 19 additions & 22 deletions main/inc/lib/document.lib.php
Expand Up @@ -3199,46 +3199,43 @@ static function generate_media_preview($i, $type = 'simple')
* @param array $document_data
* @return string
*/
static function generate_video_preview($document_data = array())
public static function generate_video_preview($document_data = array())
{
//<button class="jp-video-play-icon" role="button" tabindex="0">play</button>
$html = '
<div id="jp_container_1" class="jp-video">
<div id="jp_container_1" class="jp-video" role="application" aria-label="media player">
<div class="jp-type-single">
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div class="jp-gui">
<div class="jp-video-play">
<a href="javascript:;" class="jp-video-play-icon" tabindex="1">play</a>
</div>
<div class="jp-interface">
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-current-time"></div>
<div class="jp-current-time" role="timer" aria-label="time">&nbsp;</div>
<div class="jp-duration" role="timer" aria-label="duration">&nbsp;</div>
<div class="jp-controls-holder">
<ul class="jp-controls">
<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
</ul>
<div class="jp-controls">
<button class="jp-play" role="button" tabindex="0">play</button>
<button class="jp-stop" role="button" tabindex="0">stop</button>
</div>
<div class="jp-volume-controls">
<button class="jp-mute" role="button" tabindex="0">mute</button>
<button class="jp-volume-max" role="button" tabindex="0">max volume</button>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<ul class="jp-toggles">
<li><a href="javascript:;" class="jp-full-screen" tabindex="1" title="full screen">full screen</a></li>
<li><a href="javascript:;" class="jp-restore-screen" tabindex="1" title="restore screen">restore screen</a></li>
<li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
<li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>
</ul>
</div>
<div class="jp-toggles">
<button class="jp-repeat" role="button" tabindex="0">repeat</button>
<button class="jp-full-screen" role="button" tabindex="0">full screen</button>
</div>
</div>
<div class="jp-title">
<ul>
<li>' . $document_data['title'] . '</li>
</ul>
<div class="jp-details">
<div class="jp-title" aria-label="title">&nbsp;</div>
</div>
</div>
</div>
Expand Down
45 changes: 33 additions & 12 deletions main/newscorm/learnpath.class.php
Expand Up @@ -1104,7 +1104,7 @@ public function delete($courseInfo = null, $id = null, $delete = 'keep')
*/
public function delete_children_items($id)
{
$course_id = api_get_course_int_id();
$course_id = $this->course_info['real_id'];
if ($this->debug > 0) {
error_log('New LP - In learnpath::delete_children_items(' . $id . ')', 0);
}
Expand Down Expand Up @@ -4534,7 +4534,7 @@ public function set_name($name = null)
$this->name = $name;
$lp_table = Database :: get_course_table(TABLE_LP_MAIN);
$lp_id = $this->get_id();
$course_id = api_get_course_int_id();
$course_id = $this->course_info['real_id'];
$sql = "UPDATE $lp_table SET
name = '" . Database::escape_string($this->name). "'
WHERE c_id = ".$course_id." AND id = '$lp_id'";
Expand Down Expand Up @@ -5983,18 +5983,39 @@ public function create_document($courseInfo, $content = '', $title = '', $extens
$tmp_filename = $filename . '_' . ++ $i;

$filename = $tmp_filename . '.'.$extension;
$content = stripslashes($content);

$content = str_replace(api_get_path(WEB_COURSE_PATH), api_get_path(REL_PATH).'courses/', $content);
if ($extension == 'html') {
$content = stripslashes($content);
$content = str_replace(
api_get_path(WEB_COURSE_PATH),
api_get_path(REL_PATH).'courses/',
$content
);

// Change the path of mp3 to absolute.
// Change the path of mp3 to absolute.

// The first regexp deals with :// urls.
$content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $courseInfo['path'] . '/document/', $content);
// The second regexp deals with audio/ urls.
$content = preg_replace("|(flashvars=\"file=)([^/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $courseInfo['path'] . '/document/$2/', $content);
// For flv player: To prevent edition problem with firefox, we have to use a strange tip (don't blame me please).
$content = str_replace('</body>', '<style type="text/css">body{}</style></body>', $content);
// The first regexp deals with :// urls.
$content = preg_replace(
"|(flashvars=\"file=)([^:/]+)/|",
"$1".api_get_path(
REL_COURSE_PATH
).$courseInfo['path'].'/document/',
$content
);
// The second regexp deals with audio/ urls.
$content = preg_replace(
"|(flashvars=\"file=)([^/]+)/|",
"$1".api_get_path(
REL_COURSE_PATH
).$courseInfo['path'].'/document/$2/',
$content
);
// For flv player: To prevent edition problem with firefox, we have to use a strange tip (don't blame me please).
$content = str_replace(
'</body>',
'<style type="text/css">body{}</style></body>',
$content
);
}

if (!file_exists($filepath . $filename)) {
if ($fp = @ fopen($filepath . $filename, 'w')) {
Expand Down
5 changes: 2 additions & 3 deletions main/newscorm/scorm.class.php
Expand Up @@ -41,9 +41,8 @@ public function __construct($course_code = null, $resource_id = null, $user_id =
if ($this->debug > 0) {
error_log('New LP - scorm::scorm('.$course_code.','.$resource_id.','.$user_id.') - In scorm constructor', 0);
}
if (!empty($course_code) && !empty($resource_id) && !empty($user_id)) {
parent::__construct($course_code, $resource_id, $user_id);
}

parent::__construct($course_code, $resource_id, $user_id);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion main/webservices/client_soap.php
Expand Up @@ -69,7 +69,7 @@
// third party user id
'original_user_id_value' => $random_user_id,
'secret_key' => $secret_key,
//Extra fields
// Extra fields
'extra' => array(
array('field_name' => 'ruc', 'field_value' => '123'),
array('field_name' => 'DNI', 'field_value' => '4200000')
Expand Down

0 comments on commit ba12403

Please sign in to comment.