Completed
Push — 1.11.x ( 79bd65...73103f )
by José
30:45
created
main/coursecopy/copy_course_session.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 function display_form()
87 87
 {
88
-    $html  = '';
88
+    $html = '';
89 89
     $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC'));
90 90
 
91 91
     // Link back to the documents overview
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
     //destination
111 111
     $html .= '<div class="form-group">';
112
-    $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>';
112
+    $html .= '<label class="col-sm-2 control-label">'.get_lang('DestinationCoursesFromSession').': </label>';
113 113
     $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">';
114 114
     $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">';
115 115
     $html .= '<option value = "0">'.get_lang('ThereIsNotStillASession').'</option></select ></div>';
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     $html .= '<button class="btn btn-success" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><em class="fa fa-files-o"></em> '.get_lang('CopyCourse').'</button>';
132 132
 
133 133
     // Add Security token
134
-    $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">';
134
+    $html .= '<input type="hidden" value="'.Security::get_token().'" name="sec_token">';
135 135
     $html .= '</div></div>';
136 136
     $html .= '</form>';
137 137
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 /* HTML head extra */
229 229
 
230
-$htmlHeadXtra[] = $xajax->getJavascript( api_get_path(WEB_LIBRARY_PATH).'xajax/');
230
+$htmlHeadXtra[] = $xajax->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax/');
231 231
 $htmlHeadXtra[] = '<script>
232 232
 function checkSelected(id_select,id_radio,id_title,id_destination) {
233 233
    var num=0;
Please login to merge, or discard this patch.
main/template/default/auth/courses_list.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 <div id="actions" class="actions">
19 19
     <?php if ($action != 'createcoursecategory') { ?>
20 20
 	<a href="<?php echo api_get_self(); ?>?action=createcoursecategory">
21
-        <?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a>
21
+        <?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'), '', '32'); ?></a>
22 22
     <?php } ?>
23 23
 </div>
24 24
 
@@ -50,26 +50,26 @@  discard block
 block discarded – undo
50 50
             $max_category_key = count($user_course_categories);
51 51
             if ($action != 'unsubscribe') { ?>
52 52
                 <a href="courses.php?action=sortmycourses&amp;categoryid=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>#category<?php echo $row['id']; ?>">
53
-                <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?>
53
+                <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?>
54 54
                 </a>
55 55
 
56 56
                 <?php if ($row['id'] != $user_course_categories[0]['id']) { ?>
57 57
                         <a href="courses.php?action=<?php echo $action ?>&amp;move=up&amp;category=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
58
-                        <?php echo Display::return_icon('up.png', get_lang('Up'),'',22); ?>
58
+                        <?php echo Display::return_icon('up.png', get_lang('Up'), '', 22); ?>
59 59
                         </a>
60 60
                 <?php } else { ?>
61
-                    <?php echo Display::return_icon('up_na.png', get_lang('Up'),'',22); ?>
61
+                    <?php echo Display::return_icon('up_na.png', get_lang('Up'), '', 22); ?>
62 62
                <?php } ?>
63 63
 
64 64
                 <?php if ($row['id'] != $user_course_categories[$max_category_key - 1]['id']) { ?>
65 65
                     <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;category=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
66
-                    <?php echo Display::return_icon('down.png', get_lang('Down'),'',22); ?>
66
+                    <?php echo Display::return_icon('down.png', get_lang('Down'), '', 22); ?>
67 67
                     </a>
68 68
                 <?php } else { ?>
69
-                    <?php echo Display::return_icon('down_na.png', get_lang('Down'),'',22); ?>
69
+                    <?php echo Display::return_icon('down_na.png', get_lang('Down'), '', 22); ?>
70 70
                 <?php } ?>
71 71
                 <a href="courses.php?action=deletecoursecategory&amp;id=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
72
-                <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"),22) ?>
72
+                <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"), 22) ?>
73 73
                 </a>
74 74
             <?php }
75 75
             echo '<br /><br />';
@@ -123,35 +123,35 @@  discard block
 block discarded – undo
123 123
                     <div style="float:left;width:110px;">
124 124
                     <?php
125 125
                         if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
126
-                            $icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
126
+                            $icon_title = get_lang('CourseDetails').' - '.$course['title'];
127 127
                     ?>
128 128
                     <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax">
129
-                        <?php echo Display::return_icon('info.png', $icon_title,'','22') ?>
129
+                        <?php echo Display::return_icon('info.png', $icon_title, '', '22') ?>
130 130
                        <?php } ?>
131 131
                     </a>
132 132
 
133 133
                     <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?>
134
-                          <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?>
134
+                          <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?>
135 135
                     <?php } else { ?>
136 136
                         <a href="courses.php?action=<?php echo $action; ?>&amp;edit=<?php echo $course['code']; ?>&amp;sec_token=<?php echo $stok; ?>">
137
-                            <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?>
137
+                            <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?>
138 138
                             </a>
139 139
                     <?php } ?>
140 140
 
141 141
                     <?php if ($key > 0) { ?>
142 142
                         <a href="courses.php?action=<?php echo $action; ?>&amp;move=up&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
143
-                        <?php echo Display::display_icon('up.png', get_lang('Up'),'',22); ?>
143
+                        <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22); ?>
144 144
                         </a>
145 145
                     <?php } else { ?>
146
-                        <?php echo Display::display_icon('up_na.png', get_lang('Up'),'',22); ?>
146
+                        <?php echo Display::display_icon('up_na.png', get_lang('Up'), '', 22); ?>
147 147
                     <?php } ?>
148 148
 
149 149
                     <?php if ($key < $number_of_courses - 1) { ?>
150 150
                         <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
151
-                        <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?>
151
+                        <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?>
152 152
                         </a>
153 153
                     <?php } else { ?>
154
-                        <?php echo Display::display_icon('down_na.png', get_lang('Down'),'',22); ?>
154
+                        <?php echo Display::display_icon('down_na.png', get_lang('Down'), '', 22); ?>
155 155
                     <?php } ?>
156 156
 
157 157
                   </div>
@@ -219,36 +219,36 @@  discard block
 block discarded – undo
219 219
             <div style="float:left; width:110px">
220 220
             <?php
221 221
             if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
222
-            $icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
222
+            $icon_title = get_lang('CourseDetails').' - '.$course['title'];
223 223
             ?>
224 224
             <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax">
225
-                <?php echo Display::return_icon('info.png', $icon_title, '','22'); ?>
225
+                <?php echo Display::return_icon('info.png', $icon_title, '', '22'); ?>
226 226
             </a>
227 227
             <?php } ?>
228 228
 
229 229
              <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {   ?>
230
-                    <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?>
230
+                    <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?>
231 231
                   <?php } else { ?>
232 232
                     <a href="courses.php?action=<?php echo $action; ?>&amp;edit=<?php echo $course['code']; ?>&amp;sec_token=<?php echo $stok; ?>">
233
-                    <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?>
233
+                    <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?>
234 234
                     </a>
235 235
              <?php } ?>
236 236
 
237 237
             <!-- up /down icons-->
238 238
             <?php if ($key > 0) { ?>
239 239
                     <a href="courses.php?action=<?php echo $action; ?>&amp;move=up&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
240
-                    <?php echo Display::display_icon('up.png', get_lang('Up'),'',22) ?>
240
+                    <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22) ?>
241 241
                     </a>
242 242
             <?php } else {
243
-                    echo Display::display_icon('up_na.png', get_lang('Up'),'',22);
243
+                    echo Display::display_icon('up_na.png', get_lang('Up'), '', 22);
244 244
                   }
245 245
 
246 246
                   if ($key < $number_of_courses - 1) { ?>
247 247
                     <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
248
-                    <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?>
248
+                    <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?>
249 249
                     </a>
250 250
             <?php } else {
251
-                    echo Display::display_icon('down_na.png', get_lang('Down'),'',22);
251
+                    echo Display::display_icon('down_na.png', get_lang('Down'), '', 22);
252 252
                   }?>
253 253
                 </div>
254 254
                  <div style="float:left; margin-right:10px;">
Please login to merge, or discard this patch.
main/inc/lib/legal.lib.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     public static function get_last_condition_version($language)
81 81
     {
82 82
         $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL);
83
-        $language= Database::escape_string($language);
83
+        $language = Database::escape_string($language);
84 84
         $sql = "SELECT version FROM $legal_conditions_table
85 85
                 WHERE language_id = '".$language."'
86 86
                 ORDER BY id DESC LIMIT 1 ";
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	public static function get_last_condition($language)
102 102
     {
103 103
 		$legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL);
104
-		$language= Database::escape_string($language);
104
+		$language = Database::escape_string($language);
105 105
 		$sql = "SELECT * FROM $legal_conditions_table
106 106
                 WHERE language_id = '".$language."'
107 107
                 ORDER BY version DESC
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
                 ORDER BY version DESC
152 152
                 LIMIT 1 ";
153 153
         $result = Database::query($sql);
154
-        if (Database::num_rows($result)>0){
154
+        if (Database::num_rows($result) > 0) {
155 155
             $version = Database::fetch_array($result);
156
-            $version = explode(':',$version[0]);
156
+            $version = explode(':', $version[0]);
157 157
 
158 158
             return $version[0];
159 159
         } else {
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 break;
185 185
                 // Page link
186 186
             case 1:
187
-                $preview ='<fieldset>
187
+                $preview = '<fieldset>
188 188
                              <legend>'.get_lang('TermsAndConditions').'</legend>';
189 189
                 $preview .= '<div id="legal-accept-wrapper" class="form-item">
190 190
                 <label class="option" for="legal-accept">
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		$number_of_items = intval($number_of_items);
218 218
 		$column = intval($column);
219 219
 
220
- 		$sql  = "SELECT version, original_name as language, content, changes, type, FROM_UNIXTIME(date)
220
+ 		$sql = "SELECT version, original_name as language, content, changes, type, FROM_UNIXTIME(date)
221 221
 				FROM $legal_conditions_table inner join $lang_table l on(language_id = l.id) ";
222 222
 		$sql .= "ORDER BY language, version ASC ";
223 223
 		$sql .= "LIMIT $from, $number_of_items ";
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 		        FROM $legal_conditions_table
253 253
 		        ORDER BY id DESC ";
254 254
 		$result = Database::query($sql);
255
-		$url = Database::fetch_array($result,'ASSOC');
255
+		$url = Database::fetch_array($result, 'ASSOC');
256 256
 		$result = $url['count_result'];
257 257
 
258 258
 		return $result;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		        WHERE id =  "'.$legal_id.'" AND language_id="'.$language_id.'"';
274 274
 		$rs = Database::query($sql);
275 275
 
276
-		return Database::result($rs,0,'type');
276
+		return Database::result($rs, 0, 'type');
277 277
 	}
278 278
 
279 279
     /**
Please login to merge, or discard this patch.
main/inc/lib/pdf.lib.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         /* More info @ http://mpdf1.com/manual/index.php?tid=184&searchstring=mPDF
34 34
          * mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]])
35 35
          */
36
-        if (!in_array($orientation, array('P','L'))) {
36
+        if (!in_array($orientation, array('P', 'L'))) {
37 37
             $orientation = 'P';
38 38
         }
39 39
         //$this->pdf = $pdf = new mPDF('UTF-8', $pageFormat, '', '', 30, 20, 27, 25, 16, 13, $orientation);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $visualTheme = api_get_visual_theme();
101 101
             $img = api_get_path(SYS_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png';
102 102
             if (file_exists($img)) {
103
-                $img = api_get_path(WEB_CSS_PATH) . 'themes/' . $visualTheme . '/images/pdf_logo_header.png';
103
+                $img = api_get_path(WEB_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png';
104 104
                 $organization = "<img src='$img'>";
105 105
             }
106 106
         }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             // then print the title in the PDF
238 238
             if (is_array($file) && isset($file['title'])) {
239 239
                 $html_title = $file['title'];
240
-                $file  = $file['path'];
240
+                $file = $file['path'];
241 241
             } else {
242 242
                 //we suppose we've only been sent a file path
243 243
                 $html_title = basename($file);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
             //it's not a chapter but the file exists, print its title
269 269
             if ($print_title) {
270 270
                 $this->pdf->WriteHTML(
271
-                    '<html><body><h3>' . $html_title . '</h3></body></html>'
271
+                    '<html><body><h3>'.$html_title.'</h3></body></html>'
272 272
                 );
273 273
             }
274 274
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
                 if ($extension === 'html') {
284 284
                     $filename = basename($filename, '.html');
285
-                } elseif($extension === 'htm'){
285
+                } elseif ($extension === 'htm') {
286 286
                     $filename = basename($filename, '.htm');
287 287
                 }
288 288
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                 $document_html = str_replace('href="./css/frames.css"', $absolute_css_path, $document_html);
295 295
 
296 296
                 if (!empty($course_data['path'])) {
297
-                    $document_html= str_replace('../', '', $document_html);
297
+                    $document_html = str_replace('../', '', $document_html);
298 298
                     $document_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document/';
299 299
 
300 300
                     $doc = new DOMDocument();
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
                 if (!empty($document_html)) {
373 373
                     $this->pdf->WriteHTML($document_html.$page_break);
374 374
                 }
375
-            } elseif (in_array($extension, array('jpg','jpeg','png','gif'))) {
375
+            } elseif (in_array($extension, array('jpg', 'jpeg', 'png', 'gif'))) {
376 376
                 //Images
377 377
                 $image = Display::img($file);
378 378
                 $this->pdf->WriteHTML('<html><body>'.$image.'</body></html>'.$page_break);
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 
436 436
         //absolute path for frames.css //TODO: necessary?
437 437
         $absolute_css_path = api_get_path(WEB_CSS_PATH).api_get_setting('stylesheets').'/frames.css';
438
-        $document_html = str_replace('href="./css/frames.css"','href="'.$absolute_css_path.'"', $document_html);
438
+        $document_html = str_replace('href="./css/frames.css"', 'href="'.$absolute_css_path.'"', $document_html);
439 439
 
440 440
         $document_html = str_replace('../../', '', $document_html);
441 441
         $document_html = str_replace('../', '', $document_html);
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
                                 $old_src_fixed = str_replace(api_get_path(REL_COURSE_PATH).$course_data['path'].'/document/', '', $old_src);
464 464
                                 $old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src_fixed);
465 465
                                 $new_path = $document_path.$old_src_fixed;
466
-                                $document_html= str_replace($old_src, $new_path, $document_html);
466
+                                $document_html = str_replace($old_src, $new_path, $document_html);
467 467
 
468 468
                             }
469 469
                         }
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
         //$document_html= str_replace('temp_template_path', 'src="/main/default_course_document/', $document_html);// restore src templates
483 483
 
484 484
         api_set_encoding_html($document_html, 'UTF-8'); // The library mPDF expects UTF-8 encoded input data.
485
-        $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8');  // TODO: Maybe it is better idea the title to be passed through
485
+        $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8'); // TODO: Maybe it is better idea the title to be passed through
486 486
         // $_GET[] too, as it is done with file name.
487 487
         // At the moment the title is retrieved from the html document itself.
488 488
 
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
         //$this->pdf->Output($output_file, $outputMode); // F to save the pdf in a file
505 505
 
506 506
         if ($outputMode == 'F') {
507
-            $output_file = api_get_path(SYS_ARCHIVE_PATH) . $output_file;
507
+            $output_file = api_get_path(SYS_ARCHIVE_PATH).$output_file;
508 508
         }
509 509
 
510 510
         if ($saveInFile) {
@@ -537,14 +537,14 @@  discard block
 block discarded – undo
537 537
         $web_path = false;
538 538
         if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') {
539 539
             $course_info = api_get_course_info($course_code);
540
-            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
540
+            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path
541 541
             if (file_exists($store_path)) {
542
-                $web_path   = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';
542
+                $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';
543 543
             }
544 544
         } else {
545
-            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
545
+            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path
546 546
             if (file_exists($store_path))
547
-                $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
547
+                $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
548 548
         }
549 549
         return $web_path;
550 550
     }
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
     {
585 585
         if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') {
586 586
             $course_info = api_get_course_info($course_code);
587
-            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'];   // course path
587
+            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path']; // course path
588 588
             $web_path   = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/pdf_watermark.png';
589 589
         } else {
590
-            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images';   // course path
590
+            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images'; // course path
591 591
             $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
592 592
         }
593 593
         $course_image = $store_path.'/'.api_get_current_access_url_id().'_pdf_watermark.png';
@@ -620,9 +620,9 @@  discard block
 block discarded – undo
620 620
      */
621 621
     public function set_footer()
622 622
     {
623
-        $this->pdf->defaultfooterfontsize = 12;   // in pts
624
-        $this->pdf->defaultfooterfontstyle = 'B';   // blank, B, I, or BI
625
-        $this->pdf->defaultfooterline = 1;        // 1 to include line below header/above footer
623
+        $this->pdf->defaultfooterfontsize = 12; // in pts
624
+        $this->pdf->defaultfooterfontstyle = 'B'; // blank, B, I, or BI
625
+        $this->pdf->defaultfooterline = 1; // 1 to include line below header/above footer
626 626
         $platform_name   = api_get_setting('Institution');
627 627
         $left_content    = $platform_name;
628 628
         $center_content  = '';
@@ -689,9 +689,9 @@  discard block
 block discarded – undo
689 689
      */
690 690
     public function set_header($course_data)
691 691
     {
692
-        $this->pdf->defaultheaderfontsize   = 10;   // in pts
693
-        $this->pdf->defaultheaderfontstyle  = 'BI';   // blank, B, I, or BI
694
-        $this->pdf->defaultheaderline       = 1;    // 1 to include line below header/above footer
692
+        $this->pdf->defaultheaderfontsize   = 10; // in pts
693
+        $this->pdf->defaultheaderfontstyle  = 'BI'; // blank, B, I, or BI
694
+        $this->pdf->defaultheaderline       = 1; // 1 to include line below header/above footer
695 695
 
696 696
         if (!empty($course_data['code'])) {
697 697
             $teacher_list = CourseManager::get_teacher_list_from_course_code($course_data['code']);
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
             $teachers = '';
700 700
             if (!empty($teacher_list)) {
701 701
                 foreach ($teacher_list as $teacher) {
702
-                    $teachers[]= $teacher['firstname'].' '.$teacher['lastname'];
702
+                    $teachers[] = $teacher['firstname'].' '.$teacher['lastname'];
703 703
                 }
704 704
                 if (count($teachers) > 1) {
705 705
                     $teachers = get_lang('Teachers').': '.implode(', ', $teachers);
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
                     'line' => 1,
767 767
                 ),
768 768
             );
769
-            $this->pdf->SetHeader($header);// ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title);
769
+            $this->pdf->SetHeader($header); // ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title);
770 770
         }
771 771
     }
772 772
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
         $this->pdf->directionality = api_get_text_direction();
812 812
         $this->pdf->useOnlyCoreFonts = true;
813 813
         // Use different Odd/Even headers and footers and mirror margins
814
-        $this->pdf->mirrorMargins       = 1;
814
+        $this->pdf->mirrorMargins = 1;
815 815
 
816 816
         // Add decoration only if not stated otherwise
817 817
         if ($complete) {
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
                     $watermark_text = api_get_setting('pdf_export_watermark_text');
840 840
                 }
841 841
                 if (!empty($watermark_text)) {
842
-                    $this->pdf->SetWatermarkText(strcode2utf($watermark_text),0.1);
842
+                    $this->pdf->SetWatermarkText(strcode2utf($watermark_text), 0.1);
843 843
                     $this->pdf->showWatermarkText = true;
844 844
                 }
845 845
             }
@@ -847,8 +847,8 @@  discard block
 block discarded – undo
847 847
             if (empty($this->custom_header)) {
848 848
                 self::set_header($course_data);
849 849
             } else {
850
-                $this->pdf->SetHTMLHeader($this->custom_header,'E');
851
-                $this->pdf->SetHTMLHeader($this->custom_header,'O');
850
+                $this->pdf->SetHTMLHeader($this->custom_header, 'E');
851
+                $this->pdf->SetHTMLHeader($this->custom_header, 'O');
852 852
             }
853 853
 
854 854
             if (empty($this->custom_footer)) {
Please login to merge, or discard this patch.
main/inc/lib/myspace.lib.php 1 patch
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $session_id  = intval($session_id);
135 135
 
136 136
         $sql = 'SELECT login_course_date, logout_course_date
137
-                FROM ' . $tbl_track_course . '
137
+                FROM ' . $tbl_track_course.'
138 138
                 WHERE
139 139
                     user_id = '.$user_id.' AND
140 140
                     c_id = '.$courseId.' AND
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         foreach ($course_list as $course_item) {
174 174
             $courseInfo = api_get_course_info($course_item['code']);
175 175
             $courseId = $courseInfo['real_id'];
176
-            $new_course_list[] =  '"'.$courseId.'"';
176
+            $new_course_list[] = '"'.$courseId.'"';
177 177
         }
178 178
         $course_list = implode(', ', $new_course_list);
179 179
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             return false;
182 182
         }
183 183
         $sql = 'SELECT login_course_date, logout_course_date, c_id
184
-                FROM ' . $tbl_track_course . '
184
+                FROM ' . $tbl_track_course.'
185 185
                 WHERE
186 186
                     user_id = '.$user_id.' AND
187 187
                     c_id IN ('.$course_list.') AND
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
             // student score
260 260
             $avg_score = Tracking :: get_avg_student_score($user_id, $courseCode);
261 261
             if (is_numeric($avg_score)) {
262
-                $avg_score = round($avg_score,2);
262
+                $avg_score = round($avg_score, 2);
263 263
             } else {
264 264
                 $$avg_score = '-';
265 265
             }
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
         $t_head = '    <table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
297 297
         //$t_head .= '  <caption>'.get_lang('CourseInformation').'</caption>';
298
-        $t_head .=      '<tr>';
298
+        $t_head .= '<tr>';
299 299
         $t_head .= '        <th width="155px" style="border-left:0;border-bottom:0"><span>'.get_lang('Course').'</span></th>';
300 300
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).'</span></th>';
301 301
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgStudentsProgress'), 6, true).'</span></th>';
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
         $addparams = array('view' => 'admin', 'display' => 'user');
