Removing unused scripts + replacing the reduced_header.inc.php with the Display::display_reduced_header() function

skala
Julio Montoya 13 years ago
parent 911ec5a9d2
commit 33b2fc8871
  1. 2
      main/newscorm/display_audiorecorder.php
  2. 24
      main/newscorm/lp_api.php
  3. 52
      main/newscorm/lp_author_image.php
  4. 18
      main/newscorm/lp_footer.php
  5. 83
      main/newscorm/lp_header.php
  6. 44
      main/newscorm/lp_log.php
  7. 56
      main/newscorm/lp_message.php
  8. 1
      main/newscorm/lp_nav.php
  9. 2
      main/newscorm/lp_stats.php
  10. 52
      main/newscorm/lp_toc.php
  11. 2
      main/newscorm/lp_view.php

@ -29,7 +29,7 @@ if (isset($_SESSION['lpobject'])) {
$lp_theme_css = $_SESSION['oLP']->get_theme();
$scorm_css_header = true;
require_once '../inc/reduced_header.inc.php';
Display::display_reduced_header();
echo '<body dir="'.api_get_text_direction().'">';

@ -1,24 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* DEPRECATED (temporarily left here)
* Script that displays the footer frame for lp_view.php
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Code
*/
// 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 'lp_comm.common.php'; // xajax functions
//$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/')."\n";
//$htmlHeadXtra[] = '<script language="javascript">var myxajax = window.parent.oxajax;</script>';
include_once '../inc/reduced_header.inc.php';
?>
<body>
<!--div id="clickme" style="border: 1px solid black; width:10px; height:7px;" onclick="myxajax.xajax_get_statuses();"></div-->
</body>
</html>

@ -1,52 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Script that displays the author name and image of a LP
* @package chamilo.learnpath
* @author Julio Montoya Armas <gugli100@gmail.com>
*/
/**
* Code
*/
$use_anonymous = true;
require_once 'back_compat.inc.php';
require_once 'learnpath.class.php';
require_once 'scorm.class.php';
require_once 'aicc.class.php';
// Getting the LP.
if (isset($_SESSION['lpobject'])) {
$oLP = unserialize($_SESSION['lpobject']);
if (is_object($oLP)) {
$_SESSION['oLP'] = $oLP;
} else {
die('Could not instanciate lp object');
}
}
/*
$lp_theme_css = $_SESSION['oLP']->get_theme();
*/
$scorm_css_header = true;
// scorm.css loaded
require_once '../inc/reduced_header.inc.php';
echo '<body dir="'.api_get_text_direction().'">';
$image = '../img/lp_author_background.gif';
echo '<div id="image_preview">';
echo '<table STYLE="width:250px;height:110px;background-image: url('.$image.');">';
echo '<tr><td align="center">';
if ($_SESSION['oLP']->get_preview_image()!='')
echo '<img alt="" src="'.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image().'">';
else
echo Display::display_icon('unknown_250_100.jpg', ' ');
echo '</td></tr>';
echo '</table>';
echo '<div id="author_name">';
echo $_SESSION['oLP']->get_author();
echo '</div>';
echo '</div>';
?>
</body>
</html>

@ -1,18 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Script that displays the footer frame for lp_view.php
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Code
*/
// Flag to allow for anonymous user - needs to be set before global.inc.php.
$use_anonymous = true;
require_once 'back_compat.inc.php';
include_once '../inc/reduced_header.inc.php';
Display::display_footer();

@ -1,83 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Script that displays the header frame for lp_view.php
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Code
*/
// Flag to allow for anonymous user - needs to be set before global.inc.php.
$use_anonymous = true;
// name of the language file that needs to be included
$language_file[] = 'scormdocument';
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'])) {
$temp = $_SESSION['lpobject'];
$_SESSION['oLP'] = unserialize($temp);
}
$path_name = $_SESSION['oLP']->get_name();
$path_id = $_SESSION['oLP']->get_id();
// Use the flag set in lp_view.php to check if this script has been loaded
// as a frame of lp_view.php. Otherwise, redirect to lp_controller.
if (!$_SESSION['loaded_lp_view']) {
header('location: lp_controller.php?'.api_get_cidreq().'&action=view&item_id='.$path_id);
}
// Unset the flag as it has been used already.
$_SESSION['loaded_lp_view'] = false;
// Check if the learnpaths list should be accessible to the user.
$show_link = true;
if (!api_is_allowed_to_edit()) { // If the user has no edit permission (simple user).
$course_tool_table = Database::get_course_table(TABLE_TOOL_LIST);
$result = Database::query("SELECT * FROM $course_tool_table WHERE name='learnpath'");
if (Database::num_rows($result) > 0) {
$row = Database::fetch_array($result);
if ($row['visibility'] == '0') { // If the tool is *not* visible.
$show_link = false;
}
} else {
$show_link = false;
}
}
if (isset($_SESSION['gradebook'])){
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array (
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
}
if ($show_link) {
$interbreadcrumb[] = array('url' => './lp_controller.php?action=list', 'name' => get_lang(ucfirst(TOOL_LEARNPATH)));
}
// Else we don't display get_lang(ucfirst(TOOL_LEARNPATH)) in the breadcrumb since the learner accessed it directly from the course homepage.
$interbreadcrumb[] = array('url' => './lp_controller.php?action=view&lp_id='.$path_id, 'name' => $path_name);
$noPHP_SELF = true;
$lp_theme_css = $_SESSION['oLP']->get_theme();
include '../inc/reduced_header.inc.php';
echo '<div style="font-size:14px;padding-left: 17px;">';
echo '<table ><tr><td>';
echo '<a href="./lp_controller.php?action=return_to_course_homepage" target="_self" onclick="javascript: window.parent.API.save_asset();">';
echo '<img src="../img/lp_arrow.gif">';
echo '<a>';
echo '</td><td>';
echo '<a class="link" href="./lp_controller.php?action=return_to_course_homepage" target="_self" onclick="javascript: window.parent.API.save_asset();">'.get_lang('CourseHomepageLink').'</a>';
echo '</td></tr><table>';
echo '</div>';
?>
</body>
</html>

@ -1,44 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Container script for the messages coming from the learnpath object. Initially, this wasn't supposed to be
* a separate file but rather some text included in lp_view.php, but SCORM involves loading a script that
* saves the data asynchronously while the SCORM learning path carries on. Having an informational iframe
* helps not popping up an additional window when saving data.
*
* This script is also used to refresh the TOC as sometimes the SCORM JS messages are taken into account
* only after the TOC is drawn. As such, you might complete an item, browse to the next page, have the
* TOC drawn with your 'incomplete' status, while the SCORM messages generally arrives just after the TOC
* is drawn. By updating it here and in lp_save.php, we avoid funny visual effect like having a complete
* item showing as incomplete.
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Code
*/
// Flag to allow for anonymous user - needs to be set before global.inc.php.
$use_anonymous = true;
require_once 'back_compat.inc.php';
$htmlHeadXtra[] = '<script language="javascript">
function cleanlog(){
if(document.getElementById){
document.getElementById("log_content").innerHTML = "";
}
}
</script>';
$scorm_css_header = true;
$display_mode = '';
$lp_theme_log = true;
include_once '../inc/reduced_header.inc.php';
?>
<body dir="<?php echo api_get_text_direction(); ?>">
<div id="log_content">
</div>
<div style="color: white;" onclick="javascript: cleanlog();">.</div>
</body>
</html>

@ -1,56 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Container script for the messages coming from the learnpath object. Initially, this wasn't supposed to be
* a separate file but rather some text included in lp_view.php, but SCORM involves loading a script that
* saves the data asynchronously while the SCORM learning path carries on. Having an informational iframe
* helps not popping up an additional window when saving data.
*
* This script is also used to refresh the TOC as sometimes the SCORM JS messages are taken into account
* only after the TOC is drawn. As such, you might complete an item, browse to the next page, have the
* TOC drawn with your 'incomplete' status, while the SCORM messages generally arrives just after the TOC
* is drawn. By updating it here and in lp_save.php, we avoid funny visual effect like having a complete
* item showing as incomplete.
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Code
*/
// Flag to allow for anonymous user - needs to be set before global.inc.php.
$use_anonymous = true;
// Name of the language file that needs to be included.
$language_file = 'learnpath';
require_once 'back_compat.inc.php';
require_once 'learnpath.class.php';
require_once 'scorm.class.php';
if (empty($debug)) { $debug = 0; }
$error = '';
$display_mode = '';
if (isset($_SESSION['lpobject'])) {
$temp = $_SESSION['lpobject'];
$_SESSION['oLP'] = unserialize($temp);
$error = $_SESSION['oLP']->error;
$display_mode = $_SESSION['oLP']->mode;
}
if ($debug > 0) { error_log('New LP - Loaded lp_message : '.$_SERVER['REQUEST_URI'].' from '.$_SERVER['HTTP_REFERER'], 0); }
$htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
var dokeos_xajax_handler = window.parent.oxajax;
</script>';
$lp_theme_css=$_SESSION['oLP']->get_theme();
$scorm_css_header = true;
include_once '../inc/reduced_header.inc.php';
// Close the session immediately to avoid concurrent access problems.
session_write_close();
?>
<body dir="<?php echo api_get_text_direction(); ?>">
<div id="msg_div_id">
<?php
echo $error;
?>
</div>
</body></html>

@ -48,7 +48,6 @@ if (isset($_SESSION['lpobject'])) {
//Setting up the CSS theme if exists
//require_once '../inc/reduced_header.inc.php'; //fixes js bug in ie8 -> "src" not found see #3750
$mycourselptheme = null;
if (api_get_setting('allow_course_theme') == 'true') {

@ -41,7 +41,7 @@ if ($origin != 'tracking') {
@import "../css/public_admin/scorm.css";
/*]]>*/
</style>';
include_once api_get_path(INCLUDE_PATH).'reduced_header.inc.php';
Display::display_reduced_header();
echo '<body dir="'.api_get_text_direction().'">';
}

@ -1,52 +0,0 @@
<?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>
*/
/**
* Code
*/
// Flag to allow for anonymous user - needs to be set before global.inc.php.
$use_anonymous = true;
$language_file[] = 'scormdocument';
$language_file[] = 'scorm';
$language_file[] = 'learnpath';
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 ($debug > 0) error_log('New LP - in lp_toc.php - SESSION[lpobject] is defined', 0);
$oLP = unserialize($_SESSION['lpobject']);
if (is_object($oLP)) {
$_SESSION['oLP'] = $oLP;
} else {
//error_log('New LP - in lp_toc.php - SESSION[lpobject] is not object - dying', 0);
die('Could not instanciate lp object');
}
}
$htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
var dokeos_xajax_handler = window.parent.oxajax;
</script>';
$scorm_css_header = true;
$display_mode = '';
$lp_theme_css = $_SESSION['oLP']->get_theme();
include_once '../inc/reduced_header.inc.php';
?>
<body dir="<?php echo api_get_text_direction(); ?>">
<?php echo $_SESSION['oLP']->get_html_toc();?><br />
</body>
</html>
<?php
if (!empty($_SESSION['oLP'])) {
$_SESSION['lpobject'] = serialize($_SESSION['oLP']);
}

@ -16,6 +16,7 @@
/**
* Code
*/
$_SESSION['whereami'] = 'lp/view';
$this_section = SECTION_COURSES;
@ -245,7 +246,6 @@ if ($_SESSION['oLP']->mode == 'fullscreen') {
}
// Not in fullscreen mode.
//require_once '../inc/reduced_header.inc.php';
Display::display_reduced_header($nameTools);
//$displayAudioRecorder = (api_get_setting('service_visio', 'active') == 'true') ? true : false;
// Check if audio recorder needs to be in studentview.

Loading…
Cancel
Save