Task #1765 - Code cleaning - newscorm/audiorecorder.inc.php, newscorm/display_audiorecorder.php.

skala
Ivan Tcholakov 14 years ago
parent 49a99d03cb
commit d902106f3f
  1. 28
      main/newscorm/audiorecorder.inc.php
  2. 24
      main/newscorm/display_audiorecorder.php

@ -1,5 +1,6 @@
<?php //$id: $
// This file is part of the Dokeos software - See license and credits in the documentation/ directory
<?php
/* For licensing terms, see /license.txt */
/**
* Created on 27.09.2006
* Include the lazlo file necessary to use the audiorecorder
@ -7,11 +8,11 @@
* @author Eric Marguin <e.marguin@elixir-interactive.com>
* @author Arnaud Ligot <arnaud@cblue.be>
*/
global $_configuration;
$web_path = api_get_path(WEB_CODE_PATH);
$getid3_path = api_get_path(LIBRARY_PATH);
require_once $getid3_path.'getid3/getid3.php';
function getFLVDuration($flv_path) {
@ -25,9 +26,7 @@ function getFLVDuration($flv_path) {
}
}
if($audio_recorder_studentview=='false')
{
if ($audio_recorder_studentview == 'false') {
$width = 295;
$height= 90;
$player = 'recorder2.swf';
@ -35,9 +34,7 @@ if($audio_recorder_studentview=='false')
$post_uri = urlencode($web_path.'conference/audiopost.php?course_code='.api_get_course_id().'&user_id='.api_get_user_id().'&checker='.md5(api_get_course_id().api_get_user_id().gmdate('Ymd').$_configuration['security_key']));
$filename = 'lpi'.$audio_recorder_item_id.'-'.gmdate('YmdHis').api_get_user_id().'.flv';//using -z- as fields splitter
$path_to_lzx = $web_path.'conference/'.$player.'?server='.urlencode($server).'&postURI='.$post_uri.'&filename='.$filename;
}
else
{
} else {
$width = 295;
$height = 24;
$player = 'player2.swf';
@ -47,8 +44,7 @@ else
" WHERE path like BINARY '/audio/lpi".Database::escape_string($audio_recorder_item_id)."-%' AND filetype='file' " .
" ORDER BY path DESC";
$res = Database::query($select);
if(Database::num_rows($res)>0)
{
if (Database::num_rows($res) > 0) {
$row = Database::fetch_array($res);
//$filepath = api_get_path(WEB_COURSE_PATH).$cp.'/document'.$row['path'];
$duration = getFLVDuration(api_get_path(SYS_COURSE_PATH).$cp.'/document'.$row['path']);
@ -57,7 +53,7 @@ else
}
}
if(!empty($path_to_lzx)){
if (!empty($path_to_lzx)) {
$recorder_content = sprintf("<object type=\"application/x-shockwave-flash\" data=\"%s\" ".
"width='$width' height='$height'>".
"<param name=\"movie\" value=\"%s\">".
@ -65,8 +61,7 @@ if(!empty($path_to_lzx)){
"<param name=\"scale\" value=\"noscale\">".
"<param name=\"salign\" value=\"LT\">".
"<param name=\"menu\" value=\"false\"></object>",$path_to_lzx,$path_to_lzx);
if($audio_recorder_studentview=='false')
{
if ($audio_recorder_studentview == 'false') {
echo '<script type="text/javascript">
function show_audiorecorder()
@ -80,10 +75,7 @@ if(!empty($path_to_lzx)){
//Commented the audio for the version stable
//echo '<div id="show_audiorecorder_div"><a style="cursor:pointer" onclick="show_audiorecorder()">'.get_lang('ShowAudioRecorder').'</a></div>';
//echo '<div id="audiorecorder_frame"></div>';
}
else
{
} else {
echo $recorder_content;
}
}
?>

@ -1,42 +1,42 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Script opened in an iframe and containing the learning path's table of contents
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
* @license GNU/GPL
*/
//flag to allow for anonymous user - needs to be set before global.inc.php
// Flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;
require_once 'back_compat.inc.php';
require_once 'learnpath.class.php';
require_once 'scorm.class.php';
require_once 'aicc.class.php';
if(isset($_SESSION['lpobject']))
{
if (isset($_SESSION['lpobject'])) {
$oLP = unserialize($_SESSION['lpobject']);
if(is_object($oLP)){
if (is_object($oLP)) {
$_SESSION['oLP'] = $oLP;
}else{
die('Could not instanciate lp object');
} else {
die('Could not instanciate lp object.');
}
}
$lp_theme_css=$_SESSION['oLP']->get_theme();
$scorm_css_header=true;
$lp_theme_css = $_SESSION['oLP']->get_theme();
$scorm_css_header = true;
include_once '../inc/reduced_header.inc.php';
echo '<html>
<body>';
echo '<body dir="'.api_get_text_direction().'">';
echo '<div id="audiorecorder"> ';
$audio_recorder_studentview = 'true';
$audio_recorder_item_id = $_SESSION['oLP']->current;
if(api_get_setting('service_visio','active')=='true'){
if (api_get_setting('service_visio', 'active') == 'true') {
include 'audiorecorder.inc.php';
}
echo '</div>';
// end of audiorecorder include
echo '</body></html>';
?>
Loading…
Cancel
Save