Completed
Push — 1.11.x ( 6904fa...6a92e6 )
by José
525:44 queued 484:20
created
main/document/slideshow.php 1 patch
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.
main/course_description/index.php 1 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/course_description/add.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,26 +11,26 @@
 block discarded – undo
11 11
 api_protect_course_script(true);
12 12
 
13 13
 // display categories
14
-$categories = array ();
14
+$categories = array();
15 15
 foreach ($default_description_titles as $id => $title) {
16 16
 	$categories[$id] = $title;
17 17
 }
18 18
 $categories[ADD_BLOCK] = get_lang('NewBloc');
19 19
 
20
-$i=1;
20
+$i = 1;
21 21
 echo '<div class="actions" style="margin-bottom:30px">';
22 22
 echo '<a href="index.php?'.api_get_cidreq().'">'.
23
-	Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM).
23
+	Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ToolCourseDescription'), '', ICON_SIZE_MEDIUM).
24 24
 	'</a>';
25 25
 ksort($categories);
26 26
 foreach ($categories as $id => $title) {
27 27
 	if ($i == ADD_BLOCK) {
28 28
 		echo '<a href="index.php?'.api_get_cidreq().'&action=add">'.
29
-			Display::return_icon($default_description_icon[$id], $title, '',ICON_SIZE_MEDIUM).'</a>';
29
+			Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
30 30
 		break;
31 31
 	} else {
32 32
 		echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'.
33
-			Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>';
33
+			Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
34 34
 		$i++;
35 35
 	}
36 36
 }
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/inc/lib/AnnouncementManager.php 1 patch
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
                             announcement.id = '$announcement_id' AND
217 217
                             toolitemproperties.tool='announcement' AND
218 218
                             (
219
-                                toolitemproperties.to_user_id='" . api_get_user_id() . "' OR
220
-                                toolitemproperties.to_group_id IN ('0', '" . implode("', '", $group_list) . "') OR
219
+                                toolitemproperties.to_user_id='".api_get_user_id()."' OR
220
+                                toolitemproperties.to_group_id IN ('0', '" . implode("', '", $group_list)."') OR
221 221
                                 toolitemproperties.to_group_id IS NULL
222 222
                             ) AND
223 223
                             toolitemproperties.visibility='1' AND
@@ -246,13 +246,13 @@  discard block
 block discarded – undo
246 246
             $title = $result['title'];
247 247
             $content = $result['content'];
248 248
             $html .= "<table height=\"100\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" class=\"data_table\">";
249
-            $html .= "<tr><td><h2>" . $title . "</h2></td></tr>";
249
+            $html .= "<tr><td><h2>".$title."</h2></td></tr>";
250 250
 
251 251
             if (api_is_allowed_to_edit(false, true) ||
252 252
                 (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())
253 253
             ) {
254
-                $modify_icons = "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=modify&id=" . $announcement_id . "\">" .
255
-                    Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>";
254
+                $modify_icons = "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=modify&id=".$announcement_id."\">".
255
+                    Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>";
256 256
                 if ($result['visibility'] == 1) {
257 257
                     $image_visibility = "visible";
258 258
                     $alt_visibility = get_lang('Hide');
@@ -262,12 +262,12 @@  discard block
 block discarded – undo
262 262
                 }
263 263
                 global $stok;
264 264
 
265
-                $modify_icons .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&origin=" . (!empty($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '') . "&action=showhide&id=" . $announcement_id . "&sec_token=" . $stok . "\">" .
266
-                    Display::return_icon($image_visibility . '.png', $alt_visibility, '', ICON_SIZE_SMALL) . "</a>";
265
+                $modify_icons .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&origin=".(!empty($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '')."&action=showhide&id=".$announcement_id."&sec_token=".$stok."\">".
266
+                    Display::return_icon($image_visibility.'.png', $alt_visibility, '', ICON_SIZE_SMALL)."</a>";
267 267
 
268 268
                 if (api_is_allowed_to_edit(false, true)) {
269
-                    $modify_icons .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=delete&id=" . $announcement_id . "&sec_token=" . $stok . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . "')) return false;\">" .
270
-                        Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) .
269
+                    $modify_icons .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&id=".$announcement_id."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset))."')) return false;\">".
270
+                        Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).
271 271
                         "</a>";
272 272
                 }
273 273
                 $html .= "<tr><th style='text-align:right'>$modify_icons</th></tr>";
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
             $content = self::parse_content($result['to_user_id'], $content, api_get_course_id(), api_get_session_id());
