Browse Source

Task #1991 - Cleaning whitespace before changing some files.

Ivan Tcholakov 14 years ago
parent
commit
d7bdc67c74

+ 1 - 1
main/document/showinframes.php

@@ -140,7 +140,7 @@ $htmlHeadXtra[] = '
     var updateContentHeight = function() {
         //HeaderHeight = document.getElementById("header").offsetHeight;
         //FooterHeight = document.getElementById("footer").offsetHeight;
-        //document.getElementById("mainFrame").style.height = ((docHeight-(parseInt(HeaderHeight)+parseInt(FooterHeight)))+60)+"px";        
+        //document.getElementById("mainFrame").style.height = ((docHeight-(parseInt(HeaderHeight)+parseInt(FooterHeight)))+60)+"px";
         my_iframe = document.getElementById("mainFrame");
         new_height = my_iframe.contentWindow.document.body.scrollHeight;
         my_iframe.height = my_iframe.contentWindow.document.body.scrollHeight + "px";

+ 210 - 210
main/inc/lib/javascript/jquery.frameready.js

@@ -7,264 +7,264 @@
  * Copyright (c) 2007 Daemach (John Wilson) <daemach@gmail.com>, http://ideamill.synaptrixgroup.com
  * Licensed under the MIT License:
  * http://www.opensource.org/licenses/mit-license.php
- * 
+ *
  *	Credit John Resig and his excellent book for the ready function concepts.
  *
  * ============================================================================================
  * Usage:  	$.frameReady(function (function),target (string)[,options (map/object)]);
- * 
+ *
  * Function: (function/required) An anonymous function to be run within the target frame.
  *
- * Target: (string/required) The target frame.  This must be a window object name (in quotes), 
- *		so work from the top down.  If you have 3 frames named topFrame, navFrame, mainFrame, and 
- *		an iframe inside of mainframe named iFrame, use "top.topFrame", "top.navFrame", 
+ * Target: (string/required) The target frame.  This must be a window object name (in quotes),
+ *		so work from the top down.  If you have 3 frames named topFrame, navFrame, mainFrame, and
+ *		an iframe inside of mainframe named iFrame, use "top.topFrame", "top.navFrame",
  *		"top.mainFrame", "top.mainFrame.iFrame" respectively.
  *
  *	Options: (object/optional) Map of options in object literal form.  Options include:
  *
- * 		remote: (boolean/ default true)  Run the function in the context of the target frame. 
- *				If true, jQuery will be loaded in the target frame automatically and you can run 
- *				jQuery selectors in the target frame as if they were local. ie: $("p") instead of 
- *				$("p",top.mainFrame.document).  If false, jQuery will not be loaded automatically 
+ * 		remote: (boolean/ default true)  Run the function in the context of the target frame.
+ *				If true, jQuery will be loaded in the target frame automatically and you can run
+ *				jQuery selectors in the target frame as if they were local. ie: $("p") instead of
+ *				$("p",top.mainFrame.document).  If false, jQuery will not be loaded automatically
  *				and you must use a context in jquery selectors.
- *				
- *			load: (array or object)  jquery is loaded by default. You can pass a single object to 
- *				frameReady, or an array of objects that will be loaded and tested in order.  2 types 
+ *
+ *			load: (array or object)  jquery is loaded by default. You can pass a single object to
+ *				frameReady, or an array of objects that will be loaded and tested in order.  2 types
  *				of files can be loaded.  Scripts	and stylesheets:
- *				
+ *
  *				scripts: {type:"script", src:"/js/myscript.js", id:"_ms", test:"afunction"}
  *				stylesheets: {type:"stylesheet", src:"/css/mycss.css", id:"_ss"}
- *				
+ *
  *					type: (string/required) "script" for script files, "stylesheet" for stylesheets.
  *					src: (string/required)  The source of the file, ie: /js/myscript.js.
- *					id: (string/optional)  An id for the id attribute.  If one isn't provided it 
+ *					id: (string/optional)  An id for the id attribute.  If one isn't provided it
  *						will be generated.
- *					test: (sting/optional) The name of a function that should exist once the script 
- *						is loaded properly.  Until this function becomes available, the script will 
- *						be considered not ready and no other files will be loaded.  If a test is not 
- *						provided, the next file will be loaded immediately.  Tests are not useful 
+ *					test: (sting/optional) The name of a function that should exist once the script
+ *						is loaded properly.  Until this function becomes available, the script will
+ *						be considered not ready and no other files will be loaded.  If a test is not
+ *						provided, the next file will be loaded immediately.  Tests are not useful
  *						with stylesheets.
  *
- *	One gotcha: You must have something other than space characters within the body tags of 
- * 	target frame documents for frameReady to work properly.  A single character is enough.  
+ *	One gotcha: You must have something other than space characters within the body tags of
+ * 	target frame documents for frameReady to work properly.  A single character is enough.
  *		The reason for this is a workaround for an iFrame bug in Firefox, of all things.
  * ==============================================================================================
  *
- * Example: 
+ * Example:
  *
  *		$.frameReady(function(){
  *		  $("<div>I am a div element</div>").prependTo("body");
- *		}, "top.mainFrame", 
- *		{ load: [ 
+ *		}, "top.mainFrame",
+ *		{ load: [
  *			{type:"script",id:"_fr",src:"/js/jquery.frameReady.js",test: "$.frameReady"},
- *			{type:"stylesheet",id:"_ss",src:"frameReady.css"} 
- *			] } 
- *		); 
+ *			{type:"stylesheet",id:"_ss",src:"frameReady.css"}
+ *			] }
+ *		);
  *
  *
  * Release Notes:
