Completed
Pull Request — 1.11.x (#1293)
by José
387:57 queued 349:55
created
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.
main/gradebook/gradebook_view_result.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $resultedit[0],
63 63
         'edit_result_form',
64 64
         null,
65
-        api_get_self() . '?editres=' . $resultedit[0]->get_id() . '&selecteval=' . $select_eval.'&'.api_get_cidreq()
65
+        api_get_self().'?editres='.$resultedit[0]->get_id().'&selecteval='.$select_eval.'&'.api_get_cidreq()
66 66
     );
67 67
 
68 68
     if ($edit_res_form->validate()) {
@@ -79,21 +79,21 @@  discard block
 block discarded – undo
79 79
         }
80 80
         $result->save();
81 81
         unset($result);
82
-        header('Location: gradebook_view_result.php?selecteval=' . $select_eval . '&editresmessage=&'.api_get_cidreq());
82
+        header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&editresmessage=&'.api_get_cidreq());
83 83
         exit;
84 84
     }
85 85
 }
86 86
 $file_type = null;
87 87
 if (isset($_GET['import'])) {
88 88
     $interbreadcrumb[] = array(
89
-        'url' => api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?selecteval=' . $select_eval.'&'.api_get_cidreq(),
89
+        'url' => api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?selecteval='.$select_eval.'&'.api_get_cidreq(),
90 90
         'name' => get_lang('ViewResult')
91 91
     );
92 92
     $import_result_form = new DataForm(
93 93
         DataForm :: TYPE_IMPORT,
94 94
         'import_result_form',
95 95
         null,
96
-        api_get_self() . '?import=&selecteval=' . $select_eval,
96
+        api_get_self().'?import=&selecteval='.$select_eval,
97 97
         '_blank',
98 98
         ''
99 99
     );
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                     if (($importedresult['user_id'] == $allresult->get_user_id())) {
123 123
                         if ($importedresult['score'] != $allresult->get_score()) {
124 124
                             if (!isset($values['overwrite'])) {
125
-                                header('Location: '.api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?selecteval=' . $select_eval . '&import_score_error=' . $importedresult['user_id']);
125
+                                header('Location: '.api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?selecteval='.$select_eval.'&import_score_error='.$importedresult['user_id']);
126 126
                                 exit;
127 127
                                 break;
128 128
                             } else {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                     }
141 141
                 }
142 142
                 if ($importedresult['user_id'] == null) {
143
-                    header('Location: gradebook_view_result.php?selecteval=' . $select_eval . '&incorrectdata=');
143
+                    header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&incorrectdata=');
144 144
                     exit;
145 145
                 }
146 146
                 $userinfo = api_get_user_info($importedresult['user_id']);
@@ -149,13 +149,13 @@  discard block
 block discarded – undo
149 149
                     $userinfo['official_code'] != $importedresult['official_code']
150 150
                 ) {
151 151
                     if (!isset($values['ignoreerrors'])) {
152
-                        header('Location: gradebook_view_result.php?selecteval=' . $select_eval . '&import_user_error=' . $importedresult['user_id']);
152
+                        header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&import_user_error='.$importedresult['user_id']);
153 153
                         exit;
154 154
                     }
155 155
                 }
156 156
                 if ($added != '1') {
157 157
                     if ($importedresult['score'] > $eval[0]->get_max()) {
158
-                        header('Location: gradebook_view_result.php?selecteval=' . $select_eval . '&overwritemax=');
158
+                        header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&overwritemax=');
159 159
                         exit;
160 160
                     }
161 161
                     $result = new Result();
@@ -174,18 +174,18 @@  discard block
 block discarded – undo
174 174
                 }
175 175
             }
176 176
         } else {
177
-            header('Location: ' . api_get_self() . '?import=&selecteval=' . $select_eval . '&importnofile=');
177
+            header('Location: '.api_get_self().'?import=&selecteval='.$select_eval.'&importnofile=');
178 178
             exit;
179 179
         }
180 180
         if ($overwritescore != 0) {
181
-            header('Location: ' . api_get_self() . '?selecteval=' . $select_eval. '&importoverwritescore=' . $overwritescore);
181
+            header('Location: '.api_get_self().'?selecteval='.$select_eval.'&importoverwritescore='.$overwritescore);
182 182
             exit;
183 183
         }
184 184
         if ($nr_results_added == 0) {
185
-            header('Location: ' . api_get_self() . '?selecteval=' . $select_eval. '&nothingadded=');
185
+            header('Location: '.api_get_self().'?selecteval='.$select_eval.'&nothingadded=');
186 186
             exit;
187 187
         }
188
-        header('Location: ' . api_get_self() . '?selecteval=' . $select_eval . '&importok=');
188
+        header('Location: '.api_get_self().'?selecteval='.$select_eval.'&importok=');
189 189
         exit;
190 190
     }
