move the require_once inc/global and $htmlFeadXtra of learnpath.class.php to lp.controller.php

skala
Carlos Vargas 15 years ago
parent 0b044e0b3d
commit e64b8efb06
  1. 18
      main/newscorm/learnpath.class.php
  2. 22
      main/newscorm/lp_controller.php

@ -13,24 +13,6 @@
* @package dokeos.learnpath
*/
// including the global file
require_once '../inc/global.inc.php';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
if (api_get_setting('show_glossary_in_documents') == 'ismanual' || api_get_setting('show_glossary_in_documents') == 'isautomatic' ) {
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
}
$htmlHeadXtra[] = '<script type="text/javascript">
function setFocus(){
$("#idTitle").focus();
}
$(window).load(function () {
setFocus();
});
</script>';
class learnpath {
var $attempt = 0; //the number for the current ID view

@ -26,6 +26,28 @@ $language_file[] = 'learnpath';
$language_file[] = 'resourcelinker';
$language_file[] = 'registration';
// including the global file
require_once '../inc/global.inc.php';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
if (api_get_setting('show_glossary_in_documents') == 'ismanual' || api_get_setting('show_glossary_in_documents') == 'isautomatic' ) {
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
}
$htmlHeadXtra[] = '<script type="text/javascript">
function setFocus(){
$("#idTitle").focus();
}
$(window).load(function () {
setFocus();
});
</script>';
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;

Loading…
Cancel
Save