- *	
+ *
  *	1.2.0 - Added provision for a local callback function;
  *	        Added functionality to reset frame information if frame unloads for any reason;
- *			  
+ *
  *	1.1.0 - Added the ability to load scripts and stylesheets inside the target frame before
  *					processing function stack;
- *	
+ *
  ****/
- 
-if (typeof $daemach == "undefined") { 
-	$daemach = {}; 
-	$daemach.debug = false;  // set this to true to enable logging
-	$daemach.log = function() {
-		if (!top.window.console || !top.window.console.log || !$daemach.debug) { 
-			return;
-		} else { 
-			top.window.console.log([].join.call(arguments,'')); 
-		}
-	}
+
+if (typeof $daemach == "undefined") {
+    $daemach = {};
+    $daemach.debug = false;  // set this to true to enable logging
+    $daemach.log = function() {
+        if (!top.window.console || !top.window.console.log || !$daemach.debug) {
+            return;
+        } else {
+            top.window.console.log([].join.call(arguments,''));
+        }
+    }
 }
 
-if (typeof $daemach["frameReady"] == "undefined") { 
-	$daemach["frameReady"] = {}; 
+if (typeof $daemach["frameReady"] == "undefined") {
+    $daemach["frameReady"] = {};
 }
- 
+
 jQuery.frameReady = function(f,t,r,j) {
-	
-	/************************************************************
-		You must specify the path to your jquery.js file below!	
-	*************************************************************/
-	
-	var jQueryPath = "/main/inc/lib/javascript/jquery.js";
-	
-	var u = "undefined";	
-	var $fr = $daemach["frameReady"];
-	var fn = t.split(".").join("_");	
-	// create a branch
-	if (typeof $fr[fn] == u) { 
-		$fr[fn] = {}; 
-		$fr[fn]["settings"] = {	
-			remote: true,
-			jquery: true,
-			load: [ {type:"script",id:"_jq", src:jQueryPath, test:"jQuery"} ],
-			bLoaded: false,
-			loadInit: [],
-			callback: false
-		};
-		$fr[fn]["target"] = t;
-	}
-	var fr = $fr[fn];	
-	var frs = fr["settings"];
-	
-	if (fr.done) { 
-		$daemach.log(fr.target + " is ready.  Running functions now.");
-		return (frs.remote) ? eval(fr.target).eval("(" + f.toString() + ")()") : f(); 
-	};
-	
-	// process arguments
 
-	for (var a=2;a<arguments.length;a++){
-		var arg = arguments[a];
-		
-		if ($.isFunction(arg)){
-			frs.callback = arg;
-		} else if (typeof arg == "object") {
-			if (typeof arg.remote !== u) { 
-				frs.remote = arg.remote;
-			};
-			if (typeof arg.jquery !== u) { 
-				frs.jquery = arg.jquery;
-			};
-			
-			// if we're not running functions in the remote frame itself, no need for jQuery
-			if (!frs.remote || !frs.jquery) { 
-				frs.load.pop(); 
-			}
-			
-			if (typeof arg.load !== u) {
-				var bl = true;
-				if (arg.load.constructor == Array && arg.load.length){
-					for (var i=0;i<arg.load.length;i++){
-						bl = true;
-						for (var h=0;h<frs.load.length;h++){
-							if (frs.load[h].src == arg.load[i].src) { bl=false; };
-						}
-						if (bl) { frs.load.push(arg.load[i]); }
-					}
-				} else if (typeof arg.load == "object") {
-					for (var h=0;h<frs.load.length;h++){
-						if (frs.load[h].src == arg.load.src) { bl=false; };
-					}
-					if (bl) { frs.load.push(arg.load); }
-				}
-			}
-		}
-	}
+    /************************************************************
+        You must specify the path to your jquery.js file below!
+    *************************************************************/
+
+    var jQueryPath = "/main/inc/lib/javascript/jquery.js";
+
+    var u = "undefined";
+    var $fr = $daemach["frameReady"];
+    var fn = t.split(".").join("_");
+    // create a branch
+    if (typeof $fr[fn] == u) {
+        $fr[fn] = {};
+        $fr[fn]["settings"] = {
+            remote: true,
+            jquery: true,
+            load: [ {type:"script",id:"_jq", src:jQueryPath, test:"jQuery"} ],
+            bLoaded: false,
+            loadInit: [],
+            callback: false
+        };
+        $fr[fn]["target"] = t;
+    }
+    var fr = $fr[fn];
+    var frs = fr["settings"];
+
+    if (fr.done) {
+        $daemach.log(fr.target + " is ready.  Running functions now.");
+        return (frs.remote) ? eval(fr.target).eval("(" + f.toString() + ")()") : f();
+    };
+
+    // process arguments
 
-	if (fr.timer) {
-		fr.ready.push(f);
-	} else {
-		fr.ready=[f];
-		if (typeof addEvent !== "undefined"){ addEvent(window,"load",function(){ jQuery.isFrameReady(fn); }); };
-		fr.timer = setInterval(function(){ jQuery.isFrameReady(fn); },13);
-	}
+    for (var a=2;a<arguments.length;a++){
+        var arg = arguments[a];
+
+        if ($.isFunction(arg)){
+            frs.callback = arg;
+        } else if (typeof arg == "object") {
+            if (typeof arg.remote !== u) {
+                frs.remote = arg.remote;
+            };
+            if (typeof arg.jquery !== u) {
+                frs.jquery = arg.jquery;
+            };
+
+            // if we're not running functions in the remote frame itself, no need for jQuery
+            if (!frs.remote || !frs.jquery) {
+                frs.load.pop();
+            }
+
+            if (typeof arg.load !== u) {
+                var bl = true;
+                if (arg.load.constructor == Array && arg.load.length){
+                    for (var i=0;i<arg.load.length;i++){
+                        bl = true;
+                        for (var h=0;h<frs.load.length;h++){
+                            if (frs.load[h].src == arg.load[i].src) { bl=false; };
+                        }
+                        if (bl) { frs.load.push(arg.load[i]); }
+                    }
+                } else if (typeof arg.load == "object") {
+                    for (var h=0;h<frs.load.length;h++){
+                        if (frs.load[h].src == arg.load.src) { bl=false; };
+                    }
+                    if (bl) { frs.load.push(arg.load); }
+                }
+            }
+        }
+    }
+
+    if (fr.timer) {
+        fr.ready.push(f);
+    } else {
+        fr.ready=[f];
+        if (typeof addEvent !== "undefined"){ addEvent(window,"load",function(){ jQuery.isFrameReady(fn); }); };
+        fr.timer = setInterval(function(){ jQuery.isFrameReady(fn); },13);
+    }
 }
 
 jQuery.isFrameReady = function(fn){
-	var u = "undefined";	
-	var $d = $daemach;
-	var fr = $d["frameReady"][fn];
-	var frs = fr["settings"];
-	
-	if (fr.done) { return false; };
+    var u = "undefined";
+    var $d = $daemach;
+    var fr = $d["frameReady"][fn];
+    var frs = fr["settings"];
+
+    if (fr.done) { return false; };
+
+    var fx = eval(fr.target);
+    $d.log(fn, ": New Pass. Checking target");
+    // make sure we have a target
+    if (typeof fx !== "undefined") {
+        $d.log(fn, ": Found target.  Checking DOM");
+        var fd = fx.document;
+
+        // make sure we have a DOM
+        if (fd && fd.getElementsByTagName && fd.getElementById && fd.body && fd.body.innerHTML.length) {
+
+            $d.log(fn, ": Found DOM");
+
+            if (frs.load.length && !frs.bLoaded){
+                for (var i=0;i<frs.load.length;i++){
+                    var s = frs.load[i];
+                    var _test;
+                    try { _test = eval('typeof fx.'+s.test+ ' !== "undefined"'); }
+                    catch(ex){ _test = false;}
+                    finally { $d.log(fn, ": Running test for script ",i,". ", (_test || !s.test) ? "Passed.":"Failed."); }
+
+                    if ((_test || !s.test) && frs.loadInit[i]) {
+                        frs.bLoaded = (typeof s.test == u) ? true : _test;
+                        continue;
+                    } else {
+                        frs.bLoaded = false;
+                        if (typeof frs.loadInit[i] == u){
+                            var id = s.id || "frs_"+i;
+                            switch (s.type) {
+                                case "script" :
+                                    $d.log(fn, ": Loading script "+ i + " (" + s.src + ")");
+                                    var ele=fd.createElement('script');
+                                    ele.setAttribute('id', id);
+                                    ele.setAttribute('src', s.src);
+                                    fd.getElementsByTagName("body")[0].appendChild(ele);
+                                    void(ele);
+                                    frs.loadInit[i] = true;
+                                    break
+                                case "stylesheet" :
+                                    $d.log(fn, ": Loading stylesheet "+ i + " (" + s.src + ")");
+                                    var ele=fd.createElement('link');
+                                    ele.setAttribute('id', id);
+                                    ele.setAttribute('href', s.src);
+                                    ele.setAttribute('rel', "stylesheet");
+                                    ele.setAttribute('type', "text/css");
+                                    fd.getElementsByTagName("body")[0].appendChild(ele);
+                                    void(ele);
+                                    frs.loadInit[i] = true;
+                                break
+                                default :
+                                    $d.log(fn, ": Script "+i+" has a bad or missing type attribute..." );
+                            }
+                        }
+                        break;
+                    }
+                }
+            } else {
+                clearInterval(fr.timer);
+                fr.timer = null;
+
+                fr.ready.push(function(){ window.frameReadyUnload = function(root, fn){ $(window).bind("unload",function(){ root.jQuery.frameReady.unload(fn); }); } });
+
+                $d.log(fn, ": Processing function stack:");
+                for (var i=0; i<fr.ready.length;i++){
+                    (frs.remote) ? fx.eval("(" + fr.ready[i].toString() + ")()") : fr.ready[i]();
+                }
+
+                fx.frameReadyUnload(window,fn);
 
-	var fx = eval(fr.target);
-	$d.log(fn, ": New Pass. Checking target");
-	// make sure we have a target
-	if (typeof fx !== "undefined") {
-		$d.log(fn, ": Found target.  Checking DOM");
-		var fd = fx.document;
-		
-		// make sure we have a DOM
-		if (fd && fd.getElementsByTagName && fd.getElementById && fd.body && fd.body.innerHTML.length) {
-			
-			$d.log(fn, ": Found DOM");
-			
-			if (frs.load.length && !frs.bLoaded){
-				for (var i=0;i<frs.load.length;i++){
-					var s = frs.load[i];
-					var _test;
-					try { _test = eval('typeof fx.'+s.test+ ' !== "undefined"'); } 
-					catch(ex){ _test = false;}
-					finally { $d.log(fn, ": Running test for script ",i,". ", (_test || !s.test) ? "Passed.":"Failed."); }
+                $d.log(fn, ": Function stack processing complete.");
 
-					if ((_test || !s.test) && frs.loadInit[i]) {
-						frs.bLoaded = (typeof s.test == u) ? true : _test; 
-						continue; 
-					} else {
-						frs.bLoaded = false;
-						if (typeof frs.loadInit[i] == u){
-							var id = s.id || "frs_"+i;
-							switch (s.type) {
-								case "script" :
-									$d.log(fn, ": Loading script "+ i + " (" + s.src + ")");
-									var ele=fd.createElement('script');
-									ele.setAttribute('id', id);
-									ele.setAttribute('src', s.src);
-									fd.getElementsByTagName("body")[0].appendChild(ele);
-									void(ele);
-									frs.loadInit[i] = true;
-									break
-								case "stylesheet" :
-									$d.log(fn, ": Loading stylesheet "+ i + " (" + s.src + ")");
-									var ele=fd.createElement('link');
-									ele.setAttribute('id', id);
-									ele.setAttribute('href', s.src);
-									ele.setAttribute('rel', "stylesheet");
-									ele.setAttribute('type', "text/css");
-									fd.getElementsByTagName("body")[0].appendChild(ele);
-									void(ele);
-									frs.loadInit[i] = true;
-								break
-								default :
-									$d.log(fn, ": Script "+i+" has a bad or missing type attribute..." );
-							}
-						}
-						break;
-					}
-				}
-			} else {
-				clearInterval(fr.timer);	
-				fr.timer = null;
+                // we're done here.  let's have a beer.
+                fr.ready = null;
+                fr.done=true;
 
-				fr.ready.push(function(){ window.frameReadyUnload = function(root, fn){ $(window).bind("unload",function(){ root.jQuery.frameReady.unload(fn); }); } });
-				
-				$d.log(fn, ": Processing function stack:");
-				for (var i=0; i<fr.ready.length;i++){
-					(frs.remote) ? fx.eval("(" + fr.ready[i].toString() + ")()") : fr.ready[i]();
-				}
-				
-				fx.frameReadyUnload(window,fn);
-				
-				$d.log(fn, ": Function stack processing complete.");
-				
-				// we're done here.  let's have a beer.
-				fr.ready = null;
-				fr.done=true;
-				
-				if (frs.callback){ 
-					$d.log(fn, ": Found a callback.  Executing...");
-					frs.callback(); 
-				}
-			}
-		}
-	} 
+                if (frs.callback){
+                    $d.log(fn, ": Found a callback.  Executing...");
+                    frs.callback();
+                }
+            }
+        }
+    }
 
-	$d.log(fn, ":");
+    $d.log(fn, ":");
 }
 
 jQuery.frameReady.unload = function(fn){
-	$daemach.log("Frame " + fn + " is unloading.  Resetting state.")
-	$daemach["frameReady"][fn].done = false;
-	$daemach["frameReady"][fn]["settings"].bLoaded = false;
-	$daemach["frameReady"][fn]["settings"].loadInit = [];
+    $daemach.log("Frame " + fn + " is unloading.  Resetting state.")
+    $daemach["frameReady"][fn].done = false;
+    $daemach["frameReady"][fn]["settings"].bLoaded = false;
+    $daemach["frameReady"][fn]["settings"].loadInit = [];
 }

+ 31 - 31
main/newscorm/lp_controller.php

@@ -197,7 +197,7 @@ $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
 
 $action = (!empty($_REQUEST['action']) ? $_REQUEST['action'] : '');
 switch ($action) {
-    
+
     case 'add_item':
 
         if (!$is_allowed_to_edit) {
@@ -215,12 +215,12 @@ switch ($action) {
 
             if (isset($_POST['submit_button']) && !empty($_POST['title'])) {
                 // If a title was sumbitted:
-                
+
                 //Updating the lp.modified_on
                 $_SESSION['oLP']->set_modified_on();
-                    
+
                 if (isset($_SESSION['post_time']) && $_SESSION['post_time'] == $_POST['post_time']) {
-                   
+
                     // Check post_time to ensure ??? (counter-hacking measure?)
                     require 'lp_add_item.php';
                 } else {
@@ -262,14 +262,14 @@ switch ($action) {
                 require 'lp_add.php';
             } else {
                 $_SESSION['post_time'] = $_REQUEST['post_time'];
-                
-                if (!$_REQUEST['enabletimelimit']) {                	
-                	$_REQUEST['publicated_on'] = null;
+
+                if (!$_REQUEST['enabletimelimit']) {
+                    $_REQUEST['publicated_on'] = null;
                     $_REQUEST['expired_on'] = null;
                 } else {
                     $publicated_on  = $_REQUEST['publicated_on'];
                     $publicated_on  = $publicated_on['Y'].'-'.$publicated_on['F'].'-'.$publicated_on['d'].' '.$publicated_on['H'].':'.$publicated_on['i'].':00';
-                    
+
                     $expired_on   = $_REQUEST['expired_on'];
                     $expired_on   = $expired_on['Y'].'-'.$expired_on['F'].'-'.$expired_on['d'].' '.$expired_on['H'].':'.$expired_on['i'].':00';
                 }
@@ -301,23 +301,23 @@ switch ($action) {
             $_SESSION['refresh'] = 1;
             require 'lp_admin_view.php';
         }
-        break;       
-         
+        break;
+
     case 'auto_launch':
-        if (api_get_course_setting('enable_lp_auto_launch')) {  
+        if (api_get_course_setting('enable_lp_auto_launch')) {
             if (!$is_allowed_to_edit) {
                 api_not_allowed(true);
             }
             if ($debug > 0) error_log('New LP - export action triggered', 0);
             if (!$lp_found) { error_log('New LP - No learnpath given for set_autolunch', 0); require 'lp_list.php'; }
-            else {            
-                $_SESSION['oLP']->set_autolunch($_GET['lp_id'], $_GET['status']);            
+            else {
+                $_SESSION['oLP']->set_autolunch($_GET['lp_id'], $_GET['status']);
                 require 'lp_list.php';
                 exit;
             }
         }
     break;
-    
+
     case 'build':
         if (!$is_allowed_to_edit) {
             api_not_allowed(true);
@@ -350,21 +350,21 @@ switch ($action) {
             }
         }
         break;
-        
+
     case 'edit_item':
         if (!$is_allowed_to_edit) {
             api_not_allowed(true);
-        }        
+        }
         if ($debug > 0) error_log('New LP - edit item action triggered', 0);
 
         if (!$lp_found) { error_log('New LP - No learnpath given for edit item', 0); require 'lp_list.php'; }
         else {
             $_SESSION['refresh'] = 1;
             if (isset($_POST['submit_button']) && !empty($_POST['title'])) {
-                
+
                 //Updating the lp.modified_on
                 $_SESSION['oLP']->set_modified_on();
-                
+
                 //$_SESSION['oLP']->edit_item($_GET['id'], $_POST['parent'], $_POST['previous'], $_POST['title'], $_POST['description'], $_POST['prerequisites']);
                 // TODO: mp3 edit
                 $audio = array();
@@ -395,7 +395,7 @@ switch ($action) {
             if (isset($_POST['submit_button'])) {
                 //Updating the lp.modified_on
                 $_SESSION['oLP']->set_modified_on();
-                
+
                 $_SESSION['refresh'] = 1;
                 $_SESSION['oLP']->edit_item_prereq($_GET['id'], $_POST['prerequisites'], $_POST['min_' . $_POST['prerequisites']], $_POST['max_' . $_POST['prerequisites']]);
             }
@@ -415,7 +415,7 @@ switch ($action) {
             if (isset($_POST['submit_button'])) {
                 //Updating the lp.modified_on
                 $_SESSION['oLP']->set_modified_on();
-                
+
                 $_SESSION['oLP']->edit_item($_GET['id'], $_POST['parent'], $_POST['previous'], $_POST['title'], $_POST['description']);
                 $is_success = true;
             }
@@ -479,7 +479,7 @@ switch ($action) {
         else {
             $result = $_SESSION['oLP']->scorm_export_to_pdf($_GET['lp_id']);
             if (!$result) {
-                require 'lp_list.php';            	
+                require 'lp_list.php';
             }
             exit;
         }
@@ -595,26 +595,26 @@ switch ($action) {
             $_SESSION['oLP']->set_proximity($_REQUEST['lp_proximity']);
             $_SESSION['oLP']->set_theme($_REQUEST['lp_theme']);
             $_SESSION['oLP']->set_prerequisite($_REQUEST['prerequisites']);
-            $_SESSION['oLP']->set_use_max_score($_REQUEST['use_max_score']);            
-                   
+            $_SESSION['oLP']->set_use_max_score($_REQUEST['use_max_score']);
+
             if (!$_REQUEST['enabletimelimit']) {
-                //there will be always a publication date                   
+                //there will be always a publication date
                 $publicated_on  = $_REQUEST['publicated_on'];
                 $publicated_on  = $publicated_on['Y'].'-'.$publicated_on['F'].'-'.$publicated_on['d'].' '.$publicated_on['H'].':'.$publicated_on['i'].':00';
-                
+
                 $expired_on = null;
             } else {
                 $publicated_on  = $_REQUEST['publicated_on'];
                 $publicated_on  = $publicated_on['Y'].'-'.$publicated_on['F'].'-'.$publicated_on['d'].' '.$publicated_on['H'].':'.$publicated_on['i'].':00';
-                
+
                 $expired_on   = $_REQUEST['expired_on'];
                 $expired_on   = $expired_on['Y'].'-'.$expired_on['F'].'-'.$expired_on['d'].' '.$expired_on['H'].':'.$expired_on['i'].':00';
-            }            
-            
+            }
+
             $_SESSION['oLP']->set_modified_on();
-            $_SESSION['oLP']->set_publicated_on($publicated_on);                        
+            $_SESSION['oLP']->set_publicated_on($publicated_on);
             $_SESSION['oLP']->set_expired_on($expired_on);
-            
+
 
             if ($_REQUEST['remove_picture']) {
                 $_SESSION['oLP']->delete_lp_image();
@@ -867,7 +867,7 @@ switch ($action) {
                 // Declare variables to be used in lp_stats.php.
                 $lp_id  = $_SESSION['oLP']->get_id();
                 $list   = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id);
-                $user_id = api_get_user_id();                
+                $user_id = api_get_user_id();
                 header('location: '.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/?id_session='.api_get_session_id());
             }
             break;

+ 4 - 4
main/newscorm/lp_view.php

@@ -169,7 +169,7 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($_GET['lp_id']) && isset($
 
         $time_start_date = api_strtotime($row_dates['start_date'],'UTC');
         $time_exe_date   = api_strtotime($row_dates['exe_date'],'UTC');
-        
+
         $mytime = ((int)$time_exe_date-(int)$time_start_date);
         $score = (float)$row_dates['exe_result'];
         $max_score = (float)$row_dates['exe_weighting'];
@@ -189,10 +189,10 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($_GET['lp_id']) && isset($
         if (Database::num_rows($res_last_attempt) > 0) {
             $sql_upd_score = "UPDATE $TBL_LP_ITEM_VIEW SET status = 'completed' , score = $score,total_time = $mytime WHERE id='".$lp_item_view_id."'";
             Database::query($sql_upd_score);
-                   
+
             $update_query = "UPDATE $TBL_TRACK_EXERCICES SET  orig_lp_item_view_id = $lp_item_view_id  WHERE exe_id = ".$safe_exe_id;
             Database::query($update_query);
-        }        
+        }
     }
 
     if (intval($_GET['fb_type']) > 0) {
@@ -384,7 +384,7 @@ if ($_SESSION['oLP']->mode == 'fullscreen') {
         <?php if (!empty($_SESSION['oLP']->scorm_debug)) echo 'debugsize = 150;' ?>
         document.getElementById('inner_lp_toc').style.height = innerHauteur - hauteurHaut - 40 - debugsize + "px";
         if (document.getElementById('content_id')) {
-            document.getElementById('content_id').style.height = innerHauteur + 'px';               
+            document.getElementById('content_id').style.height = innerHauteur + 'px';
         }
 
     // Loads the glossary library.