277 277
 
278 278
             $html .= "<tr><td>$content</td></tr>";
279
-            $html .= "<tr><td class=\"announcements_datum\">" . get_lang('LastUpdateDate') . " : " . api_convert_and_format_date($result['insert_date'], DATE_TIME_FORMAT_LONG) . "</td></tr>";
279
+            $html .= "<tr><td class=\"announcements_datum\">".get_lang('LastUpdateDate')." : ".api_convert_and_format_date($result['insert_date'], DATE_TIME_FORMAT_LONG)."</td></tr>";
280 280
 
281 281
             // User or group icon
282 282
             $sent_to_icon = '';
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
                 $sent_to_form = self::sent_to_form($sent_to);
289 289
                 $html .= Display::tag(
290 290
                     'td',
291
-                    get_lang('SentTo') . ' : ' . $sent_to_form,
291
+                    get_lang('SentTo').' : '.$sent_to_form,
292 292
                     array('class' => 'announcements_datum')
293 293
                 );
294 294
             }
@@ -298,15 +298,15 @@  discard block
 block discarded – undo
298 298
                 $html .= "<tr><td>";
299 299
                 $realname = $attachment_list['path'];
300 300
                 $user_filename = $attachment_list['filename'];
301
-                $full_file_name = 'download.php?'.api_get_cidreq().'&file=' . $realname;
301
+                $full_file_name = 'download.php?'.api_get_cidreq().'&file='.$realname;
302 302
                 $html .= '<br/>';
303 303
                 $html .= Display::return_icon('attachment.gif', get_lang('Attachment'));
304
-                $html .= '<a href="' . $full_file_name . ' "> ' . $user_filename . ' </a>';
305
-                $html .= ' - <span class="forum_attach_comment" >' . $attachment_list['comment'] . '</span>';
304
+                $html .= '<a href="'.$full_file_name.' "> '.$user_filename.' </a>';
305
+                $html .= ' - <span class="forum_attach_comment" >'.$attachment_list['comment'].'</span>';
306 306
                 if (api_is_allowed_to_edit(false, true)) {
307 307
                     $html .= Display::url(
308 308
                         Display::return_icon('delete.png', get_lang('Delete'), '', 16),
309
-                        api_get_self() . "?" . api_get_cidreq() . "&action=delete_attachment&id_attach=" . $attachment_list['id'] . "&sec_token=" . $stok
309
+                        api_get_self()."?".api_get_cidreq()."&action=delete_attachment&id_attach=".$attachment_list['id']."&sec_token=".$stok
310 310
                     );
311 311
                 }
312 312
                 $html .= '</td></tr>';
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
         $order = 0;
335 335
         if (Database::num_rows($res_max)) {
336 336
             $row_max = Database::fetch_array($res_max);
337
-            $order = intval($row_max[0])+1;
337
+            $order = intval($row_max[0]) + 1;
338 338
         }
339 339
 
340 340
         return $order;
@@ -754,8 +754,8 @@  discard block
 block discarded – undo
754 754
             $result = array();