315 315
 
316
-        $table = new SortableTable('tracking_user_overview', array('MySpace','get_number_of_users_tracking_overview'), array('MySpace','get_user_data_tracking_overview'), 0);
316
+        $table = new SortableTable('tracking_user_overview', array('MySpace', 'get_number_of_users_tracking_overview'), array('MySpace', 'get_user_data_tracking_overview'), 0);
317 317
         $table->additional_parameters = $addparams;
318 318
 
319 319
         $table->set_header(0, get_lang('OfficialCode'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
         }
327 327
         $table->set_header(3, get_lang('LoginName'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
328 328
         $table->set_header(4, $t_head, false, array('style' => 'width:90%;border:0;padding:0;font-size:7.5pt;'), array('style' => 'width:90%;padding:0;font-size:7.5pt;'));
329
-        $table->set_column_filter(4, array('MySpace','course_info_tracking_filter'));
329
+        $table->set_column_filter(4, array('MySpace', 'course_info_tracking_filter'));
330 330
         $table->display();
331 331
     }
332 332
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         $table -> set_header(7, get_lang('Sessions'), false);
387 387
 
388 388
         if ($is_western_name_order) {
389
-            $csv_header[] = array (
389
+            $csv_header[] = array(
390 390
                 get_lang('FirstName'),
391 391
                 get_lang('LastName'),
392 392
                 get_lang('TimeSpentOnThePlatform'),
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                 get_lang('NumberOfSessions')
397 397
             );
398 398
         } else {
399
-            $csv_header[] = array (
399
+            $csv_header[] = array(
400 400
                 get_lang('LastName'),
401 401
                 get_lang('FirstName'),
402 402
                 get_lang('TimeSpentOnThePlatform'),
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
 
537 537
         if ($tracking_column != 3) {
538 538
             if ($tracking_direction == 'DESC') {
539
-                usort($all_datas, array('MySpace','rsort_users'));
539
+                usort($all_datas, array('MySpace', 'rsort_users'));
540 540
             } else {
541
-                usort($all_datas, array('MySpace','sort_users'));
541
+                usort($all_datas, array('MySpace', 'sort_users'));
542 542
             }
543 543
         }
544 544
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
         /**
598 598
          * Column config
599 599
          */
600
-        $column_model   = array(
600
+        $column_model = array(
601 601
             array(
602 602
                 'name' => 'username',
603 603
                 'index' => 'username',
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 
639 639
         $action_links = '';
640 640
         // jqgrid will use this URL to do the selects
641
-        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_session_lp_progress&session_id=' . $sessionId . '&course_id=' . $courseId . '&date_to=' . $date_to . '&date_from=' . $date_from;
641
+        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_session_lp_progress&session_id='.$sessionId.'&course_id='.$courseId.'&date_to='.$date_to.'&date_from='.$date_from;
642 642
 
643 643
         //Table Id
644 644
         $tableId = 'lpProgress';
@@ -660,11 +660,11 @@  discard block
 block discarded – undo
660 660
             true
661 661
         );
662 662
 
663
-        $return = '<script>$(function() {'. $table .
663
+        $return = '<script>$(function() {'.$table.
664 664
             'jQuery("#'.$tableId.'").jqGrid("navGrid","#'.$tableId.'_pager",{view:false, edit:false, add:false, del:false, search:false, excel:true});
665 665
                 jQuery("#'.$tableId.'").jqGrid("navButtonAdd","#'.$tableId.'_pager",{
666 666
                        caption:"",
667
-                       title:"' . get_lang('ExportExcel') . '",
667
+                       title:"' . get_lang('ExportExcel').'",
668 668
                        onClickButton : function () {
669 669
                            jQuery("#'.$tableId.'").jqGrid("excelExport",{"url":"'.$url.'&export_format=xls"});
670 670
                        }
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
         /**
715 715
          * Column config
716 716
          */
717
-        $column_model   = array(
717
+        $column_model = array(
718 718
             array('name'=>'session', 'index'=>'session', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
719 719
             array('name'=>'exercise_id', 'index'=>'exercise_id', 'align'=>'left', 'search' => 'true'),
720 720
             array('name'=>'quiz_title', 'index'=>'quiz_title', 'align'=>'left', 'search' => 'true'),
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
         //get dynamic column names
732 732
 
733 733
         // jqgrid will use this URL to do the selects
734
-        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_exercise_progress&session_id=' . $sessionId . '&course_id=' . $courseId  . '&exercise_id=' . $exerciseId . '&date_to=' . $date_to . '&date_from=' . $date_from;
734
+        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_exercise_progress&session_id='.$sessionId.'&course_id='.$courseId.'&exercise_id='.$exerciseId.'&date_to='.$date_to.'&date_from='.$date_from;
735 735
 
736 736
         // Autowidth
737 737
         $extra_params['autowidth'] = 'true';
@@ -742,11 +742,11 @@  discard block
 block discarded – undo
742 742
         $tableId = 'exerciseProgressOverview';
743 743
         $table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), '', true);
744 744
 
745
-        $return = '<script>$(function() {'. $table .
745
+        $return = '<script>$(function() {'.$table.
746 746
             'jQuery("#'.$tableId.'").jqGrid("navGrid","#'.$tableId.'_pager",{view:false, edit:false, add:false, del:false, search:false, excel:true});
747 747
                 jQuery("#'.$tableId.'").jqGrid("navButtonAdd","#'.$tableId.'_pager",{
748 748
                        caption:"",
749
-                       title:"' . get_lang('ExportExcel') . '",
749
+                       title:"' . get_lang('ExportExcel').'",
750 750
                        onClickButton : function () {
751 751
                            jQuery("#'.$tableId.'").jqGrid("excelExport",{"url":"'.$url.'&export_format=xls"});
752 752
                        }
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
                 // adding the fields that are checked to the session
807 807
                 $message = '';
808 808
                 foreach ($values as $field_ids => $value) {
809
-                    if ($value == 1 && strstr($field_ids,'extra_export_field')) {
809
+                    if ($value == 1 && strstr($field_ids, 'extra_export_field')) {
810 810
                         $_SESSION['additional_export_fields'][] = str_replace('extra_export_field', '', $field_ids);
811 811
                     }
812 812
                 }
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
                 // Displaying a feedback message
822 822
                 if (!empty($_SESSION['additional_export_fields'])) {
823 823
                     Display::display_confirmation_message(get_lang('FollowingFieldsWillAlsoBeExported').': <br /><ul>'.$message.'</ul>', false);
824
-                } else  {
824
+                } else {
825 825
                     Display::display_confirmation_message(get_lang('NoAdditionalFieldsWillBeExported'), false);
826 826
                 }
827 827
             } else {
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
     {
850 850
         $t_head = '    <table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
851 851
         //$t_head .= '  <caption>'.get_lang('CourseInformation').'</caption>';
852
-        $t_head .=      '<tr>';
852
+        $t_head .= '<tr>';
853 853
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).'</span></th>';
854 854
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgStudentsProgress'), 6, true).'</span></th>';
855 855
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgCourseScore'), 6, true).'</span></th>';
@@ -866,13 +866,13 @@  discard block
 block discarded – undo
866 866
 
867 867
         $addparams = array('view' => 'admin', 'display' => 'courseoverview');
868 868
 
869
-        $table = new SortableTable('tracking_session_overview', array('MySpace', 'get_total_number_courses'), array('MySpace','get_course_data_tracking_overview'), 1);
869
+        $table = new SortableTable('tracking_session_overview', array('MySpace', 'get_total_number_courses'), array('MySpace', 'get_course_data_tracking_overview'), 1);
870 870
         $table->additional_parameters = $addparams;
871 871
 
872 872
         $table->set_header(0, '', false, null, array('style' => 'display: none'));
873 873
         $table->set_header(1, get_lang('Course'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
874 874
         $table->set_header(2, $t_head, false, array('style' => 'width:90%;border:0;padding:0;font-size:7.5pt;'), array('style' => 'width:90%;padding:0;font-size:7.5pt;'));
875
-        $table->set_column_filter(2, array('MySpace','course_tracking_filter'));
875
+        $table->set_column_filter(2, array('MySpace', 'course_tracking_filter'));
876 876
         $table->display();
877 877
     }
878 878
 
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
         $sql .= " ORDER BY col$column $direction ";
909 909
         $sql .= " LIMIT $from,$number_of_items";
910 910
         $result = Database::query($sql);
911
-        $return = array ();
911
+        $return = array();
912 912
         while ($course = Database::fetch_row($result)) {
913 913
             $return[] = $course;
914 914
         }
@@ -961,18 +961,18 @@  discard block
 block discarded – undo
961 961
             $progress += $progress_tmp[0];
962 962
             $nb_progress_lp += $progress_tmp[1];
963 963
             $score_tmp = Tracking :: get_avg_student_score($row->user_id, $course_code, array(), null, true);
964
-            if(is_array($score_tmp)) {
964
+            if (is_array($score_tmp)) {
965 965
                 $score += $score_tmp[0];
966 966
                 $nb_score_lp += $score_tmp[1];
967 967
             }
968 968
             $nb_messages += Tracking::count_student_messages($row->user_id, $course_code);
969 969
             $nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code);
970 970
             $last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course($row->user_id, $courseInfo, null, false);
971
-            if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned
971
+            if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned
972 972
                 $last_login_date = $last_login_date_tmp;
973
-            } else if($last_login_date_tmp != false && $last_login_date != false) { // TODO: Repeated previous condition. To be cleaned.
973
+            } else if ($last_login_date_tmp != false && $last_login_date != false) { // TODO: Repeated previous condition. To be cleaned.
974 974
                 // Find the max and assign it to first_login_date
975
-                if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
975
+                if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
976 976
                     $last_login_date = $last_login_date_tmp;
977 977
                 }
978 978
             }
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
                 $progress += $progress_tmp[0];
1111 1111
                 $nb_progress_lp += $progress_tmp[1];
1112 1112
                 $score_tmp = Tracking :: get_avg_student_score($row->user_id, $course_code, array(), null, true);
1113
-                if(is_array($score_tmp)) {
1113
+                if (is_array($score_tmp)) {
1114 1114
                     $score += $score_tmp[0];
1115 1115
                     $nb_score_lp += $score_tmp[1];
1116 1116
                 }
@@ -1118,11 +1118,11 @@  discard block
 block discarded – undo
1118 1118
                 $nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code);
1119 1119
 
1120 1120
                 $last_login_date_tmp = Tracking::get_last_connection_date_on_the_course($row->user_id, $courseInfo, null, false);
1121
-                if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
1121
+                if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
1122 1122
                     $last_login_date = $last_login_date_tmp;
1123
-                } else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
1123
+                } else if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
1124 1124
                     // Find the max and assign it to first_login_date
1125
-                    if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1125
+                    if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1126 1126
                         $last_login_date = $last_login_date_tmp;
1127 1127
                     }
1128 1128
                 }
@@ -1132,22 +1132,22 @@  discard block
 block discarded – undo
1132 1132
                 $total_score_possible += $exercise_results_tmp['score_possible'];
1133 1133
                 $total_questions_answered += $exercise_results_tmp['questions_answered'];
1134 1134
             }
1135
-            if($nb_progress_lp > 0) {
1135
+            if ($nb_progress_lp > 0) {
1136 1136
                 $avg_progress = round($progress / $nb_progress_lp, 2);
1137 1137
             } else {
1138 1138
                 $avg_progress = 0;
1139 1139
             }
1140
-            if($nb_score_lp > 0) {
1140
+            if ($nb_score_lp > 0) {
1141 1141
                 $avg_score = round($score / $nb_score_lp, 2);
1142 1142
             } else {
1143 1143
                 $avg_score = '-';
1144 1144
             }
1145
-            if($last_login_date) {
1145
+            if ($last_login_date) {
1146 1146
                 $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
1147 1147
             } else {
1148 1148
                 $last_login_date = '-';
1149 1149
             }
1150
-            if($total_score_possible > 0) {
1150
+            if ($total_score_possible > 0) {
1151 1151
                 $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
1152 1152
             } else {
1153 1153
                 $total_score_percentage = 0;
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
     {
1184 1184
         $t_head = '    <table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
1185 1185
         //$t_head .= '  <caption>'.get_lang('CourseInformation').'</caption>';
1186
-        $t_head .=      '<tr>';
1186
+        $t_head .= '<tr>';
1187 1187
         $t_head .= '        <th width="155px" style="border-left:0;border-bottom:0"><span>'.get_lang('Course').'</span></th>';
1188 1188
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).'</span></th>';
1189 1189
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgStudentsProgress'), 6, true).'</span></th>';
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 
1202 1202
         $addparams = array('view' => 'admin', 'display' => 'sessionoverview');
1203 1203
 
1204
-        $table = new SortableTable('tracking_session_overview', array('MySpace','get_total_number_sessions'), array('MySpace','get_session_data_tracking_overview'), 1);
1204
+        $table = new SortableTable('tracking_session_overview', array('MySpace', 'get_total_number_sessions'), array('MySpace', 'get_session_data_tracking_overview'), 1);
1205 1205
         $table->additional_parameters = $addparams;
1206 1206
 
1207 1207
         $table->set_header(0, '', false, null, array('style' => 'display: none'));
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
         $sql .= " ORDER BY col$column $direction ";
1241 1241
         $sql .= " LIMIT $from,$number_of_items";
1242 1242
         $result = Database::query($sql);
1243
-        $return = array ();
1243
+        $return = array();
1244 1244
         while ($session = Database::fetch_row($result)) {
1245 1245
             $return[] = $session;
1246 1246
         }
@@ -1329,10 +1329,10 @@  discard block
 block discarded – undo
1329 1329
                 if ($last_login_date_tmp != false && $last_login_date == false) {
1330 1330
                     // TODO: To be cleaned.
1331 1331
                     $last_login_date = $last_login_date_tmp;
1332
-                } else if($last_login_date_tmp != false && $last_login_date != false) {
1332
+                } else if ($last_login_date_tmp != false && $last_login_date != false) {
1333 1333
                     // TODO: Repeated previous condition! To be cleaned.
1334 1334
                     // Find the max and assign it to first_login_date
1335
-                    if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1335
+                    if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1336 1336
                         $last_login_date = $last_login_date_tmp;
1337 1337
                     }
1338 1338
                 }
@@ -1342,27 +1342,27 @@  discard block
 block discarded – undo
1342 1342
                 $total_score_possible += $exercise_results_tmp['score_possible'];
1343 1343
                 $total_questions_answered += $exercise_results_tmp['questions_answered'];
1344 1344
             }
1345
-            if($nb_progress_lp > 0) {
1345
+            if ($nb_progress_lp > 0) {
1346 1346
                 $avg_progress = round($progress / $nb_progress_lp, 2);
1347 1347
             } else {
1348 1348
                 $avg_progress = 0;
1349 1349
             }
1350
-            if($nb_score_lp > 0) {
1350
+            if ($nb_score_lp > 0) {
1351 1351
                 $avg_score = round($score / $nb_score_lp, 2);
1352 1352
             } else {
1353 1353
                 $avg_score = '-';
1354 1354
             }
1355
-            if($last_login_date) {
1355
+            if ($last_login_date) {
1356 1356
                 $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
1357 1357
             } else {
1358 1358
                 $last_login_date = '-';
1359 1359
             }
1360
-            if($total_score_possible > 0) {
1360
+            if ($total_score_possible > 0) {
1361 1361
                 $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
1362 1362
             } else {
1363 1363
                 $total_score_percentage = 0;
1364 1364
             }
1365
-            if($total_score_percentage > 0) {
1365
+            if ($total_score_percentage > 0) {
1366 1366
                 $total_score = $total_score_obtained.'/'.$total_score_possible.' ('.$total_score_percentage.' %)';
1367 1367
             } else {
1368 1368
                 $total_score = '-';
@@ -1473,7 +1473,7 @@  discard block
 block discarded – undo
1473 1473
                 $total_score_obtained = 0;
1474 1474
                 $total_score_possible = 0;
1475 1475
                 $total_questions_answered = 0;
1476
-                while($row_user = Database::fetch_object($result_users)) {
1476
+                while ($row_user = Database::fetch_object($result_users)) {
1477 1477
                     // get time spent in the course and session
1478 1478
                     $time_spent += Tracking::get_time_spent_on_the_course($row_user->user_id, $courseId, $session_id);
1479 1479
                     $progress_tmp = Tracking::get_avg_student_progress($row_user->user_id, $row->code, array(), $session_id, true);
@@ -1502,11 +1502,11 @@  discard block
 block discarded – undo
1502 1502
                         $session_id,
1503 1503
                         false
1504 1504
                     );
1505
-                    if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
1505
+                    if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
1506 1506
                         $last_login_date = $last_login_date_tmp;
1507
-                    } else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
1507
+                    } else if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
1508 1508
                         // Find the max and assign it to first_login_date
1509
-                        if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1509
+                        if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1510 1510
                             $last_login_date = $last_login_date_tmp;
1511 1511
                         }
1512 1512
                     }
@@ -1516,27 +1516,27 @@  discard block
 block discarded – undo
1516 1516
                     $total_score_possible += $exercise_results_tmp['score_possible'];
1517 1517
                     $total_questions_answered += $exercise_results_tmp['questions_answered'];
1518 1518
                 }
1519
-                if($nb_progress_lp > 0) {
1519
+                if ($nb_progress_lp > 0) {
1520 1520
                     $avg_progress = round($progress / $nb_progress_lp, 2);
1521 1521
                 } else {
1522 1522
                     $avg_progress = 0;
1523 1523
                 }
1524
-                if($nb_score_lp > 0) {
1524
+                if ($nb_score_lp > 0) {
1525 1525
                     $avg_score = round($score / $nb_score_lp, 2);
1526 1526
                 } else {
1527 1527
                     $avg_score = '-';
1528 1528
                 }
1529
-                if($last_login_date) {
1529
+                if ($last_login_date) {
1530 1530
                     $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
1531 1531
                 } else {
1532 1532
                     $last_login_date = '-';
1533 1533
                 }
1534
-                if($total_score_possible > 0) {
1534
+                if ($total_score_possible > 0) {
1535 1535
                     $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
1536 1536
                 } else {
1537 1537
                     $total_score_percentage = 0;
1538 1538
                 }
1539
-                if($total_score_percentage > 0) {
1539
+                if ($total_score_percentage > 0) {
1540 1540
                     $total_score = $total_score_obtained.'/'.$total_score_possible.' ('.$total_score_percentage.' %)';
1541 1541
                 } else {
1542 1542
                     $total_score = '-';
@@ -1596,7 +1596,7 @@  discard block
 block discarded – undo
1596 1596
         while ($row = Database::fetch_array($result)) {
1597 1597
             $score_obtained += $row['exe_result'];
1598 1598
             $score_possible += $row['exe_weighting'];
1599
-            $questions_answered ++;
1599
+            $questions_answered++;
1600 1600
         }
1601 1601
 
1602 1602
         if ($score_possible != 0) {
@@ -1716,9 +1716,9 @@  discard block
 block discarded – undo
1716 1716
                     }
1717 1717
                 }
1718 1718
                 // time spent in the course
1719
-                $csv_row[] = api_time_to_hms(Tracking::get_time_spent_on_the_course ($user[4], $courseId));
1719
+                $csv_row[] = api_time_to_hms(Tracking::get_time_spent_on_the_course($user[4], $courseId));
1720 1720
                 // student progress in course
1721
-                $csv_row[] = round(Tracking::get_avg_student_progress ($user[4], $row[0]), 2);
1721
+                $csv_row[] = round(Tracking::get_avg_student_progress($user[4], $row[0]), 2);
1722 1722
                 // student score
1723 1723
                 $csv_row[] = round(Tracking::get_avg_student_score($user[4], $row[0]), 2);
1724 1724
                 // student tes score
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
                 // student messages
1727 1727
                 $csv_row[] = Tracking::count_student_messages($user[4], $row[0]);
1728 1728
                 // student assignments
1729
-                $csv_row[] = Tracking::count_student_assignments ($user[4], $row[0]);
1729
+                $csv_row[] = Tracking::count_student_assignments($user[4], $row[0]);
1730 1730
                 // student exercises results
1731 1731
                 $exercises_results = MySpace::exercises_results($user[4], $row[0]);
1732 1732
                 $csv_row[] = $exercises_results['score_obtained'];
@@ -1734,7 +1734,7 @@  discard block
 block discarded – undo
1734 1734
                 $csv_row[] = $exercises_results['questions_answered'];
1735 1735
                 $csv_row[] = $exercises_results['percentage'];
1736 1736
                 // first connection
1737
-                $csv_row[] = Tracking::get_first_connection_date_on_the_course ($user[4], $courseId);
1737
+                $csv_row[] = Tracking::get_first_connection_date_on_the_course($user[4], $courseId);
1738 1738
                 // last connection
1739 1739
                 $csv_row[] = strip_tags(Tracking::get_last_connection_date_on_the_course($user[4], $courseInfo));
1740 1740
 
@@ -1768,9 +1768,9 @@  discard block
 block discarded – undo
1768 1768
         // get all courses with limit
1769 1769
         $sql = "SELECT course.code as col1, course.title as col2
1770 1770
                 FROM $tbl_course course
1771
-                WHERE course.code IN (".implode(',',$courses_code).")";
1771
+                WHERE course.code IN (".implode(',', $courses_code).")";
1772 1772
 
1773
-        if (!in_array($direction, array('ASC','DESC'))) $direction = 'ASC';
1773
+        if (!in_array($direction, array('ASC', 'DESC'))) $direction = 'ASC';
1774 1774
 
1775 1775
         $column = intval($column);
1776 1776
         $from = intval($from);
@@ -1839,7 +1839,7 @@  discard block
 block discarded – undo
1839 1839
             $table_row[] = $avg_assignments_in_course;
1840 1840
 
1841 1841
             //set the "from" value to know if I access the Reporting by the chamilo tab or the course link
1842
-            $table_row[] = '<center><a href="../../tracking/courseLog.php?cidReq=' .$course_code.'&from=myspace&id_session='.$session_id.'">
1842
+            $table_row[] = '<center><a href="../../tracking/courseLog.php?cidReq='.$course_code.'&from=myspace&id_session='.$session_id.'">
1843 1843
                              '.Display::return_icon('2rightarrow.png').'
1844 1844
                              </a>
1845 1845
                             </center>';
@@ -1848,7 +1848,7 @@  discard block
 block discarded – undo
1848 1848
                 $nb_students_in_course,
1849 1849
                 $avg_time_spent_in_course,
1850 1850
                 is_null($avg_progress_in_course) ? null : $avg_progress_in_course.'%',
1851
-                is_null($avg_score_in_course) ? null : is_numeric($avg_score_in_course) ? $avg_score_in_course.'%' : $avg_score_in_course ,
1851
+                is_null($avg_score_in_course) ? null : is_numeric($avg_score_in_course) ? $avg_score_in_course.'%' : $avg_score_in_course,
1852 1852
                 is_null($avg_score_in_exercise) ? null : $avg_score_in_exercise.'%',
1853 1853
                 $avg_messages_in_course,
1854 1854
                 $avg_assignments_in_course,
@@ -1916,7 +1916,7 @@  discard block
 block discarded – undo
1916 1916
         $sql .= " ORDER BY col$column $direction ";
1917 1917
         $sql .= " LIMIT $from,$number_of_items";
1918 1918
         $result = Database::query($sql);
1919
-        $return = array ();
1919
+        $return = array();
1920 1920
         while ($user = Database::fetch_row($result)) {
1921 1921
             $return[] = $user;
1922 1922
         }
@@ -1971,7 +1971,7 @@  discard block
 block discarded – undo
1971 1971
                     $i++;
1972 1972
                 }
1973 1973
             }
1974
-            $username_array = array('username' => $desired_username , 'sufix' => $sufix);
1974
+            $username_array = array('username' => $desired_username, 'sufix' => $sufix);
1975 1975
             return $username_array;
1976 1976
         } else {
1977 1977
             $username_array = array('username' => $username, 'sufix' => '');
@@ -2246,7 +2246,7 @@  discard block
 block discarded – undo
2246 2246
         foreach ($users as $index => $user) {
2247 2247
             $userid = $user['id'];
2248 2248
             $sql_insert = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at)
2249
-                           VALUES ('$id_session','$userid', '" . api_get_utc_datetime() . "')";
2249
+                           VALUES ('$id_session','$userid', '".api_get_utc_datetime()."')";
2250 2250
             Database::query($sql_insert);
2251 2251
             $user['added_at_session'] = 1;
2252 2252
             $new_users[] = $user;
@@ -2280,10 +2280,10 @@  discard block
 block discarded – undo
2280 2280
                 );
2281 2281
                 $userInfo = api_get_user_info($user['id']);
2282 2282
 
2283
-                if (($user['added_at_platform'] == 1  && $user['added_at_session'] == 1) || $user['added_at_session'] == 1) {
2283
+                if (($user['added_at_platform'] == 1 && $user['added_at_session'] == 1) || $user['added_at_session'] == 1) {
2284 2284
                     if ($user['added_at_platform'] == 1) {
2285 2285
                         $addedto = get_lang('UserCreatedPlatform');
2286
-                    } else  {
2286
+                    } else {
2287 2287
                         $addedto = '          ';
2288 2288
                     }
2289 2289
 
@@ -2346,7 +2346,7 @@  discard block
 block discarded – undo
2346 2346
         global $current_tag;
2347 2347
         switch ($data) {
2348 2348
             case 'Contact' :
2349
-                $user = array ();
2349
+                $user = array();
2350 2350
                 break;
2351 2351
             default :
2352 2352
                 $current_tag = $data;
@@ -2393,9 +2393,9 @@  discard block
 block discarded – undo
2393 2393
         global $current_value;
2394 2394
         global $user;
2395 2395
         global $users;
2396
-        $users = array ();
2396
+        $users = array();
2397 2397
         $parser = xml_parser_create('UTF-8');
2398
-        xml_set_element_handler($parser, array('MySpace','element_start'), array('MySpace','element_end'));
2398
+        xml_set_element_handler($parser, array('MySpace', 'element_start'), array('MySpace', 'element_end'));
2399 2399
         xml_set_character_data_handler($parser, "character_data");
2400 2400
         xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
2401 2401
         xml_parse($parser, api_utf8_encode_xml(file_get_contents($file)));
@@ -2441,7 +2441,7 @@  discard block
 block discarded – undo
2441 2441
             get_lang('SearchCourse'),
2442 2442
             $courseList,
2443 2443
             [
2444
-                'url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?' . http_build_query([
2444
+                'url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?'.http_build_query([
2445 2445
                     'a' => 'search_course_by_session_all',
2446 2446
                     'session_id' => $sessionId
2447 2447
                 ])
@@ -2460,7 +2460,7 @@  discard block
 block discarded – undo
2460 2460
                             course_id: $('#course_id').val() || 0
2461 2461
                         });
2462 2462
 
2463
-                        return '" . api_get_path(WEB_AJAX_PATH) . "session.ajax.php?' + params;
2463
+                        return '" . api_get_path(WEB_AJAX_PATH)."session.ajax.php?' + params;
2464 2464
                     }
2465 2465
                 "
2466 2466
             ]
@@ -2491,7 +2491,7 @@  discard block
 block discarded – undo
2491 2491
                             course_id: $('#course_id').val()
2492 2492
                         });
2493 2493
 
2494
-                        return '" . api_get_path(WEB_AJAX_PATH) . "course.ajax.php?' + params;
2494
+                        return '" . api_get_path(WEB_AJAX_PATH)."course.ajax.php?' + params;
2495 2495
                     }
2496 2496
                 "
2497 2497
             ]
@@ -2579,7 +2579,7 @@  discard block
 block discarded – undo
2579 2579
                     " : "
2580 2580
                         u.lastname AS col2,
2581 2581
                         u.firstname AS col3,
2582
-                " ) . "
2582
+                " )."
2583 2583
                 a.logout_course_date,
2584 2584
                 c.title,
2585 2585
                 c.code,
@@ -2590,7 +2590,7 @@  discard block
 block discarded – undo
2590 2590
 
2591 2591
         if (isset($_GET['session_id']) && !empty($_GET['session_id'])) {
2592 2592
             $sessionId = intval($_GET['session_id']);
2593
-            $sql .= " WHERE a.session_id = " . $sessionId;
2593
+            $sql .= " WHERE a.session_id = ".$sessionId;
2594 2594
         }
2595 2595
 
2596 2596
         $sql .= " ORDER BY col$column $orderDirection ";
@@ -2696,13 +2696,13 @@  discard block
 block discarded – undo
2696 2696
 function get_stats($user_id, $courseId, $start_date = null, $end_date = null)
2697 2697
 {
2698 2698
     // Database table definitions
2699
-    $tbl_track_course   = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
2699
+    $tbl_track_course = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
2700 2700
 
2701 2701
     $course_info = api_get_course_info_by_id($courseId);
2702 2702
     if (!empty($course_info)) {
2703 2703
         $strg_sd = '';
2704 2704
         $strg_ed = '';
2705
-        if ($start_date != null && $end_date != null){
2705
+        if ($start_date != null && $end_date != null) {
2706 2706
             $end_date = add_day_to($end_date);
2707 2707
             $strg_sd = "AND login_course_date BETWEEN '$start_date' AND '$end_date'";
2708 2708
             $strg_ed = "AND logout_course_date BETWEEN '$start_date' AND '$end_date'";
@@ -2711,10 +2711,10 @@  discard block
 block discarded – undo
2711 2711
                 SEC_TO_TIME(avg(time_to_sec(timediff(logout_course_date,login_course_date)))) as avrg,
2712 2712
                 SEC_TO_TIME(sum(time_to_sec(timediff(logout_course_date,login_course_date)))) as total,
2713 2713
                 count(user_id) as times
2714
-                FROM ' . $tbl_track_course . '
2714
+                FROM ' . $tbl_track_course.'
2715 2715
                 WHERE
2716
-                    user_id = ' . intval($user_id) . ' AND
2717
-                    c_id = ' . intval($courseId) . ' '.$strg_sd.' '.$strg_ed.' '.'
2716
+                    user_id = ' . intval($user_id).' AND
2717
+                    c_id = ' . intval($courseId).' '.$strg_sd.' '.$strg_ed.' '.'
2718 2718
                 ORDER BY login_course_date ASC';
2719 2719
 
2720 2720
         $rs = Database::query($sql);
@@ -2732,7 +2732,7 @@  discard block
 block discarded – undo
2732 2732
 }
2733 2733
 
2734 2734
 function add_day_to($end_date) {
2735
-    $foo_date = strtotime( $end_date );
2735
+    $foo_date = strtotime($end_date);
2736 2736
     $foo_date = strtotime(" +1 day", $foo_date);
2737 2737
     $foo_date = date("Y-m-d", $foo_date);
2738 2738
     return $foo_date;
@@ -2746,7 +2746,7 @@  discard block
 block discarded – undo
2746 2746
  * @version OCT-22- 2010
2747 2747
  * @return array
2748 2748
  */
2749
-function convert_to_array($sql_result){
2749
+function convert_to_array($sql_result) {
2750 2750
     $result_to_print = '<table>';
2751 2751
     foreach ($sql_result as $key => $data) {
2752 2752
         $result_to_print .= '<tr><td>'.date('d-m-Y (H:i:s)', $data['login']).'</td><td>'.api_time_to_hms($data['logout'] - $data['login']).'</tr></td>'."\n";
@@ -2765,7 +2765,7 @@  discard block
 block discarded – undo
2765 2765
  * @version OCT-22- 2010
2766 2766
  * @return string
2767 2767
  */
2768
-function convert_to_string($sql_result){
2768
+function convert_to_string($sql_result) {
2769 2769
     $result_to_print = '<table>';
2770 2770
     if (!empty($sql_result)) {
2771 2771
         foreach ($sql_result as $key => $data) {
@@ -2790,18 +2790,18 @@  discard block
 block discarded – undo
2790 2790
  */
2791 2791
 function grapher($sql_result, $start_date, $end_date, $type = "")
2792 2792
 {
2793
-    if (empty($start_date)) { $start_date =""; }
2794
-    if (empty($end_date)) { $end_date =""; }
2795
-    if ($type == ""){ $type = 'day'; }
2796
-    $main_year  = $main_month_year = $main_day = array();
2793
+    if (empty($start_date)) { $start_date = ""; }
2794
+    if (empty($end_date)) { $end_date = ""; }
2795
+    if ($type == "") { $type = 'day'; }
2796
+    $main_year = $main_month_year = $main_day = array();
2797 2797
     // get last 8 days/months
2798 2798
     $last_days      = 5;
2799 2799
     $last_months    = 3;
2800 2800
     for ($i = $last_days; $i >= 0; $i--) {
2801
-        $main_day[date ('d-m-Y', time () - $i * 3600 * 24)] = 0;
2801
+        $main_day[date('d-m-Y', time() - $i * 3600 * 24)] = 0;
2802 2802
     }
2803 2803
     for ($i = $last_months; $i >= 0; $i--) {
2804
-        $main_month_year[date ('m-Y', time () - $i * 30 * 3600 * 24)] = 0;
2804
+        $main_month_year[date('m-Y', time() - $i * 30 * 3600 * 24)] = 0;
2805 2805
     }
2806 2806
 
2807 2807
     $i = 0;
@@ -2837,7 +2837,7 @@  discard block
 block discarded – undo
2837 2837
         /* Create and populate the pData object */
2838 2838
         $myData = new pData();
2839 2839
         $myData->addPoints($main_date, 'Serie1');
2840
-        if (count($main_date)!= 1) {
2840
+        if (count($main_date) != 1) {
2841 2841
             $myData->addPoints($labels, 'Labels');
2842 2842
             $myData->setSerieDescription('Labels', 'Months');
2843 2843
             $myData->setAbscissa('Labels');
@@ -2845,7 +2845,7 @@  discard block
 block discarded – undo
2845 2845
         $myData->setSerieWeight('Serie1', 1);
2846 2846
         $myData->setSerieDescription('Serie1', get_lang('MyResults'));
2847 2847
         $myData->setAxisName(0, get_lang('Minutes'));
2848
-        $myData->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
2848
+        $myData->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
2849 2849
 
2850 2850
         // Cache definition
2851 2851
         $cachePath = api_get_path(SYS_ARCHIVE_PATH);
@@ -2854,9 +2854,9 @@  discard block
 block discarded – undo
2854 2854
 
2855 2855
         if ($myCache->isInCache($chartHash)) {
2856 2856
             //if we already created the img
2857
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
2857
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
2858 2858
             $myCache->saveFromCache($chartHash, $imgPath);
2859
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
2859
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
2860 2860
         } else {
2861 2861
             /* Define width, height and angle */
2862 2862
             $mainWidth = 760;
@@ -2885,7 +2885,7 @@  discard block
 block discarded – undo
2885 2885
             /* Set the default font */
2886 2886
             $myPicture->setFontProperties(
2887 2887
                 array(
2888
-                    "FontName" => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
2888
+                    "FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
2889 2889
                     "FontSize" => 10)
2890 2890
             );
2891 2891
             /* Write the chart title */
@@ -2902,7 +2902,7 @@  discard block
 block discarded – undo
2902 2902
             /* Set the default font */
2903 2903
             $myPicture->setFontProperties(
2904 2904
                 array(
2905
-                    "FontName" => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
2905
+                    "FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
2906 2906
                     "FontSize" => 8
2907 2907
                 )
2908 2908
             );
@@ -2944,7 +2944,7 @@  discard block
 block discarded – undo
2944 2944
             /* Draw the line chart */
2945 2945
             $myPicture->setFontProperties(
2946 2946
                 array(
2947
-                    "FontName" => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
2947
+                    "FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
2948 2948
                     "FontSize" => 10
2949 2949
                 )
2950 2950
             );
@@ -2963,15 +2963,15 @@  discard block
 block discarded – undo
2963 2963
 
2964 2964
             /* Write and save into cache */
2965 2965
             $myCache->writeToCache($chartHash, $myPicture);
2966
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
2966
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
2967 2967
             $myCache->saveFromCache($chartHash, $imgPath);
2968
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
2968
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
2969 2969
         }
2970
-        $html = '<img src="' . $imgPath . '">';
2970
+        $html = '<img src="'.$imgPath.'">';
2971 2971
 
2972 2972
         return $html;
2973 2973
     } else {
2974
-        $foo_img = api_convert_encoding('<div id="messages" class="warning-message">'.get_lang('GraphicNotAvailable').'</div>','UTF-8');
2974
+        $foo_img = api_convert_encoding('<div id="messages" class="warning-message">'.get_lang('GraphicNotAvailable').'</div>', 'UTF-8');
2975 2975
 
2976 2976
         return $foo_img;
2977 2977
     }
Please login to merge, or discard this patch.
main/mySpace/access_details.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
 echo Display::page_header(get_lang('DetailsStudentInCourse'));
128 128
 echo Display::page_subheader(
129
-    get_lang('User').': '.$userInfo['complete_name'].' - '.get_lang('Course').': '.$courseInfo['title'] . ' (' . $course_code . ')'
129
+    get_lang('User').': '.$userInfo['complete_name'].' - '.get_lang('Course').': '.$courseInfo['title'].' ('.$course_code.')'
130 130
 );
131 131
 
132 132
 $form->setDefaults(array('from' => $from, 'to' => $to));
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     </div><br />
139 139
     <div id="cev_cont_stats">
140 140
     <?php
141
-    if ($result_to_print != "")  {
141
+    if ($result_to_print != "") {
142 142
         $rst = get_stats($user_id, $courseId);
143 143
         $foo_stats = '<strong>'.get_lang('Total').': </strong>'.$rst['total'].'<br />';
144 144
         $foo_stats .= '<strong>'.get_lang('Average').': </strong>'.$rst['avg'].'<br />';
Please login to merge, or discard this patch.
main/lp/lp_list_search.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 }
23 23
 
24 24
 if (!empty($gradebook) && $gradebook == 'view') {
25
-    $interbreadcrumb[]= array(
25
+    $interbreadcrumb[] = array(
26 26
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
27 27
         'name' => get_lang('ToolGradebook')
28 28
     );
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 $term_array = array();
63 63
 $specific_fields = get_specific_field_list();
64 64
 foreach ($specific_fields as $specific_field) {
65
-    if (!empty($_REQUEST['sf_'. $specific_field['code']])) {
66
-        $values = $_REQUEST['sf_'. $specific_field['code']];
65
+    if (!empty($_REQUEST['sf_'.$specific_field['code']])) {
66
+        $values = $_REQUEST['sf_'.$specific_field['code']];
67 67
         if (in_array('__all__', $values)) {
68 68
             $sf_terms_for_code = xapian_get_all_terms(1000, $specific_field['code']);
69 69
             foreach ($sf_terms_for_code as $term) {
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             foreach ($values as $term) {
76 76
                 if (!empty($term)) {
77 77
                     $prefix = $specific_field['code'];
78
-                    $term_array[] = chamilo_get_boolean_query($prefix . $term);
78
+                    $term_array[] = chamilo_get_boolean_query($prefix.$term);
79 79
                 }
80 80
             }
81 81
         }
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 // Get right group of terms to show on multiple select.
94 94
 $fixed_queries = array();
95 95
 $course_filter = null;
96
-if (($cid=api_get_course_id()) != -1 ) {
96
+if (($cid = api_get_course_id()) != -1) {
97 97
     // Results only from actual course.
98
-    $course_filter = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID . $cid);
98
+    $course_filter = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID.$cid);
99 99
 }
100 100
 
101 101
 if (count($term_array)) {
@@ -145,12 +145,12 @@  discard block
 block discarded – undo
145 145
         }
146 146
 
147 147
         if ($mode == 'gallery') {
148
-            $title = $a_prefix.str_replace('_', ' ', $result['title']). $a_suffix;
148
+            $title = $a_prefix.str_replace('_', ' ', $result['title']).$a_suffix;
149 149
             $blocks[] = array(1 =>
150
-                $a_prefix .'<img src="'.$result['thumbnail'].'" />'. $a_suffix .'<br />'.$title.'<br />'.$result['author'],
150
+                $a_prefix.'<img src="'.$result['thumbnail'].'" />'.$a_suffix.'<br />'.$title.'<br />'.$result['author'],
151 151
             );
152 152
         } else {
153
-            $title = '<div style="text-align:left;">'. $a_prefix . $result['title']. $a_suffix .(!empty($result['author']) ? ' '.$result['author'] : '').'<div>';
153
+            $title = '<div style="text-align:left;">'.$a_prefix.$result['title'].$a_suffix.(!empty($result['author']) ? ' '.$result['author'] : '').'<div>';
154 154
             $blocks[] = array(1 => $title);
155 155
         }
156 156
     }
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
     );
170 170
     $get_params = '';
171 171
     foreach ($specific_fields as $specific_field) {
172
-        if (isset($_REQUEST['sf_'. $specific_field['code']])) {
173
-            $values = $_REQUEST['sf_'. $specific_field['code']];
172
+        if (isset($_REQUEST['sf_'.$specific_field['code']])) {
173
+            $values = $_REQUEST['sf_'.$specific_field['code']];
174 174
             //Sortable additional_parameters doesn't accept multi dimensional arrays
175 175
             //$additional_parameters[ 'sf_'. $specific_field['code'] ] = $values;
176
-            foreach ( $values as $value ) {
177
-                $get_params .= '&sf_' . $specific_field['code'] .'[]='. $value;
176
+            foreach ($values as $value) {
177
+                $get_params .= '&sf_'.$specific_field['code'].'[]='.$value;
178 178
             }
179 179
             $get_params .= '&';
180 180
         }
Please login to merge, or discard this patch.
main/lp/learnpathItem.class.php 1 patch
Spacing   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
             $res = Database::query($sql);
200 200
             if (Database::num_rows($res) > 0) {
201 201
                 $se_ref = Database::fetch_array($res);
202
-                $this->search_did = (int)$se_ref['search_did'];
202
+                $this->search_did = (int) $se_ref['search_did'];
203 203
             }
204 204
         }
205 205
         $this->audio = $row['audio'];
206 206
         if (self::debug > 0) {
207 207
             error_log(
208
-                'New LP - End of learnpathItem constructor for item ' . $id,
208
+                'New LP - End of learnpathItem constructor for item '.$id,
209 209
                 0
210 210
             );
211 211
         }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
     public function delete()
315 315
     {
316 316
         if (self::debug > 0) {
317
-            error_log('learnpath_item::delete() for item ' . $this->db_id, 0);
317
+            error_log('learnpath_item::delete() for item '.$this->db_id, 0);
318 318
         }
319 319
         $lp_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
320 320
         $lp_item = Database::get_course_table(TABLE_LP_ITEM);
@@ -322,29 +322,29 @@  discard block
 block discarded – undo
322 322
         $course_id = api_get_course_int_id();
323 323
 
324 324
         $sql = "DELETE FROM $lp_item_view
325
-                WHERE c_id = $course_id AND lp_item_id = " . $this->db_id;
325
+                WHERE c_id = $course_id AND lp_item_id = ".$this->db_id;
326 326
         if (self::debug > 0) {
327
-            error_log('Deleting from lp_item_view: ' . $sql, 0);
327
+            error_log('Deleting from lp_item_view: '.$sql, 0);
328 328
         }
329 329
         Database::query($sql);
330 330
 
331 331
         $sql = "SELECT * FROM $lp_item
332
-                WHERE c_id = $course_id AND id = " . $this->db_id;
332
+                WHERE c_id = $course_id AND id = ".$this->db_id;
333 333
         $res_sel = Database::query($sql);
334 334
         if (Database::num_rows($res_sel) < 1) {
335 335
             return false;
336 336
         }
337 337
 
338 338
         $sql = "DELETE FROM $lp_item
339
-                WHERE c_id = $course_id AND id = " . $this->db_id;
339
+                WHERE c_id = $course_id AND id = ".$this->db_id;
340 340
         Database::query($sql);
341 341
         if (self::debug > 0) {
342
-            error_log('Deleting from lp_item: ' . $sql);
342
+            error_log('Deleting from lp_item: '.$sql);
343 343
         }
344 344
 
345 345
         if (api_get_setting('search_enabled') == 'true') {
346 346
             if (!is_null($this->search_did)) {
347
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
347
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
348 348
                 $di = new ChamiloIndexer();
349 349
                 $di->remove_document($this->search_did);
350 350
             }
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
     {
381 381
         if (self::debug > 0) {
382 382
             error_log(
383
-                'learnpathItem::get_attempt_id() on item ' . $this->db_id,
383
+                'learnpathItem::get_attempt_id() on item '.$this->db_id,
384 384
                 0
385 385
             );
386 386
         }
@@ -390,8 +390,8 @@  discard block
 block discarded – undo
390 390
         }
391 391
         if (self::debug > 0) {
392 392
             error_log(
393
-                'New LP - End of learnpathItem::get_attempt_id() on item ' .
394
-                $this->db_id . ' - Returning ' . $res,
393
+                'New LP - End of learnpathItem::get_attempt_id() on item '.
394
+                $this->db_id.' - Returning '.$res,
395 395
                 0
396 396
             );
397 397
         }
@@ -453,12 +453,12 @@  discard block
 block discarded – undo
453 453
             if (self::debug > 2) {
454 454
                 error_log(
455 455
                     'learnpathItem::get_credit() - get_prevent_reinit!=0 and '.
456
-                    'status is ' . $status,
456
+                    'status is '.$status,
457 457
                     0
458 458
                 );
459 459
             }
460 460
             //0=not attempted - 1 = incomplete
461
-            if ($status != $this->possible_status[0]&&
461
+            if ($status != $this->possible_status[0] &&
462 462
                 $status != $this->possible_status[1]
463 463
             ) {
464 464
                 $credit = 'no-credit';
@@ -530,13 +530,13 @@  discard block
 block discarded – undo
530 530
                 case TOOL_DOCUMENT:
531 531
                     $table_doc = Database::get_course_table(TABLE_DOCUMENT);
532 532
                     $sql = 'SELECT path
533
-                            FROM ' . $table_doc . '
533
+                            FROM ' . $table_doc.'
534 534
                             WHERE
535
-                                c_id = ' . $course_id . ' AND
535
+                                c_id = ' . $course_id.' AND
536 536
                                 id = ' . $path;
537 537
                     $res = Database::query($sql);
538 538
                     $row = Database::fetch_array($res);
539
-                    $real_path = 'document' . $row['path'];
539
+                    $real_path = 'document'.$row['path'];
540 540
                     return $real_path;
541 541
                 case TOOL_STUDENTPUBLICATION:
542 542
                 case TOOL_QUIZ:
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
             }
549 549
         } else {
550 550
             if (!empty($path_to_scorm_dir)) {
551
-                $path = $path_to_scorm_dir . $path;
551
+                $path = $path_to_scorm_dir.$path;
552 552
             }
553 553
             return $path;
554 554
         }
@@ -584,8 +584,8 @@  discard block
 block discarded – undo
584 584
         $sql = "SELECT id FROM $tbl
585 585
                 WHERE
586 586
                     c_id = $course_id AND
587
-                    lp_item_id = " . $this->db_id . " AND
588
-                    lp_view_id = " . $this->view_id . " AND
587
+                    lp_item_id = ".$this->db_id." AND
588
+                    lp_view_id = " . $this->view_id." AND
589 589
                     view_count = " . $this->attempt_id;
590 590
         $res = Database::query($sql);
591 591
         if (Database::num_rows($res) > 0) {
@@ -628,8 +628,8 @@  discard block
 block discarded – undo
628 628
             $sql = "SELECT id FROM $tbl
629 629
                     WHERE
630 630
                         c_id = $course_id AND
631
-                        lp_item_id = " . $this->db_id . " AND
632
-                        lp_view_id = " . $this->view_id ." AND
631
+                        lp_item_id = ".$this->db_id." AND
632
+                        lp_view_id = " . $this->view_id." AND
633 633
                         view_count = " . $this->get_attempt_id();
634 634
             $res = Database::query($sql);
635 635
             if (Database::num_rows($res) > 0) {
@@ -669,13 +669,13 @@  discard block
 block discarded – undo
669 669
         foreach ($this->interactions as $id => $in) {
670 670
             $return .= "[
671 671
                 '$id',
672
-                '" . $in[1] . "',
673
-                '" . $in[2] . "',
674
-                '" . $in[3] . "',
675
-                '" . $in[4] . "',
676
-                '" . $in[5] . "',
677
-                '" . $in[6] . "',
678
-                '" . $in[7] . "'],";
672
+                '".$in[1]."',
673
+                '" . $in[2]."',
674
+                '" . $in[3]."',
675
+                '" . $in[4]."',
676
+                '" . $in[5]."',
677
+                '" . $in[6]."',
678
+                '" . $in[7]."'],";
679 679
         }
680 680
         if (!empty($return)) {
681 681
             $return = substr($return, 0, -1);
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
                 $table = Database::get_course_table(TABLE_LP_MAIN);
918 918
                 $sql = "SELECT prevent_reinit
919 919
                     FROM $table
920
-                    WHERE c_id = $course_id AND id = " . $this->lp_id;
920
+                    WHERE c_id = $course_id AND id = ".$this->lp_id;
921 921
                 $res = Database::query($sql);
922 922
                 if (Database::num_rows($res) < 1) {
923 923
                     $this->error = "Could not find parent learnpath in lp table";
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
         }
940 940
         if (self::debug > 2) {
941 941
             error_log(
942
-                'New LP - End of learnpathItem::get_prevent_reinit() - Returned ' . $this->prevent_reinit,
942
+                'New LP - End of learnpathItem::get_prevent_reinit() - Returned '.$this->prevent_reinit,
943 943
                 0
944 944
             );
945 945
         }
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
                 $table = Database::get_course_table(TABLE_LP_MAIN);
965 965
                 $sql = "SELECT seriousgame_mode
966 966
                         FROM $table
967
-                        WHERE c_id = $course_id AND id = " . $this->lp_id;
967
+                        WHERE c_id = $course_id AND id = ".$this->lp_id;
968 968
                 $res = Database::query($sql);
969 969
                 if (Database::num_rows($res) < 1) {
970 970
                     $this->error = "Could not find parent learnpath in learnpath table";
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
         }
986 986
         if (self::debug > 2) {
987 987
             error_log(
988
-                'New LP - End of learnpathItem::get_seriousgame_mode() - Returned ' . $this->seriousgame_mode,
988
+                'New LP - End of learnpathItem::get_seriousgame_mode() - Returned '.$this->seriousgame_mode,
989 989
                 0
990 990
             );
991 991
         }
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
         }
1031 1031
         if (!isset($abs_path)) {
1032 1032
             $path = $this->get_file_path();
1033
-            $abs_path = api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/' . $path;
1033
+            $abs_path = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/'.$path;
1034 1034
         }
1035 1035
 
1036 1036
         $files_list = array();
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
                                                             $abs_path
1306 1306
                                                         );
1307 1307
                                                         $new_abs_path = realpath(
1308
-                                                            $dir . '/' . $second_part
1308
+                                                            $dir.'/'.$second_part
1309 1309
                                                         );
1310 1310
                                                         $in_files_list[] = learnpathItem::get_resources_from_source(
1311 1311
                                                             TOOL_DOCUMENT,
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
                                                             $abs_path
1344 1344
                                                         );
1345 1345
                                                         $new_abs_path = realpath(
1346
-                                                            $dir . '/' . $second_part
1346
+                                                            $dir.'/'.$second_part
1347 1347
                                                         );
1348 1348
                                                         $in_files_list[] = learnpathItem::get_resources_from_source(
1349 1349
                                                             TOOL_DOCUMENT,
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
                                                             $abs_path
1451 1451
                                                         );
1452 1452
                                                         $new_abs_path = realpath(
1453
-                                                            $dir . '/' . $source
1453
+                                                            $dir.'/'.$source
1454 1454
                                                         );
1455 1455
                                                         $in_files_list[] = learnpathItem::get_resources_from_source(
1456 1456
                                                             TOOL_DOCUMENT,
@@ -1488,7 +1488,7 @@  discard block
 block discarded – undo
1488 1488
                                                             $abs_path
1489 1489
                                                         );
1490 1490
                                                         $new_abs_path = realpath(
1491
-                                                            $dir . '/' . $source
1491
+                                                            $dir.'/'.$source
1492 1492
                                                         );
1493 1493
                                                         $in_files_list[] = learnpathItem::get_resources_from_source(
1494 1494
                                                             TOOL_DOCUMENT,
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
                                                 );
1573 1573
                                                 $dir = dirname($abs_path);
1574 1574
                                                 $new_abs_path = realpath(
1575
-                                                    $dir . '/' . $source
1575
+                                                    $dir.'/'.$source
1576 1576
                                                 );
1577 1577
                                                 $in_files_list[] = learnpathItem::get_resources_from_source(
1578 1578
                                                     TOOL_DOCUMENT,
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
                                                 );
1618 1618
                                                 $dir = dirname($abs_path);
1619 1619
                                                 $new_abs_path = realpath(
1620
-                                                    $dir . '/' . $source
1620
+                                                    $dir.'/'.$source
1621 1621
                                                 );
1622 1622
                                                 $in_files_list[] = learnpathItem::get_resources_from_source(
1623 1623
                                                     TOOL_DOCUMENT,
@@ -1677,7 +1677,7 @@  discard block
 block discarded – undo
1677 1677
         }
1678 1678
         if (self::debug > 1) {
1679 1679
             error_log(
1680
-                'New LP - Out of learnpathItem::get_score() - returning ' . $res,
1680
+                'New LP - Out of learnpathItem::get_score() - returning '.$res,
1681 1681
                 0
1682 1682
             );
1683 1683
         }
@@ -1697,7 +1697,7 @@  discard block
 block discarded – undo
1697 1697
         $course_id = api_get_course_int_id();
1698 1698
         $debug = self::debug;
1699 1699
         if ($debug > 0) {
1700
-            error_log('learnpathItem::get_status() on item ' . $this->db_id, 0);
1700
+            error_log('learnpathItem::get_status() on item '.$this->db_id, 0);
1701 1701
         }
1702 1702
         if ($check_db) {
1703 1703
             if ($debug > 2) {
@@ -1708,12 +1708,12 @@  discard block
 block discarded – undo
1708 1708
                 $sql = "SELECT status FROM $table
1709 1709
                         WHERE
1710 1710
                             c_id = $course_id AND
1711
-                            id = '" . $this->db_item_view_id . "' AND
1712
-                            view_count = '" . $this->get_attempt_id() . "'";
1711
+                            id = '".$this->db_item_view_id."' AND
1712
+                            view_count = '" . $this->get_attempt_id()."'";
1713 1713
 
1714 1714
                 if ($debug > 2) {
1715 1715
                     error_log(
1716
-                        'learnpathItem::get_status() - Checking DB: ' . $sql,
1716
+                        'learnpathItem::get_status() - Checking DB: '.$sql,
1717 1717
                         0
1718 1718
                     );
1719 1719
                 }
@@ -1724,7 +1724,7 @@  discard block
 block discarded – undo
1724 1724
                     if ($update_local) {
1725 1725
                         if ($debug > 2) {
1726 1726
                             error_log(
1727
-                                'learnpathItem::set_status() :' . $row['status'],
1727
+                                'learnpathItem::set_status() :'.$row['status'],
1728 1728
                                 0
1729 1729
                             );
1730 1730
                         }
@@ -1732,7 +1732,7 @@  discard block
 block discarded – undo
1732 1732
                     }
1733 1733
                     if ($debug > 2) {
1734 1734
                         error_log(
1735
-                            'learnpathItem::get_status() - Returning db value ' . $row['status'],
1735
+                            'learnpathItem::get_status() - Returning db value '.$row['status'],
1736 1736
                             0
1737 1737
                         );
1738 1738
                     }
@@ -1749,7 +1749,7 @@  discard block
 block discarded – undo
1749 1749
             if (!empty($this->status)) {
1750 1750
                 if ($debug > 2) {
1751 1751
                     error_log(
1752
-                        'learnpathItem::get_status() - Returning attrib: ' . $this->status,
1752
+                        'learnpathItem::get_status() - Returning attrib: '.$this->status,
1753 1753
                         0
1754 1754
                     );
1755 1755
                 }
@@ -1759,7 +1759,7 @@  discard block
 block discarded – undo
1759 1759
 
1760 1760
         if ($debug > 2) {
1761 1761
             error_log(
1762
-                'learnpathItem::get_status() - Returning default ' . $this->possible_status[0],
1762
+                'learnpathItem::get_status() - Returning default '.$this->possible_status[0],
1763 1763
                 0
1764 1764
             );
1765 1765
         }
@@ -1799,7 +1799,7 @@  discard block
 block discarded – undo
1799 1799
             if ($origin == 'js') {
1800 1800
                 return '00 : 00: 00';
1801 1801
             } else {
1802
-                return '00 ' . $h . ' 00 \' 00"';
1802
+                return '00 '.$h.' 00 \' 00"';
1803 1803
             }
1804 1804
         } else {
1805 1805
             return api_format_time($time, $origin);
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
         if (!isset($given_time)) {
1825 1825
             if (self::debug > 2) {
1826 1826
                 error_log(
1827
-                    'learnpathItem::get_scorm_time(): given time empty, current_start_time = ' . $this->current_start_time,
1827
+                    'learnpathItem::get_scorm_time(): given time empty, current_start_time = '.$this->current_start_time,
1828 1828
                     0
1829 1829
                 );
1830 1830
             }
@@ -1834,8 +1834,8 @@  discard block
 block discarded – undo
1834 1834
                         FROM $table
1835 1835
                         WHERE
1836 1836
                             c_id = $course_id AND
1837
-                            id = '" . $this->db_item_view_id . "' AND
1838
-                            view_count = '" . $this->get_attempt_id() . "'";
1837
+                            id = '".$this->db_item_view_id."' AND
1838
+                            view_count = '" . $this->get_attempt_id()."'";
1839 1839
                 $res = Database::query($sql);
1840 1840
                 $row = Database::fetch_array($res);
1841 1841
                 $start = $row['start_time'];
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
         }
1857 1857
         if (self::debug > 2) {
1858 1858
             error_log(
1859
-                'learnpathItem::get_scorm_time(): intermediate = ' . $time,
1859
+                'learnpathItem::get_scorm_time(): intermediate = '.$time,
1860 1860
                 0
1861 1861
             );
1862 1862
         }
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
         $sql = "SELECT * FROM $lp_item
1877 1877
                 WHERE
1878 1878
                     c_id = $course_id AND
1879
-                    id='" . intval($this->db_id) . "'";
1879
+                    id='".intval($this->db_id)."'";
1880 1880
         $res = Database::query($sql);
1881 1881
         $row = Database::fetch_array($res);
1882 1882
         return $row['terms'];
@@ -1905,9 +1905,9 @@  discard block
 block discarded – undo
1905 1905
     {
1906 1906
         if (self::debug > 0) {
1907 1907
             error_log(
1908
-                'learnpathItem::get_total_time() for item ' . $this->db_id .
1909
-                ' - Initially, current_start_time = ' . $this->current_start_time .
1910
-                ' and current_stop_time = ' . $this->current_stop_time,
1908
+                'learnpathItem::get_total_time() for item '.$this->db_id.
1909
+                ' - Initially, current_start_time = '.$this->current_start_time.
1910
+                ' and current_stop_time = '.$this->current_stop_time,
1911 1911
                 0
1912 1912
             );
1913 1913
         }
@@ -1948,9 +1948,9 @@  discard block
 block discarded – undo
1948 1948
         } else {
1949 1949
             if (self::debug > 2) {
1950 1950
                 error_log(
1951
-                    'learnpathItem::get_total_time() - Current start time = ' .
1952
-                    $this->current_start_time . ', current stop time = ' .
1953
-                    $this->current_stop_time . ' Returning ' . $time . "-----------\n",
1951
+                    'learnpathItem::get_total_time() - Current start time = '.
1952
+                    $this->current_start_time.', current stop time = '.
1953
+                    $this->current_stop_time.' Returning '.$time."-----------\n",
1954 1954
                     0
1955 1955
                 );
1956 1956
             }
@@ -1970,7 +1970,7 @@  discard block
 block discarded – undo
1970 1970
         }
1971 1971
         if (self::debug > 2) {
1972 1972
             error_log(
1973
-                'learnpathItem::get_type() - Returning ' . $res . ' for item ' . $this->db_id,
1973
+                'learnpathItem::get_type() - Returning '.$res.' for item '.$this->db_id,
1974 1974
                 0
1975 1975
             );
1976 1976
         }
@@ -2010,8 +2010,8 @@  discard block
 block discarded – undo
2010 2010
         if ($this->status_is($completedStatusList)) {
2011 2011
             if (self::debug > 2) {
2012 2012
                 error_log(
2013
-                    'learnpath::is_done() - Item ' . $this->get_id(
2014
-                    ) . ' is complete',
2013
+                    'learnpath::is_done() - Item '.$this->get_id(
2014
+                    ).' is complete',
2015 2015
                     0
2016 2016
                 );
2017 2017
             }
@@ -2020,8 +2020,8 @@  discard block
 block discarded – undo
2020 2020
         } else {
2021 2021
             if (self::debug > 2) {
2022 2022
                 error_log(
2023
-                    'learnpath::is_done() - Item ' . $this->get_id(
2024
-                    ) . ' is not complete',
2023
+                    'learnpath::is_done() - Item '.$this->get_id(
2024
+                    ).' is not complete',
2025 2025
                     0
2026 2026
                 );
2027 2027
             }
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
         }
2059 2059
         if (self::debug > 2) {
2060 2060
             error_log(
2061
-                'New LP - End of learnpathItem::is_restart_allowed() - Returning ' . $restart,
2061
+                'New LP - End of learnpathItem::is_restart_allowed() - Returning '.$restart,
2062 2062
                 0
2063 2063
             );
2064 2064
         }
@@ -2137,7 +2137,7 @@  discard block
 block discarded – undo
2137 2137
     {
2138 2138
         if (self::debug > 0) {
2139 2139
             error_log(
2140
-                'learnpathItem::parse_prereq() for learnpath ' . $this->lp_id . ' with string ' . $prereqs_string,
2140
+                'learnpathItem::parse_prereq() for learnpath '.$this->lp_id.' with string '.$prereqs_string,
2141 2141
                 0
2142 2142
             );
2143 2143
         }
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
                                 // Strange...
2339 2339
                                 if (self::debug > 1) {
2340 2340
                                     error_log(
2341
-                                        'New LP - Found ~ but strange string: ' . $prereqs_string,
2341
+                                        'New LP - Found ~ but strange string: '.$prereqs_string,
2342 2342
                                         0
2343 2343
                                     );
2344 2344
                                 }
@@ -2366,7 +2366,7 @@  discard block
 block discarded – undo
2366 2366
                                     //  the big brackets-enclosed condition.
2367 2367
                                     if (self::debug > 1) {
2368 2368
                                         error_log(
2369
-                                            'New LP - Dealing with group ' . $gr,
2369
+                                            'New LP - Dealing with group '.$gr,
2370 2370
                                             0
2371 2371
                                         );
2372 2372
                                     }
@@ -2380,7 +2380,7 @@  discard block
 block discarded – undo
2380 2380
                                     ) {
2381 2381
                                         if (self::debug > 1) {
2382 2382
                                             error_log(
2383
-                                                'New LP - Found multiplier ' . $multi[0],
2383
+                                                'New LP - Found multiplier '.$multi[0],
2384 2384
                                                 0
2385 2385
                                             );
2386 2386
                                         }
@@ -2396,7 +2396,7 @@  discard block
 block discarded – undo
2396 2396
                                                     $mytrue++;
2397 2397
                                                     if (self::debug > 1) {
2398 2398
                                                         error_log(
2399
-                                                            'New LP - Found true item, counting.. (' . ($mytrue) . ')',
2399
+                                                            'New LP - Found true item, counting.. ('.($mytrue).')',
2400 2400
                                                             0
2401 2401
                                                         );
2402 2402
                                                     }
@@ -2404,7 +2404,7 @@  discard block
 block discarded – undo
2404 2404
                                             } else {
2405 2405
                                                 if (self::debug > 1) {
2406 2406
                                                     error_log(
2407
-                                                        'New LP - item ' . $cond . ' does not exist in items list',
2407
+                                                        'New LP - item '.$cond.' does not exist in items list',
2408 2408
                                                         0
2409 2409
                                                     );
2410 2410
                                                 }
@@ -2451,7 +2451,7 @@  discard block
 block discarded – undo
2451 2451
                                                 } else {
2452 2452
                                                     if (self::debug > 1) {
2453 2453
                                                         error_log(
2454
-                                                            'New LP - ' .
2454
+                                                            'New LP - '.
2455 2455
                                                             ' Found false item, the set is not true, return false',
2456 2456
                                                             0
2457 2457
                                                         );
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
                                             } else {
2463 2463
                                                 if (self::debug > 1) {
2464 2464
                                                     error_log(
2465
-                                                        'New LP - item ' . $cond . ' does not exist in items list',
2465
+                                                        'New LP - item '.$cond.' does not exist in items list',
2466 2466
                                                         0
2467 2467
                                                     );
2468 2468
                                                 }
@@ -2488,7 +2488,7 @@  discard block
 block discarded – undo
2488 2488
                                 //  value of the corresponding resource completion status.
2489 2489
                                 if (self::debug > 1) {
2490 2490
                                     error_log(
2491
-                                        'New LP - Didnt find any group, returning value for ' . $prereqs_string,
2491
+                                        'New LP - Didnt find any group, returning value for '.$prereqs_string,
2492 2492
                                         0
2493 2493
                                     );
2494 2494
                                 }
@@ -2505,14 +2505,14 @@  discard block
 block discarded – undo
2505 2505
                                         if (!$returnstatus) {
2506 2506
                                             if (self::debug > 1) {
2507 2507
                                                 error_log(
2508
-                                                    'New LP - Prerequisite ' . $prereqs_string . ' not complete',
2508
+                                                    'New LP - Prerequisite '.$prereqs_string.' not complete',
2509 2509
                                                     0
2510 2510
                                                 );
2511 2511
                                             }
2512 2512
                                         } else {
2513 2513
                                             if (self::debug > 1) {
2514 2514
                                                 error_log(
2515
-                                                    'New LP - Prerequisite ' . $prereqs_string . ' complete',
2515
+                                                    'New LP - Prerequisite '.$prereqs_string.' complete',
2516 2516
                                                     0
2517 2517
                                                 );
2518 2518
                                             }
@@ -2524,12 +2524,12 @@  discard block
 block discarded – undo
2524 2524
                                             if ($returnstatus) {
2525 2525
                                                 //AND origin_lp_item_id = '.$user_id.'
2526 2526
                                                 $sql = 'SELECT exe_result, exe_weighting
2527
-                                                        FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) . '
2527
+                                                        FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).'
2528 2528
                                                         WHERE
2529
-                                                            exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . ' AND
2530
-                                                            exe_user_id = ' . $user_id . ' AND
2531
-                                                            orig_lp_id = ' . $this->lp_id . ' AND
2532
-                                                            orig_lp_item_id = ' . $prereqs_string . ' AND
2529
+                                                            exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path.' AND
2530
+                                                            exe_user_id = ' . $user_id.' AND
2531
+                                                            orig_lp_id = ' . $this->lp_id.' AND
2532
+                                                            orig_lp_item_id = ' . $prereqs_string.' AND
2533 2533
                                                             status <> "incomplete"
2534 2534
                                                         ORDER BY exe_date DESC
2535 2535
                                                         LIMIT 0, 1';
@@ -2567,12 +2567,12 @@  discard block
 block discarded – undo
2567 2567
 
2568 2568
                                             // Checking in the database.
2569 2569
                                             $sql = 'SELECT exe_result, exe_weighting
2570
-                                                    FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) . '
2570
+                                                    FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).'
2571 2571
                                                     WHERE
2572
-                                                        exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . ' AND
2573
-                                                        exe_user_id = ' . $user_id . ' AND
2574
-                                                        orig_lp_id = ' . $this->lp_id . ' AND
2575
-                                                        orig_lp_item_id = ' . $prereqs_string . ' ';
2572
+                                                        exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path.' AND
2573
+                                                        exe_user_id = ' . $user_id.' AND
2574
+                                                        orig_lp_id = ' . $this->lp_id.' AND
2575
+                                                        orig_lp_item_id = ' . $prereqs_string.' ';
2576 2576
 
2577 2577
                                             $rs_quiz = Database::query($sql);
2578 2578
                                             if (Database::num_rows($rs_quiz) > 0) {
@@ -2619,14 +2619,14 @@  discard block
 block discarded – undo
2619 2619
                                         if (!$returnstatus) {
2620 2620
                                             if (self::debug > 1) {
2621 2621
                                                 error_log(
2622
-                                                    'New LP - Prerequisite ' . $prereqs_string . ' not complete',
2622
+                                                    'New LP - Prerequisite '.$prereqs_string.' not complete',
2623 2623
                                                     0
2624 2624
                                                 );
2625 2625
                                             }
2626 2626
                                         } else {
2627 2627
                                             if (self::debug > 1) {
2628 2628
                                                 error_log(
2629
-                                                    'New LP - Prerequisite ' . $prereqs_string . ' complete',
2629
+                                                    'New LP - Prerequisite '.$prereqs_string.' complete',
2630 2630
                                                     0
2631 2631
                                                 );
2632 2632
                                             }
@@ -2641,11 +2641,11 @@  discard block
 block discarded – undo
2641 2641
                                                 TABLE_LP_VIEW
2642 2642
                                             );
2643 2643
 
2644
-                                            $sql = 'SELECT id FROM ' . $lp_view . '
2644
+                                            $sql = 'SELECT id FROM '.$lp_view.'
2645 2645
                                                     WHERE
2646
-                                                        c_id = ' . $course_id . ' AND
2647
-                                                        user_id = ' . $user_id . '  AND
2648
-                                                        lp_id = ' . $this->lp_id . ' AND
2646
+                                                        c_id = ' . $course_id.' AND
2647
+                                                        user_id = ' . $user_id.'  AND
2648
+                                                        lp_id = ' . $this->lp_id.' AND
2649 2649
                                                         session_id = '.$sessionId.'
2650 2650
                                                     LIMIT 0, 1';
2651 2651
                                             $rs_lp = Database::query($sql);
@@ -2654,11 +2654,11 @@  discard block
 block discarded – undo
2654 2654
                                             );
2655 2655
                                             $my_lp_id = $lp_id[0];
2656 2656
 
2657
-                                            $sql = 'SELECT status FROM ' . $lp_item_view . '
2657
+                                            $sql = 'SELECT status FROM '.$lp_item_view.'
2658 2658
                                                    WHERE
2659
-                                                        c_id = ' . $course_id . ' AND
2660
-                                                        lp_view_id = ' . $my_lp_id . ' AND
2661
-                                                        lp_item_id = ' . $refs_list[$prereqs_string] . '
2659
+                                                        c_id = ' . $course_id.' AND
2660
+                                                        lp_view_id = ' . $my_lp_id.' AND
2661
+                                                        lp_item_id = ' . $refs_list[$prereqs_string].'
2662 2662
                                                     LIMIT 0, 1';
2663 2663
                                             $rs_lp = Database::query($sql);
2664 2664
                                             $status_array = Database :: fetch_row(
@@ -2675,14 +2675,14 @@  discard block
 block discarded – undo
2675 2675
                                             if (!$returnstatus) {
2676 2676
                                                 if (self::debug > 1) {
2677 2677
                                                     error_log(
2678
-                                                        'New LP - Prerequisite ' . $prereqs_string . ' not complete',
2678
+                                                        'New LP - Prerequisite '.$prereqs_string.' not complete',
2679 2679
                                                         0
2680 2680
                                                     );
2681 2681
                                                 }
2682 2682
                                             } else {
2683 2683
                                                 if (self::debug > 1) {
2684 2684
                                                     error_log(
2685
-                                                        'New LP - Prerequisite ' . $prereqs_string . ' complete',
2685
+                                                        'New LP - Prerequisite '.$prereqs_string.' complete',
2686 2686
                                                         0
2687 2687
                                                     );
2688 2688
                                                 }
@@ -2693,7 +2693,7 @@  discard block
 block discarded – undo
2693 2693
                                 } else {
2694 2694
                                     if (self::debug > 1) {
2695 2695
                                         error_log(
2696
-                                            'New LP - Could not find ' . $prereqs_string . ' in ' . print_r(
2696
+                                            'New LP - Could not find '.$prereqs_string.' in '.print_r(
2697 2697
                                                 $refs_list,
2698 2698
                                                 true
2699 2699
                                             ),
@@ -2716,7 +2716,7 @@  discard block
 block discarded – undo
2716 2716
                 foreach ($list as $condition) {
2717 2717
                     if (self::debug > 1) {
2718 2718
                         error_log(
2719
-                            'New LP - Found OR, adding it (' . $condition . ')',
2719
+                            'New LP - Found OR, adding it ('.$condition.')',
2720 2720
                             0
2721 2721
                         );
2722 2722
                     }
@@ -2770,7 +2770,7 @@  discard block
 block discarded – undo
2770 2770
 
2771 2771
         if (self::debug > 1) {
2772 2772
             error_log(
2773
-                'New LP - End of parse_prereq. Error code is now ' . $this->prereq_alert,
2773
+                'New LP - End of parse_prereq. Error code is now '.$this->prereq_alert,
2774 2774
                 0
2775 2775
             );
2776 2776
         }
@@ -2888,7 +2888,7 @@  discard block
 block discarded – undo
2888 2888
                                 $this->set_score($value);
2889 2889
                                 if (self::debug > 2) {
2890 2890
                                     error_log(
2891
-                                        'learnpathItem::save() - setting score to ' . $value,
2891
+                                        'learnpathItem::save() - setting score to '.$value,
2892 2892
                                         0
2893 2893
                                     );
2894 2894
                                 }
@@ -2897,7 +2897,7 @@  discard block
 block discarded – undo
2897 2897
                                 $this->set_max_score($value);
2898 2898
                                 if (self::debug > 2) {
2899 2899
                                     error_log(
2900
-                                        'learnpathItem::save() - setting view_max_score to ' . $value,
2900
+                                        'learnpathItem::save() - setting view_max_score to '.$value,
2901 2901
                                         0
2902 2902
                                     );
2903 2903
                                 }
@@ -2906,7 +2906,7 @@  discard block
 block discarded – undo
2906 2906
                                 $this->min_score = $value;
2907 2907
                                 if (self::debug > 2) {
2908 2908
                                     error_log(
2909
-                                        'learnpathItem::save() - setting min_score to ' . $value,
2909
+                                        'learnpathItem::save() - setting min_score to '.$value,
2910 2910
                                         0
2911 2911
                                     );
2912 2912
                                 }
@@ -2916,7 +2916,7 @@  discard block
 block discarded – undo
2916 2916
                                     $this->set_status($value);
2917 2917
                                     if (self::debug > 2) {
2918 2918
                                         error_log(
2919
-                                            'learnpathItem::save() - setting status to ' . $value,
2919
+                                            'learnpathItem::save() - setting status to '.$value,
2920 2920
                                             0
2921 2921
                                         );
2922 2922
                                     }
@@ -2926,7 +2926,7 @@  discard block
 block discarded – undo
2926 2926
                                 $this->set_time($value);
2927 2927
                                 if (self::debug > 2) {
2928 2928
                                     error_log(
2929
-                                        'learnpathItem::save() - setting time to ' . $value,
2929
+                                        'learnpathItem::save() - setting time to '.$value,
2930 2930
                                         0
2931 2931
                                     );
2932 2932
                                 }
@@ -2935,7 +2935,7 @@  discard block
 block discarded – undo
2935 2935
                                 $this->current_data = $value;
2936 2936
                                 if (self::debug > 2) {
2937 2937
                                     error_log(
2938
-                                        'learnpathItem::save() - setting suspend_data to ' . $value,
2938
+                                        'learnpathItem::save() - setting suspend_data to '.$value,
2939 2939
                                         0
2940 2940
                                     );
2941 2941
                                 }
@@ -2944,7 +2944,7 @@  discard block
 block discarded – undo
2944 2944
                                 $this->set_lesson_location($value);
2945 2945
                                 if (self::debug > 2) {
2946 2946
                                     error_log(
2947
-                                        'learnpathItem::save() - setting lesson_location to ' . $value,
2947
+                                        'learnpathItem::save() - setting lesson_location to '.$value,
2948 2948
                                         0
2949 2949
                                     );
2950 2950
                                 }
@@ -2953,7 +2953,7 @@  discard block
 block discarded – undo
2953 2953
                                 $this->set_core_exit($value);
2954 2954
                                 if (self::debug > 2) {
2955 2955
                                     error_log(
2956
-                                        'learnpathItem::save() - setting core_exit to ' . $value,
2956
+                                        'learnpathItem::save() - setting core_exit to '.$value,
2957 2957
                                         0
2958 2958
                                     );
2959 2959
                                 }
@@ -3100,7 +3100,7 @@  discard block
 block discarded – undo
3100 3100
     public function set_level($int = 0)
3101 3101
     {
3102 3102
         if (self::debug > 0) {
3103
-            error_log('learnpathItem::set_level(' . $int . ')', 0);
3103
+            error_log('learnpathItem::set_level('.$int.')', 0);
3104 3104
         }
3105 3105
         if (!empty($int) AND $int == strval(intval($int))) {
3106 3106
             $this->level = $int;
@@ -3129,7 +3129,7 @@  discard block
 block discarded – undo
3129 3129
         if (empty($lpItemId)) {
3130 3130
             if (self::debug > 0) {
3131 3131
                 error_log(
3132
-                    'learnpathItem::set_lp_view(' . $lp_view_id . ') $lpItemId is empty',
3132
+                    'learnpathItem::set_lp_view('.$lp_view_id.') $lpItemId is empty',
3133 3133
                     0
3134 3134
                 );
3135 3135
             }
@@ -3140,7 +3140,7 @@  discard block
 block discarded – undo
3140 3140
         if (empty($lp_view_id)) {
3141 3141
             if (self::debug > 0) {
3142 3142
                 error_log(
3143
-                    'learnpathItem::set_lp_view(' . $lp_view_id . ') $lp_view_id is empty',
3143
+                    'learnpathItem::set_lp_view('.$lp_view_id.') $lp_view_id is empty',
3144 3144
                     0
3145 3145
                 );
3146 3146
             }
@@ -3149,7 +3149,7 @@  discard block
 block discarded – undo
3149 3149
         }
3150 3150
 
3151 3151
         if (self::debug > 0) {
3152
-            error_log('learnpathItem::set_lp_view(' . $lp_view_id . ')', 0);
3152
+            error_log('learnpathItem::set_lp_view('.$lp_view_id.')', 0);
3153 3153
         }
3154 3154
 
3155 3155
         $this->view_id = $lp_view_id;
@@ -3159,13 +3159,13 @@  discard block
 block discarded – undo
3159 3159
         $sql = "SELECT * FROM $item_view_table
3160 3160
                 WHERE
3161 3161
                     c_id = $course_id AND
3162
-                    lp_item_id = " . $lpItemId . " AND
3163
-                    lp_view_id = " . $lp_view_id . "
3162
+                    lp_item_id = ".$lpItemId." AND
3163
+                    lp_view_id = " . $lp_view_id."
3164 3164
                 ORDER BY view_count DESC";
3165 3165
 
3166 3166
         if (self::debug > 2) {
3167 3167
             error_log(
3168
-                'learnpathItem::set_lp_view() - Querying lp_item_view: ' . $sql,
3168
+                'learnpathItem::set_lp_view() - Querying lp_item_view: '.$sql,
3169 3169
                 0
3170 3170
             );
3171 3171
         }
@@ -3197,7 +3197,7 @@  discard block
 block discarded – undo
3197 3197
             $sql = "SELECT * FROM $item_view_interaction_table
3198 3198
                     WHERE
3199 3199
                         c_id = $course_id AND
3200
-                        lp_iv_id = '" . $this->db_item_view_id . "'";
3200
+                        lp_iv_id = '".$this->db_item_view_id."'";
3201 3201
 
3202 3202
             $res = Database::query($sql);
3203 3203
             if ($res !== false) {
@@ -3212,7 +3212,7 @@  discard block
 block discarded – undo
3212 3212
             $sql = "SELECT * FROM $item_view_objective_table
3213 3213
                     WHERE
3214 3214
                         c_id = $course_id AND
3215
-                        lp_iv_id = '" . $this->db_item_view_id . "'";
3215
+                        lp_iv_id = '".$this->db_item_view_id."'";
3216 3216
 
3217 3217
             $res = Database::query($sql);
3218 3218
             if ($res !== false) {
@@ -3273,7 +3273,7 @@  discard block
 block discarded – undo
3273 3273
     {
3274 3274
         $debug = self::debug;
3275 3275
         if ($debug > 0) {
3276
-            error_log('learnpathItem::set_score(' . $score . ')', 0);
3276
+            error_log('learnpathItem::set_score('.$score.')', 0);
3277 3277
         }
3278 3278
         if (($this->max_score <= 0 || $score <= $this->max_score) && ($score >= $this->min_score)) {
3279 3279
             $this->current_score = $score;
@@ -3286,9 +3286,9 @@  discard block
 block discarded – undo
3286 3286
             }
3287 3287
 
3288 3288
             if ($debug > 0) {
3289
-                error_log('get_mastery_score: ' . $masteryScore);
3290
-                error_log('current_status: ' . $current_status);
3291
-                error_log('current score : ' . $this->current_score);
3289
+                error_log('get_mastery_score: '.$masteryScore);
3290
+                error_log('current_status: '.$current_status);
3291
+                error_log('current score : '.$this->current_score);
3292 3292
             }
3293 3293
 
3294 3294
             // If mastery_score is set AND the current score reaches the mastery
@@ -3316,15 +3316,15 @@  discard block
 block discarded – undo
3316 3316
     public function set_max_score($score)
3317 3317
     {
3318 3318
         if (self::debug > 0) {
3319
-            error_log('learnpathItem::set_max_score(' . $score . ')', 0);
3319
+            error_log('learnpathItem::set_max_score('.$score.')', 0);
3320 3320
         }
3321 3321
         if (is_int($score) || $score == '') {
3322 3322
             $this->view_max_score = $score;
3323 3323
             if (self::debug > 1) {
3324 3324
                 error_log(
3325
-                    'learnpathItem::set_max_score() - ' .
3326
-                    'Updated object score of item ' . $this->db_id .
3327
-                    ' to ' . $this->view_max_score,
3325
+                    'learnpathItem::set_max_score() - '.
3326
+                    'Updated object score of item '.$this->db_id.
3327
+                    ' to '.$this->view_max_score,
3328 3328
                     0
3329 3329
                 );
3330 3330
             }
@@ -3342,12 +3342,12 @@  discard block
 block discarded – undo
3342 3342
     public function set_status($status)
3343 3343
     {
3344 3344
         if (self::debug > 0) {
3345
-            error_log('learnpathItem::set_status(' . $status . ')', 0);
3345
+            error_log('learnpathItem::set_status('.$status.')', 0);
3346 3346
         }
3347 3347
 
3348 3348
         $found = false;
3349 3349
         foreach ($this->possible_status as $possible) {
3350
-            if (preg_match('/^' . $possible . '$/i', $status)) {
3350
+            if (preg_match('/^'.$possible.'$/i', $status)) {
3351 3351
                 $found = true;
3352 3352
             }
3353 3353
         }
@@ -3357,8 +3357,8 @@  discard block
 block discarded – undo
3357 3357
             if (self::debug > 1) {
3358 3358
                 error_log(
3359 3359
                     'learnpathItem::set_status() - '.
3360
-                        'Updated object status of item ' . $this->db_id .
3361
-                        ' to ' . $this->status,
3360
+                        'Updated object status of item '.$this->db_id.
3361
+                        ' to '.$this->status,
3362 3362
                     0
3363 3363
                 );
3364 3364
             }
@@ -3380,7 +3380,7 @@  discard block
 block discarded – undo
3380 3380
         global $charset;
3381 3381
         $course_id = api_get_course_int_id();
3382 3382
         $lp_item = Database::get_course_table(TABLE_LP_ITEM);
3383
-        require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
3383
+        require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
3384 3384
         $a_terms = preg_split('/,/', $terms);
3385 3385
         $i_terms = preg_split('/,/', $this->get_terms());
3386 3386
         foreach ($i_terms as $term) {
@@ -3397,7 +3397,7 @@  discard block
 block discarded – undo
3397 3397
                 SET terms = '$terms'
3398 3398
                 WHERE
3399 3399
                     c_id = $course_id AND
3400
-                    id=" . $this->get_id();
3400
+                    id=".$this->get_id();
3401 3401
         Database::query($sql);
3402 3402
         // Save it to search engine.
3403 3403
         if (api_get_setting('search_enabled') == 'true') {
@@ -3425,7 +3425,7 @@  discard block
 block discarded – undo
3425 3425
     public function set_time($scorm_time, $format = 'scorm')
3426 3426
     {
3427 3427
         if (self::debug > 0) {
3428
-            error_log('learnpathItem::set_time(' . $scorm_time . ')', 0);
3428
+            error_log('learnpathItem::set_time('.$scorm_time.')', 0);
3429 3429
         }
3430 3430
         if ($scorm_time == '0'
3431 3431
                 and ($this->type != 'sco')
@@ -3436,8 +3436,8 @@  discard block
 block discarded – undo
3436 3436
                 $this->update_time($my_time);
3437 3437
                 if (self::debug > 0) {
3438 3438
                     error_log(
3439
-                        'learnpathItem::set_time(' . $scorm_time . ') - ' .
3440
-                            'found asset - set time to ' . $my_time,
3439
+                        'learnpathItem::set_time('.$scorm_time.') - '.
3440
+                            'found asset - set time to '.$my_time,
3441 3441
                         0
3442 3442
                     );
3443 3443
                 }
@@ -3510,10 +3510,10 @@  discard block
 block discarded – undo
3510 3510
     {
3511 3511
         if (self::debug > 1) {
3512 3512
             error_log(
3513
-                'learnpathItem::status_is(' . print_r(
3513
+                'learnpathItem::status_is('.print_r(
3514 3514
                     $list,
3515 3515
                     true
3516
-                ) . ') on item ' . $this->db_id,
3516
+                ).') on item '.$this->db_id,
3517 3517
                 0
3518 3518
             );
3519 3519
         }
@@ -3523,11 +3523,11 @@  discard block
 block discarded – undo
3523 3523
         }
3524 3524
         $found = false;
3525 3525
         foreach ($list as $status) {
3526
-            if (preg_match('/^' . $status . '$/i', $currentStatus)) {
3526
+            if (preg_match('/^'.$status.'$/i', $currentStatus)) {
3527 3527
                 if (self::debug > 2) {
3528 3528
                     error_log(
3529
-                        'New LP - learnpathItem::status_is() - Found status ' .
3530
-                            $status . ' corresponding to current status',
3529
+                        'New LP - learnpathItem::status_is() - Found status '.
3530
+                            $status.' corresponding to current status',
3531 3531
                         0
3532 3532
                     );
3533 3533
                 }
@@ -3538,8 +3538,8 @@  discard block
 block discarded – undo
3538 3538
         }
3539 3539
         if (self::debug > 2) {
3540 3540
             error_log(
3541
-                'New LP - learnpathItem::status_is() - Status ' .
3542
-                    $currentStatus . ' did not match request',
3541
+                'New LP - learnpathItem::status_is() - Status '.
3542
+                    $currentStatus.' did not match request',
3543 3543
                 0
3544 3544
             );
3545 3545
         }
@@ -3556,7 +3556,7 @@  discard block
 block discarded – undo
3556 3556
     public function update_time($total_sec = 0)
3557 3557
     {
3558 3558
         if (self::debug > 0) {
3559
-            error_log('learnpathItem::update_time(' . $total_sec . ')', 0);
3559
+            error_log('learnpathItem::update_time('.$total_sec.')', 0);
3560 3560
         }
3561 3561
         if ($total_sec >= 0) {
3562 3562
             // Getting start time from finish time. The only problem in the calculation is it might be
@@ -3606,12 +3606,12 @@  discard block
 block discarded – undo
3606 3606
         $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
3607 3607
         $course_id = api_get_course_int_id();
3608 3608
 
3609
-        $sql = 'SELECT total_time, status FROM ' . $item_view_table . '
3609
+        $sql = 'SELECT total_time, status FROM '.$item_view_table.'
3610 3610
                  WHERE 
3611
-                    c_id = ' . $course_id . ' AND 
3612
-                    lp_item_id="' . $this->db_id . '" AND 
3613
-                    lp_view_id="' . $this->view_id . '" AND 
3614
-                    view_count="' . $this->get_attempt_id() . '"';
3611
+                    c_id = ' . $course_id.' AND 
3612
+                    lp_item_id="' . $this->db_id.'" AND 
3613
+                    lp_view_id="' . $this->view_id.'" AND 
3614
+                    view_count="' . $this->get_attempt_id().'"';
3615 3615
         $result = Database::query($sql);
3616 3616
         $row = Database::fetch_array($result);
3617 3617
 
@@ -3681,13 +3681,13 @@  discard block
 block discarded – undo
3681 3681
     {
3682 3682
         $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
3683 3683
         $course_id = api_get_course_int_id();
3684
-        $sql = 'UPDATE ' . $item_view_table . '
3684
+        $sql = 'UPDATE '.$item_view_table.'
3685 3685
                 SET total_time = 0, 
3686
-                    start_time=' . time() . '
3687
-                WHERE c_id = ' . $course_id . '
3688
-                    AND lp_item_id="' . $this->db_id . '"
3689
-                    AND lp_view_id="' . $this->view_id . '"
3690
-                    AND view_count="' . $this->attempt_id . '" ;';
3686
+                    start_time=' . time().'
3687
+                WHERE c_id = ' . $course_id.'
3688
+                    AND lp_item_id="' . $this->db_id.'"
3689
+                    AND lp_view_id="' . $this->view_id.'"
3690
+                    AND view_count="' . $this->attempt_id.'" ;';
3691 3691
         Database::query($sql);
3692 3692
     }
3693 3693
 
@@ -3709,8 +3709,8 @@  discard block
 block discarded – undo
3709 3709
                     FROM $tbl
3710 3710
                     WHERE
3711 3711
                         c_id = $course_id AND
3712
-                        lp_item_id = " . $this->db_id . " AND
3713
-                        lp_view_id = " . $this->view_id . " AND
3712
+                        lp_item_id = ".$this->db_id." AND
3713
+                        lp_view_id = " . $this->view_id." AND
3714 3714
                         view_count = " . $this->attempt_id;
3715 3715
             $res = Database::query($sql);
3716 3716
             if (Database::num_rows($res) > 0) {
@@ -3718,8 +3718,8 @@  discard block
 block discarded – undo
3718 3718
                 $lp_iv_id = $row[0];
3719 3719
                 if (self::debug > 2) {
3720 3720
                     error_log(
3721
-                        'learnpathItem::write_to_db() - Got item_view_id ' .
3722
-                            $lp_iv_id . ', now checking objectives ',
3721
+                        'learnpathItem::write_to_db() - Got item_view_id '.
3722
+                            $lp_iv_id.', now checking objectives ',
3723 3723
                         0
3724 3724
                     );
3725 3725
                 }
@@ -3731,7 +3731,7 @@  discard block
 block discarded – undo
3731 3731
                                 WHERE
3732 3732
                                     c_id = $course_id AND
3733 3733
                                     lp_iv_id = $lp_iv_id AND
3734
-                                    objective_id = '" . Database::escape_string($objective[0]) . "'";
3734
+                                    objective_id = '".Database::escape_string($objective[0])."'";
3735 3735
                     $iva_res = Database::query($iva_sql);
3736 3736
                     // id(0), type(1), time(2), weighting(3),
3737 3737
                     // correct_responses(4), student_response(5),
@@ -3740,12 +3740,12 @@  discard block
 block discarded – undo
3740 3740
                         // Update (or don't).
3741 3741
                         $iva_row = Database::fetch_array($iva_res);
3742 3742
                         $iva_id = $iva_row[0];
3743
-                        $ivau_sql = "UPDATE $iva_table " .
3744
-                            "SET objective_id = '" . Database::escape_string($objective[0]) . "'," .
3745
-                            "status = '" . Database::escape_string($objective[1]) . "'," .
3746
-                            "score_raw = '" . Database::escape_string($objective[2]) . "'," .
3747
-                            "score_min = '" . Database::escape_string($objective[4]) . "'," .
3748
-                            "score_max = '" . Database::escape_string($objective[3]) . "' " .
3743
+                        $ivau_sql = "UPDATE $iva_table ".
3744
+                            "SET objective_id = '".Database::escape_string($objective[0])."',".
3745
+                            "status = '".Database::escape_string($objective[1])."',".
3746
+                            "score_raw = '".Database::escape_string($objective[2])."',".
3747
+                            "score_min = '".Database::escape_string($objective[4])."',".
3748
+                            "score_max = '".Database::escape_string($objective[3])."' ".
3749 3749
                             "WHERE c_id = $course_id AND id = $iva_id";
3750 3750
                         Database::query($ivau_sql);
3751 3751
                     } else {
@@ -3797,12 +3797,12 @@  discard block
 block discarded – undo
3797 3797
         $my_status = ' ';
3798 3798
 
3799 3799
         $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
3800
-        $sql = 'SELECT status FROM ' . $item_view_table . '
3800
+        $sql = 'SELECT status FROM '.$item_view_table.'
3801 3801
                 WHERE
3802
-                    c_id = ' . $course_id . ' AND
3803
-                    lp_item_id="' . $this->db_id . '" AND
3804
-                    lp_view_id="' . $this->view_id . '" AND
3805
-                    view_count="' . $this->get_attempt_id() . '" ';
3802
+                    c_id = ' . $course_id.' AND
3803
+                    lp_item_id="' . $this->db_id.'" AND
3804
+                    lp_view_id="' . $this->view_id.'" AND
3805
+                    view_count="' . $this->get_attempt_id().'" ';
3806 3806
         $rs_verified = Database::query($sql);
3807 3807
         $row_verified = Database::fetch_array($rs_verified);
3808 3808
 
@@ -3830,8 +3830,8 @@  discard block
 block discarded – undo
3830 3830
                     "This info shouldn't be saved as the credit or lesson mode info prevent it"
3831 3831
                 );
3832 3832
                 error_log(
3833
-                    'learnpathItem::write_to_db() - credit(' . $credit . ') or'.
3834
-                        ' lesson_mode(' . $mode . ') prevent recording!',
3833
+                    'learnpathItem::write_to_db() - credit('.$credit.') or'.
3834
+                        ' lesson_mode('.$mode.') prevent recording!',
3835 3835
                     0
3836 3836
                 );
3837 3837
             }
@@ -3855,14 +3855,14 @@  discard block
 block discarded – undo
3855 3855
                     "max_score" => $this->get_max(),
3856 3856
                     "lp_item_id" => $this->db_id,
3857 3857
                     "lp_view_id" => $this->view_id,
3858
-                    "view_count" => $this->get_attempt_id() ,
3858
+                    "view_count" => $this->get_attempt_id(),
3859 3859
                     "suspend_data" => $this->current_data,
3860 3860
                     //"max_time_allowed" => ,
3861 3861
                     "lesson_location" => $this->lesson_location
3862 3862
                 );
3863 3863
                 if (self::debug > 2) {
3864 3864
                     error_log(
3865
-                        'learnpathItem::write_to_db() - Inserting into item_view forced: ' . print_r($params, 1),
3865
+                        'learnpathItem::write_to_db() - Inserting into item_view forced: '.print_r($params, 1),
3866 3866
                         0
3867 3867
                     );
3868 3868
                 }
@@ -3870,7 +3870,7 @@  discard block
 block discarded – undo
3870 3870
 
3871 3871
                 if ($this->db_item_view_id) {
3872 3872
                     $sql = "UPDATE $item_view_table SET id = iid
3873
-                            WHERE iid = " . $this->db_item_view_id;
3873
+                            WHERE iid = ".$this->db_item_view_id;
3874 3874
                     Database::query($sql);
3875 3875
                     $inserted = true;
3876 3876
                 }
@@ -3880,12 +3880,12 @@  discard block
 block discarded – undo
3880 3880
             $sql = "SELECT * FROM $item_view_table
3881 3881
                     WHERE
3882 3882
                         c_id = $course_id AND
3883
-                        lp_item_id = " . $this->db_id . " AND
3884
-                        lp_view_id = " . $this->view_id . " AND
3883
+                        lp_item_id = ".$this->db_id." AND
3884
+                        lp_view_id = " . $this->view_id." AND
3885 3885
                         view_count = " . intval($this->get_attempt_id());
3886 3886
             if (self::debug > 2) {
3887 3887
                 error_log(
3888
-                    'learnpathItem::write_to_db() - Querying item_view: ' . $sql,
3888
+                    'learnpathItem::write_to_db() - Querying item_view: '.$sql,
3889 3889
                     0
3890 3890
                 );
3891 3891
             }
@@ -3902,7 +3902,7 @@  discard block
 block discarded – undo
3902 3902
                     "max_score" => $this->get_max(),
3903 3903
                     "lp_item_id" => $this->db_id,
3904 3904
                     "lp_view_id" => $this->view_id,
3905
-                    "view_count" => $this->get_attempt_id() ,
3905
+                    "view_count" => $this->get_attempt_id(),
3906 3906
                     "suspend_data" => $this->current_data,
3907 3907
                     //"max_time_allowed" => ,$this->get_max_time_allowed()
3908 3908
                     "lesson_location" => $this->lesson_location
@@ -3910,7 +3910,7 @@  discard block
 block discarded – undo
3910 3910
 
3911 3911
                 if (self::debug > 2) {
3912 3912
                     error_log(
3913
-                        'learnpathItem::write_to_db() - Inserting into item_view forced: ' . print_r($params, 1),
3913
+                        'learnpathItem::write_to_db() - Inserting into item_view forced: '.print_r($params, 1),
3914 3914
                         0
3915 3915
                     );
3916 3916
                 }
@@ -3919,7 +3919,7 @@  discard block
 block discarded – undo
3919 3919
 
3920 3920
                 if ($this->db_item_view_id) {
3921 3921
                     $sql = "UPDATE $item_view_table SET id = iid
3922
-                            WHERE iid = " . $this->db_item_view_id;
3922
+                            WHERE iid = ".$this->db_item_view_id;
3923 3923
                     Database::query($sql);
3924 3924
                 }
3925 3925
             } else {
@@ -3959,8 +3959,8 @@  discard block
 block discarded – undo
3959 3959
                             $time_exe_date = convert_sql_date(
3960 3960
                                 $row_dates['exe_date']
3961 3961
                             );
3962
-                            $mytime = ((int)$time_exe_date - (int)$time_start_date);
3963
-                            $total_time = " total_time = " . $mytime . ", ";
3962
+                            $mytime = ((int) $time_exe_date - (int) $time_start_date);
3963
+                            $total_time = " total_time = ".$mytime.", ";
3964 3964
                         }
3965 3965
                     } else {
3966 3966
                         $my_type_lp = learnpath::get_type_static($this->lp_id);
@@ -3974,16 +3974,16 @@  discard block
 block discarded – undo
3974 3974
 
3975 3975
                         // Is not multiple attempts
3976 3976
                         if ($this->seriousgame_mode == 1 && $this->type == 'sco') {
3977
-                            $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
3978
-                            $my_status = " status = '" . $this->get_status(false) . "' ,";
3977
+                            $total_time = " total_time = total_time +".$this->get_total_time().", ";
3978
+                            $my_status = " status = '".$this->get_status(false)."' ,";
3979 3979
                         } elseif ($this->get_prevent_reinit() == 1) {
3980 3980
                             // Process of status verified into data base.
3981
-                            $sql = 'SELECT status FROM ' . $item_view_table . '
3981
+                            $sql = 'SELECT status FROM '.$item_view_table.'
3982 3982
                                     WHERE
3983
-                                        c_id = ' . $course_id . ' AND
3984
-                                        lp_item_id="' . $this->db_id . '" AND
3985
-                                        lp_view_id="' . $this->view_id . '" AND
3986
-                                        view_count="' . $this->get_attempt_id() . '"
3983
+                                        c_id = ' . $course_id.' AND
3984
+                                        lp_item_id="' . $this->db_id.'" AND
3985
+                                        lp_view_id="' . $this->view_id.'" AND
3986
+                                        view_count="' . $this->get_attempt_id().'"
3987 3987
                                     ';
3988 3988
                             $rs_verified = Database::query($sql);
3989 3989
                             $row_verified = Database::fetch_array($rs_verified);
@@ -3993,26 +3993,26 @@  discard block
 block discarded – undo
3993 3993
                             if (!in_array($this->get_status(false), $case_completed) &&
3994 3994
                                 $my_type_lp == 2
3995 3995
                             ) {
3996
-                                $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
3997
-                                $my_status = " status = '" . $this->get_status(false) . "' ,";
3996
+                                $total_time = " total_time = total_time +".$this->get_total_time().", ";
3997
+                                $my_status = " status = '".$this->get_status(false)."' ,";
3998 3998
                             } else {
3999 3999
                                 // Verified into database.
4000 4000
                                 if (!in_array($row_verified['status'], $case_completed) &&
4001 4001
                                     $my_type_lp == 2
4002 4002
                                 ) {
4003
-                                    $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
4004
-                                    $my_status = " status = '" . $this->get_status(false) . "' ,";
4005
-                                } elseif (in_array($row_verified['status'], $case_completed ) &&
4003
+                                    $total_time = " total_time = total_time +".$this->get_total_time().", ";
4004
+                                    $my_status = " status = '".$this->get_status(false)."' ,";
4005
+                                } elseif (in_array($row_verified['status'], $case_completed) &&
4006 4006
                                     $my_type_lp == 2 && $this->type != 'sco'
4007 4007
                                 ) {
4008
-                                    $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
4009
-                                    $my_status = " status = '" . $this->get_status(false) . "' ,";
4008
+                                    $total_time = " total_time = total_time +".$this->get_total_time().", ";
4009
+                                    $my_status = " status = '".$this->get_status(false)."' ,";
4010 4010
                                 } else {
4011 4011
                                     if (($my_type_lp == 3 && $this->type == 'au') ||
4012 4012
                                         ($my_type_lp == 1 && $this->type != 'dir')) {
4013 4013
                                         // Is AICC or Chamilo LP
4014
-                                        $total_time = " total_time = total_time + " . $this->get_total_time() . ", ";
4015
-                                        $my_status = " status = '" . $this->get_status(false) . "' ,";
4014
+                                        $total_time = " total_time = total_time + ".$this->get_total_time().", ";
4015
+                                        $my_status = " status = '".$this->get_status(false)."' ,";
4016 4016
                                     }
4017 4017
                                 }
4018 4018
                             }
@@ -4024,27 +4024,27 @@  discard block
 block discarded – undo
4024 4024
                                 ) && $my_type_lp == 2
4025 4025
                             ) {
4026 4026
                                 // Reset zero new attempt ?
4027
-                                $my_status = " status = '" . $this->get_status(false) . "' ,";
4027
+                                $my_status = " status = '".$this->get_status(false)."' ,";
4028 4028
                             } elseif (!in_array($this->get_status(false), $case_completed) &&
4029 4029
                                 $my_type_lp == 2
4030 4030
                             ) {
4031
-                                $total_time = " total_time = " . $this->get_total_time() . ", ";
4032
-                                $my_status = " status = '" . $this->get_status(false) . "' ,";
4031
+                                $total_time = " total_time = ".$this->get_total_time().", ";
4032
+                                $my_status = " status = '".$this->get_status(false)."' ,";
4033 4033
                             } else {
4034 4034
                                 // It is chamilo LP.
4035
-                                $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
4036
-                                $my_status = " status = '" . $this->get_status(false) . "' ,";
4035
+                                $total_time = " total_time = total_time +".$this->get_total_time().", ";
4036
+                                $my_status = " status = '".$this->get_status(false)."' ,";
4037 4037
                             }
4038 4038
 
4039 4039
                             // This code line fixes the problem of wrong status.
4040 4040
                             if ($my_type_lp == 2) {
4041 4041
                                 // Verify current status in multiples attempts.
4042
-                                $sql = 'SELECT status FROM ' . $item_view_table . '
4042
+                                $sql = 'SELECT status FROM '.$item_view_table.'
4043 4043
                                         WHERE
4044
-                                            c_id = ' . $course_id . ' AND
4045
-                                            lp_item_id="' . $this->db_id . '" AND
4046
-                                            lp_view_id="' . $this->view_id . '" AND
4047
-                                            view_count="' . $this->get_attempt_id() . '" ';
4044
+                                            c_id = ' . $course_id.' AND
4045
+                                            lp_item_id="' . $this->db_id.'" AND
4046
+                                            lp_view_id="' . $this->view_id.'" AND
4047
+                                            view_count="' . $this->get_attempt_id().'" ';
4048 4048
                                 $rs_status = Database::query($sql);
4049 4049
                                 $current_status = Database::result(
4050 4050
                                     $rs_status,
@@ -4055,7 +4055,7 @@  discard block
 block discarded – undo
4055 4055
                                     $my_status = '';
4056 4056
                                     $total_time = '';
4057 4057
                                 } else {
4058
-                                    $total_time = " total_time = total_time +" . $this->get_total_time() . ", ";
4058
+                                    $total_time = " total_time = total_time +".$this->get_total_time().", ";
4059 4059
                                 }
4060 4060
                             }
4061 4061
                         }
@@ -4066,38 +4066,38 @@  discard block
 block discarded – undo
4066 4066
                         //" . //start_time = ".$this->get_current_start_time().", " . //scorm_init_time does it
4067 4067
                         ////" max_time_allowed = '".$this->get_max_time_allowed()."'," .
4068 4068
                         $sql = "UPDATE $item_view_table SET
4069
-                                    score = " . $this->get_score() . ",
4069
+                                    score = ".$this->get_score().",
4070 4070
                                     $my_status
4071
-                                    max_score = '" . $this->get_max() . "',
4072
-                                    suspend_data = '" . Database::escape_string($this->current_data) . "',
4073
-                                    lesson_location = '" . $this->lesson_location . "'
4071
+                                    max_score = '".$this->get_max()."',
4072
+                                    suspend_data = '" . Database::escape_string($this->current_data)."',
4073
+                                    lesson_location = '" . $this->lesson_location."'
4074 4074
                                 WHERE
4075 4075
                                     c_id = $course_id AND
4076
-                                    lp_item_id = " . $this->db_id . " AND
4077
-                                    lp_view_id = " . $this->view_id . "  AND
4076
+                                    lp_item_id = ".$this->db_id." AND
4077
+                                    lp_view_id = " . $this->view_id."  AND
4078 4078
                                     view_count = " . $this->get_attempt_id();
4079 4079
 
4080 4080
                     } else {
4081 4081
                         //" max_time_allowed = '".$this->get_max_time_allowed()."'," .
4082 4082
                         $sql = "UPDATE $item_view_table SET
4083 4083
                                     $total_time
4084
-                                    start_time = " . $this->get_current_start_time() . ",
4085
-                                    score = " . $this->get_score() . ",
4084
+                                    start_time = ".$this->get_current_start_time().",
4085
+                                    score = " . $this->get_score().",
4086 4086
                                     $my_status
4087
-                                    max_score = '" . $this->get_max() . "',
4088
-                                    suspend_data = '" . Database::escape_string($this->current_data) . "',
4089
-                                    lesson_location = '" . $this->lesson_location . "'
4087
+                                    max_score = '".$this->get_max()."',
4088
+                                    suspend_data = '" . Database::escape_string($this->current_data)."',
4089
+                                    lesson_location = '" . $this->lesson_location."'
4090 4090
                                 WHERE
4091 4091
                                     c_id = $course_id AND
4092
-                                    lp_item_id = " . $this->db_id . " AND
4093
-                                    lp_view_id = " . $this->view_id . " AND
4092
+                                    lp_item_id = ".$this->db_id." AND
4093
+                                    lp_view_id = " . $this->view_id." AND
4094 4094
                                     view_count = " . $this->get_attempt_id();
4095 4095
                     }
4096 4096
                     $this->current_start_time = time();
4097 4097
                 }
4098 4098
                 if (self::debug > 2) {
4099 4099
                     error_log(
4100
-                        'learnpathItem::write_to_db() - Updating item_view: ' . $sql,
4100
+                        'learnpathItem::write_to_db() - Updating item_view: '.$sql,
4101 4101
                         0
4102 4102
                     );
4103 4103
                 }
@@ -4110,8 +4110,8 @@  discard block
 block discarded – undo
4110 4110
                 $sql = "SELECT id FROM $tbl
4111 4111
                         WHERE
4112 4112
                             c_id = $course_id AND
4113
-                            lp_item_id = " . $this->db_id . " AND
4114
-                            lp_view_id = " . $this->view_id . " AND
4113
+                            lp_item_id = ".$this->db_id." AND
4114
+                            lp_view_id = " . $this->view_id." AND
4115 4115
                             view_count = " . $this->get_attempt_id();
4116 4116
                 $res = Database::query($sql);
4117 4117
                 if (Database::num_rows($res) > 0) {
@@ -4119,16 +4119,16 @@  discard block
 block discarded – undo
4119 4119
                     $lp_iv_id = $row[0];
4120 4120
                     if (self::debug > 2) {
4121 4121
                         error_log(
4122
-                            'learnpathItem::write_to_db() - Got item_view_id ' .
4123
-                                $lp_iv_id . ', now checking interactions ',
4122
+                            'learnpathItem::write_to_db() - Got item_view_id '.
4123
+                                $lp_iv_id.', now checking interactions ',
4124 4124
                             0
4125 4125
                         );
4126 4126
                     }
4127 4127
                     foreach ($this->interactions as $index => $interaction) {
4128 4128
                         $correct_resp = '';
4129
-                        if (is_array($interaction[4] ) && !empty($interaction[4][0])) {
4129
+                        if (is_array($interaction[4]) && !empty($interaction[4][0])) {
4130 4130
                             foreach ($interaction[4] as $resp) {
4131
-                                $correct_resp .= $resp . ',';
4131
+                                $correct_resp .= $resp.',';
4132 4132
                             }
4133 4133
                             $correct_resp = substr(
4134 4134
                                 $correct_resp,
@@ -4147,7 +4147,7 @@  discard block
 block discarded – undo
4147 4147
                                         lp_iv_id = $lp_iv_id AND
4148 4148
                                         (
4149 4149
                                             order_id = $index OR
4150
-                                            interaction_id = '" . Database::escape_string($interaction[0]) . "'
4150
+                                            interaction_id = '".Database::escape_string($interaction[0])."'
4151 4151
                                         )
4152 4152
                                     ";
4153 4153
                         $iva_res = Database::query($iva_sql);
@@ -4229,11 +4229,11 @@  discard block
 block discarded – undo
4229 4229
     public function add_audio()
4230 4230
     {
4231 4231
         $course_info = api_get_course_info();
4232
-        $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document/';
4232
+        $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/';
4233 4233
 
4234
-        if (!is_dir($filepath . 'audio')) {
4234
+        if (!is_dir($filepath.'audio')) {
4235 4235
             mkdir(
4236
-                $filepath . 'audio',
4236
+                $filepath.'audio',
4237 4237
                 api_get_permissions_for_new_directories()
4238 4238
             );
4239 4239
             $audio_id = add_document(
@@ -4292,10 +4292,10 @@  discard block
 block discarded – undo
4292 4292
             // Store the mp3 file in the lp_item table.
4293 4293
             $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
4294 4294
             $sql = "UPDATE $tbl_lp_item SET
4295
-                        audio = '" . Database::escape_string($file_path) . "'
4295
+                        audio = '".Database::escape_string($file_path)."'
4296 4296
                     WHERE
4297 4297
                         c_id = {$course_info['real_id']} AND
4298
-                        id = '" . intval($this->db_id) . "'";
4298
+                        id = '".intval($this->db_id)."'";
4299 4299
             Database::query($sql);
4300 4300
         }
4301 4301
 
@@ -4320,10 +4320,10 @@  discard block
 block discarded – undo
4320 4320
             // Store the mp3 file in the lp_item table.
4321 4321
             $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
4322 4322
             $sql = "UPDATE $tbl_lp_item SET
4323
-                        audio = '" . Database::escape_string($file_path) . "'
4323
+                        audio = '".Database::escape_string($file_path)."'
4324 4324
                     WHERE
4325 4325
                         c_id = {$course_info['real_id']} AND
4326
-                        id = " . intval($this->db_id);
4326
+                        id = ".intval($this->db_id);
4327 4327
             Database::query($sql);
4328 4328
         }
4329 4329
         return $file_path;
@@ -4344,7 +4344,7 @@  discard block
 block discarded – undo
4344 4344
         }
4345 4345
         $sql = "UPDATE $tbl_lp_item SET
4346 4346
                 audio = ''
4347
-                WHERE c_id = $course_id AND id IN (" . $this->db_id . ")";
4347
+                WHERE c_id = $course_id AND id IN (".$this->db_id.")";
4348 4348
         Database::query($sql);
4349 4349
     }
4350 4350
 
@@ -4390,7 +4390,7 @@  discard block
 block discarded – undo
4390 4390
 
4391 4391
         if ($type == 'simple') {
4392 4392
             if (in_array($status, array('failed', 'passed', 'browsed'))) {
4393
-                $myLessonStatus = get_lang('ScormIncomplete');;
4393
+                $myLessonStatus = get_lang('ScormIncomplete'); ;
4394 4394
                 $classStatus = 'warning';
4395 4395
             }
4396 4396
         }
@@ -4539,7 +4539,7 @@  discard block
 block discarded – undo
4539 4539
      */
4540 4540
     public function createForumThread($currentForumId)
4541 4541
     {
4542
-        require_once api_get_path(SYS_CODE_PATH) . '/forum/forumfunction.inc.php';
4542
+        require_once api_get_path(SYS_CODE_PATH).'/forum/forumfunction.inc.php';
4543 4543
 
4544 4544
         $em = Database::getManager();
4545 4545
         $threadRepo = $em->getRepository('ChamiloCourseBundle:CForumThread');
Please login to merge, or discard this patch.
main/lp/download.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 $doc_url = str_replace(array('../', '\\..', '\\0', '..\\'), array('', '', '', ''), $doc_url); //echo $doc_url;
26 26
 
27
-if (strpos($doc_url,'../') || strpos($doc_url,'/..')) {
27
+if (strpos($doc_url, '../') || strpos($doc_url, '/..')) {
28 28
     $doc_url = '';
29 29
 }
30 30
 $sys_course_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm';
@@ -50,5 +50,5 @@  discard block
 block discarded – undo
50 50
     }
51 51
 }
52 52
 
53
-Display::display_error_message(get_lang('ProtectedDocument'));//api_not_allowed backbutton won't work.
53
+Display::display_error_message(get_lang('ProtectedDocument')); //api_not_allowed backbutton won't work.
54 54
 exit;
Please login to merge, or discard this patch.