Completed
Push — 1.11.x ( 78f130...f6f5c2 )
by José
50:40 queued 24:26
created
main/forum/forumsearch.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 // Are we in a lp ?
41 41
 $origin = '';
42 42
 if (isset($_GET['origin'])) {
43
-    $origin =  Security::remove_XSS($_GET['origin']);
43
+    $origin = Security::remove_XSS($_GET['origin']);
44 44
 }
45 45
 
46 46
 // Name of the tool
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 
49 49
 // Breadcrumbs
50 50
 
51
-if (isset($_SESSION['gradebook'])){
51
+if (isset($_SESSION['gradebook'])) {
52 52
     $gradebook = $_SESSION['gradebook'];
53 53
 }
54 54
 
55 55
 if (!empty($gradebook) && $gradebook == 'view') {
56
-    $interbreadcrumb[] = array (
56
+    $interbreadcrumb[] = array(
57 57
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
58 58
         'name' => get_lang('ToolGradebook')
59 59
     );
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
67 67
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
68 68
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title']));
69
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(),'name' => get_lang('ForumSearch'));
69
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), 'name' => get_lang('ForumSearch'));
70 70
 } else {
71 71
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools);
72 72
     $nameTools = get_lang('ForumSearch');
Please login to merge, or discard this patch.
main/document/slideshow.php 2 patches
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 if ($slide_id != 'all') {
65 65
 	$image = null;
66 66
 	if (isset($image_files_only[$slide])) {
67
-		$image = $sys_course_path . $_course['path'] . '/document' . $folder . $image_files_only[$slide];
67
+		$image = $sys_course_path.$_course['path'].'/document'.$folder.$image_files_only[$slide];
68 68
 	}
69 69
 	if (file_exists($image)) {
70 70
 		echo '<div class="actions-pagination">';
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             $last = Display::return_icon('action_last_na.png', get_lang('LastSlide'));
106 106
 		} else {
107 107
 			$imgn = 'action_next.png';
108
-			$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
108
+			$last = '<a href="slideshow.php?slide_id='.($total_slides - 1).'&curdirpath='.$pathurl.'">
109 109
 			        '.Display::return_icon('action_last.png', get_lang('LastSlide')).'
110 110
                 </a>';
111 111
 		}
@@ -122,18 +122,18 @@  discard block
 block discarded – undo
122 122
 
123 123
 // Exit the slideshow
124 124
 echo '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
125
-    Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
125
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
126 126
 
127 127
 // Show thumbnails
128 128
 if ($slide_id != 'all') {
129 129
 	echo '<a href="slideshow.php?slide_id=all&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
130
-        Display::return_icon('thumbnails.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM).'</a>';
130
+        Display::return_icon('thumbnails.png', get_lang('ShowThumbnails'), '', ICON_SIZE_MEDIUM).'</a>';
131 131
 } else {
132
-	echo Display::return_icon('thumbnails_na.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM);
132
+	echo Display::return_icon('thumbnails_na.png', get_lang('ShowThumbnails'), '', ICON_SIZE_MEDIUM);
133 133
 }
134 134
 // Slideshow options
135 135
 echo '<a href="slideshowoptions.php?curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
136
-    Display::return_icon('settings.png', get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>';
136
+    Display::return_icon('settings.png', get_lang('SetSlideshowOptions'), '', ICON_SIZE_MEDIUM).'</a>';
137 137
 
138 138
 echo '</div>';
139 139
 echo '<br />';
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 }
158 158
 $target_width = $target_height = null;
159 159
 // The target height and width depends if we choose resizing or no resizing
160
-if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == "resizing") {
160
+if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == "resizing") {
161 161
 	$target_width = $_SESSION["image_resizing_width"];
162 162
 	$target_height = $_SESSION["image_resizing_height"];
163 163
 }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 /*	THUMBNAIL VIEW */
166 166
 
167 167
 // This is for viewing all the images in the slideshow as thumbnails.
168
-$image_tag = array ();
168
+$image_tag = array();
169 169
 $html = '';
170 170
 if ($slide_id == 'all') {
171 171
 
@@ -173,16 +173,16 @@  discard block
 block discarded – undo
173 173
     $allowed_thumbnail_types = array('jpg', 'jpeg', 'gif', 'png');
174 174
 	$max_thumbnail_width     = 250;
175 175
 	$max_thumbnail_height    = 250;
176
-	$png_compression	     = 0;//0(none)-9
177
-	$jpg_quality  	         = 75;//from 0 to 100 (default is 75). More quality less compression
176
+	$png_compression	     = 0; //0(none)-9
177
+	$jpg_quality = 75; //from 0 to 100 (default is 75). More quality less compression
178 178
 
179 179
 	$directory_thumbnails = $sys_course_path.$_course['path'].'/document'.$folder.'.thumbs/';
180 180
 
181 181
 	//Other parameters only for show tumbnails
182
-	$row_items 			     = 4;//only in slideshow.php
183
-	$number_image 			 = 7;//num icons cols to show
184
-	$thumbnail_width_frame=$max_thumbnail_width;//optional $max_thumbnail_width+x
185
-	$thumbnail_height_frame=$max_thumbnail_height;
182
+	$row_items = 4; //only in slideshow.php
183
+	$number_image = 7; //num icons cols to show
184
+	$thumbnail_width_frame = $max_thumbnail_width; //optional $max_thumbnail_width+x
185
+	$thumbnail_height_frame = $max_thumbnail_height;
186 186
 
187 187
 	// Create the template_thumbnails folder (if no exist)
188 188
 
@@ -195,20 +195,20 @@  discard block
 block discarded – undo
195 195
 
196 196
 		foreach ($image_files_only as $one_image_file) {
197 197
 			$image = $sys_course_path.$_course['path'].'/document'.$folder.$one_image_file;
198
-			$image_thumbnail= $directory_thumbnails.'.'.$one_image_file;
198
+			$image_thumbnail = $directory_thumbnails.'.'.$one_image_file;
199 199
 
200 200
 			if (file_exists($image)) {
201 201
 				//check thumbnail
202 202
 				$imagetype = explode(".", $image);
203 203
                 //or check $imagetype = image_type_to_extension(exif_imagetype($image), false);
204
-				$imagetype = strtolower($imagetype[count($imagetype)-1]);
204
+				$imagetype = strtolower($imagetype[count($imagetype) - 1]);
205 205
 
206
-				if(in_array($imagetype,$allowed_thumbnail_types)) {
207
-					if (!file_exists($image_thumbnail)){
206
+				if (in_array($imagetype, $allowed_thumbnail_types)) {
207
+					if (!file_exists($image_thumbnail)) {
208 208
                         //run each once we view thumbnails is too heavy, then need move into  !file_exists($image_thumbnail, and only run when haven't the thumbnail
209 209
 						$original_image_size = api_getimagesize($image);
210 210
 
211
-						switch($imagetype) {
211
+						switch ($imagetype) {
212 212
 							case 'gif':
213 213
 								$source_img = imagecreatefromgif($image);
214 214
 								break;
@@ -230,17 +230,17 @@  discard block
 block discarded – undo
230 230
                             $max_thumbnail_height
231 231
                         );
232 232
 
233
-						if($max_thumbnail_width>$original_image_size['width'] && $max_thumbnail_height>$original_image_size['height']){
234
-							$new_thumbnail_size['width']=$original_image_size['width'];
235
-							$new_thumbnail_size['height']=$original_image_size['height'];
233
+						if ($max_thumbnail_width > $original_image_size['width'] && $max_thumbnail_height > $original_image_size['height']) {
234
+							$new_thumbnail_size['width'] = $original_image_size['width'];
235
+							$new_thumbnail_size['height'] = $original_image_size['height'];
236 236
 						}
237 237
 
238 238
 						$crop = imagecreatetruecolor($new_thumbnail_size['width'], $new_thumbnail_size['height']);
239 239
 
240 240
 						// preserve transparency
241
-						if($imagetype == "png"){
241
+						if ($imagetype == "png") {
242 242
 							imagesavealpha($crop, true);
243
-							$color = imagecolorallocatealpha($crop,0x00,0x00,0x00,127);
243
+							$color = imagecolorallocatealpha($crop, 0x00, 0x00, 0x00, 127);
244 244
 							imagefill($crop, 0, 0, $color);
245 245
 						}
246 246
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 							$transindex = imagecolortransparent($source_img);
249 249
                             $palletsize = imagecolorstotal($source_img);
250 250
 							 //GIF89a for transparent and anim (first clip), either GIF87a
251
-							 if ($transindex >= 0 && $transindex < $palletsize){
251
+							 if ($transindex >= 0 && $transindex < $palletsize) {
252 252
 								 $transcol = imagecolorsforindex($source_img, $transindex);
253 253
 								 $transindex = imagecolorallocatealpha($crop, $transcol['red'], $transcol['green'], $transcol['blue'], 127);
254 254
 								 imagefill($crop, 0, 0, $transindex);
@@ -272,16 +272,16 @@  discard block
 block discarded – undo
272 272
 
273 273
 						switch ($imagetype) {
274 274
 							case 'gif':
275
-								imagegif($crop,$image_thumbnail);
275
+								imagegif($crop, $image_thumbnail);
276 276
 								break;
277 277
 							case 'jpg':
278
-								imagejpeg($crop,$image_thumbnail,$jpg_quality);
278
+								imagejpeg($crop, $image_thumbnail, $jpg_quality);
279 279
 								break;
280 280
 							case 'jpeg':
281
-								imagejpeg($crop,$image_thumbnail,$jpg_quality);
281
+								imagejpeg($crop, $image_thumbnail, $jpg_quality);
282 282
 								break;
283 283
 							case 'png':
284
-								imagepng($crop,$image_thumbnail,$png_compression);
284
+								imagepng($crop, $image_thumbnail, $png_compression);
285 285
 								break;
286 286
 						}
287 287
 
@@ -291,26 +291,26 @@  discard block
 block discarded – undo
291 291
 
292 292
 					//show thumbnail and link
293 293
 
294
-					$one_image_thumbnail_file='.thumbs/.'.$one_image_file;//get path thumbnail
294
+					$one_image_thumbnail_file = '.thumbs/.'.$one_image_file; //get path thumbnail
295 295
 					$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_thumbnail_file : $path.$one_image_thumbnail_file;
296 296
 					$image_tag[] = '<img class="img-gallery" src="download.php?doc_url='.$doc_url.'" border="0" title="'.$one_image_file.'">';
297 297
 				} else {
298 298
 					//if images aren't support by gd (not gif, jpg, jpeg, png)
299
-					if ($imagetype=="bmp") {
299
+					if ($imagetype == "bmp") {
300 300
                         // use getimagesize instead api_getimagesize($image); becasuse api_getimagesize doesn't support bmp files. Put here for each show, only for a few bmp files isn't heavy
301 301
 						$original_image_size = getimagesize($image);
302
-						if ($max_thumbnail_width<$original_image_size[0] || $max_thumbnail_height<$original_image_size[1]){
303
-							$thumbnail_size=api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height);//don't use resize_image because doesn't run with bmp files
302
+						if ($max_thumbnail_width < $original_image_size[0] || $max_thumbnail_height < $original_image_size[1]) {
303
+							$thumbnail_size = api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height); //don't use resize_image because doesn't run with bmp files
304 304
 							$image_height = $thumbnail_size['height'];
305 305
 							$image_width  = $thumbnail_size['width'];
306 306
 						} else {
307
-							$image_height=$original_image_size[0];
308
-							$image_width=$original_image_size[1];
307
+							$image_height = $original_image_size[0];
308
+							$image_width = $original_image_size[1];
309 309
 						}
310 310
 					} else {
311 311
 						//example for svg files,...
312
-						$image_width=$max_thumbnail_width;
313
-						$image_height=$max_thumbnail_height;
312
+						$image_width = $max_thumbnail_width;
313
+						$image_height = $max_thumbnail_height;
314 314
 					}
315 315
 
316 316
 					$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file;
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 
327 327
 	$i = 0;
328 328
 	$count_image = count($image_tag);
329
-	$number_iteration = ceil($count_image/$number_image);
329
+	$number_iteration = ceil($count_image / $number_image);
330 330
 	$p = 0;
331 331
     $html = '';
332 332
     $html .= '<div class="gallery">';
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
                             $html .= '<a class="canvas-two" href="slideshow.php?slide_id='.$p.'&curdirpath='.$pathurl.'">';
339 339
                             $html .= '<div class="frame">';
340 340
                             $html .= '<div class="photo">';
341
-                            $html .=  $image_tag[$p];
341
+                            $html .= $image_tag[$p];
342 342
                             $html .= '</div>';
343 343
                             $html .= '</div>';
344 344
                             $html .= '</a>';
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 
394 394
 		list($width, $height) = getimagesize($image);
395 395
 		// Auto resize
396
-		if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == 'resizing') {
396
+		if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == 'resizing') {
397 397
 		?>
398 398
 
399 399
 		<script type="text/javascript">
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 				start_height=initial_height;
411 411
 			}
412 412
 
413
-			document.write('<img id="image"  src="<?php echo  'download.php?doc_url='.$path.'/'.$image_files_only[$slide]; ?>" width="'+start_width+'" height="'+start_height+'"  border="0"  alt="<?php echo $image_files_only[$slide] ;?>">');
413
+			document.write('<img id="image"  src="<?php echo  'download.php?doc_url='.$path.'/'.$image_files_only[$slide]; ?>" width="'+start_width+'" height="'+start_height+'"  border="0"  alt="<?php echo $image_files_only[$slide]; ?>">');
414 414
 
415 415
 			function resizeImage() {
416 416
 
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 		echo '</a>';
455 455
         echo '<div class="caption text-center">';
456 456
         echo Display::tag('h3', $row['title']);
457
-        echo '<p>' . $row['comment'] . '</p>';
457
+        echo '<p>'.$row['comment'].'</p>';
458 458
         echo '</div>';
459 459
         echo '</div>';
460 460
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                 $resize_info = get_lang('Resizing').'<br />';
468 468
                 $resize_width = $_SESSION["image_resizing_width"].' x ';
469 469
                 $resize_height = $_SESSION['image_resizing_height'];
470
-            } elseif (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] != 'noresizing'){
470
+            } elseif (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] != 'noresizing') {
471 471
                 $resize_info = get_lang('Resizing').'<br />';
472 472
                 $resize_width = get_lang('Auto').' x ';
473 473
                 $resize_height = get_lang('Auto');
@@ -478,10 +478,10 @@  discard block
 block discarded – undo
478 478
             }
479 479
 
480 480
             echo '<li class="text-center">';
481
-            echo $image_files_only[$slide] . ' ';
481
+            echo $image_files_only[$slide].' ';
482 482
             echo Display::toolbarButton(
483 483
                 get_lang('Modify'),
484
-                'edit_document.php?' . api_get_cidreq() . '&' . http_build_query([
484
+                'edit_document.php?'.api_get_cidreq().'&'.http_build_query([
485 485
                     'id' => $row['id'],
486 486
                     'origin' => 'slideshow',
487 487
                     'origin_opt' => $edit_slide_id,
@@ -493,11 +493,11 @@  discard block
 block discarded – undo
493 493
                 false
494 494
             );
495 495
             echo '</li>';
496
-            echo '<li class="text-center">' . $width.' x '.$height . '</li>';
497
-			echo '<li class="text-center">' . round((filesize($image) / 1024), 2) . ' KB - ' . $ext . '</li>';
498
-            echo '<li class="text-center">' . $resize_info . '</li>';
499
-			echo '<li class="text-center">' . $resize_width . '</li>';
500
-			echo '<li class="text-center">' . $resize_height . '</li>';
496
+            echo '<li class="text-center">'.$width.' x '.$height.'</li>';
497
+			echo '<li class="text-center">'.round((filesize($image) / 1024), 2).' KB - '.$ext.'</li>';
498
+            echo '<li class="text-center">'.$resize_info.'</li>';
499
+			echo '<li class="text-center">'.$resize_width.'</li>';
500
+			echo '<li class="text-center">'.$resize_height.'</li>';
501 501
             echo '</ul>';
502 502
 		}
503 503
 
Please login to merge, or discard this patch.
Indentation   +245 added lines, -245 removed lines patch added patch discarded remove patch
@@ -15,15 +15,15 @@  discard block
 block discarded – undo
15 15
 $slide_id = isset($_GET['slide_id']) ? Security::remove_XSS($_GET['slide_id']) : null;
16 16
 
17 17
 if (empty($slide_id)) {
18
-	$edit_slide_id = 1;
18
+    $edit_slide_id = 1;
19 19
 } else {
20
-	$edit_slide_id = $slide_id;
20
+    $edit_slide_id = $slide_id;
21 21
 }
22 22
 
23 23
 if ($path != '/') {
24
-	$folder = $path.'/';
24
+    $folder = $path.'/';
25 25
 } else {
26
-	$folder = '/';
26
+    $folder = '/';
27 27
 }
28 28
 $sys_course_path = api_get_path(SYS_COURSE_PATH);
29 29
 
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
41 41
 
42 42
 // Loading the slides from the session
43 43
 if (isset($_SESSION['image_files_only'])) {
44
-	$image_files_only = $_SESSION['image_files_only'];
44
+    $image_files_only = $_SESSION['image_files_only'];
45 45
 }
46 46
 
47 47
 // Calculating the current slide, next slide, previous slide and the number of slides
48 48
 $slide = null;
49 49
 if ($slide_id != 'all') {
50
-	$slide = $slide_id ? $slide_id : 0;
51
-	$previous_slide = $slide - 1;
52
-	$next_slide = $slide + 1;
50
+    $slide = $slide_id ? $slide_id : 0;
51
+    $previous_slide = $slide - 1;
52
+    $next_slide = $slide + 1;
53 53
 }
54 54
 $total_slides = count($image_files_only);
55 55
 ?>
@@ -62,62 +62,62 @@  discard block
 block discarded – undo
62 62
 <?php
63 63
 
64 64
 if ($slide_id != 'all') {
65
-	$image = null;
66
-	if (isset($image_files_only[$slide])) {
67
-		$image = $sys_course_path . $_course['path'] . '/document' . $folder . $image_files_only[$slide];
68
-	}
69
-	if (file_exists($image)) {
70
-		echo '<div class="actions-pagination">';
71
-
72
-		// Back forward buttons
73
-		if ($slide == 0) {
74
-			$imgp = 'action_prev_na.png';
75
-			$first = Display::return_icon('action_first_na.png');
76
-		} else {
77
-			$imgp = 'action_prev.png';
78
-			$first = '<a href="slideshow.php?slide_id=0&curdirpath='.$pathurl.'">
65
+    $image = null;
66
+    if (isset($image_files_only[$slide])) {
67
+        $image = $sys_course_path . $_course['path'] . '/document' . $folder . $image_files_only[$slide];
68
+    }
69
+    if (file_exists($image)) {
70
+        echo '<div class="actions-pagination">';
71
+
72
+        // Back forward buttons
73
+        if ($slide == 0) {
74
+            $imgp = 'action_prev_na.png';
75
+            $first = Display::return_icon('action_first_na.png');
76
+        } else {
77
+            $imgp = 'action_prev.png';
78
+            $first = '<a href="slideshow.php?slide_id=0&curdirpath='.$pathurl.'">
79 79
 			          '.Display::return_icon('action_first.png', get_lang('FirstSlide')).'
80 80
 			          </a>';
81
-		}
81
+        }
82 82
 
83
-		// First slide
84
-		echo $first;
83
+        // First slide
84
+        echo $first;
85 85
 
86
-		// Previous slide
87
-		if ($slide > 0) {
88
-			echo '<a href="slideshow.php?slide_id='.$previous_slide.'&curdirpath='.$pathurl.'">';
89
-		}
86
+        // Previous slide
87
+        if ($slide > 0) {
88
+            echo '<a href="slideshow.php?slide_id='.$previous_slide.'&curdirpath='.$pathurl.'">';
89
+        }
90 90
 
91 91
         echo Display::return_icon($imgp, get_lang('Previous'));
92
-		if ($slide > 0) {
93
-			echo '</a>';
94
-		}
95
-
96
-		// Divider
97
-		echo ' [ '.$next_slide.'/'.$total_slides.' ] ';
98
-
99
-		// Next slide
100
-		if ($slide < $total_slides - 1) {
101
-			echo '<a href="slideshow.php?slide_id='.$next_slide.'&curdirpath='.$pathurl.'">';
102
-		}
103
-		if ($slide == $total_slides - 1) {
104
-			$imgn = 'action_next_na.png';
92
+        if ($slide > 0) {
93
+            echo '</a>';
94
+        }
95
+
96
+        // Divider
97
+        echo ' [ '.$next_slide.'/'.$total_slides.' ] ';
98
+
99
+        // Next slide
100
+        if ($slide < $total_slides - 1) {
101
+            echo '<a href="slideshow.php?slide_id='.$next_slide.'&curdirpath='.$pathurl.'">';
102
+        }
103
+        if ($slide == $total_slides - 1) {
104
+            $imgn = 'action_next_na.png';
105 105
             $last = Display::return_icon('action_last_na.png', get_lang('LastSlide'));
106
-		} else {
107
-			$imgn = 'action_next.png';
108
-			$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
106
+        } else {
107
+            $imgn = 'action_next.png';
108
+            $last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
109 109
 			        '.Display::return_icon('action_last.png', get_lang('LastSlide')).'
110 110
                 </a>';
111
-		}
111
+        }
112 112
         echo Display::return_icon($imgn, get_lang('Next'));
113
-		if ($slide > 0) {
114
-			echo '</a>';
115
-		}
116
-
117
-		// Last slide
118
-		echo $last;
119
-		echo '</div>';
120
-	}
113
+        if ($slide > 0) {
114
+            echo '</a>';
115
+        }
116
+
117
+        // Last slide
118
+        echo $last;
119
+        echo '</div>';
120
+    }
121 121
 }
122 122
 
123 123
 // Exit the slideshow
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
 
127 127
 // Show thumbnails
128 128
 if ($slide_id != 'all') {
129
-	echo '<a href="slideshow.php?slide_id=all&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
129
+    echo '<a href="slideshow.php?slide_id=all&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
130 130
         Display::return_icon('thumbnails.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM).'</a>';
131 131
 } else {
132
-	echo Display::return_icon('thumbnails_na.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM);
132
+    echo Display::return_icon('thumbnails_na.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM);
133 133
 }
134 134
 // Slideshow options
135 135
 echo '<a href="slideshowoptions.php?curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
@@ -142,24 +142,24 @@  discard block
 block discarded – undo
142 142
 
143 143
 // If we come from slideshowoptions.php we sessionize (new word !!! ;-) the options
144 144
 if (isset($_POST['Submit'])) {
145
-	// We come from slideshowoptions.php
146
-	//$_SESSION["auto_image_resizing"]=Security::remove_XSS($_POST['auto_radio_resizing']);
147
-	$_SESSION["image_resizing"] = Security::remove_XSS($_POST['radio_resizing']);
148
-	if ($_POST['radio_resizing'] == "resizing" && $_POST['width'] != '' && $_POST['height'] != '') {
149
-		//echo "resizing";
150
-		$_SESSION["image_resizing_width"] = Security::remove_XSS($_POST['width']);
151
-		$_SESSION["image_resizing_height"] = Security::remove_XSS($_POST['height']);
152
-	} else {
153
-		//echo "unsetting the session heighte and width";
154
-		$_SESSION["image_resizing_width"] = null;
155
-		$_SESSION["image_resizing_height"] = null;
156
-	}
145
+    // We come from slideshowoptions.php
146
+    //$_SESSION["auto_image_resizing"]=Security::remove_XSS($_POST['auto_radio_resizing']);
147
+    $_SESSION["image_resizing"] = Security::remove_XSS($_POST['radio_resizing']);
148
+    if ($_POST['radio_resizing'] == "resizing" && $_POST['width'] != '' && $_POST['height'] != '') {
149
+        //echo "resizing";
150
+        $_SESSION["image_resizing_width"] = Security::remove_XSS($_POST['width']);
151
+        $_SESSION["image_resizing_height"] = Security::remove_XSS($_POST['height']);
152
+    } else {
153
+        //echo "unsetting the session heighte and width";
154
+        $_SESSION["image_resizing_width"] = null;
155
+        $_SESSION["image_resizing_height"] = null;
156
+    }
157 157
 }
158 158
 $target_width = $target_height = null;
159 159
 // The target height and width depends if we choose resizing or no resizing
160 160
 if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == "resizing") {
161
-	$target_width = $_SESSION["image_resizing_width"];
162
-	$target_height = $_SESSION["image_resizing_height"];
161
+    $target_width = $_SESSION["image_resizing_width"];
162
+    $target_height = $_SESSION["image_resizing_height"];
163 163
 }
164 164
 
165 165
 /*	THUMBNAIL VIEW */
@@ -169,59 +169,59 @@  discard block
 block discarded – undo
169 169
 $html = '';
170 170
 if ($slide_id == 'all') {
171 171
 
172
-	// Config for make thumbnails
172
+    // Config for make thumbnails
173 173
     $allowed_thumbnail_types = array('jpg', 'jpeg', 'gif', 'png');
174
-	$max_thumbnail_width     = 250;
175
-	$max_thumbnail_height    = 250;
176
-	$png_compression	     = 0;//0(none)-9
177
-	$jpg_quality  	         = 75;//from 0 to 100 (default is 75). More quality less compression
174
+    $max_thumbnail_width     = 250;
175
+    $max_thumbnail_height    = 250;
176
+    $png_compression	     = 0;//0(none)-9
177
+    $jpg_quality  	         = 75;//from 0 to 100 (default is 75). More quality less compression
178 178
 
179
-	$directory_thumbnails = $sys_course_path.$_course['path'].'/document'.$folder.'.thumbs/';
179
+    $directory_thumbnails = $sys_course_path.$_course['path'].'/document'.$folder.'.thumbs/';
180 180
 
181
-	//Other parameters only for show tumbnails
182
-	$row_items 			     = 4;//only in slideshow.php
183
-	$number_image 			 = 7;//num icons cols to show
184
-	$thumbnail_width_frame=$max_thumbnail_width;//optional $max_thumbnail_width+x
185
-	$thumbnail_height_frame=$max_thumbnail_height;
181
+    //Other parameters only for show tumbnails
182
+    $row_items 			     = 4;//only in slideshow.php
183
+    $number_image 			 = 7;//num icons cols to show
184
+    $thumbnail_width_frame=$max_thumbnail_width;//optional $max_thumbnail_width+x
185
+    $thumbnail_height_frame=$max_thumbnail_height;
186 186
 
187
-	// Create the template_thumbnails folder (if no exist)
187
+    // Create the template_thumbnails folder (if no exist)
188 188
 
189
-	if (!file_exists($directory_thumbnails)) {
190
-		@mkdir($directory_thumbnails, api_get_permissions_for_new_directories());
189
+    if (!file_exists($directory_thumbnails)) {
190
+        @mkdir($directory_thumbnails, api_get_permissions_for_new_directories());
191 191
     }
192 192
 
193
-	// check files and thumbnails
194
-	if (is_array($image_files_only)) {
193
+    // check files and thumbnails
194
+    if (is_array($image_files_only)) {
195 195
 
196
-		foreach ($image_files_only as $one_image_file) {
197
-			$image = $sys_course_path.$_course['path'].'/document'.$folder.$one_image_file;
198
-			$image_thumbnail= $directory_thumbnails.'.'.$one_image_file;
196
+        foreach ($image_files_only as $one_image_file) {
197
+            $image = $sys_course_path.$_course['path'].'/document'.$folder.$one_image_file;
198
+            $image_thumbnail= $directory_thumbnails.'.'.$one_image_file;
199 199
 
200
-			if (file_exists($image)) {
201
-				//check thumbnail
202
-				$imagetype = explode(".", $image);
200
+            if (file_exists($image)) {
201
+                //check thumbnail
202
+                $imagetype = explode(".", $image);
203 203
                 //or check $imagetype = image_type_to_extension(exif_imagetype($image), false);
204
-				$imagetype = strtolower($imagetype[count($imagetype)-1]);
204
+                $imagetype = strtolower($imagetype[count($imagetype)-1]);
205 205
 
206
-				if(in_array($imagetype,$allowed_thumbnail_types)) {
207
-					if (!file_exists($image_thumbnail)){
206
+                if(in_array($imagetype,$allowed_thumbnail_types)) {
207
+                    if (!file_exists($image_thumbnail)){
208 208
                         //run each once we view thumbnails is too heavy, then need move into  !file_exists($image_thumbnail, and only run when haven't the thumbnail
209
-						$original_image_size = api_getimagesize($image);
210
-
211
-						switch($imagetype) {
212
-							case 'gif':
213
-								$source_img = imagecreatefromgif($image);
214
-								break;
215
-							case 'jpg':
216
-								$source_img = imagecreatefromjpeg($image);
217
-								break;
218
-							case 'jpeg':
219
-								$source_img = imagecreatefromjpeg($image);
220
-								break;
221
-							case 'png':
222
-								$source_img = imagecreatefrompng($image);
223
-								break;
224
-						}
209
+                        $original_image_size = api_getimagesize($image);
210
+
211
+                        switch($imagetype) {
212
+                            case 'gif':
213
+                                $source_img = imagecreatefromgif($image);
214
+                                break;
215
+                            case 'jpg':
216
+                                $source_img = imagecreatefromjpeg($image);
217
+                                break;
218
+                            case 'jpeg':
219
+                                $source_img = imagecreatefromjpeg($image);
220
+                                break;
221
+                            case 'png':
222
+                                $source_img = imagecreatefrompng($image);
223
+                                break;
224
+                        }
225 225
 
226 226
                         $new_thumbnail_size = api_calculate_image_size(
227 227
                             $original_image_size['width'],
@@ -230,33 +230,33 @@  discard block
 block discarded – undo
230 230
                             $max_thumbnail_height
231 231
                         );
232 232
 
233
-						if($max_thumbnail_width>$original_image_size['width'] && $max_thumbnail_height>$original_image_size['height']){
234
-							$new_thumbnail_size['width']=$original_image_size['width'];
235
-							$new_thumbnail_size['height']=$original_image_size['height'];
236
-						}
233
+                        if($max_thumbnail_width>$original_image_size['width'] && $max_thumbnail_height>$original_image_size['height']){
234
+                            $new_thumbnail_size['width']=$original_image_size['width'];
235
+                            $new_thumbnail_size['height']=$original_image_size['height'];
236
+                        }
237 237
 
238
-						$crop = imagecreatetruecolor($new_thumbnail_size['width'], $new_thumbnail_size['height']);
238
+                        $crop = imagecreatetruecolor($new_thumbnail_size['width'], $new_thumbnail_size['height']);
239 239
 
240
-						// preserve transparency
241
-						if($imagetype == "png"){
242
-							imagesavealpha($crop, true);
243
-							$color = imagecolorallocatealpha($crop,0x00,0x00,0x00,127);
244
-							imagefill($crop, 0, 0, $color);
245
-						}
240
+                        // preserve transparency
241
+                        if($imagetype == "png"){
242
+                            imagesavealpha($crop, true);
243
+                            $color = imagecolorallocatealpha($crop,0x00,0x00,0x00,127);
244
+                            imagefill($crop, 0, 0, $color);
245
+                        }
246 246
 
247
-						if ($imagetype == "gif") {
248
-							$transindex = imagecolortransparent($source_img);
247
+                        if ($imagetype == "gif") {
248
+                            $transindex = imagecolortransparent($source_img);
249 249
                             $palletsize = imagecolorstotal($source_img);
250
-							 //GIF89a for transparent and anim (first clip), either GIF87a
251
-							 if ($transindex >= 0 && $transindex < $palletsize){
252
-								 $transcol = imagecolorsforindex($source_img, $transindex);
253
-								 $transindex = imagecolorallocatealpha($crop, $transcol['red'], $transcol['green'], $transcol['blue'], 127);
254
-								 imagefill($crop, 0, 0, $transindex);
255
-								 imagecolortransparent($crop, $transindex);
256
-							 }
257
-						}
258
-
259
-						//resampled image
250
+                                //GIF89a for transparent and anim (first clip), either GIF87a
251
+                                if ($transindex >= 0 && $transindex < $palletsize){
252
+                                    $transcol = imagecolorsforindex($source_img, $transindex);
253
+                                    $transindex = imagecolorallocatealpha($crop, $transcol['red'], $transcol['green'], $transcol['blue'], 127);
254
+                                    imagefill($crop, 0, 0, $transindex);
255
+                                    imagecolortransparent($crop, $transindex);
256
+                                }
257
+                        }
258
+
259
+                        //resampled image
260 260
                         imagecopyresampled(
261 261
                             $crop,
262 262
                             $source_img,
@@ -270,69 +270,69 @@  discard block
 block discarded – undo
270 270
                             $original_image_size['height']
271 271
                         );
272 272
 
273
-						switch ($imagetype) {
274
-							case 'gif':
275
-								imagegif($crop,$image_thumbnail);
276
-								break;
277
-							case 'jpg':
278
-								imagejpeg($crop,$image_thumbnail,$jpg_quality);
279
-								break;
280
-							case 'jpeg':
281
-								imagejpeg($crop,$image_thumbnail,$jpg_quality);
282
-								break;
283
-							case 'png':
284
-								imagepng($crop,$image_thumbnail,$png_compression);
285
-								break;
286
-						}
287
-
288
-						//clean memory
289
-						imagedestroy($crop);
290
-					}//end !exist thumbnail
291
-
292
-					//show thumbnail and link
293
-
294
-					$one_image_thumbnail_file='.thumbs/.'.$one_image_file;//get path thumbnail
295
-					$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_thumbnail_file : $path.$one_image_thumbnail_file;
296
-					$image_tag[] = '<img class="img-gallery" src="download.php?doc_url='.$doc_url.'" border="0" title="'.$one_image_file.'">';
297
-				} else {
298
-					//if images aren't support by gd (not gif, jpg, jpeg, png)
299
-					if ($imagetype=="bmp") {
273
+                        switch ($imagetype) {
274
+                            case 'gif':
275
+                                imagegif($crop,$image_thumbnail);
276
+                                break;
277
+                            case 'jpg':
278
+                                imagejpeg($crop,$image_thumbnail,$jpg_quality);
279
+                                break;
280
+                            case 'jpeg':
281
+                                imagejpeg($crop,$image_thumbnail,$jpg_quality);
282
+                                break;
283
+                            case 'png':
284
+                                imagepng($crop,$image_thumbnail,$png_compression);
285
+                                break;
286
+                        }
287
+
288
+                        //clean memory
289
+                        imagedestroy($crop);
290
+                    }//end !exist thumbnail
291
+
292
+                    //show thumbnail and link
293
+
294
+                    $one_image_thumbnail_file='.thumbs/.'.$one_image_file;//get path thumbnail
295
+                    $doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_thumbnail_file : $path.$one_image_thumbnail_file;
296
+                    $image_tag[] = '<img class="img-gallery" src="download.php?doc_url='.$doc_url.'" border="0" title="'.$one_image_file.'">';
297
+                } else {
298
+                    //if images aren't support by gd (not gif, jpg, jpeg, png)
299
+                    if ($imagetype=="bmp") {
300 300
                         // use getimagesize instead api_getimagesize($image); becasuse api_getimagesize doesn't support bmp files. Put here for each show, only for a few bmp files isn't heavy
301
-						$original_image_size = getimagesize($image);
302
-						if ($max_thumbnail_width<$original_image_size[0] || $max_thumbnail_height<$original_image_size[1]){
303
-							$thumbnail_size=api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height);//don't use resize_image because doesn't run with bmp files
304
-							$image_height = $thumbnail_size['height'];
305
-							$image_width  = $thumbnail_size['width'];
306
-						} else {
307
-							$image_height=$original_image_size[0];
308
-							$image_width=$original_image_size[1];
309
-						}
310
-					} else {
311
-						//example for svg files,...
312
-						$image_width=$max_thumbnail_width;
313
-						$image_height=$max_thumbnail_height;
314
-					}
315
-
316
-					$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file;
317
-					$image_tag[] = '<img src="download.php?doc_url='.$doc_url.'" border="0" width="'.$image_width.'" height="'.$image_height.'" title="'.$one_image_file.'">';
318
-
319
-				}//end allowed image types
320
-			}//end if exist file image
321
-		}//end foreach
322
-	}//end image files only
323
-
324
-	// Creating the table
325
-	$html_table = '';
326
-
327
-	$i = 0;
328
-	$count_image = count($image_tag);
329
-	$number_iteration = ceil($count_image/$number_image);
330
-	$p = 0;
301
+                        $original_image_size = getimagesize($image);
302
+                        if ($max_thumbnail_width<$original_image_size[0] || $max_thumbnail_height<$original_image_size[1]){
303
+                            $thumbnail_size=api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height);//don't use resize_image because doesn't run with bmp files
304
+                            $image_height = $thumbnail_size['height'];
305
+                            $image_width  = $thumbnail_size['width'];
306
+                        } else {
307
+                            $image_height=$original_image_size[0];
308
+                            $image_width=$original_image_size[1];
309
+                        }
310
+                    } else {
311
+                        //example for svg files,...
312
+                        $image_width=$max_thumbnail_width;
313
+                        $image_height=$max_thumbnail_height;
314
+                    }
315
+
316
+                    $doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file;
317
+                    $image_tag[] = '<img src="download.php?doc_url='.$doc_url.'" border="0" width="'.$image_width.'" height="'.$image_height.'" title="'.$one_image_file.'">';
318
+
319
+                }//end allowed image types
320
+            }//end if exist file image
321
+        }//end foreach
322
+    }//end image files only
323
+
324
+    // Creating the table
325
+    $html_table = '';
326
+
327
+    $i = 0;
328
+    $count_image = count($image_tag);
329
+    $number_iteration = ceil($count_image/$number_image);
330
+    $p = 0;
331 331
     $html = '';
332 332
     $html .= '<div class="gallery">';
333
-	for ($k = 0; $k < $number_iteration; $k++) {
334
-		for ($i = 0; $i < $number_image; $i++) {
335
-			if (isset($image_tag[$p])) {
333
+    for ($k = 0; $k < $number_iteration; $k++) {
334
+        for ($i = 0; $i < $number_image; $i++) {
335
+            if (isset($image_tag[$p])) {
336 336
                             $html .= '<div class="col-xs-6 col-sm-3 col-md-2">';
337 337
                             $html .= '<div class="canvas-one">';
338 338
                             $html .= '<a class="canvas-two" href="slideshow.php?slide_id='.$p.'&curdirpath='.$pathurl.'">';
@@ -344,10 +344,10 @@  discard block
 block discarded – undo
344 344
                             $html .= '</a>';
345 345
                             $html .= '</div>';
346 346
                             $html .= '</div>';
347
-			}
348
-			$p++;
349
-		}
350
-	}
347
+            }
348
+            $p++;
349
+        }
350
+    }
351 351
     $html .= '</div>';
352 352
 
353 353
 }//end slide==all
@@ -358,43 +358,43 @@  discard block
 block discarded – undo
358 358
 // This is for viewing all the images in the slideshow one at a time.
359 359
 
360 360
 if ($slide_id != 'all' && !empty($image_files_only)) {
361
-	if (file_exists($image) && is_file($image)) {
362
-		$image_height_width = resize_image($image, $target_width, $target_height);
363
-
364
-		$image_height = $image_height_width[0];
365
-		$image_width = $image_height_width[1];
366
-
367
-		$height_width_tags = null;
368
-		if (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') {
369
-			$height_width_tags = 'width="'.$image_width.'" height="'.$image_height.'"';
370
-		}
371
-
372
-		// This is done really quickly and should be cleaned up a little bit using the API functions
373
-		$tbl_documents = Database::get_course_table(TABLE_DOCUMENT);
374
-		if ($path == '/') {
375
-			$pathpart = '/';
376
-		} else {
377
-			$pathpart = $path.'/';
378
-		}
379
-		$sql = "SELECT * FROM $tbl_documents
361
+    if (file_exists($image) && is_file($image)) {
362
+        $image_height_width = resize_image($image, $target_width, $target_height);
363
+
364
+        $image_height = $image_height_width[0];
365
+        $image_width = $image_height_width[1];
366
+
367
+        $height_width_tags = null;
368
+        if (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') {
369
+            $height_width_tags = 'width="'.$image_width.'" height="'.$image_height.'"';
370
+        }
371
+
372
+        // This is done really quickly and should be cleaned up a little bit using the API functions
373
+        $tbl_documents = Database::get_course_table(TABLE_DOCUMENT);
374
+        if ($path == '/') {
375
+            $pathpart = '/';
376
+        } else {
377
+            $pathpart = $path.'/';
378
+        }
379
+        $sql = "SELECT * FROM $tbl_documents
380 380
 		        WHERE c_id = $course_id AND path='".Database::escape_string($pathpart.$image_files_only[$slide])."'";
381
-		$result = Database::query($sql);
382
-		$row = Database::fetch_array($result);
381
+        $result = Database::query($sql);
382
+        $row = Database::fetch_array($result);
383 383
 
384 384
         echo '<div class="thumbnail">';
385
-		if ($slide < $total_slides - 1 && $slide_id != 'all') {
386
-			echo "<a href='slideshow.php?slide_id=".$next_slide."&curdirpath=$pathurl'>";
387
-		} else {
388
-			echo "<a href='slideshow.php?slide_id=0&curdirpath=$pathurl'>";
389
-		}
385
+        if ($slide < $total_slides - 1 && $slide_id != 'all') {
386
+            echo "<a href='slideshow.php?slide_id=".$next_slide."&curdirpath=$pathurl'>";
387
+        } else {
388
+            echo "<a href='slideshow.php?slide_id=0&curdirpath=$pathurl'>";
389
+        }
390 390
         if ($path == '/') {
391
-        	$path = '';
391
+            $path = '';
392 392
         }
393 393
 
394
-		list($width, $height) = getimagesize($image);
395
-		// Auto resize
396
-		if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == 'resizing') {
397
-		?>
394
+        list($width, $height) = getimagesize($image);
395
+        // Auto resize
396
+        if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == 'resizing') {
397
+        ?>
398 398
 
399 399
 		<script type="text/javascript">
400 400
 			var initial_width='<?php echo $width; ?>';
@@ -447,21 +447,21 @@  discard block
 block discarded – undo
447 447
 
448 448
 		</script>
449 449
     <?php
450
-		} else {
451
-			echo "<img class=\"img-responsive\" src='download.php?doc_url=$path/".$image_files_only[$slide]."' alt='".$image_files_only[$slide]."' border='0'".$height_width_tags.">";
452
-		}
450
+        } else {
451
+            echo "<img class=\"img-responsive\" src='download.php?doc_url=$path/".$image_files_only[$slide]."' alt='".$image_files_only[$slide]."' border='0'".$height_width_tags.">";
452
+        }
453 453
 
454
-		echo '</a>';
454
+        echo '</a>';
455 455
         echo '<div class="caption text-center">';
456 456
         echo Display::tag('h3', $row['title']);
457 457
         echo '<p>' . $row['comment'] . '</p>';
458 458
         echo '</div>';
459 459
         echo '</div>';
460 460
 
461
-		if (api_is_allowed_to_edit(null, true)) {
461
+        if (api_is_allowed_to_edit(null, true)) {
462 462
             echo '<ul class="list-unstyled">';
463
-			$aux = explode('.', htmlspecialchars($image_files_only[$slide]));
464
-			$ext = $aux[count($aux) - 1];
463
+            $aux = explode('.', htmlspecialchars($image_files_only[$slide]));
464
+            $ext = $aux[count($aux) - 1];
465 465
 
466 466
             if (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') {
467 467
                 $resize_info = get_lang('Resizing').'<br />';
@@ -473,8 +473,8 @@  discard block
 block discarded – undo
473 473
                 $resize_height = get_lang('Auto');
474 474
             } else {
475 475
                 $resize_info = get_lang('NoResizing').'<br />';
476
-				$resize_width = '';
477
-				$resize_height = '';
476
+                $resize_width = '';
477
+                $resize_height = '';
478 478
             }
479 479
 
480 480
             echo '<li class="text-center">';
@@ -494,16 +494,16 @@  discard block
 block discarded – undo
494 494
             );
495 495
             echo '</li>';
496 496
             echo '<li class="text-center">' . $width.' x '.$height . '</li>';
497
-			echo '<li class="text-center">' . round((filesize($image) / 1024), 2) . ' KB - ' . $ext . '</li>';
497
+            echo '<li class="text-center">' . round((filesize($image) / 1024), 2) . ' KB - ' . $ext . '</li>';
498 498
             echo '<li class="text-center">' . $resize_info . '</li>';
499
-			echo '<li class="text-center">' . $resize_width . '</li>';
500
-			echo '<li class="text-center">' . $resize_height . '</li>';
499
+            echo '<li class="text-center">' . $resize_width . '</li>';
500
+            echo '<li class="text-center">' . $resize_height . '</li>';
501 501
             echo '</ul>';
502
-		}
502
+        }
503 503
 
504
-	} else {
505
-		Display::display_warning_message(get_lang('FileNotFound'));
506
-	}
504
+    } else {
505
+        Display::display_warning_message(get_lang('FileNotFound'));
506
+    }
507 507
 } else {
508 508
     if ($slide_id != 'all') {
509 509
         Display::display_warning_message(get_lang('NoDataAvailable'));
Please login to merge, or discard this patch.
main/course_description/index.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
24 24
 $actions = array('listing', 'add', 'edit', 'delete', 'history');
25 25
 $action = 'listing';
26 26
 if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
27
-	$action = $_GET['action'];
27
+    $action = $_GET['action'];
28 28
 }
29 29
 
30 30
 $description_type = '';
31 31
 if (isset($_GET['description_type'])) {
32
-	$description_type = intval($_GET['description_type']);
32
+    $description_type = intval($_GET['description_type']);
33 33
 }
34 34
 
35 35
 $id = null;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 */
10 10
 
11 11
 require_once '../inc/global.inc.php';
12
-$current_course_tool  = TOOL_COURSE_DESCRIPTION;
12
+$current_course_tool = TOOL_COURSE_DESCRIPTION;
13 13
 
14 14
 // defining constants
15 15
 define('ADD_BLOCK', 8);
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 // get actions
24 24
 $actions = array('listing', 'add', 'edit', 'delete', 'history');
25 25
 $action = 'listing';
26
-if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
26
+if (isset($_GET['action']) && in_array($_GET['action'], $actions)) {
27 27
 	$action = $_GET['action'];
28 28
 }
29 29
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 // interbreadcrumb
45
-$interbreadcrumb[] = array ("url" => "index.php?".api_get_cidreq(), "name" => get_lang('CourseProgram'));
45
+$interbreadcrumb[] = array("url" => "index.php?".api_get_cidreq(), "name" => get_lang('CourseProgram'));
46 46
 if ($description_type == 1) {
47 47
     $interbreadcrumb[] = array("url" => "#", "name" => get_lang('GeneralDescription'));
48 48
 }
Please login to merge, or discard this patch.
main/upload/upload.scorm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 chdir($cwdir);
16 16
 
17 17
 if (api_get_setting('search.search_enabled') == 'true') {
18
-    require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
18
+    require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
19 19
     $specific_fields = get_specific_field_list();
20 20
 
21 21
     foreach ($specific_fields as $specific_field) {
Please login to merge, or discard this patch.
main/admin/languages.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                 SubLanguageManager::make_unavailable_language($_POST['id']);
36 36
                 echo 'set_hidden';
37 37
             } else {
38
-                echo 'confirm:' . intval($_POST['id']);
38
+                echo 'confirm:'.intval($_POST['id']);
39 39
             }
40 40
         }
41 41
     }
@@ -57,21 +57,21 @@  discard block
 block discarded – undo
57 57
     var disabledLang = "'.$disabledLang.'"
58 58
 
59 59
     if (msgLang == 1) {
60
-        $("#id_content_message").html("<div class=\"warning-message alert alert-warning\">' . get_lang('ThereAreUsersUsingThisLanguagesDisableItManually') . ' <br /> " + disabledLang + "</div");
60
+        $("#id_content_message").html("<div class=\"warning-message alert alert-warning\">' . get_lang('ThereAreUsersUsingThisLanguagesDisableItManually').' <br /> " + disabledLang + "</div");
61 61
     }
62 62
 
63 63
     $("#disable_all_except_default").click(function () {
64
-        if(confirm("'. get_lang('ConfirmYourChoice') .'")) {
64
+        if(confirm("'. get_lang('ConfirmYourChoice').'")) {
65 65
             $.ajax({
66 66
                 contentType: "application/x-www-form-urlencoded",
67 67
                 beforeSend: function(objeto) {
68
-                    $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading') . '</div>");
68
+                    $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading').'</div>");
69 69
                 },
70 70
                 type: "GET",
71 71
                 url: "../admin/languages.php",
72 72
                 data: "action=disable_all_except_default",
73 73
                 success: function(datos) {
74
-                    window.location.href = "' . api_get_self() . '";
74
+                    window.location.href = "' . api_get_self().'";
75 75
                 }
76 76
             });
77 77
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$.ajax({
108 108
 			contentType: "application/x-www-form-urlencoded",
109 109
 			beforeSend: function(objeto) {
110
-				$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading') . '</div>");
110
+				$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading').'</div>");
111 111
 			},
112 112
 			type: "POST",
113 113
 			url: "../admin/languages.php",
@@ -118,26 +118,26 @@  discard block
 block discarded – undo
118 118
                     $("#"+id_img_link_tool).attr("src",path_name_of_imglinktool);
119 119
 
120 120
                     if (my_image_tool=="visible.png") {
121
-                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeAvailable', '') . '");
122
-                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeAvailable', '') . '");
121
+                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeAvailable', '').'");
122
+                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeAvailable', '').'");
123 123
                     } else {
124
-                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeUnavailable', '') . '");
125
-                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeUnavailable', '') . '");
124
+                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeUnavailable', '').'");
125
+                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeUnavailable', '').'");
126 126
                     }
127 127
 
128 128
                     if (datos=="set_visible") {
129
-                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowVisible', '') . '</div>");
129
+                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowVisible', '').'</div>");
130 130
                     }
131 131
 
132 132
                     if (datos=="set_hidden") {
133
-                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowHidden', '') . '</div>");
133
+                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowHidden', '').'</div>");
134 134
                     }
135 135
                 }
136 136
 
137 137
                 var action = datos.split(":")[0];
138 138
                 if (action && action == "confirm") {
139 139
                     var id = datos.split(":")[1];
140
-                    var sure = "<div class=\"warning-message alert alert-warning\">'.get_lang('ThereAreUsersUsingThisLanguageYouWantToDisableThisLanguageAndSetUsersWithTheDefaultPortalLanguage').'<br /><br /><a href=\"languages.php?action=make_unavailable_confirmed&id="+id+"\" class=\"btn btn-default\"><em class=\"fa fa-eye\"></em> ' . get_lang('MakeUnavailable') . '</a></div>";
140
+                    var sure = "<div class=\"warning-message alert alert-warning\">'.get_lang('ThereAreUsersUsingThisLanguageYouWantToDisableThisLanguageAndSetUsersWithTheDefaultPortalLanguage').'<br /><br /><a href=\"languages.php?action=make_unavailable_confirmed&id="+id+"\" class=\"btn btn-default\"><em class=\"fa fa-eye\"></em> '.get_lang('MakeUnavailable').'</a></div>";
141 141
                     $("#id_content_message").html(sure);
142 142
                     $("html, body").animate({ scrollTop: 0 }, 200);
143 143
 				}
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             SubLanguageManager::make_unavailable_language($language['id']);
183 183
         } else {
184 184
             if (intval(SubLanguageManager::get_platform_language_id()) !== intval($language['id'])) {
185
-                $failedDisabledLanguages .= ' - ' .$language['english_name'] . '<br />';
185
+                $failedDisabledLanguages .= ' - '.$language['english_name'].'<br />';
186 186
                 $checkFailed = true;
187 187
             }
188 188
         }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 foreach ($_POST['id'] as $index => $id) {
214 214
                     $ids[] = intval($id);
215 215
                 }
216
-                $sql = "UPDATE $tbl_admin_languages SET available='1' WHERE id IN ('" . implode("','", $ids) . "')";
216
+                $sql = "UPDATE $tbl_admin_languages SET available='1' WHERE id IN ('".implode("','", $ids)."')";
217 217
                 Database::query($sql);
218 218
             }
219 219
             break;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                 foreach ($_POST['id'] as $index => $id) {
224 224
                     $ids[] = intval($id);
225 225
                 }
226
-                $sql = "UPDATE $tbl_admin_languages SET available='0' WHERE id IN ('" . implode("','", $ids) . "')";
226
+                $sql = "UPDATE $tbl_admin_languages SET available='0' WHERE id IN ('".implode("','", $ids)."')";
227 227
                 Database::query($sql);
228 228
             }
229 229
             break;
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 // displaying the explanation for this tool
253 253
 Display::display_normal_message(get_lang('PlatformLanguagesExplanation'));
254 254
 
255
-echo '<a id="disable_all_except_default" href="javascript:void(0)" class="btn btn-primary"><em class="fa fa-eye"></em> ' . get_lang('LanguagesDisableAllExceptDefault') . '</a><br /><br />';
255
+echo '<a id="disable_all_except_default" href="javascript:void(0)" class="btn btn-primary"><em class="fa fa-eye"></em> '.get_lang('LanguagesDisableAllExceptDefault').'</a><br /><br />';
256 256
 
257 257
 // selecting all the languages
258 258
 $sql_select = "SELECT * FROM $tbl_admin_languages";
@@ -273,8 +273,8 @@  discard block
 block discarded – undo
273 273
             $checked = ' checked="checked" ';
274 274
         }
275 275
 
276
-        $row_td[] = '<input type="hidden" name="edit_id" value="' . Security::remove_XSS($_GET['id']) . '" /><input type="text" name="txt_name" value="' . $row['original_name'] . '" /> '
277
-                . '<input type="checkbox" ' . $checked . 'name="platformlanguage" id="platformlanguage" value="' . $row['english_name'] . '" /><label for="platformlanguage">' . $row['original_name'] . ' ' . get_lang('AsPlatformLanguage') . '</label> <input type="submit" name="Submit" value="' . get_lang('Ok') . '" /><a name="value" />';
276
+        $row_td[] = '<input type="hidden" name="edit_id" value="'.Security::remove_XSS($_GET['id']).'" /><input type="text" name="txt_name" value="'.$row['original_name'].'" /> '
277
+                . '<input type="checkbox" '.$checked.'name="platformlanguage" id="platformlanguage" value="'.$row['english_name'].'" /><label for="platformlanguage">'.$row['original_name'].' '.get_lang('AsPlatformLanguage').'</label> <input type="submit" name="Submit" value="'.get_lang('Ok').'" /><a name="value" />';
278 278
     } else {
279 279
         $row_td[] = $row['original_name'];
280 280
     }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     if ($row['english_name'] == $row_lang['selected_value']) {
289 289
         $setplatformlanguage = Display::return_icon('languages.png', get_lang('CurrentLanguagesPortal'), '', ICON_SIZE_SMALL);
290 290
     } else {
291
-        $setplatformlanguage = "<a href=\"javascript:if (confirm('" . addslashes(get_lang('AreYouSureYouWantToSetThisLanguageAsThePortalDefault')) . "')) { location.href='" . api_get_self() . "?action=setplatformlanguage&id=" . $row['id'] . "'; }\">" . Display::return_icon('languages_na.png', get_lang('SetLanguageAsDefault'), '', ICON_SIZE_SMALL) . "</a>";
291
+        $setplatformlanguage = "<a href=\"javascript:if (confirm('".addslashes(get_lang('AreYouSureYouWantToSetThisLanguageAsThePortalDefault'))."')) { location.href='".api_get_self()."?action=setplatformlanguage&id=".$row['id']."'; }\">".Display::return_icon('languages_na.png', get_lang('SetLanguageAsDefault'), '', ICON_SIZE_SMALL)."</a>";
292 292
     }
293 293
 
294 294
     $allow_delete_sub_language = null;
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
         if ($verified_if_is_sub_language === false) {
302 302
             $verified_if_is_father = SubLanguageManager::check_if_language_is_father($row['id']);
303
-            $allow_use_sub_language = "&nbsp;<a href='sub_language_add.php?action=definenewsublanguage&id=" . $row['id'] . "'>" . Display::return_icon('new_language.png', get_lang('CreateSubLanguage'), array(), ICON_SIZE_SMALL) . "</a>";
303
+            $allow_use_sub_language = "&nbsp;<a href='sub_language_add.php?action=definenewsublanguage&id=".$row['id']."'>".Display::return_icon('new_language.png', get_lang('CreateSubLanguage'), array(), ICON_SIZE_SMALL)."</a>";
304 304
             if ($verified_if_is_father === true) {
305 305
                 //$allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=".$row['id']."'>".Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'),array('width'=>ICON_SIZE_SMALL,'height'=>ICON_SIZE_SMALL))."</a>";
306 306
                 $allow_add_term_sub_language = '';
@@ -310,8 +310,8 @@  discard block
 block discarded – undo
310 310
         } else {
311 311
             $allow_use_sub_language = '';
312 312
             $all_information_of_sub_language = SubLanguageManager::get_all_information_of_language($row['id']);
313
-            $allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>";
314
-            $allow_delete_sub_language = "&nbsp;<a href='sub_language_add.php?action=deletesublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('delete.png', get_lang('DeleteSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>";
313
+            $allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=".Security::remove_XSS($all_information_of_sub_language['parent_id'])."&sub_language_id=".Security::remove_XSS($row['id'])."'>".Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL))."</a>";
314
+            $allow_delete_sub_language = "&nbsp;<a href='sub_language_add.php?action=deletesublanguage&id=".Security::remove_XSS($all_information_of_sub_language['parent_id'])."&sub_language_id=".Security::remove_XSS($row['id'])."'>".Display::return_icon('delete.png', get_lang('DeleteSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL))."</a>";
315 315
         }
316 316
     } else {
317 317
         $allow_use_sub_language = '';
@@ -319,13 +319,13 @@  discard block
 block discarded – undo
319 319
     }
320 320
 
321 321
     if ($row['english_name'] == $row_lang['selected_value']) {
322
-        $row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>
323
-                     &nbsp;" . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language;
322
+        $row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>
323
+                     &nbsp;" . $setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
324 324
     } else {
325 325
         if ($row['available'] == 1) {
326
-            $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_" . $row['id'] . "\" href='" . api_get_self() . "?action=makeunavailable&id=" . $row['id'] . "'>" . Display::return_icon('visible.png', get_lang('MakeUnavailable'), array('id' => 'imglinktool_' . $row['id']), ICON_SIZE_SMALL) . "</a> <a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>&nbsp;" . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language;
326
+            $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_".$row['id']."\" href='".api_get_self()."?action=makeunavailable&id=".$row['id']."'>".Display::return_icon('visible.png', get_lang('MakeUnavailable'), array('id' => 'imglinktool_'.$row['id']), ICON_SIZE_SMALL)."</a> <a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>&nbsp;".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
327 327
         } else {
328
-            $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_" . $row['id'] . "\" href='" . api_get_self() . "?action=makeavailable&id=" . $row['id'] . "'>" . Display::return_icon('invisible.png', get_lang('MakeAvailable'), array('id' => 'imglinktool_' . $row['id']), ICON_SIZE_SMALL) . "</a> <a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>&nbsp;" . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language;
328
+            $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_".$row['id']."\" href='".api_get_self()."?action=makeavailable&id=".$row['id']."'>".Display::return_icon('invisible.png', get_lang('MakeAvailable'), array('id' => 'imglinktool_'.$row['id']), ICON_SIZE_SMALL)."</a> <a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>&nbsp;".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
329 329
         }
330 330
     }
331 331
     $language_data[] = $row_td;
Please login to merge, or discard this patch.
main/reports/templates/exercicesMultiCourses.reports.php 2 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $reports_template['exercicesMultiCourses'] = array(
4
-	'description' => 'Result of each test per student',
5
-	'getSQL' => 'reports_template_exercicesMultiCourses_getSQL',
6
-	'wizard' =>
4
+    'description' => 'Result of each test per student',
5
+    'getSQL' => 'reports_template_exercicesMultiCourses_getSQL',
6
+    'wizard' =>
7 7
 '
8 8
 <span id="exercicesMultiCourses" class="step">
9 9
 	<span class="font_normal_07em_black">Result of each test per student</span><br />
@@ -32,39 +32,39 @@  discard block
 block discarded – undo
32 32
 ');
33 33
 
34 34
 function reports_template_exercicesMultiCourses_getSQL() {
35
-	// foreach quiz
36
-	$result = array();
37
-	$columns = Database::query('select r.id as kid, c.title as course, '.
38
-		'r.child_name as test from '.
39
-		Database::get_main_table(TABLE_MAIN_REPORTS_KEYS).' r, '.
40
-		Database::get_main_table(TABLE_MAIN_COURSE).' c '.
41
-		'where r.course_id=c.id and r.tool_id='.
42
-		reports_getToolId(TOOL_QUIZ).
43
-		' order by r.course_id, r.child_name');
44
-	if (Database::num_rows($columns) == 0)
45
-		die('<b>'.get_lang('no data found').'</b>');
46
-	$query = 'select u.lastname Name, u.firstname Firstname';
47
-	$columns = Database::store_result($columns);
48
-	if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max')
49
-		$function = $_REQUEST['tattempt'];
50
-	else
51
-		$function = 'avg';
52
-	foreach ($columns as $key => $column)
53
-		$query .= ', '.$function.'(k'.$key.'.score) as `'.
54
-				$column['course'].' - '.
55
-				$column['test'].'` ';
56
-	$query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
57
-	foreach ($columns as $key => $column) // fixme sessions
58
-		$query .= 'left outer join '.
59
-			Database::get_main_table(TABLE_MAIN_REPORTS_VALUES).
60
-			' k'.$key.
61
-			' on k'.$key.'.key_id = '.$column['kid'].
62
-				' and k'.$key.'.user_id = u.user_id ';
63
-	$query .= ' group by ';
64
-	foreach ($columns as $key => $column) // grouping attempt
65
-		$query .= 'k'.$key.'.attempt, ';
66
-	$query = substr($query, 0, -2); // removing last ', ';
35
+    // foreach quiz
36
+    $result = array();
37
+    $columns = Database::query('select r.id as kid, c.title as course, '.
38
+        'r.child_name as test from '.
39
+        Database::get_main_table(TABLE_MAIN_REPORTS_KEYS).' r, '.
40
+        Database::get_main_table(TABLE_MAIN_COURSE).' c '.
41
+        'where r.course_id=c.id and r.tool_id='.
42
+        reports_getToolId(TOOL_QUIZ).
43
+        ' order by r.course_id, r.child_name');
44
+    if (Database::num_rows($columns) == 0)
45
+        die('<b>'.get_lang('no data found').'</b>');
46
+    $query = 'select u.lastname Name, u.firstname Firstname';
47
+    $columns = Database::store_result($columns);
48
+    if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max')
49
+        $function = $_REQUEST['tattempt'];
50
+    else
51
+        $function = 'avg';
52
+    foreach ($columns as $key => $column)
53
+        $query .= ', '.$function.'(k'.$key.'.score) as `'.
54
+                $column['course'].' - '.
55
+                $column['test'].'` ';
56
+    $query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
57
+    foreach ($columns as $key => $column) // fixme sessions
58
+        $query .= 'left outer join '.
59
+            Database::get_main_table(TABLE_MAIN_REPORTS_VALUES).
60
+            ' k'.$key.
61
+            ' on k'.$key.'.key_id = '.$column['kid'].
62
+                ' and k'.$key.'.user_id = u.user_id ';
63
+    $query .= ' group by ';
64
+    foreach ($columns as $key => $column) // grouping attempt
65
+        $query .= 'k'.$key.'.attempt, ';
66
+    $query = substr($query, 0, -2); // removing last ', ';
67 67
 
68 68
 
69
-	return $query;
69
+    return $query;
70 70
 }
Please login to merge, or discard this patch.
Braces   +17 added lines, -10 removed lines patch added patch discarded remove patch
@@ -41,28 +41,35 @@
 block discarded – undo
41 41
 		'where r.course_id=c.id and r.tool_id='.
42 42
 		reports_getToolId(TOOL_QUIZ).
43 43
 		' order by r.course_id, r.child_name');
44
-	if (Database::num_rows($columns) == 0)
45
-		die('<b>'.get_lang('no data found').'</b>');
44
+	if (Database::num_rows($columns) == 0) {
45
+			die('<b>'.get_lang('no data found').'</b>');
46
+	}
46 47
 	$query = 'select u.lastname Name, u.firstname Firstname';
47 48
 	$columns = Database::store_result($columns);
48
-	if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max')
49
-		$function = $_REQUEST['tattempt'];
50
-	else
51
-		$function = 'avg';
52
-	foreach ($columns as $key => $column)
53
-		$query .= ', '.$function.'(k'.$key.'.score) as `'.
49
+	if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max') {
50
+			$function = $_REQUEST['tattempt'];
51
+	} else {
52
+			$function = 'avg';
53
+	}
54
+	foreach ($columns as $key => $column) {
55
+			$query .= ', '.$function.'(k'.$key.'.score) as `'.
54 56
 				$column['course'].' - '.
55 57
 				$column['test'].'` ';
58
+	}
56 59
 	$query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
57
-	foreach ($columns as $key => $column) // fixme sessions
60
+	foreach ($columns as $key => $column) {
61
+	    // fixme sessions
58 62
 		$query .= 'left outer join '.
59 63
 			Database::get_main_table(TABLE_MAIN_REPORTS_VALUES).
60 64
 			' k'.$key.
61 65
 			' on k'.$key.'.key_id = '.$column['kid'].
62 66
 				' and k'.$key.'.user_id = u.user_id ';
67
+	}
63 68
 	$query .= ' group by ';
64
-	foreach ($columns as $key => $column) // grouping attempt
69
+	foreach ($columns as $key => $column) {
70
+	    // grouping attempt
65 71
 		$query .= 'k'.$key.'.attempt, ';
72
+	}
66 73
 	$query = substr($query, 0, -2); // removing last ', ';
67 74
 
68 75
 
Please login to merge, or discard this patch.
plugin/buycourses/src/panel.ajax.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -37,20 +37,20 @@  discard block
 block discarded – undo
37 37
 
38 38
         $userInfo = api_get_user_info($sale['user_id']);
39 39
 
40
-        $html = '<h2>' . $sale['product_name'] .'</h2>';
40
+        $html = '<h2>'.$sale['product_name'].'</h2>';
41 41
         $html .= '<div class="row">';
42 42
         $html .= '<div class="col-sm-6 col-md-6">';
43 43
         $html .= '<ul>';
44
-        $html .= '<li><b>'. $plugin->get_lang('OrderPrice') . ':</b> '. $sale['price'] . '</li>';
45
-        $html .= '<li><b>'. $plugin->get_lang('CurrencyType') . ':</b> '. $currency['iso_code'] . '</li>';
46
-        $html .= '<li><b>'. $plugin->get_lang('ProductType') . ':</b> '. $productType . '</li>';
47
-        $html .= '<li><b>'. $plugin->get_lang('OrderDate') . ':</b> '. api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H) . '</li>';
48
-        $html .= '<li><b>'. $plugin->get_lang('Buyer') . ':</b> '. $userInfo['complete_name'] . '</li>';
49
-        $html .= '<li><b>'. $plugin->get_lang('PaymentMethods') . ':</b> '. $paymentType . '</li>';
44
+        $html .= '<li><b>'.$plugin->get_lang('OrderPrice').':</b> '.$sale['price'].'</li>';
45
+        $html .= '<li><b>'.$plugin->get_lang('CurrencyType').':</b> '.$currency['iso_code'].'</li>';
46
+        $html .= '<li><b>'.$plugin->get_lang('ProductType').':</b> '.$productType.'</li>';
47
+        $html .= '<li><b>'.$plugin->get_lang('OrderDate').':</b> '.api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H).'</li>';
48
+        $html .= '<li><b>'.$plugin->get_lang('Buyer').':</b> '.$userInfo['complete_name'].'</li>';
49
+        $html .= '<li><b>'.$plugin->get_lang('PaymentMethods').':</b> '.$paymentType.'</li>';
50 50
         $html .= '</ul>';
51 51
         $html .= '</div>';
52 52
         $html .= '<div class="col-sm-6 col-md-6">';
53
-        $html .= '<img class="thumbnail" src="'. $productImage .'" >';
53
+        $html .= '<img class="thumbnail" src="'.$productImage.'" >';
54 54
         $html .= '</div>';
55 55
         $html .= '</div>';
56 56
 
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
         $html = '<div class="row">'
96 96
         . '<p>'
97 97
             . '<ul>'
98
-                . '<li>'. get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin") .' <b>'. $stats['completed_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['completed_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
99
-                . '<li>'. get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin") .' <b>'. $stats['pending_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['pending_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
100
-                . '<li>'. get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin") .' <b>'. $stats['canceled_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['canceled_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
98
+                . '<li>'.get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin").' <b>'.$stats['completed_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['completed_total_amount'].' '.$currency['iso_code'].'</b></li>'
99
+                . '<li>'.get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin").' <b>'.$stats['pending_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['pending_total_amount'].' '.$currency['iso_code'].'</b></li>'
100
+                . '<li>'.get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin").' <b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['canceled_total_amount'].' '.$currency['iso_code'].'</b></li>'
101 101
             . '</ul>'
102 102
         . '</p>';
103 103
         $html .= '</div>';
@@ -137,15 +137,15 @@  discard block
 block discarded – undo
137 137
 
138 138
         $isoCode = $currentCurrency['iso_code'];
139 139
 
140
-        $html .= '<p>'. get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin") .'</p>';
140
+        $html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>';
141 141
         $html .= ''
142 142
         . '<p>'
143 143
             . '<ul>'
144
-                . '<li>'. get_plugin_lang("TotalAcounts", "BuyCoursesPlugin") .' <b>'. $totalAccounts .'</b></li>'
145
-                . '<li>'. get_plugin_lang("TotalPayout", "BuyCoursesPlugin") .' <b>'. $isoCode .' '. $totalPayout .'</b></li>'
144
+                . '<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>'
145
+                . '<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>'
146 146
             . '</ul>'
147 147
         . '</p>';
148
-        $html .= '<p>'. get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin") .'</p>';
148
+        $html .= '<p>'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'</p>';
149 149
         $html .= '<br /><br />';
150 150
         $html .= '<div id="spinner" class="text-center"></div>';
151 151
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
         } else {
201 201
 
202
-            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'. $result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
202
+            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'.$result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
203 203
 
204 204
         }
205 205
 
Please login to merge, or discard this patch.
plugin/buycourses/src/buycourses.ajax.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -37,20 +37,20 @@  discard block
 block discarded – undo
37 37
 
38 38
         $userInfo = api_get_user_info($sale['user_id']);
39 39
 
40
-        $html = '<h2>' . $sale['product_name'] .'</h2>';
40
+        $html = '<h2>'.$sale['product_name'].'</h2>';
41 41
         $html .= '<div class="row">';
42 42
         $html .= '<div class="col-sm-6 col-md-6">';
43 43
         $html .= '<ul>';
44
-        $html .= '<li><b>'. $plugin->get_lang('OrderPrice') . ':</b> '. $sale['price'] . '</li>';
45
-        $html .= '<li><b>'. $plugin->get_lang('CurrencyType') . ':</b> '. $currency['iso_code'] . '</li>';
46
-        $html .= '<li><b>'. $plugin->get_lang('ProductType') . ':</b> '. $productType . '</li>';
47
-        $html .= '<li><b>'. $plugin->get_lang('OrderDate') . ':</b> '. api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H) . '</li>';
48
-        $html .= '<li><b>'. $plugin->get_lang('Buyer') . ':</b> '. $userInfo['complete_name'] . '</li>';
49
-        $html .= '<li><b>'. $plugin->get_lang('PaymentMethods') . ':</b> '. $paymentType . '</li>';
44
+        $html .= '<li><b>'.$plugin->get_lang('OrderPrice').':</b> '.$sale['price'].'</li>';
45
+        $html .= '<li><b>'.$plugin->get_lang('CurrencyType').':</b> '.$currency['iso_code'].'</li>';
46
+        $html .= '<li><b>'.$plugin->get_lang('ProductType').':</b> '.$productType.'</li>';
47
+        $html .= '<li><b>'.$plugin->get_lang('OrderDate').':</b> '.api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H).'</li>';
48
+        $html .= '<li><b>'.$plugin->get_lang('Buyer').':</b> '.$userInfo['complete_name'].'</li>';
49
+        $html .= '<li><b>'.$plugin->get_lang('PaymentMethods').':</b> '.$paymentType.'</li>';
50 50
         $html .= '</ul>';
51 51
         $html .= '</div>';
52 52
         $html .= '<div class="col-sm-6 col-md-6">';
53
-        $html .= '<img class="thumbnail" src="'. $productImage .'" >';
53
+        $html .= '<img class="thumbnail" src="'.$productImage.'" >';
54 54
         $html .= '</div>';
55 55
         $html .= '</div>';
56 56
 
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
         $html = '<div class="row">'
96 96
         . '<p>'
97 97
             . '<ul>'
98
-                . '<li>'. get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin") .' <b>'. $stats['completed_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['completed_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
99
-                . '<li>'. get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin") .' <b>'. $stats['pending_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['pending_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
100
-                . '<li>'. get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin") .' <b>'. $stats['canceled_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['canceled_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
98
+                . '<li>'.get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin").' <b>'.$stats['completed_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['completed_total_amount'].' '.$currency['iso_code'].'</b></li>'
99
+                . '<li>'.get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin").' <b>'.$stats['pending_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['pending_total_amount'].' '.$currency['iso_code'].'</b></li>'
100
+                . '<li>'.get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin").' <b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['canceled_total_amount'].' '.$currency['iso_code'].'</b></li>'
101 101
             . '</ul>'
102 102
         . '</p>';
103 103
         $html .= '</div>';
@@ -137,15 +137,15 @@  discard block
 block discarded – undo
137 137
 
138 138
         $isoCode = $currentCurrency['iso_code'];
139 139
 
140
-        $html .= '<p>'. get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin") .'</p>';
140
+        $html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>';
141 141
         $html .= ''
142 142
         . '<p>'
143 143
             . '<ul>'
144
-                . '<li>'. get_plugin_lang("TotalAcounts", "BuyCoursesPlugin") .' <b>'. $totalAccounts .'</b></li>'
145
-                . '<li>'. get_plugin_lang("TotalPayout", "BuyCoursesPlugin") .' <b>'. $isoCode .' '. $totalPayout .'</b></li>'
144
+                . '<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>'
145
+                . '<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>'
146 146
             . '</ul>'
147 147
         . '</p>';
148
-        $html .= '<p>'. get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin") .'</p>';
148
+        $html .= '<p>'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'</p>';
149 149
         $html .= '<br /><br />';
150 150
         $html .= '<div id="spinner" class="text-center"></div>';
151 151
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
         } else {
201 201
 
202
-            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'. $result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
202
+            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'.$result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
203 203
 
204 204
         }
205 205
 
Please login to merge, or discard this patch.
main/session/session_add.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -31,27 +31,27 @@  discard block
 block discarded – undo
31 31
 function search_coachs($needle)
32 32
 {
33 33
     $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
34
-	$xajax_response = new xajaxResponse();
35
-	$return = '';
34
+    $xajax_response = new xajaxResponse();
35
+    $return = '';
36 36
 
37
-	if (!empty($needle)) {
38
-		$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
37
+    if (!empty($needle)) {
38
+        $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
39 39
 
40
-		// search users where username or firstname or lastname begins likes $needle
41
-		$sql = 'SELECT username, lastname, firstname
40
+        // search users where username or firstname or lastname begins likes $needle
41
+        $sql = 'SELECT username, lastname, firstname
42 42
 		        FROM '.$tbl_user.' user
43 43
 				WHERE (username LIKE "'.$needle.'%"
44 44
 				OR firstname LIKE "'.$needle.'%"
45 45
 				OR lastname LIKE "'.$needle.'%")
46 46
 				AND status=1'.
47
-				$order_clause.
48
-				' LIMIT 10';
49
-
50
-		if (api_is_multiple_url_enabled()) {
51
-			$tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
52
-			$access_url_id = api_get_current_access_url_id();
53
-			if ($access_url_id != -1) {
54
-				$sql = 'SELECT username, lastname, firstname
47
+                $order_clause.
48
+                ' LIMIT 10';
49
+
50
+        if (api_is_multiple_url_enabled()) {
51
+            $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
52
+            $access_url_id = api_get_current_access_url_id();
53
+            if ($access_url_id != -1) {
54
+                $sql = 'SELECT username, lastname, firstname
55 55
                         FROM '.$tbl_user.' user
56 56
                         INNER JOIN '.$tbl_user_rel_access_url.' url_user
57 57
                         ON (url_user.user_id=user.user_id)
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
                             AND status=1'.
66 66
                         $order_clause.'
67 67
                         LIMIT 10';
68
-			}
69
-		}
70
-
71
-		$rs = Database::query($sql);
72
-		while ($user = Database :: fetch_array($rs)) {
73
-			$return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\''.$user['username'].'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />';
74
-		}
75
-	}
76
-	$xajax_response -> addAssign('ajax_list_coachs','innerHTML', api_utf8_encode($return));
77
-	return $xajax_response;
68
+            }
69
+        }
70
+
71
+        $rs = Database::query($sql);
72
+        while ($user = Database :: fetch_array($rs)) {
73
+            $return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\''.$user['username'].'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />';
74
+        }
75
+    }
76
+    $xajax_response -> addAssign('ajax_list_coachs','innerHTML', api_utf8_encode($return));
77
+    return $xajax_response;
78 78
 }
79 79
 $xajax -> processRequests();
80 80
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 </script>";
118 118
 
119 119
 if (isset($_POST['formSent']) && $_POST['formSent']) {
120
-	$formSent = 1;
120
+    $formSent = 1;
121 121
 }
122 122
 
123 123
 $tool_name = get_lang('AddSession');
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 Display::display_header($tool_name);
210 210
 
211 211
 if (!empty($return)) {
212
-	Display::display_error_message($return, false);
212
+    Display::display_error_message($return, false);
213 213
 }
214 214
 
215 215
 echo '<div class="actions">';
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 				' LIMIT 10';
52 52
 
53 53
 		if (api_is_multiple_url_enabled()) {
54
-			$tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
54
+			$tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
55 55
 			$access_url_id = api_get_current_access_url_id();
56 56
 			if ($access_url_id != -1) {
57 57
 				$sql = 'SELECT username, lastname, firstname
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 			$return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\''.$user['username'].'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />';
77 77
 		}
78 78
 	}
79
-	$xajax_response -> addAssign('ajax_list_coachs','innerHTML', api_utf8_encode($return));
79
+	$xajax_response -> addAssign('ajax_list_coachs', 'innerHTML', api_utf8_encode($return));
80 80
 	return $xajax_response;
81 81
 }
82 82
 $xajax -> processRequests();
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 $form->addElement('header', $tool_name);
138 138
 $result = SessionManager::setForm($form);
139 139
 
140
-$htmlHeadXtra[] ='
140
+$htmlHeadXtra[] = '
141 141
 <script>
142 142
 $(function() {
143 143
     '.$result['js'].'
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 $form->addButtonNext(get_lang('NextStep'));
148 148
 
149 149
 if (!$formSent) {
150
-    $formDefaults['access_start_date'] =  $formDefaults['display_start_date'] = api_get_local_time();
150
+    $formDefaults['access_start_date'] = $formDefaults['display_start_date'] = api_get_local_time();
151 151
     $formDefaults['coach_username'] = api_get_user_id();
152 152
 } else {
153 153
     $formDefaults['name'] = api_htmlentities($name, ENT_QUOTES, $charset);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     $id_visibility = $params['session_visibility'];
173 173
     $duration = isset($params['duration']) ? $params['duration'] : null;
174 174
     $description = $params['description'];
175
-    $showDescription = isset($params['show_description']) ? 1: 0;
175
+    $showDescription = isset($params['show_description']) ? 1 : 0;
176 176
     $sendSubscriptionNotification = isset($params['send_subscription_notification']);
177 177
     $isThisImageCropped = isset($params['picture_crop_result']);
178 178
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
     if ($return == strval(intval($return))) {
211 211
         // integer => no error on session creation
212
-        header('Location: add_courses_to_session.php?id_session=' . $return . '&add=true&msg=');
212
+        header('Location: add_courses_to_session.php?id_session='.$return.'&add=true&msg=');
213 213
         exit();
214 214
     }
215 215
 }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
 echo '<div class="actions">';
224 224
 echo '<a href="../session/session_list.php">'.
225
-    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>';
225
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>';
226 226
 echo '</div>';
227 227
 
228 228
 $form->display();
Please login to merge, or discard this patch.