191 191
 }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         DataForm :: TYPE_EXPORT,
201 201
         'export_result_form',
202 202
         null,
203
-        api_get_self() . '?export=&selecteval=' . $select_eval,
203
+        api_get_self().'?export=&selecteval='.$select_eval,
204 204
         '_blank',
205 205
         $locked_status
206 206
     );
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     if ($export_result_form->validate()) {
212 212
         $export = $export_result_form->exportValues();
213 213
         $file_type = $export['file_type'];
214
-        $filename = 'export_results_' . gmdate('Y-m-d_H-i-s');
214
+        $filename = 'export_results_'.gmdate('Y-m-d_H-i-s');
215 215
         $results = Result :: load(null, null, $select_eval);
216 216
         $data = array(); //when file type is csv, add a header to the output file
217 217
         if ($file_type == 'csv') {
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
             $datagen = new ResultsDataGenerator($eval[0], $allresults);
232 232
 
233 233
             // set headers pdf
234
-            !empty($_user['official_code']) ? $officialcode = $_user['official_code'] . ' - ' : '';
234
+            !empty($_user['official_code']) ? $officialcode = $_user['official_code'].' - ' : '';
235 235
 
236
-            $h1 = array(get_lang('Teacher'), $officialcode . $_user['firstName'] . ', ' . $_user['lastName']);
236
+            $h1 = array(get_lang('Teacher'), $officialcode.$_user['firstName'].', '.$_user['lastName']);
237 237
             $h2 = array(get_lang('Score'), $eval[0]->get_max());
238 238
             $h3 = array(get_lang('Course'), $_course['name']);
239 239
             $h4 = array(get_lang('Weight'), $eval[0]->get_weight());
@@ -243,9 +243,9 @@  discard block
 block discarded – undo
243 243
             $header_pdf = array($h1, $h2, $h3, $h4, $h5, $h6);
244 244
 
245 245
             // set footer pdf
246
-            $f1 = '<hr />' . get_lang('Drh');
247
-            $f2 = '<hr />' . get_lang('Teacher');
248
-            $f3 = '<hr />' . get_lang('Date');
246
+            $f1 = '<hr />'.get_lang('Drh');
247
+            $f2 = '<hr />'.get_lang('Teacher');
248
+            $f3 = '<hr />'.get_lang('Date');
249 249
             $footer_pdf = array($f1, $f2, $f3);
250 250
 
251 251
             // set title pdf
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
             // set headers data table
255 255
             $head_ape_name = '';
256 256
             if (api_is_western_name_order()) {
257
-                $head_ape_name = get_lang('FirstName') . ', ' . get_lang('LastName');
257
+                $head_ape_name = get_lang('FirstName').', '.get_lang('LastName');
258 258
             } else {
259
-                $head_ape_name = get_lang('LastName') . ', ' . get_lang('FirstName');
259
+                $head_ape_name = get_lang('LastName').', '.get_lang('FirstName');
260 260
             }
261 261
 
262 262
             $head_table = array(
@@ -291,15 +291,15 @@  discard block
 block discarded – undo
291 291
                 $result[] = $user_info['username'];
292 292
 
293 293
                 if (api_is_western_name_order()) {
294
-                    $result[] = $user_info['firstname'] . ', ' . $user_info['lastname'];
294
+                    $result[] = $user_info['firstname'].', '.$user_info['lastname'];
295 295
                 } else {
296
-                    $result[] = $user_info['lastname'] . ', ' . $user_info['firstname'];
296
+                    $result[] = $user_info['lastname'].', '.$user_info['firstname'];
297 297
                 }
298 298
                 if ($number_decimals == null) {
299 299
                     if (empty($data['scoreletter']) && !is_numeric($data['score'])) {
300 300
                         $result[] = get_lang('DidNotTakeTheExam');
301 301
                     } else {
302
-                        $result[] = api_strtoupper(get_lang('Literal' . $data['scoreletter']));
302
+                        $result[] = api_strtoupper(get_lang('Literal'.$data['scoreletter']));
303 303
                     }
304 304
                 } else {
305 305
                     if (empty($data['score']) && !is_numeric($data['score'])) {
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 if (isset($_GET['resultdelete'])) {
351 351
     $result = Result :: load($_GET['resultdelete']);
352 352
     $result[0]->delete();
353
-    header('Location: gradebook_view_result.php?deleteresult=&selecteval=' . $select_eval);
353
+    header('Location: gradebook_view_result.php?deleteresult=&selecteval='.$select_eval);
354 354
     exit;
355 355
 }
356 356
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                     $result[0]->delete();
368 368
                     $number_of_deleted_results++;
369 369
                 }
370
-                header('Location: gradebook_view_result.php?massdelete=&selecteval=' . $select_eval);
370
+                header('Location: gradebook_view_result.php?massdelete=&selecteval='.$select_eval);
371 371
                 exit;
372 372
                 break;
373 373
         }
@@ -408,14 +408,14 @@  discard block
 block discarded – undo
408 408
 
409 409
 $htmlHeadXtra[] = '<script>
410 410
 function confirmationuser() {
411
-    if (confirm("' . get_lang('DeleteUser') . '?"))
411
+    if (confirm("' . get_lang('DeleteUser').'?"))
412 412
     	{return true;}
413 413
     else
414 414
     	{return false;}
415 415
 }
416 416
 
417 417
 function confirmationall () {
418
-    if (confirm("' . get_lang('DeleteAll') . '?"))
418
+    if (confirm("' . get_lang('DeleteAll').'?"))
419 419
     	{return true;}
420 420
     else
421 421
     	{return false;}
@@ -423,13 +423,13 @@  discard block
 block discarded – undo
423 423
 </script>';
424 424
 if (isset($_GET['deleteall'])) {
425 425
     $eval[0]->delete_results();
426
-    header('Location: '.api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?allresdeleted=&selecteval=' . $select_eval.'&'.api_get_cidreq());
426
+    header('Location: '.api_get_path(WEB_CODE_PATH).'gradebook/gradebook_view_result.php?allresdeleted=&selecteval='.$select_eval.'&'.api_get_cidreq());
427 427
     exit;
428 428
 }
429 429
 if (!isset($_GET['export']) && (!isset($_GET['import']))) {
430 430
     if (!isset($_GET['selectcat'])) {
431 431
         $interbreadcrumb[] = array(
432
-            'url' => $_SESSION['gradebook_dest'] . '?selectcat=' . $currentcat[0]->get_id().'&'.api_get_cidreq(),
432
+            'url' => $_SESSION['gradebook_dest'].'?selectcat='.$currentcat[0]->get_id().'&'.api_get_cidreq(),
433 433
             'name' => get_lang('Details')
434 434
         );
435 435
     }
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
     Display :: display_warning_message(get_lang('OverWriteMax'), false);
485 485
 }
486 486
 if (isset($_GET['importoverwritescore'])) {
487
-    Display :: display_confirmation_message(get_lang('ImportOverWriteScore') . ' ' . $_GET['importoverwritescore']);
487
+    Display :: display_confirmation_message(get_lang('ImportOverWriteScore').' '.$_GET['importoverwritescore']);
488 488
 }
489 489
 if (isset($_GET['import_user_error'])) {
490 490
     $userinfo = api_get_user_info($_GET['import_user_error']);
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 }
498 498
 if (isset($_GET['import_score_error'])) {
499 499
     $userinfo = api_get_user_info($_GET['import_score_error']);
500
-    Display :: display_warning_message(get_lang('ScoreDoesNotMatch') . ' ' . api_get_person_name($userinfo['firstname'], $userinfo['lastname']));
500
+    Display :: display_warning_message(get_lang('ScoreDoesNotMatch').' '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']));
501 501
 }
502 502
 if ($file_type == null) {
503 503
     //show the result header
Please login to merge, or discard this patch.
main/gradebook/lib/fe/exportgradebook.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  * @param	string	View to print as a title for the table
13 13
  * @param	string	Course name to print as title for the table
14 14
  */
15
-function print_table($data_array,$header_names,$view,$coursename)
15
+function print_table($data_array, $header_names, $view, $coursename)
16 16
 {
17 17
 	$printdata = '<!DOCTYPE html
18 18
      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
 	$count_pages = ceil(count($data_table) / $items_per_page);
162 162
     $content_table = '';
163
-    for ($x = 0; $x<$count_pages; $x++) {
163
+    for ($x = 0; $x < $count_pages; $x++) {
164 164
         $content_table .= '<table width="100%" border="1" style="border-collapse:collapse">';
165 165
         // header table
166 166
         $content_table .= '<tr>';
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
             foreach ($headers_table as $head_table) {
171 171
                 if (!empty($head_table[0])) {
172
-                    $width = (!empty($head_table[1])?$head_table[1].'%':'');
172
+                    $width = (!empty($head_table[1]) ? $head_table[1].'%' : '');
173 173
                     $content_table .= '<th width="'.$width.'">'.$head_table[0].'</th>';
174 174
                     $i++;
175 175
                 }
@@ -178,16 +178,16 @@  discard block
 block discarded – undo
178 178
         $content_table .= '</tr>';
179 179
         // body table
180 180
         if (is_array($data_table) && count($data_table) > 0) {
181
-            $offset = $x*$items_per_page;
182
-            $data_table = array_slice ($data_table, $offset, count($data_table));
181
+            $offset = $x * $items_per_page;
182
+            $data_table = array_slice($data_table, $offset, count($data_table));
183 183
             $i = 1;
184
-            $item = $offset+1;
184
+            $item = $offset + 1;
185 185
             foreach ($data_table as $data) {
186 186
                 $content_table .= '<tr>';
187
-                $content_table .= '<td>'.($item<10?'0'.$item:$item).'</td>';
187
+                $content_table .= '<td>'.($item < 10 ? '0'.$item : $item).'</td>';
188 188
                 foreach ($data as  $key => $content) {
189 189
                     if (isset($content)) {
190
-                        $key == 1 ? $align='align="left"':$align='align="center"';
190
+                        $key == 1 ? $align = 'align="left"' : $align = 'align="center"';
191 191
                         $content_table .= '<td '.$align.' style="padding:4px;" >'.$content.'</td>';
192 192
                     }
193 193
                 }
@@ -240,10 +240,10 @@  discard block
 block discarded – undo
240 240
                             <h1>'.$title_pdf.'</h1></td></tr>';
241 241
         foreach ($headers_pdf as $header_pdf) {
242 242
             if (!empty($header_pdf[0]) && !empty($header_pdf[1])) {
243
-                $header.= '<tr><td><strong>'.$header_pdf[0].'</strong> </td><td>'.$header_pdf[1].'</td></tr>';
243
+                $header .= '<tr><td><strong>'.$header_pdf[0].'</strong> </td><td>'.$header_pdf[1].'</td></tr>';
244 244
             }
245 245
         }
246
-        $header.='</table><br />';
246
+        $header .= '</table><br />';
247 247
     }
248 248
 
249 249
     // preparing footer pdf
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
     }
268 268
     $items_per_page = 30;
269 269
     $count_pages = ceil(count($data_table) / $items_per_page);
270
-    for ($x = 0; $x<$count_pages; $x++) {
270
+    for ($x = 0; $x < $count_pages; $x++) {
271 271
         $content_table .= '<table width="100%" border="1" style="border-collapse:collapse">';
272 272
         // header table
273 273
         $content_table .= '<tr>';
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         if (is_array($headers_table)) {
276 276
             foreach ($headers_table as $head_table) {
277 277
                 if (!empty($head_table[0])) {
278
-                    $width = (!empty($head_table[1])?$head_table[1].'%':'');
278
+                    $width = (!empty($head_table[1]) ? $head_table[1].'%' : '');
279 279
                     $content_table .= '<th width="'.$width.'">'.$head_table[0].'</th>';
280 280
                     $i++;
281 281
                 }
@@ -285,16 +285,16 @@  discard block
 block discarded – undo
285 285
         // body table
286 286
 
287 287
         if (is_array($data_table) && count($data_table) > 0) {
288
-            $offset = $x*$items_per_page;
289
-            $data_table = array_slice ($data_table, $offset, count($data_table));
288
+            $offset = $x * $items_per_page;
289
+            $data_table = array_slice($data_table, $offset, count($data_table));
290 290
             $i = 1;
291
-            $item = $offset+1;
291
+            $item = $offset + 1;
292 292
             foreach ($data_table as $data) {
293 293
                 $content_table .= '<tr>';
294
-                $content_table .= '<td>'.($item<10?'0'.$item:$item).'</td>';
294
+                $content_table .= '<td>'.($item < 10 ? '0'.$item : $item).'</td>';
295 295
                 foreach ($data as  $key => $content) {
296 296
                     if (isset($content)) {
297
-                        $key == 1 ? $align='align="left"':$align='align="center"';
297
+                        $key == 1 ? $align = 'align="left"' : $align = 'align="center"';
298 298
                         $content_table .= '<td '.$align.' style="padding:4px;" >'.$content.'</td>';
299 299
                     }
300 300
                 }
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
     $pdf = new PDF();
313 313
     $pdf->set_custom_footer($footer);
314 314
     $pdf->set_custom_header($headers_in_pdf);
315
-    $pdf->content_to_pdf($header.$content_table, $css, $title_pdf );
315
+    $pdf->content_to_pdf($header.$content_table, $css, $title_pdf);
316 316
     exit;
317 317
 
318 318
 }
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
 function export_pdf($pdf, $newarray, $header_names, $format)
328 328
 {
329 329
 	$pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm');
330
-	$pdf->ezSetCmMargins(0,0,0,0);
331
-	$pdf->ezSetY(($format=='portrait')?'820':'570');
330
+	$pdf->ezSetCmMargins(0, 0, 0, 0);
331
+	$pdf->ezSetY(($format == 'portrait') ? '820' : '570');
332 332
 	$pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm');
333 333
     if ($format == 'portrait') {
334 334
         $pdf->line(40, 790, 540, 790);
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
         $pdf->line(40, 540, 790, 540);
338 338
         $pdf->line(40, 40, 790, 40);
339 339
     }
340
-    $pdf->ezSetY(($format=='portrait')?'750':'520');
340
+    $pdf->ezSetY(($format == 'portrait') ? '750' : '520');
341 341
     $pdf->ezTable($newarray, $header_names, '', array(
342 342
         'showHeadings' => 1,
343 343
         'shaded' => 1,
Please login to merge, or discard this patch.
main/session/session_user_edit.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 }
29 29
 
30 30
 
31
-$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
31
+$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
32 32
 $interbreadcrumb[] = array(
33 33
     'url' => "resume_session.php?id_session=".$sessionId,
34 34
     "name" => get_lang('SessionOverview')
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     if ($days > 0) {
61 61
         $msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateInZDays'), $firstAccessString, $duration, $days);
62 62
     } else {
63
-        $endDateInSeconds = $firstAccess + $duration * 24*60*60;
63
+        $endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60;
64 64
         $last = api_convert_and_format_date($endDateInSeconds, DATE_FORMAT_SHORT);
65 65
         $msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateWasZ'), $firstAccessString, $duration, $last);
66 66
     }
Please login to merge, or discard this patch.