Passed
Push — 1.10.x ( f9cbcd...83c791 )
by Yannick
657:30 queued 614:41
created
main/newscorm/lp_impress.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     null,
36 36
     api_get_group_id()
37 37
 );
38
-if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0 ) {
38
+if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0) {
39 39
      api_not_allowed();
40 40
 }
41 41
 
@@ -73,22 +73,22 @@  discard block
 block discarded – undo
73 73
 $html = '';
74 74
 $step = 1;
75 75
 foreach ($list as $toc) {
76
-    $x = 1000*$step;
76
+    $x = 1000 * $step;
77 77
     $html .= '<div id="step-'.$step.'" class="step slide" data-x="'.$x.'" data-y="-1500"  >';
78 78
     $html .= '<div class="impress-content">';
79 79
     $src = $_SESSION['oLP']->get_link('http', $toc['id']);
80 80
     if ($toc['type'] !== 'dokeos_chapter') {
81 81
         //just showing the src in a iframe ...
82 82
         $html .= '<h2>'.$toc['title'].'</h2>';
83
-        $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="' . $src . '"></iframe>';
84
-    }else{
83
+        $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="'.$src.'"></iframe>';
84
+    } else {
85 85
         $html .= "<div class='impress-title'>";
86 86
         $html .= '<h1>'.$toc['title'].'</h1>';
87 87
         $html .= "</div>";
88 88
     }
89 89
     $html .= "</div>";
90 90
     $html .= "</div>";
91
-    $step ++;
91
+    $step++;
92 92
 }
93 93
 
94 94
 //Setting the template
Please login to merge, or discard this patch.
main/newscorm/scormOrganization.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
         foreach ($this->items as $id => $dummy) {
99 99
             $abs_order = 0;
100 100
             // Passes the array as a pointer so it is modified in $list directly.
101
-            $this->items[$id]->get_flat_list($list,$abs_order, $i, 0);
101
+            $this->items[$id]->get_flat_list($list, $abs_order, $i, 0);
102 102
             $i++;
103 103
         }
104 104
 
Please login to merge, or discard this patch.
main/newscorm/storageapi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         and sco_id = '$sv_sco'
104 104
         and course_id = '$sv_course'
105 105
         and sv_key = '$sv_key'
106
-        order by sv_value ".($sv_asc ? "ASC": "DESC")." limit $sv_length";
106
+        order by sv_value ".($sv_asc ? "ASC" : "DESC")." limit $sv_length";
107 107
 //	$sql_data = "select sv.user_id as user_id, sv_key as variable, sv_value as value
108 108
 //		from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." sv
109 109
 //		where sv.user_id in (select u2.user_id from ($sql_leaders) u2)
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         and search.sco_id = '$sv_sco'
136 136
         and search.course_id = '$sv_course'
137 137
         and search.sv_key = '$sv_key'
138
-        and list.sv_value ".($sv_asc ? "<=": ">=")." search.sv_value
138
+        and list.sv_value ".($sv_asc ? "<=" : ">=")." search.sv_value
139 139
         and list.sco_id = search.sco_id
140 140
         and list.course_id = search.course_id
141 141
         and list.sv_key = search.sv_key
Please login to merge, or discard this patch.
main/newscorm/lp_view_item.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 if (isset($_GET['lp_item_id'])) {
21 21
 
22 22
     // Get parameter only came from lp_view.php.
23
-    $lp_item_id  = intval($_GET['lp_item_id']);
23
+    $lp_item_id = intval($_GET['lp_item_id']);
24 24
     if (isset($_SESSION['lpobject'])) {
25 25
         $oLP = unserialize($_SESSION['lpobject']);
26 26
     }
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
         $src = $oLP->get_link('http', $lp_item_id);
29 29
     }
30 30
 
31
-    $url_info 		= parse_url($src);
32
-    $real_url_info	= parse_url(api_get_path(WEB_PATH));
31
+    $url_info = parse_url($src);
32
+    $real_url_info = parse_url(api_get_path(WEB_PATH));
33 33
 
34 34
     // The host must be the same.
35 35
     if ($url_info['host'] == $real_url_info['host']) {
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 
76 76
 $course_id = api_get_course_int_id();
77 77
 $sql_query = "SELECT * FROM $tbl_lp WHERE c_id = $course_id AND id = $learnpath_id";
78
-$result=Database::query($sql_query);
79
-$therow=Database::fetch_array($result);
78
+$result = Database::query($sql_query);
79
+$therow = Database::fetch_array($result);
80 80
 
81 81
 /* SHOWING THE ADMIN TOOLS	*/
82 82
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 }
86 86
 