755 755
             if ($num_rows > 0) {
756 756
                 while ($myrow = Database::fetch_array($rs)) {
757
-                    $content.= '<strong>' . $myrow['title'] . '</strong><br /><br />';
758
-                    $content.= $myrow['content'];
757
+                    $content .= '<strong>'.$myrow['title'].'</strong><br /><br />';
758
+                    $content .= $myrow['content'];
759 759
                     $i++;
760 760
                 }
761 761
                 $result['content'] = $content;
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
         echo "<table id=\"recipient_list\" >";
787 787
         echo '<tr>';
788 788
         echo '<td>';
789
-        echo '<label><input type="checkbox" id="send_to_all_users">'.get_lang('SendToAllUsers') . "</label>";
789
+        echo '<label><input type="checkbox" id="send_to_all_users">'.get_lang('SendToAllUsers')."</label>";
790 790
         echo "</td>";
791 791
         echo '</tr>';
792 792
         echo '<tr>';
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 
795 795
         // the form containing all the groups and all the users of the course
796 796
         echo '<td>';
797
-        echo "<strong>" . get_lang('Users') . "</strong><br />";
797
+        echo "<strong>".get_lang('Users')."</strong><br />";
798 798
 
799 799
         self::construct_not_selected_select_form($groupList, $userList, $to_already_selected);
800 800
         echo "</td>";
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
         echo "<td>";
810 810
 
811 811
         // the form containing the selected groups and users
812
-        echo "<strong>" . get_lang('DestinationUsers') . "</strong><br />";
812
+        echo "<strong>".get_lang('DestinationUsers')."</strong><br />";
813 813
         self::construct_selected_select_form($groupList, $userList, $to_already_selected);
814 814
         echo "</td>";
815 815
         echo "</tr>";
@@ -827,8 +827,8 @@  discard block
 block discarded – undo
827 827
         echo "<select id=\"not_selected_form\" name=\"not_selected_form[]\" size=5 style=\"width:200px\" multiple>";
828 828
         $group_users = GroupManager::getStudentsAndTutors($group_id);
829 829
         foreach ($group_users as $user) {
830
-            echo '<option value="' . $user['user_id'] . '" title="' . sprintf(get_lang('LoginX'), $user['username']) . '" >' .
831
-                api_get_person_name($user['firstname'], $user['lastname']) .
830
+            echo '<option value="'.$user['user_id'].'" title="'.sprintf(get_lang('LoginX'), $user['username']).'" >'.
831
+                api_get_person_name($user['firstname'], $user['lastname']).
832 832
                 '</option>';
833 833
         }
834 834
         echo '</select>';
@@ -866,12 +866,12 @@  discard block
 block discarded – undo
866 866
         if (!empty($groupList)) {
867 867
             foreach ($groupList as $this_group) {
868 868
                 if (is_array($to_already_selected)) {
869
-                    if (!in_array("GROUP:" . $this_group['id'], $to_already_selected)) {
869
+                    if (!in_array("GROUP:".$this_group['id'], $to_already_selected)) {
870 870
                         // $to_already_selected is the array containing the groups (and users) that are already selected
871
-                        $user_label = ($this_group['userNb'] > 0) ? get_lang('Users') : get_lang('LowerCaseUser') ;
872
-                        $user_disabled = ($this_group['userNb'] > 0) ? "" : "disabled=disabled" ;
873
-                        echo "<option $user_disabled value=\"GROUP:" . $this_group['id'] . "\">",
874
-                        "G: ", $this_group['name'], " - " . $this_group['userNb'] . " " . $user_label .
871
+                        $user_label = ($this_group['userNb'] > 0) ? get_lang('Users') : get_lang('LowerCaseUser');
872
+                        $user_disabled = ($this_group['userNb'] > 0) ? "" : "disabled=disabled";
873
+                        echo "<option $user_disabled value=\"GROUP:".$this_group['id']."\">",
874
+                        "G: ", $this_group['name'], " - ".$this_group['userNb']." ".$user_label.
875 875
                             "</option>";
876 876
                     }
877 877
                 }
@@ -885,15 +885,15 @@  discard block
 block discarded – undo
885 885
         if (!empty($userList)) {
886 886
             foreach ($userList as $user) {
887 887
                 if (is_array($to_already_selected)) {
888
-                    if (!in_array("USER:" . $user['user_id'], $to_already_selected)) {
888
+                    if (!in_array("USER:".$user['user_id'], $to_already_selected)) {
889 889
                         // $to_already_selected is the array containing the users (and groups) that are already selected
890
-                        echo "<option value=\"USER:" . $user['user_id'] . "\" title='" . sprintf(get_lang('LoginX'), $user['username']) . "'>",
890
+                        echo "<option value=\"USER:".$user['user_id']."\" title='".sprintf(get_lang('LoginX'), $user['username'])."'>",
891 891
                         "", api_get_person_name($user['firstname'], $user['lastname']),
892 892
                         "</option>";
893 893
 
894 894
                         if (isset($user['drh_list']) && !empty($user['drh_list'])) {
895 895
                             foreach ($user['drh_list'] as $drh) {
896
-                                echo "<option value=\"USER:" . $drh['user_id'] . "\" title='" . sprintf(get_lang('LoginX'), $drh['username']) . "'>&nbsp;&nbsp;&nbsp;&nbsp;",
896
+                                echo "<option value=\"USER:".$drh['user_id']."\" title='".sprintf(get_lang('LoginX'), $drh['username'])."'>&nbsp;&nbsp;&nbsp;&nbsp;",
897 897
                                 "", api_get_person_name($drh['firstname'], $drh['lastname']),
898 898
                                 "</option>";
899 899
                             }
@@ -925,16 +925,16 @@  discard block
 block discarded – undo
925 925
             foreach ($to_already_selected as $groupuser) {
926 926
                 list($type, $id) = explode(":", $groupuser);
927 927
                 if ($type == "GROUP") {
928
-                    echo "<option value=\"" . $groupuser . "\">G: " . $ref_array_groups[$id]['name'] . "</option>";
928
+                    echo "<option value=\"".$groupuser."\">G: ".$ref_array_groups[$id]['name']."</option>";
929 929
                 } else {
930 930
                     foreach ($ref_array_users as $key => $value) {
931 931
                         if ($value['user_id'] == $id) {
932
-                            echo "<option value=\"" . $groupuser . "\" title='" . sprintf(get_lang('LoginX'), $value['username']) . "'>" .
933
-                                api_get_person_name($value['firstname'], $value['lastname']) . "</option>";
932
+                            echo "<option value=\"".$groupuser."\" title='".sprintf(get_lang('LoginX'), $value['username'])."'>".
933
+                                api_get_person_name($value['firstname'], $value['lastname'])."</option>";
934 934
 
935 935
                             if (isset($value['drh_list']) && !empty($value['drh_list'])) {
936 936
                                 foreach ($value['drh_list'] as $drh) {
937
-                                    echo "<option value=\"USER:" . $drh['user_id'] . "\" title='" . sprintf(get_lang('LoginX'), $drh['username']) . "'>&nbsp;&nbsp;&nbsp;&nbsp;",
937
+                                    echo "<option value=\"USER:".$drh['user_id']."\" title='".sprintf(get_lang('LoginX'), $drh['username'])."'>&nbsp;&nbsp;&nbsp;&nbsp;",
938 938
                                     "", api_get_person_name($drh['firstname'], $drh['lastname']),
939 939
                                     "</option>";
940 940
                                 }
@@ -950,17 +950,17 @@  discard block
 block discarded – undo
950 950
                 if (is_array($ref_array_groups)) {
951 951
                     foreach ($ref_array_groups as $this_group) {
952 952
                         //api_display_normal_message("group " . $thisGroup[id] . $thisGroup[name]);
953
-                        if (!is_array($to_already_selected) || !in_array("GROUP:" . $this_group['id'], $to_already_selected)) { // $to_already_selected is the array containing the groups (and users) that are already selected
954
-                            echo "<option value=\"GROUP:" . $this_group['id'] . "\">",
955
-                            "G: ", $this_group['name'], " &ndash; " . $this_group['userNb'] . " " . get_lang('Users') .
953
+                        if (!is_array($to_already_selected) || !in_array("GROUP:".$this_group['id'], $to_already_selected)) { // $to_already_selected is the array containing the groups (and users) that are already selected
954
+                            echo "<option value=\"GROUP:".$this_group['id']."\">",
955
+                            "G: ", $this_group['name'], " &ndash; ".$this_group['userNb']." ".get_lang('Users').
956 956
                                 "</option>";
957 957
                         }
958 958
                     }
959 959
                 }
960 960
                 // adding the individual users to the select form
961 961
                 foreach ($ref_array_users as $this_user) {
962
-                    if (!is_array($to_already_selected) || !in_array("USER:" . $this_user['user_id'], $to_already_selected)) { // $to_already_selected is the array containing the users (and groups) that are already selected
963
-                        echo "<option value=\"USER:", $this_user['user_id'], "\"  title='" . sprintf(get_lang('LoginX'), $this_user['username']) . "'>",
962
+                    if (!is_array($to_already_selected) || !in_array("USER:".$this_user['user_id'], $to_already_selected)) { // $to_already_selected is the array containing the users (and groups) that are already selected
963
+                        echo "<option value=\"USER:", $this_user['user_id'], "\"  title='".sprintf(get_lang('LoginX'), $this_user['username'])."'>",
964 964
                         "", api_get_person_name($this_user['firstname'], $this_user['lastname']),
965 965
                         "</option>";
966 966
                     }
@@ -1073,14 +1073,14 @@  discard block
 block discarded – undo
1073 1073
             switch ($to_group) {
1074 1074
                 // it was send to one specific user
1075 1075
                 case null:
1076
-                    $to[] = "USER:" . $row['to_user_id'];
1076
+                    $to[] = "USER:".$row['to_user_id'];
1077 1077
                     break;
1078 1078
                 // it was sent to everyone
1079 1079
                 case 0:
1080 1080
                     return "everyone";
1081 1081
                     break;
1082 1082
                 default:
1083
-                    $to[] = "GROUP:" . $row['to_group_id'];
1083
+                    $to[] = "GROUP:".$row['to_group_id'];
1084 1084
             }
1085 1085
         }
1086 1086
         return $to;
@@ -1161,10 +1161,10 @@  discard block
 block discarded – undo
1161 1161
                 $sent_to_array['groups'][0] !== 0
1162 1162
             ) {
1163 1163
                 $group_id = $sent_to_array['groups'][0];
1164
-                $output[] = "&nbsp;" . $group_names[$group_id]['name'];
1164
+                $output[] = "&nbsp;".$group_names[$group_id]['name'];
1165 1165
             }
1166 1166
             if (empty($sent_to_array['groups']) and empty($sent_to_array['users'])) {
1167
-                $output[] = "&nbsp;" . get_lang('Everybody');
1167
+                $output[] = "&nbsp;".get_lang('Everybody');
1168 1168
             }
1169 1169
         }
1170 1170
 
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 
1200 1200
         $sql = "SELECT to_group_id, to_user_id
1201 1201
                 FROM $tbl_item_property
1202
-                WHERE c_id = $course_id AND tool = '$tool' AND ref=" . $id;
1202
+                WHERE c_id = $course_id AND tool = '$tool' AND ref=".$id;
1203 1203
         $result = Database::query($sql);
1204 1204
 
1205 1205
         while ($row = Database::fetch_array($result)) {
@@ -1238,8 +1238,8 @@  discard block
 block discarded – undo
1238 1238
         $announcement_id = intval($announcement_id);
1239 1239
         $course_id = api_get_course_int_id();
1240 1240
         $row = array();
1241
-        $sql = 'SELECT id, path, filename, comment FROM ' . $tbl_announcement_attachment . '
1242
-				WHERE c_id = ' . $course_id . ' AND announcement_id = ' . $announcement_id . '';
1241
+        $sql = 'SELECT id, path, filename, comment FROM '.$tbl_announcement_attachment.'
1242
+				WHERE c_id = ' . $course_id.' AND announcement_id = '.$announcement_id.'';
1243 1243
         $result = Database::query($sql);
1244 1244
         if (Database::num_rows($result) != 0) {
1245 1245
             $row = Database::fetch_array($result, 'ASSOC');
@@ -1264,9 +1264,9 @@  discard block
 block discarded – undo
1264 1264
 
1265 1265
         if (is_array($file) && $file['error'] == 0) {
1266 1266
             // TODO: This path is obsolete. The new document repository scheme should be kept in mind here.
1267
-            $courseDir = $_course['path'] . '/upload/announcements';
1267
+            $courseDir = $_course['path'].'/upload/announcements';
1268 1268
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
1269
-            $updir = $sys_course_path . $courseDir;
1269
+            $updir = $sys_course_path.$courseDir;
1270 1270
 
1271 1271
             // Try to add an extension to the file if it hasn't one
1272 1272
             $new_file_name = add_ext_on_mime(stripslashes($file['name']), $file['type']);
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
                 Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension'));
1279 1279
             } else {
1280 1280
                 $new_file_name = uniqid('');
1281
-                $new_path = $updir . '/' . $new_file_name;
1281
+                $new_path = $updir.'/'.$new_file_name;
1282 1282
                 move_uploaded_file($file['tmp_name'], $new_path);
1283 1283
 
1284 1284
                 $params = [
@@ -1319,9 +1319,9 @@  discard block
 block discarded – undo
1319 1319
 
1320 1320
         if (is_array($file) && $file['error'] == 0) {
1321 1321
             // TODO: This path is obsolete. The new document repository scheme should be kept in mind here.
1322
-            $courseDir = $_course['path'] . '/upload/announcements';
1322
+            $courseDir = $_course['path'].'/upload/announcements';
1323 1323
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
1324
-            $updir = $sys_course_path . $courseDir;
1324
+            $updir = $sys_course_path.$courseDir;
1325 1325
 
1326 1326
             // Try to add an extension to the file if it hasn't one
1327 1327
             $new_file_name = add_ext_on_mime(stripslashes($file['name']), $file['type']);
@@ -1333,13 +1333,13 @@  discard block
 block discarded – undo
1333 1333
                 Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension'));
1334 1334
             } else {
1335 1335
                 $new_file_name = uniqid('');
1336
-                $new_path = $updir . '/' . $new_file_name;
1336
+                $new_path = $updir.'/'.$new_file_name;
1337 1337
                 @move_uploaded_file($file['tmp_name'], $new_path);
1338 1338
                 $safe_file_comment = Database::escape_string($file_comment);
1339 1339
                 $safe_file_name = Database::escape_string($file_name);
1340 1340
                 $safe_new_file_name = Database::escape_string($new_file_name);
1341 1341
                 $id_attach = intval($id_attach);
1342
-                $sql = "UPDATE $tbl_announcement_attachment SET filename = '$safe_file_name', comment = '$safe_file_comment', path = '$safe_new_file_name', size ='" . intval($file['size']) . "'
1342
+                $sql = "UPDATE $tbl_announcement_attachment SET filename = '$safe_file_name', comment = '$safe_file_comment', path = '$safe_new_file_name', size ='".intval($file['size'])."'
1343 1343
 					 	WHERE c_id = $course_id AND id = '$id_attach'";
1344 1344
                 $result = Database::query($sql);
1345 1345
                 if ($result === false) {
@@ -1441,7 +1441,7 @@  discard block
 block discarded – undo
1441 1441
 
1442 1442
             //if (!empty($user_id)) {
1443 1443
             if (0) {
1444
-                if (is_array($group_memberships) && count($group_memberships) > 0 ) {
1444
+                if (is_array($group_memberships) && count($group_memberships) > 0) {
1445 1445
                     $sql = "SELECT $select
1446 1446
                             FROM $tbl_announcement announcement, $tbl_item_property ip
1447 1447
                             WHERE
@@ -1652,8 +1652,8 @@  discard block
 block discarded – undo
1652 1652
                 $attachment_list = AnnouncementManager::get_attachment($myrow['id']);
1653 1653
 
1654 1654
                 $attachment_icon = '';
1655
-                if (count($attachment_list)>0) {
1656
-                    $attachment_icon = ' '.Display::return_icon('attachment.gif',get_lang('Attachment'));
1655
+                if (count($attachment_list) > 0) {
1656
+                    $attachment_icon = ' '.Display::return_icon('attachment.gif', get_lang('Attachment'));
1657 1657
                 }
1658 1658
 
1659 1659
                 /* TITLE */
@@ -1672,16 +1672,16 @@  discard block
 block discarded – undo
1672 1672
                     || (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())
1673 1673
                 ) {
1674 1674
                     $modify_icons = "<a href=\"".$actionUrl."&action=modify&id=".$myrow['id']."\">".
1675
-                        Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL)."</a>";
1676
-                    if ($myrow['visibility']==1) {
1677
-                        $image_visibility="visible";
1678
-                        $alt_visibility=get_lang('Hide');
1675
+                        Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>";
1676
+                    if ($myrow['visibility'] == 1) {
1677
+                        $image_visibility = "visible";
1678
+                        $alt_visibility = get_lang('Hide');
1679 1679
                     } else {
1680
-                        $image_visibility="invisible";
1681
-                        $alt_visibility=get_lang('Visible');
1680
+                        $image_visibility = "invisible";
1681
+                        $alt_visibility = get_lang('Visible');
1682 1682
                     }
1683
-                    $modify_icons .=  "<a href=\"".$actionUrl."&origin=".$origin."&action=showhide&id=".$myrow['id']."&sec_token=".$stok."\">".
1684
-                        Display::return_icon($image_visibility.'.png', $alt_visibility,'',ICON_SIZE_SMALL)."</a>";
1683
+                    $modify_icons .= "<a href=\"".$actionUrl."&origin=".$origin."&action=showhide&id=".$myrow['id']."&sec_token=".$stok."\">".
1684
+                        Display::return_icon($image_visibility.'.png', $alt_visibility, '', ICON_SIZE_SMALL)."</a>";
1685 1685
 
1686 1686
                     // DISPLAY MOVE UP COMMAND only if it is not the top announcement
1687 1687
                     if ($iterator != 1) {
@@ -1696,12 +1696,12 @@  discard block
 block discarded – undo
1696 1696
                     } else {
1697 1697
                         $modify_icons .= Display::return_icon('down_na.gif', get_lang('Down'));
1698 1698
                     }
1699
-                    if (api_is_allowed_to_edit(false,true)) {
1700
-                        $modify_icons .= "<a href=\"".$actionUrl."&action=delete&id=".$myrow['id']."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,api_get_system_encoding()))."')) return false;\">".
1701
-                            Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).
1699
+                    if (api_is_allowed_to_edit(false, true)) {
1700
+                        $modify_icons .= "<a href=\"".$actionUrl."&action=delete&id=".$myrow['id']."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, api_get_system_encoding()))."')) return false;\">".
1701
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).
1702 1702
                             "</a>";
1703 1703
                     }
1704
-                    $iterator ++;
1704
+                    $iterator++;
1705 1705
                 } else {
1706 1706
                     $modify_icons = Display::url(
1707 1707
                         Display::return_icon('default.png'),
@@ -1731,7 +1731,7 @@  discard block
 block discarded – undo
1731 1731
     public static function getNumberAnnouncements()
1732 1732
     {
1733 1733
         // Maximum title messages to display
1734
-        $maximum 	= '12';
1734
+        $maximum = '12';
1735 1735
         // Database Table Definitions
1736 1736
         $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
1737 1737
         $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
@@ -1742,7 +1742,7 @@  discard block
 block discarded – undo
1742 1742
         $userId = api_get_user_id();
1743 1743
         $condition_session = api_get_session_condition($session_id, true, true, 'announcement.session_id');
1744 1744
 
1745
-        if (api_is_allowed_to_edit(false,true))  {
1745
+        if (api_is_allowed_to_edit(false, true)) {
1746 1746
             // check teacher status
1747 1747
             if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') {
1748 1748
 
@@ -1805,7 +1805,7 @@  discard block
 block discarded – undo
1805 1805
                 }
1806 1806
 
1807 1807
                 // the user is member of several groups => display personal announcements AND his group announcements AND the general announcements
1808
-                if (is_array($group_memberships) && count($group_memberships)>0) {
1808
+                if (is_array($group_memberships) && count($group_memberships) > 0) {
1809 1809
                     $sql = "SELECT announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id
1810 1810
                     FROM $tbl_announcement announcement, $tbl_item_property ip
1811 1811
                     WHERE
@@ -1855,7 +1855,7 @@  discard block
 block discarded – undo
1855 1855
                         }
1856 1856
 
1857 1857
                         // the user is not identiefied => show only the general announcements
1858
-                        $sql="SELECT announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id
1858
+                        $sql = "SELECT announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id
1859 1859
                                 FROM $tbl_announcement announcement, $tbl_item_property ip
1860 1860
                                 WHERE
1861 1861
                                     announcement.c_id = $course_id AND
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/blog/blog_admin.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 require_once '../inc/global.inc.php';
11
-$current_course_tool  = TOOL_BLOGS;
11
+$current_course_tool = TOOL_BLOGS;
12 12
 
13 13
 $this_section = SECTION_COURSES;
14 14
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 //	 ONLY USERS REGISTERED IN THE COURSE
22 22
 if ((!$is_allowed_in_course || !$is_courseMember) && !api_is_allowed_to_edit()) {
23
-    api_not_allowed(true);//print headers/footers
23
+    api_not_allowed(true); //print headers/footers
24 24
 }
25 25
 
26 26
 if (api_is_allowed_to_edit()) {
@@ -30,30 +30,30 @@  discard block
 block discarded – undo
30 30
     // the learning path, we do not include the banner so we have to explicitly
31 31
     // include the stylesheet, which is normally done in the header
32 32
     if (empty($_GET['origin']) || $_GET['origin'] != 'learnpath') {
33
-        $interbreadcrumb[]= array ('url' => 'blog_admin.php?','name' => $nameTools);
34
-        $my_url='';
35
-        if (isset($_GET['action']) && $_GET['action']=='add') {
33
+        $interbreadcrumb[] = array('url' => 'blog_admin.php?', 'name' => $nameTools);
34
+        $my_url = '';
35
+        if (isset($_GET['action']) && $_GET['action'] == 'add') {
36 36
             $current_section = get_lang('AddBlog');
37
-            $my_url='action=add';
38
-        } elseif (isset($_GET['action']) && $_GET['action']=='edit') {
37
+            $my_url = 'action=add';
38
+        } elseif (isset($_GET['action']) && $_GET['action'] == 'edit') {
39 39
             $current_section = get_lang('EditBlog');
40
-            $my_url='action=edit&amp;blog_id='.Security::remove_XSS($_GET['blog_id']);
40
+            $my_url = 'action=edit&amp;blog_id='.Security::remove_XSS($_GET['blog_id']);
41 41
         }
42 42
         Display::display_header('');
43 43
     }
44 44
     echo '<div class="actions">';
45 45
     echo "<a href='".api_get_self()."?".api_get_cidreq()."&action=add'>",
46
-        Display::return_icon('new_blog.png', get_lang('AddBlog'),'',ICON_SIZE_MEDIUM)."</a>";
46
+        Display::return_icon('new_blog.png', get_lang('AddBlog'), '', ICON_SIZE_MEDIUM)."</a>";
47 47
     echo '</div>';
48 48
 
49 49
     if (!empty($_POST['new_blog_submit']) && !empty($_POST['blog_name'])) {
50
-        if (isset($_POST['blog_name']))  {
50
+        if (isset($_POST['blog_name'])) {
51 51
             Blog::create_blog($_POST['blog_name'], $_POST['blog_subtitle']);
52 52
             Display::display_confirmation_message(get_lang('BlogStored'));
53 53
         }
54 54
     }
55 55
     if (!empty($_POST['edit_blog_submit']) && !empty($_POST['blog_name'])) {
56
-        if (strlen(trim($_POST['blog_name']))>0) {
56
+        if (strlen(trim($_POST['blog_name'])) > 0) {
57 57
             Blog::edit_blog($_POST['blog_id'], $_POST['blog_name'], $_POST['blog_subtitle']);
58 58
             Display::display_confirmation_message(get_lang('BlogEdited'));
59 59
         }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         // we show the form if
86 86
         // 1. no post data
87 87
         // 2. there is post data and one of the three form elements is empty
88
-        if (!$_POST || (!empty($_POST) && (empty($_POST['edit_blog_submit']) || empty($_POST['blog_name']) ))) {
88
+        if (!$_POST || (!empty($_POST) && (empty($_POST['edit_blog_submit']) || empty($_POST['blog_name'])))) {
89 89
             // if there is post data there is certainly an error in the form
90 90
             if ($_POST) {
91 91
                 Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'));
Please login to merge, or discard this patch.
main/gradebook/gradebook_add_cat.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 require_once '../inc/global.inc.php';
9 9
 $_in_course = true;
10 10
 $course_code = api_get_course_id();
11
-if (empty($course_code )) {
11
+if (empty($course_code)) {
12 12
     $_in_course = false;
13 13
 }
14 14
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 $my_user_id = api_get_user_id();
24 24
 $catadd->set_user_id($my_user_id);
25 25
 $catadd->set_parent_id($get_select_cat);
26
-$catcourse = Category :: load ($get_select_cat);
26
+$catcourse = Category :: load($get_select_cat);
27 27
 
28 28
 if ($_in_course) {
29 29
     $catadd->set_course_code($course_code);
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
     $catadd,
38 38
     'add_cat_form',
39 39
     null,
40
-    api_get_self() . '?selectcat='.$get_select_cat.'&'.api_get_cidreq()
40
+    api_get_self().'?selectcat='.$get_select_cat.'&'.api_get_cidreq()
41 41
 );
42 42
 
43 43
 if ($form->validate()) {
44 44
     $values = $form->exportValues();
45
-    $select_course=isset($values['select_course']) ? $values['select_course'] : array();
45
+    $select_course = isset($values['select_course']) ? $values['select_course'] : array();
46 46
     $cat = new Category();
47 47
     if ($values['hid_parent_id'] == '0') {
48 48
         if ($select_course == 'COURSEINDEPENDENT') {
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
     }
90 90
     $cat->set_visible($visible);
91 91
     $result = $cat->add();
92
-    header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?addcat=&selectcat=' . $cat->get_parent_id().'&'.api_get_cidreq());
92
+    header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?addcat=&selectcat='.$cat->get_parent_id().'&'.api_get_cidreq());
93 93
     exit;
94 94
 }
95 95
 
96 96
 if (!$_in_course) {
97
-    $interbreadcrumb[] = array (
97
+    $interbreadcrumb[] = array(
98 98
         'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$get_select_cat.'&'.api_get_cidreq(),
99 99
         'name' => get_lang('Gradebook')
100 100
     );
Please login to merge, or discard this patch.