lib-cookies MDL-19737 Removed need to include cookies.js on every page
authorsamhemelryk <samhemelryk>
Thu, 17 Sep 2009 06:42:54 +0000 (06:42 +0000)
committersamhemelryk <samhemelryk>
Thu, 17 Sep 2009 06:42:54 +0000 (06:42 +0000)
Is only been used by SCORM and the chameleon theme so they include it locally when required

lib/outputrenderers.php
mod/scorm/datamodels/aicclib.php
mod/scorm/datamodels/scorm_12lib.php
mod/scorm/datamodels/scorm_13lib.php
mod/scorm/loaddatamodel.php
theme/chameleon/header.html
theme/chameleon/ui/chameleon.php

index a3e9e09..1efb7f6 100644 (file)
@@ -494,7 +494,6 @@ class moodle_core_renderer extends moodle_renderer_base {
         $this->page->requires->js('lib/javascript-mod.php')->in_head();
         $this->page->requires->js('lib/overlib/overlib.js')->in_head();
         $this->page->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
-        $this->page->requires->js('lib/cookies.js')->in_head();
         $this->page->requires->js_function_call('setTimeout', array('fix_column_widths()', 20));
 
         $focus = $this->page->focuscontrol;
index fd8e0f8..dd45646 100644 (file)
@@ -536,6 +536,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
         $result->toc .= $PAGE->requires->data_for_js('scormdata', array(
                 'plusicon' => $OUTPUT->mod_icon_url('pix/plus', 'scorm'),
                 'minusicon' => $OUTPUT->mod_icon_url('pix/minus', 'scorm')))->asap();
+        $result->toc .= $PAGE->requires->js('lib/cookies.js')->asap();
         $result->toc .= $PAGE->requires->js('mod/scorm/datamodels/scorm_datamodels.js')->asap();
     }
 
index c07b547..ae69e2a 100644 (file)
@@ -320,6 +320,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
         $PAGE->requires->data_for_js('scormdata', array(
                 'plusicon' => $OUTPUT->mod_icon_url('pix/plus', 'scorm'),
                 'minusicon' => $OUTPUT->mod_icon_url('pix/minus', 'scorm')));
+        $PAGE->requires->js('lib/cookies.js');
         $PAGE->requires->js('mod/scorm/datamodels/scorm_datamodels.js');
     }
 
index f1821a7..33bee3b 100644 (file)
@@ -211,6 +211,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
         $PAGE->requires->data_for_js('scormdata', array(
                 'plusicon' => $OUTPUT->mod_icon_url('pix/plus', 'scorm'),
                 'minusicon' => $OUTPUT->mod_icon_url('pix/minus', 'scorm')));
+        $PAGE->requires->js('lib/cookies.js');
         $PAGE->requires->js('mod/scorm/datamodels/scorm_datamodels.js');
     }
 
index 29b2e10..e0548c5 100644 (file)
@@ -70,6 +70,7 @@
         print_error('cannotfindsco', 'scorm');
     }
     $scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR));   // Just to be safe
+    $PAGE->requires->js('lib/cookies.js')->asap();
     if (file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php')) {
         include_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php');
     } else {
index 13e0716..a299e5f 100644 (file)
@@ -7,7 +7,6 @@
     <link rel="shortcut icon" href="<?php echo $CFG->themewww .'/'. current_theme() ?>/favicon.ico" />
 
     <?php include('ui/chameleon.php'); ?>
-    <?php include("$CFG->javascript"); ?>
 </head>
 
 <body<?php
index 9f113f7..1bb782e 100644 (file)
@@ -19,6 +19,7 @@ if (!empty($THEME->chameleonenabled)) {
 
 <style type="text/css"> @import '<?php echo "$CFG->themewww/$chameleon_theme" ?>/ui/chameleon_ui.css'; </style>
 
+<script type="text/javascript" src="<?php echo "$CFG->wwwroot/lib/cookies.js" ?>"> </script>
 <script type="text/javascript" src="<?php echo "$CFG->themewww/$chameleon_theme/ui/css_query.js" ?>"> </script>
 <script type="text/javascript" src="<?php echo "$CFG->themewww/$chameleon_theme/ui/sarissa.js" ?>"> </script>
 <script type="text/javascript" src="<?php echo "$CFG->themewww/$chameleon_theme/ui/chameleon_js.php$chameleon_courseparam" ?>"> </script>