87 87
 if (!empty($gradebook) && $gradebook == 'view') {
88
-    $interbreadcrumb[] = array (
88
+    $interbreadcrumb[] = array(
89 89
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
90 90
         'name' => get_lang('ToolGradebook')
91 91
     );
Please login to merge, or discard this patch.
main/newscorm/scormMetadata.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
                      //$keep_href = '';
89 89
                      if (is_array($attributes)) {
90 90
                          foreach ($attributes as $attrib) {
91
-                             if (trim($attrib->value) != ''){
91
+                             if (trim($attrib->value) != '') {
92 92
                                  $this->attribs[$attrib->name] = $attrib->value;
93 93
                              }
94 94
                          }
Please login to merge, or discard this patch.
main/newscorm/scormItem.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                                         }
101 101
                                         break;
102 102
                                     case 'item':
103
-                                        $oItem = new scormItem('manifest',$child);
103
+                                        $oItem = new scormItem('manifest', $child);
104 104
                                         if ($oItem->identifier != '') {
105 105
                                             $this->sub_items[$oItem->identifier] = $oItem;
106 106
                                         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                         $attributes = $element->attributes;
120 120
                         //$keep_href = '';
121 121
                         foreach ($attributes as $attrib) {
122
-                            switch($attrib->name){
122
+                            switch ($attrib->name) {
123 123
                                 case 'identifier':
124 124
                                     $this->identifier = $attrib->value;
125 125
                                     break;
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
         );
173 173
         $abs_order++;
174 174
         $i = 1;
175
-        foreach($this->sub_items as $id => $dummy) {
176
-            $oSubitem =& $this->sub_items[$id];
175
+        foreach ($this->sub_items as $id => $dummy) {
176
+            $oSubitem = & $this->sub_items[$id];
177 177
             $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1);
178 178
             $i++;
179 179
         }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         parent::save($from_outside, $prereqs_complete);
189 189
         // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
190 190
         $this->scorm_contact = true;
191
-        if (!$this->scorm_contact){
191
+        if (!$this->scorm_contact) {
192 192
             //error_log('New LP - was expecting SCORM message but none received', 0);
193 193
         }
194 194
     }
Please login to merge, or discard this patch.
main/newscorm/lp_controller.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 // Including the global initialization file.
27 27
 require_once '../inc/global.inc.php';
28
-$current_course_tool  = TOOL_LEARNPATH;
28
+$current_course_tool = TOOL_LEARNPATH;
29 29
 $_course = api_get_course_info();
30 30
 
31 31
 $glossaryExtraTools = api_get_setting('show_glossary_in_extra_tools');
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
     ) {
38 38
         $htmlHeadXtra[] = '<script>
39 39
     <!--
40
-        var jQueryFrameReadyConfigPath = \'' . api_get_jquery_web_path() . '\';
40
+        var jQueryFrameReadyConfigPath = \'' . api_get_jquery_web_path().'\';
41 41
     -->
42 42
     </script>';
43
-    $htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>';
44
-    $htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
43
+    $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>';
44
+    $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
45 45
     }
46 46
 }
47 47
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
 $course_id = api_get_course_int_id();
270 270
 
271
-if ($debug>0) error_log('New LP - Passed data remains check', 0);
271
+if ($debug > 0) error_log('New LP - Passed data remains check', 0);
272 272
 
273 273
 if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $_REQUEST['lp_id'])) {
274 274
     if ($debug > 0) error_log('New LP - oLP is not object, has changed or refresh been asked, getting new', 0);
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
             if (Database::num_rows($res)) {
293 293
                 $row = Database::fetch_array($res);
294 294
                 $type = $row['lp_type'];
295
-                if ($debug > 0) error_log('New LP - found row - type '.$type. ' - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
295
+                if ($debug > 0) error_log('New LP - found row - type '.$type.' - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
296 296
                 switch ($type) {
297 297
                     case 1:
298 298
                         if ($debug > 0) error_log('New LP - found row - type dokeos - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
@@ -687,8 +687,8 @@  discard block
 block discarded – undo
687 687
                 $editPrerequisite = $_SESSION['oLP']->edit_item_prereq(
688 688
                     $_GET['id'],
689 689
                     $_POST['prerequisites'],
690
-                    $_POST['min_' . $_POST['prerequisites']],
691
-                    $_POST['max_' . $_POST['prerequisites']]
690
+                    $_POST['min_'.$_POST['prerequisites']],
691
+                    $_POST['max_'.$_POST['prerequisites']]
692 692
                 );
693 693
 
694 694
                 if ($editPrerequisite) {
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
             $_SESSION['oLP']->setSubscribeUsers($_REQUEST['subscribe_users']);
938 938
 
939 939
             if (isset($_REQUEST['activate_start_date_check']) && $_REQUEST['activate_start_date_check'] == 1) {
940
-            	$publicated_on  = $_REQUEST['publicated_on'];
940
+            	$publicated_on = $_REQUEST['publicated_on'];
941 941
             } else {
942 942
             	$publicated_on = null;
943 943
             }
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
         else {
1009 1009
             $_SESSION['refresh'] = 1;
1010 1010
             if (!empty($_REQUEST['parent_item_id'])) {
1011
-                $_SESSION['from_learnpath']='yes';
1011
+                $_SESSION['from_learnpath'] = 'yes';
1012 1012
                 $_SESSION['origintoolurl'] = 'lp_controller.php?action=admin_view&lp_id='.Security::remove_XSS($_REQUEST['lp_id']);
1013 1013
                 require 'resourcelinker.php';
1014 1014
             } else {
@@ -1109,8 +1109,8 @@  discard block
 block discarded – undo
1109 1109
             error_log('New LP - No learnpath given for view', 0);
1110 1110
             require 'lp_list.php';
1111 1111
         } else {
1112
-            if ($debug > 0) {error_log('New LP - Trying to set current item to ' . $_REQUEST['item_id'], 0); }
1113
-            if ( !empty($_REQUEST['item_id']) ) {
1112
+            if ($debug > 0) {error_log('New LP - Trying to set current item to '.$_REQUEST['item_id'], 0); }
1113
+            if (!empty($_REQUEST['item_id'])) {
1114 1114
                 $_SESSION['oLP']->set_current_item($_REQUEST['item_id']);
1115 1115
             }
1116 1116
             require 'lp_view.php';
@@ -1190,8 +1190,8 @@  discard block
 block discarded – undo
1190 1190
 		break;
1191 1191
      */
1192 1192
 	case 'switch_attempt_mode':
1193
-		if($debug>0) error_log('New LP - switch_reinit action triggered',0);
1194
-		if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; }
1193
+		if ($debug > 0) error_log('New LP - switch_reinit action triggered', 0);
1194
+		if (!$lp_found) { error_log('New LP - No learnpath given for switch', 0); require 'lp_list.php'; }
1195 1195
 		$_SESSION['refresh'] = 1;
1196 1196
 		$_SESSION['oLP']->switch_attempt_mode();
1197 1197
         require 'lp_list.php';
@@ -1241,8 +1241,8 @@  discard block
 block discarded – undo
1241 1241
             error_log('New LP - No learnpath given for view', 0);
1242 1242
             require 'lp_list.php';
1243 1243
         } else {
1244
-            if ($debug > 0) {error_log('New LP - Trying to impress this LP item to ' . $_REQUEST['item_id'], 0); }
1245
-            if (!empty($_REQUEST['item_id']) ) {
1244
+            if ($debug > 0) {error_log('New LP - Trying to impress this LP item to '.$_REQUEST['item_id'], 0); }
1245
+            if (!empty($_REQUEST['item_id'])) {
1246 1246
                 $_SESSION['oLP']->set_current_item($_REQUEST['item_id']);
1247 1247
             }
1248 1248
             require 'lp_impress.php';
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
                     $_SESSION['oLP']->lp_session_id
1306 1306
                 );
1307 1307
 
1308
-                $forumCategoryId = !empty($forumCategory) ? $forumCategory['cat_id']: 0;
1308
+                $forumCategoryId = !empty($forumCategory) ? $forumCategory['cat_id'] : 0;
1309 1309
 
1310 1310
                 if (empty($forumCategoryId)) {
1311 1311
                     $forumCategoryId = store_forumcategory(
@@ -1337,7 +1337,7 @@  discard block
 block discarded – undo
1337 1337
             }
1338 1338
         }
1339 1339
 
1340
-        header('Location:' . api_get_self() . '?' . http_build_query([
1340
+        header('Location:'.api_get_self().'?'.http_build_query([
1341 1341
             'action' => 'add_item',
1342 1342
             'type' => 'step',
1343 1343
             'lp_id' => $_SESSION['oLP']->lp_id
@@ -1379,7 +1379,7 @@  discard block
 block discarded – undo
1379 1379
             }
1380 1380
         }
1381 1381
 
1382
-        header('Location:' . api_get_self() . '?' . http_build_query([
1382
+        header('Location:'.api_get_self().'?'.http_build_query([
1383 1383
             'action' => 'add_item',
1384 1384
             'type' => 'step',
1385 1385
             'lp_id' => $_SESSION['oLP']->lp_id
Please login to merge, or discard this patch.
main/newscorm/resourcelinker.inc.php 1 patch
Spacing   +166 added lines, -166 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 $use_anonymous = true;
18 18
 
19 19
 require_once '../inc/global.inc.php';
20
-if (!empty($_course['language'])){
21
-    $resource_linker_file =  api_get_path(SYS_CODE_PATH).'lang/'.$_course['language'].'/resourcelinker.inc.php';
20
+if (!empty($_course['language'])) {
21
+    $resource_linker_file = api_get_path(SYS_CODE_PATH).'lang/'.$_course['language'].'/resourcelinker.inc.php';
22 22
     if (file_exists($resource_linker_file)) {
23 23
         require_once $resource_linker_file;
24 24
     }
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
         echo "<a href='".api_get_self()."?content=Document&amp;source_forum=".$_GET['source_forum']."&amp;source_id=$source_id&amp;action=$action&amp;learnpath_id=$learnpath_id&amp;chapter_id=$chapter_id&amp;originalresource=no'><img src='../img/folder_up.gif' border='0' />".get_lang('LevelUp')."</a>";
48 48
     }
49 49
     if ($level && $level != 0 && $level != 1) {
50
-        $folder_up=$folder;
51
-        $folder_temp=explode('/',$folder);
52
-        $last=count($folder_temp)-1;
50
+        $folder_up = $folder;
51
+        $folder_temp = explode('/', $folder);
52
+        $last = count($folder_temp) - 1;
53 53
         unset($folder_temp[$last]);
54
-        $folder_up=implode('/',$folder_temp);
54
+        $folder_up = implode('/', $folder_temp);
55 55
         echo "<a href='".api_get_self()."?content=Document&amp;source_forum=".$_GET['source_forum']."&amp;folder=$folder_up&amp;source_id=$source_id&amp;action=$action&amp;learnpath_id=$learnpath_id&amp;chapter_id=$chapter_id&amp;originalresource=no'><img src='../img/folder_up.gif' border='0' />".get_lang('LevelUp')."</a>";
56 56
     }
57 57
 }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     $result = Database::query($sql);
89 89
     while ($row = Database::fetch_array($result)) {
90 90
         if (!$folder) {
91
-            if (get_levels($row['path'])-1 == 1) {
91
+            if (get_levels($row['path']) - 1 == 1) {
92 92
                 // showing the right icon.
93 93
                 if (file_or_folder($row['path'])) {
94 94
                         echo '<img src="../img/file.gif" align="middle" />';
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                     echo "&folder=".substr($row['path'], 1)."&source_id=$source_id&source_forum=".$_GET['source_forum']."&action=$action&lp_id=$learnpath_id&parent_item_id=$chapter_id&originalresource=no'>".substr($row['path'], 1).'</a><br />';
104 104
                 } else {
105 105
                     echo substr($row['path'], 1).' ';
106
-                    echo showorhide_addresourcelink('Document',$row['id']);
106
+                    echo showorhide_addresourcelink('Document', $row['id']);
107 107
                     echo '<br />';
108 108
                 }
109 109
             }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             $level = get_levels($folder) + 1;
114 114
 
115 115
             // We calculate each level of the database entry.
116
-            $file_level=get_levels($row['path'])-1;
116
+            $file_level = get_levels($row['path']) - 1;
117 117
             // If the level of the database entry is equal to the level we ar in, we put it into an array
118 118
             // as this is a potential good entry.
119 119
             if ($file_level == $level) {
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
     $addedresourceid = $_SESSION['addedresourceid'];
192 192
     if ($_SESSION['addedresource']) {
193 193
         foreach ($addedresource as $resource_type) {
194
-            $sql="INSERT INTO $resource_table (c_id, source_type, source_id, resource_type, resource_id) VALUES
194
+            $sql = "INSERT INTO $resource_table (c_id, source_type, source_id, resource_type, resource_id) VALUES
195 195
             ($course_id, '$source_type', '$source_id', '$resource_type', '".$addedresourceid[key($addedresource)]."')";
196 196
             Database::query($sql);
197
-            $i=key($addedresource);
197
+            $i = key($addedresource);
198 198
             next($addedresource);
199 199
         }
200
-        $_SESSION['addedresource']='';
201
-        $_SESSION['addedresourceid']='';
200
+        $_SESSION['addedresource'] = '';
201
+        $_SESSION['addedresourceid'] = '';
202 202
     }
203 203
 }
204 204
 
@@ -278,21 +278,21 @@  discard block
 block discarded – undo
278 278
             $dbTable = Database::get_course_table(TABLE_DOCUMENT);
279 279
             $result = Database::query("SELECT * FROM $dbTable WHERE c_id = $course_id AND id=$id");
280 280
             $myrow = Database::fetch_array($result);
281
-            $pathname = explode('/',$myrow['path']); // Making a correct name for the link.
282
-            $last = count($pathname) - 1;  // Making a correct name for the link.
283
-            $filename = $pathname[$last];  // Making a correct name for the link.
281
+            $pathname = explode('/', $myrow['path']); // Making a correct name for the link.
282
+            $last = count($pathname) - 1; // Making a correct name for the link.
283
+            $filename = $pathname[$last]; // Making a correct name for the link.
284 284
             $image = choose_image($filename);
285 285
             $ext = explode('.', $filename);
286
-            $ext = strtolower($ext[sizeof($ext)-1]);
286
+            $ext = strtolower($ext[sizeof($ext) - 1]);
287 287
             $myrow['path'] = rawurlencode($myrow['path']);
288 288
 
289
-			$array_ext=array('htm', 'html', 'gif', 'jpg', 'jpeg', 'png');
289
+			$array_ext = array('htm', 'html', 'gif', 'jpg', 'jpeg', 'png');
290 290
 
291
-			if (api_browser_support('svg')){
292
-				$array_ext[]='svg';
291
+			if (api_browser_support('svg')) {
292
+				$array_ext[] = 'svg';
293 293
 			}
294
-			if (api_browser_support('ogg')){
295
-				$array_ext[]='ogg';
294
+			if (api_browser_support('ogg')) {
295
+				$array_ext[] = 'ogg';
296 296
 			}
297 297
 
298 298
             $in_frames = in_array($ext, $array_ext);
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
     $length = ((($builder == 'builder') && ($icon == 'nolink')) ? 65 : 32);
336 336
 
337
-    if ($builder != 'builder') $origin = 'learnpath';	//origin = learnpath in student view
337
+    if ($builder != 'builder') $origin = 'learnpath'; //origin = learnpath in student view
338 338
     $linktype = $type;
339 339
     if (($type == 'Link _self') or ($type == 'Link _blank')) $type = 'Link';
340 340
 
@@ -342,12 +342,12 @@  discard block
 block discarded – undo
342 342
     switch ($type) {
343 343
         case TOOL_CALENDAR_EVENT:
344 344
         case 'Agenda':
345
-            $TABLEAGENDA 		= Database::get_course_table(TABLE_AGENDA);
345
+            $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
346 346
             $result = Database::query("SELECT * FROM $TABLEAGENDA WHERE c_id = $course_id AND id=$id");
347 347
             $myrow = Database::fetch_array($result);
348 348
 
349 349
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
350
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
350
+            $result = Database::query($sql); $row = Database::fetch_array($result);
351 351
             if ($row['title'] != '') { $myrow['title'] = $row['title']; }
352 352
             $desc = $row['description'];
353 353
             $agenda_id = $row['item_id'];
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
             if ($icon != 'nolink') {
357 357
                 if ($completed == 'completed') {
358 358
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
359
-                }	else {
359
+                } else {
360 360
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
361 361
                     //echo "&nbsp;";
362 362
                 }
@@ -368,17 +368,17 @@  discard block
 block discarded – undo
368 368
             if ($icon == 'nolink') { return(shorten($myrow['title'], $length)); }
369 369
             if ($icon == 'icon') { echo "<img src='../img/agenda.gif' align=\"absmiddle\" alt='agenda'>"; }
370 370
             if ($builder != 'builder') {
371
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path\" class='$completed'>".shorten($myrow['title'], ($length-3*$level))."</a>";
371
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path\" class='$completed'>".shorten($myrow['title'], ($length - 3 * $level))."</a>";
372 372
                 $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path";
373 373
                 if ($desc != '') {
374 374
                     if ($icon != 'wrap') {
375
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>";
375
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
376 376
                     } else {
377
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>";
377
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
378 378
                     }
379 379
                 }
380 380
             } else {
381
-                echo "<a href=\"../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id\" class='$completed' target='_blank'>".shorten($myrow['title'], ($length-3*$level))."</a>";
381
+                echo "<a href=\"../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id\" class='$completed' target='_blank'>".shorten($myrow['title'], ($length - 3 * $level))."</a>";
382 382
             }
383 383
             break;
384 384
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
             if ($icon != 'nolink') {
408 408
                 if ($completed == 'completed') {
409 409
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
410
-                }	else {
410
+                } else {
411 411
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
412 412
                     //echo "&nbsp;";
413 413
                 }
@@ -420,26 +420,26 @@  discard block
 block discarded – undo
420 420
                 return(true);
421 421
             }
422 422
 
423
-            if ($icon == 'nolink') { return(shorten($title,$length)); }
423
+            if ($icon == 'nolink') { return(shorten($title, $length)); }
424 424
             if ($icon == 'icon') { echo "<img src='../img/valves.gif' align=\"absmiddle\" alt='ad valvas'>"; }
425 425
             if ($builder != 'builder') {
426
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path\" class='$completed'>".shorten($title, ($length-3*$level))."</a>";
426
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path\" class='$completed'>".shorten($title, ($length - 3 * $level))."</a>";
427 427
                 $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path";
428 428
                 if ($desc != '') {
429 429
                     if ($icon != 'wrap') {
430
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>";
430
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
431 431
                     } else {
432
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>";
432
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
433 433
                     }
434 434
                 }
435 435
             } else {
436
-                echo "<a href=\"../announcements/announcements.php?origin=$origin&ann_id=$ann_id\" class='$completed' target='_blank'>".shorten($title, ($length-3*$level))."</a>";
436
+                echo "<a href=\"../announcements/announcements.php?origin=$origin&ann_id=$ann_id\" class='$completed' target='_blank'>".shorten($title, ($length - 3 * $level))."</a>";
437 437
             }
438 438
             break;
439 439
 
440 440
         case TOOL_LINK:
441 441
         case 'Link':
442
-            $TABLETOOLLINK	= Database::get_course_table(TABLE_LINK);
442
+            $TABLETOOLLINK = Database::get_course_table(TABLE_LINK);
443 443
             $result = Database::query("SELECT * FROM $TABLETOOLLINK WHERE c_id = $course_id AND id=$id");
444 444
             $myrow = Database::fetch_array($result);
445 445
 
@@ -447,14 +447,14 @@  discard block
 block discarded – undo
447 447
             $result = Database::query($sql);
448 448
             $row = Database::fetch_array($result);
449 449
             if ($row['title'] != '') { $myrow['title'] = $row['title']; }
450
-            $desc=$row['description'];
450
+            $desc = $row['description'];
451 451
             echo str_repeat("&nbsp;&gt;", $level);
452 452
 
453 453
             if (($builder != 'builder') && ($icon != 'wrap')) { echo "<td>"; }
454 454
             if ($icon != 'nolink') {
455 455
                 if ($completed == 'completed') {
456 456
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
457
-                }	else {
457
+                } else {
458 458
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
459 459
                     //echo "&nbsp;";
460 460
                 }
@@ -473,23 +473,23 @@  discard block
 block discarded – undo
473 473
             }
474 474
             $thelink = $myrow['url'];
475 475
             if ($builder != 'builder') {
476
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path\" class='$completed'>".shorten($myrow['title'], ($length-3*$level))."</a>";
477
-                $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path";
476
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path\" class='$completed'>".shorten($myrow['title'], ($length - 3 * $level))."</a>";
477
+                $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path";
478 478
                 if ($desc != '') {
479 479
                     if ($icon != 'wrap') {
480
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>";
480
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
481 481
                     } else {
482
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>";
482
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
483 483
                     }
484 484
                 }
485 485
             } else {
486
-                echo "<a href=\"$thelink\" class='$completed' target='_blank'>".shorten($myrow['title'], ($length-3*$level))."</a>";
486
+                echo "<a href=\"$thelink\" class='$completed' target='_blank'>".shorten($myrow['title'], ($length - 3 * $level))."</a>";
487 487
             }
488 488
             break;
489 489
 
490 490
         case TOOL_QUIZ:
491 491
         case 'Exercise':
492
-            $TBL_EXERCICES  = Database::get_course_table(TABLE_QUIZ_TEST);
492
+            $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
493 493
             $result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id");
494 494
             $myrow = Database::fetch_array($result);
495 495
 
@@ -522,35 +522,35 @@  discard block
 block discarded – undo
522 522
             if ($icon == 'nolink') { return(shorten($myrow['title'], $length)); }
523 523
             if ($icon == 'icon') { echo "<img src='../img/quiz.gif' align=\"absmiddle\" alt='quizz'>"; }
524 524
             if ($builder != 'builder') {
525
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path\" class='$completed'>".shorten($myrow['title'], ($length-3*$level))."</a>";
525
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path\" class='$completed'>".shorten($myrow['title'], ($length - 3 * $level))."</a>";
526 526
                 $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path";
527 527
                 if ($desc != '') {
528 528
                     if ($icon != 'wrap') {
529
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>";
529
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
530 530
                     } else {
531
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>";
531
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
532 532
                     }
533 533
                 }
534 534
             } else {
535
-                echo "<a href=\"../exercice/exercise_submit.php?origin=$origin&exerciseId=".$myrow['id']."\" class='$completed' target='_blank'>".shorten($myrow['title'], ($length-3*$level))."</a>";
535
+                echo "<a href=\"../exercice/exercise_submit.php?origin=$origin&exerciseId=".$myrow['id']."\" class='$completed' target='_blank'>".shorten($myrow['title'], ($length - 3 * $level))."</a>";
536 536
             }
537 537
             break;
538 538
 
539 539
         case 'hotpotatoes':
540 540
         case 'HotPotatoes':
541
-            $TBL_DOCUMENT  = Database::get_course_table(TABLE_DOCUMENT);
541
+            $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
542 542
             $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
543 543
             $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE c_id = $course_id AND id=$id");
544 544
             $myrow = Database::fetch_array($result);
545 545
             $path = $myrow['path'];
546 546
             $name = GetQuizName($path, $documentPath);
547 547
 
548
-            if ($builder == 'builder') { $origin='builder'; }
548
+            if ($builder == 'builder') { $origin = 'builder'; }
549 549
               // This is needed for the exercise_submit.php can delete the session info about tests.
550 550
 
551 551
             $sql = "select * from $tbl_lp_item where id=$id_in_path";
552
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
553
-            if ($row['title'] != '') { $name=$row['title']; }
552
+            $result = Database::query($sql); $row = Database::fetch_array($result);
553
+            if ($row['title'] != '') { $name = $row['title']; }
554 554
             $desc = $row['description'];
555 555
             echo str_repeat("&nbsp;&gt;", $level);
556 556
 
@@ -558,32 +558,32 @@  discard block
 block discarded – undo
558 558
             if ($icon != 'nolink') {
559 559
                 if ($completed == 'completed') {
560 560
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
561
-                }	else {
561
+                } else {
562 562
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
563 563
                     //echo "&nbsp;";
564 564
                 }
565 565
             }
566 566
             if (($builder != 'builder') && ($icon != 'wrap')) { echo "</td><td>"; }
567 567
 
568
-            if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
568
+            if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
569 569
 
570
-            if ($icon == 'nolink') { return(shorten($name,$length)); }
570
+            if ($icon == 'nolink') { return(shorten($name, $length)); }
571 571
             if ($icon == 'icon') { echo "<img src='../img/jqz.jpg' align=\"absmiddle\" alt='hot potatoes'>"; }
572 572
 
573 573
             $cid = $_course['official_code'];
574 574
 
575 575
             if ($builder != 'builder') {
576
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>";
576
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>";
577 577
                 $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path";
578 578
                 if ($desc != '') {
579 579
                     if ($icon != 'wrap') {
580
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>";
580
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
581 581
                     } else {
582
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>";
582
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
583 583
                     }
584 584
                 }
585 585
             } else {
586
-                echo "&nbsp;<a href=\"../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
586
+                echo "&nbsp;<a href=\"../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>";
587 587
             }
588 588
             break;
589 589
 
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
             $myrow = Database::fetch_array($result);
595 595
 
596 596
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
597
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
597
+            $result = Database::query($sql); $row = Database::fetch_array($result);
598 598
             if ($row['title'] != '') { $myrow["forum_name"] = $row['title']; }
599 599
             $desc = $row['description'];
600 600
             echo str_repeat("&nbsp;&gt;", $level);
@@ -603,30 +603,30 @@  discard block
 block discarded – undo
603 603
             if ($icon != 'nolink') {
604 604
                 if ($completed == 'completed') {
605 605
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
606
-                }	else {
606
+                } else {
607 607
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
608 608
                     //echo "&nbsp;";
609 609
                 }
610 610
             }
611 611
             if (($builder != 'builder') && ($icon != 'wrap')) { echo "</td><td>"; }
612 612
 
613
-            if ($myrow["forum_name"]=='') { $type="Forum"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
613
+            if ($myrow["forum_name"] == '') { $type = "Forum"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
614 614
 
615 615
             if ($icon == 'nolink') { return(shorten($myrow['forum_name'], $length)); }
616 616
             if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; }
617 617
             $forumparameters = "forum=".$myrow["forum_id"]."&md5=".$myrow["md5"];
618 618
             if ($builder != 'builder') {
619
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path\" class='$completed'>".shorten($myrow["forum_name"],($length-3*$level))."</a>";
619
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path\" class='$completed'>".shorten($myrow["forum_name"], ($length - 3 * $level))."</a>";
620 620
                 $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path";
621 621
                 if ($desc != '') {
622 622
                     if ($icon != 'wrap') {
623
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc,($length-3*$level))."</div></td></tr>";
623
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
624 624
                     } else {
625
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc,($length-3*$level))."</div>";
625
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
626 626
                     }
627 627
                 }
628 628
             } else {
629
-                echo "<a href=\"../phpbb/viewforum.php?$forumparameters\" class='$completed' target='_blank'>".shorten($myrow["forum_name"],($length-3*$level))."</a>";
629
+                echo "<a href=\"../phpbb/viewforum.php?$forumparameters\" class='$completed' target='_blank'>".shorten($myrow["forum_name"], ($length - 3 * $level))."</a>";
630 630
             }
631 631
             break;
632 632
 
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
             $myrow = Database::fetch_array($result);
639 639
 
640 640
             $sql = "select * from $tbl_lp_item where id=$id_in_path";
641
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
641
+            $result = Database::query($sql); $row = Database::fetch_array($result);
642 642
             if ($row['title'] != '') { $myrow['topic_title'] = $row['title']; }
643 643
             $desc = $row['description'];
644 644
             echo str_repeat("&nbsp;&gt;", $level);
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
             if ($icon != 'nolink') {
648 648
                 if ($completed == 'completed') {
649 649
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
650
-                }	else {
650
+                } else {
651 651
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
652 652
                     //echo "&nbsp;";
653 653
                 }
@@ -659,17 +659,17 @@  discard block
 block discarded – undo
659 659
             if ($icon == 'nolink') { return(shorten($myrow['topic_title'], $length)); }
660 660
             if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; }
661 661
             if ($builder != 'builder') {
662
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path\" class='$completed'>".shorten($myrow["topic_title"], ($length-3*$level))."</a>";
662
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path\" class='$completed'>".shorten($myrow["topic_title"], ($length - 3 * $level))."</a>";
663 663
                 $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path";
664 664
                 if ($desc != '') {
665 665
                     if ($icon != 'wrap') {
666
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc,($length-3*$level))."</div></td></tr>";
666
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
667 667
                     } else {
668
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc,($length-3*$level))."</div>";
668
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
669 669
                     }
670 670
                 }
671 671
             } else {
672
-                echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["topic_title"],($length-3*$level))."</a>";
672
+                echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["topic_title"], ($length - 3 * $level))."</a>";
673 673
             }
674 674
             break;
675 675
 
@@ -684,13 +684,13 @@  discard block
 block discarded – undo
684 684
 
685 685
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
686 686
             $result = Database::query($sql);
687
-            $row=Database::fetch_array($result);
687
+            $row = Database::fetch_array($result);
688 688
             if ($row['title'] != '') { $myrow['post_title'] = $row['title']; }
689 689
             $desc = $row['description'];
690 690
             echo str_repeat("&nbsp;&gt;", $level);
691 691
 
692
-            $posternom = $myrow['nom'];				$posterprenom = $myrow['prenom'];
693
-            $posttime = $myrow['post_time'];			$posttext = $myrow['post_text'];
692
+            $posternom = $myrow['nom']; $posterprenom = $myrow['prenom'];
693
+            $posttime = $myrow['post_time']; $posttext = $myrow['post_text'];
694 694
             $posttitle = $myrow['post_title'];
695 695
             $posttext = str_replace('"', "'", $posttext);
696 696
 
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
             if ($icon != 'nolink') {
699 699
                 if ($completed == 'completed') {
700 700
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
701
-                }	else {
701
+                } else {
702 702
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
703 703
                     //echo "&nbsp;";
704 704
                 }
@@ -710,19 +710,19 @@  discard block
 block discarded – undo
710 710
                 echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true);
711 711
             }
712 712
 
713
-            if ($icon == 'nolink') { return(shorten($myrow["post_title"],$length)); }
713
+            if ($icon == 'nolink') { return(shorten($myrow["post_title"], $length)); }
714 714
             if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; }
715 715
             if ($builder != 'builder') {
716
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".intval($_GET['source_forum'])."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path\" class='$completed'>".shorten($myrow["post_title"],($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".intval($_GET['source_forum'])."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path";
716
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".intval($_GET['source_forum'])."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path\" class='$completed'>".shorten($myrow["post_title"], ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".intval($_GET['source_forum'])."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path";
717 717
                 if ($desc != '') {
718 718
                     if ($icon != 'wrap') {
719
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc,($length-3*$level))."</div></td></tr>";
719
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
720 720
                     } else {
721
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc,($length-3*$level))."</div>";
721
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
722 722
                     }
723 723
                 }
724 724
             } else {
725
-                echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["post_title"],($length-3*$level))."</a>";
725
+                echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["post_title"], ($length - 3 * $level))."</a>";
726 726
             }
727 727
             break;
728 728
 
@@ -735,14 +735,14 @@  discard block
 block discarded – undo
735 735
             $myrow = Database::fetch_array($result);
736 736
 
737 737
             $pathname = explode('/', $myrow['path']); // Making a correct name for the link.
738
-            $last = count($pathname) - 1;  // Making a correct name for the link.
739
-            $filename=$pathname[$last];  // Making a correct name for the link.
738
+            $last = count($pathname) - 1; // Making a correct name for the link.
739
+            $filename = $pathname[$last]; // Making a correct name for the link.
740 740
             if (($builder != 'builder') && ($icon != 'wrap')) { echo "<td>"; }
741 741
 
742 742
             echo str_repeat("&nbsp;&gt;", $level);
743 743
 
744 744
             if ($icon != 'nolink') {
745
-                if ($completed=='completed') {
745
+                if ($completed == 'completed') {
746 746
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
747 747
                 } else {
748 748
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
@@ -754,9 +754,9 @@  discard block
 block discarded – undo
754 754
 
755 755
             $sql = "select * from $tbl_lp_item where id=$id_in_path";
756 756
             //error_log('New LP - Querying lp_item table: '.$sql, 0);
757
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
757
+            $result = Database::query($sql); $row = Database::fetch_array($result);
758 758
             if ($row['title'] != '') { $filename = $row['title']; }
759
-            $desc=$row['description'];
759
+            $desc = $row['description'];
760 760
 
761 761
             if (($myrow['path'] == '') && ($filename == '')) {
762 762
                 echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>";
@@ -767,22 +767,22 @@  discard block
 block discarded – undo
767 767
             if ($icon == 'icon') { echo "<img src='../img/$image' align=\"absmiddle\" alt='$image'>"; }
768 768
             if ($builder != 'builder')
769 769
             {
770
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path\" class='$completed'>".shorten($filename,($length-3*$level))."</a>";
770
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path\" class='$completed'>".shorten($filename, ($length - 3 * $level))."</a>";
771 771
                 if ($desc != '') {
772 772
                     if ($icon != 'wrap') {
773
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc,($length-3*$level))."</div></td></tr>";
773
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
774 774
                     } else {
775
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc,($length-3*$level))."</div>";
775
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
776 776
                     }
777 777
                 } $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path";
778 778
             } else {
779
-                $enableDocumentParsing=yes;
779
+                $enableDocumentParsing = yes;
780 780
                 if (!$enableDocumentParsing) {
781 781
                     // This is the solution for the non-parsing version in the builder.
782 782
                     $file = urlencode($myrow['path']);
783
-                    echo "<a href='../document/showinframes.php?file=$file' class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>";
783
+                    echo "<a href='../document/showinframes.php?file=$file' class='$completed' $hyperlink_target_parameter>".shorten($filename, ($length - 3 * $level))."</a>";
784 784
                 } else {
785
-                    echo "<a href=\"../document/download.php?doc_url=".$myrow['path']."\" class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>";
785
+                    echo "<a href=\"../document/download.php?doc_url=".$myrow['path']."\" class='$completed' $hyperlink_target_parameter>".shorten($filename, ($length - 3 * $level))."</a>";
786 786
                 }
787 787
             }
788 788
             break;
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
794 794
             $result = Database::query($sql);
795 795
             $row = Database::fetch_array($result);
796
-            if ($row['title'] != '') { $name=$row['title']; }
796
+            if ($row['title'] != '') { $name = $row['title']; }
797 797
             $desc = $row['description'];
798 798
             echo str_repeat("&nbsp;&gt;", $level);
799 799
 
@@ -801,30 +801,30 @@  discard block
 block discarded – undo
801 801
             if ($icon != 'nolink') {
802 802
                 if ($completed == 'completed') {
803 803
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
804
-                }	else {
804
+                } else {
805 805
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
806 806
                     //echo "&nbsp;";
807 807
                 }
808 808
             }
809 809
             if (($builder != 'builder') && ($icon != 'wrap')) { echo "</td><td>"; }
810 810
 
811
-            if ($name=='') {
811
+            if ($name == '') {
812 812
                 echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true);
813 813
             }
814 814
 
815 815
             if ($icon == 'nolink') { return(shorten($name, $length)); }
816 816
             if ($icon == 'icon') { echo "<img src='../img/works.gif' align=\"absmiddle\">"; }
817 817
             if ($builder != 'builder') {
818
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path";
818
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path";
819 819
                 if ($desc != '') {
820 820
                     if ($icon != 'wrap') {
821
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>";
821
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>";
822 822
                     } else {
823
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>";
823
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>";
824 824
                     }
825 825
                 }
826 826
             } else {
827
-                echo "<a href=\"../work/work.php\" class='$completed' target='_blank'>".shorten($name, ($length-3*$level))."</a>";
827
+                echo "<a href=\"../work/work.php\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>";
828 828
             }
829 829
             break;
830 830
 
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
             if ($icon != 'nolink') {
843 843
                 if ($completed == 'completed') {
844 844
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
845
-                }	else {
845
+                } else {
846 846
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
847 847
                     //echo "&nbsp;";
848 848
                 }
@@ -855,15 +855,15 @@  discard block
 block discarded – undo
855 855
             if ($icon == 'icon') { echo "<img src='../img/dropbox.gif' align=\"absmiddle\">"; }
856 856
 
857 857
             if ($builder != 'builder') {
858
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path";
858
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path";
859 859
                 if ($desc != '') {
860 860
                     if ($icon != 'wrap') {
861
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>"; }
861
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; }
862 862
                     else {
863
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>"; }
863
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>"; }
864 864
                 }
865 865
             } else {
866
-                echo "<a href=\"../dropbox/index.php\" class='$completed' target='_blank'>".shorten($name, ($length-3*$level))."</a>";
866
+                echo "<a href=\"../dropbox/index.php\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>";
867 867
             }
868 868
             break;
869 869
 
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
         case 'Introduction_text':
872 872
             $name = get_lang('IntroductionText');
873 873
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
874
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
874
+            $result = Database::query($sql); $row = Database::fetch_array($result);
875 875
             if ($row['title'] != '') { $name = $row['title']; }
876 876
             $desc = $row['description'];
877 877
             echo str_repeat("&nbsp;&gt;", $level);
@@ -893,17 +893,17 @@  discard block
 block discarded – undo
893 893
             if ($icon == 'icon') { echo "<img src='../img/introduction.gif' align=\"absmiddle\" alt='introduction'>"; }
894 894
 
895 895
             if ($builder != 'builder') {
896
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>";
896
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>";
897 897
                 $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path";
898 898
                 if ($desc != '') {
899 899
                     if ($icon != 'wrap') {
900
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>"; }
900
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; }
901 901
                     else {
902
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>"; }
902
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>"; }
903 903
                 }
904 904
             } else {
905 905
                 $s = api_get_path(WEB_COURSE_PATH)."$_cid/index.php?intro_cmdEdit=1";
906
-                echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name, ($length-3*$level))."</a>";
906
+                echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>";
907 907
             }
908 908
             break;
909 909
 
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
         case 'Course_description':
912 912
             $name = get_lang('CourseDescription');
913 913
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
914
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
914
+            $result = Database::query($sql); $row = Database::fetch_array($result);
915 915
             if ($row['title'] != '') { $name = $row['title']; }
916 916
             $desc = $row['description'];
917 917
             echo str_repeat("&nbsp;&gt;", $level);
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
             if ($icon != 'nolink') {
921 921
                 if ($completed == 'completed') {
922 922
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>";
923
-                }	else {
923
+                } else {
924 924
                     echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>";
925 925
                     //echo "&nbsp;";
926 926
                 }
@@ -929,20 +929,20 @@  discard block
 block discarded – undo
929 929
 
930 930
             if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
931 931
 
932
-            if ($icon == 'nolink') { return(shorten($name,$length)); }
932
+            if ($icon == 'nolink') { return(shorten($name, $length)); }
933 933
             if ($icon == 'icon') { echo "<img src='../img/info.gif' align=\"absmiddle\" alt='info'>"; }
934 934
 
935 935
             if ($builder != 'builder') {
936
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path";
936
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path";
937 937
                 if ($desc != '') {
938 938
                     if ($icon != 'wrap') {
939
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>"; }
939
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; }
940 940
                     else {
941
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>"; }
941
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>"; }
942 942
                 }
943 943
             } else {
944
-                $s=api_get_path(WEB_CODE_PATH)."course_description";
945
-                echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name, ($length-3*$level))."</a>";
944
+                $s = api_get_path(WEB_CODE_PATH)."course_description";
945
+                echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>";
946 946
             }
947 947
             break;
948 948
 
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
953 953
             $result = Database::query($sql);
954 954
             $row = Database::fetch_array($result);
955
-            if ($row['title'] != '') { $name=$row['title']; }
955
+            if ($row['title'] != '') { $name = $row['title']; }
956 956
             $desc = $row['description'];
957 957
             echo str_repeat("&nbsp;&gt;", $level);
958 958
 
@@ -967,21 +967,21 @@  discard block
 block discarded – undo
967 967
             }
968 968
             if (($builder != 'builder') && ($icon != 'wrap')) { echo "</td><td>"; }
969 969
 
970
-            if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
970
+            if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
971 971
 
972 972
             if ($icon == 'nolink') { return(shorten($name, $length)); }
973 973
             if ($icon == 'icon') { echo "<img src='../img/group.gif' align=\"absmiddle\" alt='group'>"; }
974 974
 
975 975
             if ($builder != 'builder') {
976
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path";
976
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path";
977 977
                 if ($desc != '') {
978 978
                     if ($icon != 'wrap') {
979
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>"; }
979
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; }
980 980
                     else {
981
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>"; }
981
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>"; }
982 982
                 }
983 983
             } else {
984
-                echo "<a href=\"../group/group.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name, ($length-3*$level))."</a>";
984
+                echo "<a href=\"../group/group.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>";
985 985
             }
986 986
             break;
987 987
 
@@ -1006,21 +1006,21 @@  discard block
 block discarded – undo
1006 1006
             }
1007 1007
             if (($builder != 'builder') && ($icon != 'wrap')) { echo "</td><td>"; }
1008 1008
 
1009
-            if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
1009
+            if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
1010 1010
 
1011
-            if ($icon == 'nolink') { return(shorten($name,$length)); }
1011
+            if ($icon == 'nolink') { return(shorten($name, $length)); }
1012 1012
             if ($icon == 'icon') { echo "<img src='../img/members.gif' align=\"absmiddle\" alt='members'>"; }
1013 1013
 
1014 1014
             if ($builder != 'builder') {
1015
-                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path";
1015
+                echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path";
1016 1016
                 if ($desc != '') {
1017 1017
                     if ($icon != 'wrap') {
1018
-                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div></td></tr>"; }
1018
+                        echo "</tr><tr><td></td><td></td><td><div class='description'>&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; }
1019 1019
                     else {
1020
-                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length-3*$level))."</div>"; }
1020
+                        echo "<div class='description'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".shorten($desc, ($length - 3 * $level))."</div>"; }
1021 1021
                 }
1022 1022
             } else {
1023
-                echo "<a href=\"../user/user.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name, ($length-3*$level))."</a>";
1023
+                echo "<a href=\"../user/user.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>";
1024 1024
             }
1025 1025
             break;
1026 1026
     }//end huge switch-statement
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
             $myrow = Database::fetch_array($result);
1060 1060
 
1061 1061
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
1062
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
1062
+            $result = Database::query($sql); $row = Database::fetch_array($result);
1063 1063
             if ($row['title'] != '') { $myrow['title'] = $row['title']; }
1064 1064
             $desc = $row['description'];
1065 1065
             $agenda_id = $row['item_id'];
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
             break;
1085 1085
 
1086 1086
         case 'Link':
1087
-            $TABLETOOLLINK	= Database::get_course_table(TABLE_LINK);
1087
+            $TABLETOOLLINK = Database::get_course_table(TABLE_LINK);
1088 1088
             $result = Database::query("SELECT * FROM $TABLETOOLLINK WHERE c_id = $course_id AND id=$id");
1089 1089
             $myrow = Database::fetch_array($result);
1090 1090
 
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
             break;
1102 1102
 
1103 1103
         case 'Exercise':
1104
-            $TBL_EXERCICES  = Database::get_course_table(TABLE_QUIZ_TEST);
1104
+            $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
1105 1105
             $result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id");
1106 1106
             $myrow = Database::fetch_array($result);
1107 1107
 
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
               // This is needed for the exercise_submit.php can delete the session info about tests.
1110 1110
 
1111 1111
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
1112
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
1112
+            $result = Database::query($sql); $row = Database::fetch_array($result);
1113 1113
             if ($row['title'] != '') { $myrow['title'] = $row['title']; }
1114 1114
 
1115 1115
             if ($builder != 'builder') {
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
             }
1120 1120
             break;
1121 1121
         case 'HotPotatoes':
1122
-            $TBL_DOCUMENT  = Database::get_course_table(TABLE_DOCUMENT);
1122
+            $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
1123 1123
             $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
1124 1124
             $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE c_id = $course_id AND id=$id");
1125 1125
             $myrow = Database::fetch_array($result);
@@ -1137,14 +1137,14 @@  discard block
 block discarded – undo
1137 1137
             break;
1138 1138
         case 'Forum':
1139 1139
             //deprecated
1140
-            $TBL_FORUMS = Database::get_course_table(TABLE_FORUM);  // TODO: This is the old table name, it should be corrected.
1140
+            $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); // TODO: This is the old table name, it should be corrected.
1141 1141
             $result = Database::query("SELECT * FROM $TBL_FORUMS WHERE c_id = $course_id AND forum_id=$id");
1142 1142
             $myrow = Database::fetch_array($result);
1143 1143
 
1144 1144
             if ($builder == 'builder') { $origin = 'builder'; }
1145 1145
 
1146 1146
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
1147
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
1147
+            $result = Database::query($sql); $row = Database::fetch_array($result);
1148 1148
             if ($row['title'] != '') { $myrow['forum_name'] = $row['title']; }
1149 1149
 
1150 1150
             if ($myrow['forum_name'] == '') { $type = 'Forum'; }
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
             $myrow = Database::fetch_array($result);
1168 1168
 
1169 1169
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
1170
-            $result = Database::query($sql);	$row = Database::fetch_array($result);
1170
+            $result = Database::query($sql); $row = Database::fetch_array($result);
1171 1171
 
1172 1172
             if ($builder != 'builder') {
1173 1173
                 $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path";
@@ -1191,8 +1191,8 @@  discard block
 block discarded – undo
1191 1191
             $desc = $row['description'];
1192 1192
             //$link .= str_repeat("&nbsp;&gt;", $level);
1193 1193
 
1194
-            $posternom = $myrow['nom'];				$posterprenom = $myrow['prenom'];
1195
-            $posttime = $myrow['post_time'];		$posttext = $myrow['post_text'];
1194
+            $posternom = $myrow['nom']; $posterprenom = $myrow['prenom'];
1195
+            $posttime = $myrow['post_time']; $posttext = $myrow['post_text'];
1196 1196
             $posttitle = $myrow['post_title'];
1197 1197
             $posttext = str_replace('"', "'", $posttext);
1198 1198
 
@@ -1209,8 +1209,8 @@  discard block
 block discarded – undo
1209 1209
             $myrow = Database::fetch_array($result);
1210 1210
 
1211 1211
             $pathname = explode('/', $myrow['path']); // Making a correct name for the link.
1212
-            $last = count($pathname) - 1;  // Making a correct name for the link.
1213
-            $filename = $pathname[$last];  // Making a correct name for the link.
1212
+            $last = count($pathname) - 1; // Making a correct name for the link.
1213
+            $filename = $pathname[$last]; // Making a correct name for the link.
1214 1214
 
1215 1215
             $sql = "select * from $tbl_lp_item where c_id = $course_id AND id=$id_in_path";
1216 1216
             $result = Database::query($sql);
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
     unset($addedresource[$resource_key]);
1289 1289
     unset($addedresourceid[$resource_key]);
1290 1290
     $_SESSION['addedresource'] = $addedresource;
1291
-    $_SESSION['addedresourceid'] = $addedresourceid ;
1291
+    $_SESSION['addedresourceid'] = $addedresourceid;
1292 1292
 }
1293 1293
 
1294 1294
 /**
@@ -1363,11 +1363,11 @@  discard block
 block discarded – undo
1363 1363
 
1364 1364
     $sql = "SELECT * FROM $TABLERESOURCE
1365 1365
             WHERE c_id = $course_id AND source_type='$type' and source_id=$id";
1366
-    $result=Database::query($sql);
1367
-    while ($row=Database::fetch_array($result))
1366
+    $result = Database::query($sql);
1367
+    while ($row = Database::fetch_array($result))
1368 1368
     {
1369
-        $addedresource[]=$row["resource_type"];
1370
-        $addedresourceid[]=$row["resource_id"];
1369
+        $addedresource[] = $row["resource_type"];
1370
+        $addedresourceid[] = $row["resource_id"];
1371 1371
     }
1372 1372
     $_SESSION['addedresource'] = $addedresource;
1373 1373
     $_SESSION['addedresourceid'] = $addedresourceid;
@@ -1413,11 +1413,11 @@  discard block
 block discarded – undo
1413 1413
 
1414 1414
     $sql = "SELECT * FROM $TABLERESOURCE WHERE c_id = $course_id AND source_type='$type' and source_id='$id'";
1415 1415
     $result = Database::query($sql);
1416
-    while ($row=Database::fetch_array($result)) {
1416
+    while ($row = Database::fetch_array($result)) {
1417 1417
         if ($origin != 'learnpath') {
1418
-            display_addedresource_link($row['resource_type'], $row['resource_id'], $style) ;
1418
+            display_addedresource_link($row['resource_type'], $row['resource_id'], $style);
1419 1419
         } else {
1420
-            display_addedresource_link_in_learnpath($row['resource_type'], $row['resource_id'],'agendaitems','','builder','icon') ; echo "<br>";
1420
+            display_addedresource_link_in_learnpath($row['resource_type'], $row['resource_id'], 'agendaitems', '', 'builder', 'icon'); echo "<br>";
1421 1421
         }
1422 1422
     }
1423 1423
 }
@@ -1479,7 +1479,7 @@  discard block
 block discarded – undo
1479 1479
 
1480 1480
     if (is_array($_SESSION['addedresource'])) {
1481 1481
         foreach ($addedresource as $toolcompare) {
1482
-            if ($toolcompare==$type && $addedresourceid[key($addedresource)] == $id) {
1482
+            if ($toolcompare == $type && $addedresourceid[key($addedresource)] == $id) {
1483 1483
                 $show = 0;
1484 1484
             }
1485 1485
             next($addedresource);
@@ -1513,7 +1513,7 @@  discard block
 block discarded – undo
1513 1513
  * @param boolean	Open in a new window (true) or in the current frame/window (false)?
1514 1514
  * @todo use the constants for the type definitions.
1515 1515
  */
1516
-function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_window = true) {
1516
+function rl_get_html_resource_link($course_code, $type, $id, $style = '', $new_window = true) {
1517 1517
     $_course = api_get_course_info($course_code);
1518 1518
 
1519 1519
     $course_id = api_get_course_int_id();
@@ -1559,7 +1559,7 @@  discard block
 block discarded – undo
1559 1559
         case TOOL_THREAD:  //=topics
1560 1560
             //$tbl_forum 		= Database::get_course_table(TABLE_FORUM);
1561 1561
             //$tbl_thread 	= Database::get_course_table(TABLE_FORUM_THREAD);
1562
-            $tbl_post 		= Database::get_course_table(TABLE_FORUM_POST);
1562
+            $tbl_post = Database::get_course_table(TABLE_FORUM_POST);
1563 1563
             // grabbing the title of the post
1564 1564
             $sql_title = "SELECT * FROM $tbl_post WHERE c_id = $course_id AND post_id=".$id;
1565 1565
             $result_title = Database::query($sql_title);
@@ -1579,8 +1579,8 @@  discard block
 block discarded – undo
1579 1579
             $result = Database::query("SELECT * FROM $tbl_doc WHERE c_id = $course_id AND id=$id");
1580 1580
             $myrow = Database::fetch_array($result);
1581 1581
             $pathname = explode('/', $myrow['path']); // Making a correct name for the link.
1582
-            $last = count($pathname) - 1;  // Making a correct name for the link.
1583
-            $filename = $pathname[$last];  // Making a correct name for the link.
1582
+            $last = count($pathname) - 1; // Making a correct name for the link.
1583
+            $filename = $pathname[$last]; // Making a correct name for the link.
1584 1584
             $image = choose_image($filename);
1585 1585
             $ext = explode('.', $filename);
1586 1586
             $ext = strtolower($ext[sizeof($ext) - 1]);
@@ -1654,8 +1654,8 @@  discard block
 block discarded – undo
1654 1654
             if (!empty($id)) {
1655 1655
                 $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
1656 1656
                 $sql = "SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id";
1657
-                $result= Database::query($sql);
1658
-                $myrow=Database::fetch_array($result);
1657
+                $result = Database::query($sql);
1658
+                $myrow = Database::fetch_array($result);
1659 1659
                 if ($row_item['title'] != '') {
1660 1660
                     $myrow['title'] = $row_item['title'];
1661 1661
                 }
@@ -1667,8 +1667,8 @@  discard block
 block discarded – undo
1667 1667
             $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE c_id = $course_id AND id=$id");
1668 1668
             $myrow = Database::fetch_array($result);
1669 1669
             $path = $myrow['path'];
1670
-            $link .= $main_dir_path.'exercice/showinframes.php?file='.$path.'' .
1671
-                    '&origin='.$origin.'&cid='.$course_code.'&uid='.api_get_user_id().'' .
1670
+            $link .= $main_dir_path.'exercice/showinframes.php?file='.$path.''.
1671
+                    '&origin='.$origin.'&cid='.$course_code.'&uid='.api_get_user_id().''.
1672 1672
                     '&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$id_in_path.'&lp_view_id='.$lpViewId;
1673 1673
             break;
1674 1674
         case TOOL_FORUM:
@@ -1680,7 +1680,7 @@  discard block
 block discarded – undo
1680 1680
                 $sql = "SELECT * FROM $tbl_topics WHERE c_id = $course_id AND thread_id=$id";
1681 1681
                 $result = Database::query($sql);
1682 1682
                 $myrow = Database::fetch_array($result);
1683
-                $link .= $main_dir_path.'forum/viewthread.php?origin=learnpath&thread='.$id.'' .
1683
+                $link .= $main_dir_path.'forum/viewthread.php?origin=learnpath&thread='.$id.''.
1684 1684
                         '&forum='.$myrow['forum_id'].'&lp=true';
1685 1685
             }
1686 1686
             break;
@@ -1696,8 +1696,8 @@  discard block
 block discarded – undo
1696 1696
             $posttitle = $title;
1697 1697
             $posttext = str_replace('"', "'", $posttext);
1698 1698
 
1699
-            $link .= $main_dir_path.'forum/viewthread.php?post='.$id.'' .
1700
-                    '&thread='.$myrow['thread_id'].'&forum='.$myrow['forum_id'].'' .
1699
+            $link .= $main_dir_path.'forum/viewthread.php?post='.$id.''.
1700
+                    '&thread='.$myrow['thread_id'].'&forum='.$myrow['forum_id'].''.
1701 1701
                     '&lp=true';
1702 1702
             break;
1703 1703
         case TOOL_DOCUMENT:
@@ -1709,8 +1709,8 @@  discard block
 block discarded – undo
1709 1709
             $link .= $main_course_path.'document'.$docurl.'?cidReq='.$course_code.'&id_session='.$session_id;
1710 1710
             $openmethod = 2;
1711 1711
             $officedoc = false;
1712
-            Session::write('openmethod',$openmethod);
1713
-            Session::write('officedoc',$officedoc);
1712
+            Session::write('openmethod', $openmethod);
1713
+            Session::write('officedoc', $officedoc);
1714 1714
             break;
1715 1715
         case 'assignments':
1716 1716
             $link .= $main_dir_path.'work/work.php?origin='.$origin;
@@ -1834,8 +1834,8 @@  discard block
 block discarded – undo
1834 1834
             $result = Database::query("SELECT * FROM $tbl_doc WHERE c_id = $course_id AND id=$id");
1835 1835
             $myrow = Database::fetch_array($result);
1836 1836
             $pathname = explode('/', $myrow['path']); // Making a correct name for the link.
1837
-            $last = count($pathname) - 1;  // Making a correct name for the link.
1838
-            $filename = $pathname[$last];  // Making a correct name for the link.
1837
+            $last = count($pathname) - 1; // Making a correct name for the link.
1838
+            $filename = $pathname[$last]; // Making a correct name for the link.
1839 1839
             $image = choose_image($filename);
1840 1840
             $ext = explode('.', $filename);
1841 1841
             $ext = strtolower($ext[sizeof($ext) - 1]);
Please login to merge, or discard this patch.
main/newscorm/lp_edit_item.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -27,22 +27,22 @@  discard block
 block discarded – undo
27 27
 $htmlHeadXtra[] = '
28 28
 <script>'.$_SESSION['oLP']->get_js_dropdown_array().
29 29
 
30
-'function load_cbo(id){' ."\n" .
30
+'function load_cbo(id){'."\n".
31 31
   'if (!id) {return false;}'.
32
-  'var cbo = document.getElementById(\'previous\');' .
33
-  'for(var i = cbo.length - 1; i > 0; i--) {' .
34
-    'cbo.options[i] = null;' .
35
-  '}' ."\n" .
36
-  'var k=0;' .
37
-  'for(var i = 1; i <= child_name[id].length; i++){' ."\n" .
38
-  '  cbo.options[i] = new Option(child_name[id][i-1], child_value[id][i-1]);' ."\n" .
39
-  '  k=i;' ."\n" .
40
-  '}' ."\n" .
32
+  'var cbo = document.getElementById(\'previous\');'.
33
+  'for(var i = cbo.length - 1; i > 0; i--) {'.
34
+    'cbo.options[i] = null;'.
35
+  '}'."\n".
36
+  'var k=0;'.
37
+  'for(var i = 1; i <= child_name[id].length; i++){'."\n".
38
+  '  cbo.options[i] = new Option(child_name[id][i-1], child_value[id][i-1]);'."\n".
39
+  '  k=i;'."\n".
40
+  '}'."\n".
41 41
   //'if( typeof cbo != "undefined" ) {'."\n" .
42
-  'cbo.options[k].selected = true;'."\n" .
42
+  'cbo.options[k].selected = true;'."\n".
43 43
    //'}'."\n" .
44 44
 
45
-   '$(\'#previous\').selectpicker(\'refresh\');' .
45
+   '$(\'#previous\').selectpicker(\'refresh\');'.
46 46
 '}
47 47
 
48 48
 $(document).on("ready", function() {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 }
92 92
 
93 93
 if (!empty($gradebook) && $gradebook == 'view') {
94
-    $interbreadcrumb[] = array (
94
+    $interbreadcrumb[] = array(
95 95
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
96 96
         'name' => get_lang('ToolGradebook')
97 97
     );
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 $show_learn_path = true;
105 105
 $lp_theme_css = $_SESSION['oLP']->get_theme();
106 106
 
107
-Display::display_header(get_lang('Edit'),'Path');
107
+Display::display_header(get_lang('Edit'), 'Path');
108 108
 $suredel = trim(get_lang('AreYouSureToDeleteJS'));
109 109
 
110 110
 ?>
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 $path_item = isset($_GET['path_item']) ? $_GET['path_item'] : 0;
158 158
 $path_item = Database::escape_string($path_item);
159 159
 $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
160
-$sql_doc = "SELECT path FROM " . $tbl_doc . "
161
-            WHERE c_id = $course_id AND id = '". $path_item."' ";
160
+$sql_doc = "SELECT path FROM ".$tbl_doc."
161
+            WHERE c_id = $course_id AND id = '".$path_item."' ";
162 162
 
163 163
 $res_doc = Database::query($sql_doc);
164 164
 $path_file = Database::result($res_doc, 0, 0);
Please login to merge, or discard this patch.