@@ -11,26 +11,26 @@ |
||
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 | } |
@@ -20,32 +20,32 @@ discard block |
||
20 | 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). |
|
24 | - '</a>'; |
|
23 | + Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM). |
|
24 | + '</a>'; |
|
25 | 25 | ksort($categories); |
26 | 26 | foreach ($categories as $id => $title) { |
27 | - if ($i == ADD_BLOCK) { |
|
28 | - echo '<a href="index.php?'.api_get_cidreq().'&action=add">'. |
|
29 | - Display::return_icon($default_description_icon[$id], $title, '',ICON_SIZE_MEDIUM).'</a>'; |
|
30 | - break; |
|
31 | - } else { |
|
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>'; |
|
34 | - $i++; |
|
35 | - } |
|
27 | + if ($i == ADD_BLOCK) { |
|
28 | + echo '<a href="index.php?'.api_get_cidreq().'&action=add">'. |
|
29 | + Display::return_icon($default_description_icon[$id], $title, '',ICON_SIZE_MEDIUM).'</a>'; |
|
30 | + break; |
|
31 | + } else { |
|
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>'; |
|
34 | + $i++; |
|
35 | + } |
|
36 | 36 | } |
37 | 37 | echo '</div>'; |
38 | 38 | |
39 | 39 | // error messages |
40 | 40 | if (isset($error) && intval($error) == 1) { |
41 | - Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); |
|
41 | + Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | // default header title form |
45 | 45 | $header = ''; |
46 | 46 | $description_type = intval($description_type); |
47 | 47 | if ($description_type >= ADD_BLOCK) { |
48 | - $header = $default_description_titles[ADD_BLOCK]; |
|
48 | + $header = $default_description_titles[ADD_BLOCK]; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | // display form |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | |
74 | 74 | // display default questions |
75 | 75 | if (isset ($question[$description_type])) { |
76 | - $message = '<strong>'.get_lang('QuestionPlan').'</strong><br />'; |
|
77 | - $message .= $question[$description_type]; |
|
78 | - Display::display_normal_message($message, false); |
|
76 | + $message = '<strong>'.get_lang('QuestionPlan').'</strong><br />'; |
|
77 | + $message .= $question[$description_type]; |
|
78 | + Display::display_normal_message($message, false); |
|
79 | 79 | } |
80 | 80 | $form->display(); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | chdir($cwdir); |
16 | 16 | |
17 | 17 | if (api_get_setting('search.search_enabled') == 'true') { |
18 | - require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'; |
|
18 | + require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
19 | 19 | $specific_fields = get_specific_field_list(); |
20 | 20 | |
21 | 21 | foreach ($specific_fields as $specific_field) { |
@@ -35,7 +35,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 = " <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 = " <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 = " <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 |
||
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 = " <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 = " <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 = " <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 = " <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 |
||
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 | - " . $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 | + " . $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> " . $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> ".$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> " . $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> ".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language; |
|
329 | 329 | } |
330 | 330 | } |
331 | 331 | $language_data[] = $row_td; |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $reports_template['exercicesMultiCourses'] = array( |
4 | - 'description' => 'Result of each test per student', |
|
5 | - 'getSQL' => 'reports_template_exercicesMultiCourses_getSQL', |
|
6 | - 'wizard' => |
|
4 | + 'description' => 'Result of each test per student', |
|
5 | + 'getSQL' => 'reports_template_exercicesMultiCourses_getSQL', |
|
6 | + 'wizard' => |
|
7 | 7 | ' |
8 | 8 | <span id="exercicesMultiCourses" class="step"> |
9 | 9 | <span class="font_normal_07em_black">Result of each test per student</span><br /> |
@@ -32,39 +32,39 @@ discard block |
||
32 | 32 | '); |
33 | 33 | |
34 | 34 | function reports_template_exercicesMultiCourses_getSQL() { |
35 | - // foreach quiz |
|
36 | - $result = array(); |
|
37 | - $columns = Database::query('select r.id as kid, c.title as course, '. |
|
38 | - 'r.child_name as test from '. |
|
39 | - Database::get_main_table(TABLE_MAIN_REPORTS_KEYS).' r, '. |
|
40 | - Database::get_main_table(TABLE_MAIN_COURSE).' c '. |
|
41 | - 'where r.course_id=c.id and r.tool_id='. |
|
42 | - reports_getToolId(TOOL_QUIZ). |
|
43 | - ' order by r.course_id, r.child_name'); |
|
44 | - if (Database::num_rows($columns) == 0) |
|
45 | - die('<b>'.get_lang('no data found').'</b>'); |
|
46 | - $query = 'select u.lastname Name, u.firstname Firstname'; |
|
47 | - $columns = Database::store_result($columns); |
|
48 | - if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max') |
|
49 | - $function = $_REQUEST['tattempt']; |
|
50 | - else |
|
51 | - $function = 'avg'; |
|
52 | - foreach ($columns as $key => $column) |
|
53 | - $query .= ', '.$function.'(k'.$key.'.score) as `'. |
|
54 | - $column['course'].' - '. |
|
55 | - $column['test'].'` '; |
|
56 | - $query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
|
57 | - foreach ($columns as $key => $column) // fixme sessions |
|
58 | - $query .= 'left outer join '. |
|
59 | - Database::get_main_table(TABLE_MAIN_REPORTS_VALUES). |
|
60 | - ' k'.$key. |
|
61 | - ' on k'.$key.'.key_id = '.$column['kid']. |
|
62 | - ' and k'.$key.'.user_id = u.user_id '; |
|
63 | - $query .= ' group by '; |
|
64 | - foreach ($columns as $key => $column) // grouping attempt |
|
65 | - $query .= 'k'.$key.'.attempt, '; |
|
66 | - $query = substr($query, 0, -2); // removing last ', '; |
|
35 | + // foreach quiz |
|
36 | + $result = array(); |
|
37 | + $columns = Database::query('select r.id as kid, c.title as course, '. |
|
38 | + 'r.child_name as test from '. |
|
39 | + Database::get_main_table(TABLE_MAIN_REPORTS_KEYS).' r, '. |
|
40 | + Database::get_main_table(TABLE_MAIN_COURSE).' c '. |
|
41 | + 'where r.course_id=c.id and r.tool_id='. |
|
42 | + reports_getToolId(TOOL_QUIZ). |
|
43 | + ' order by r.course_id, r.child_name'); |
|
44 | + if (Database::num_rows($columns) == 0) |
|
45 | + die('<b>'.get_lang('no data found').'</b>'); |
|
46 | + $query = 'select u.lastname Name, u.firstname Firstname'; |
|
47 | + $columns = Database::store_result($columns); |
|
48 | + if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max') |
|
49 | + $function = $_REQUEST['tattempt']; |
|
50 | + else |
|
51 | + $function = 'avg'; |
|
52 | + foreach ($columns as $key => $column) |
|
53 | + $query .= ', '.$function.'(k'.$key.'.score) as `'. |
|
54 | + $column['course'].' - '. |
|
55 | + $column['test'].'` '; |
|
56 | + $query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
|
57 | + foreach ($columns as $key => $column) // fixme sessions |
|
58 | + $query .= 'left outer join '. |
|
59 | + Database::get_main_table(TABLE_MAIN_REPORTS_VALUES). |
|
60 | + ' k'.$key. |
|
61 | + ' on k'.$key.'.key_id = '.$column['kid']. |
|
62 | + ' and k'.$key.'.user_id = u.user_id '; |
|
63 | + $query .= ' group by '; |
|
64 | + foreach ($columns as $key => $column) // grouping attempt |
|
65 | + $query .= 'k'.$key.'.attempt, '; |
|
66 | + $query = substr($query, 0, -2); // removing last ', '; |
|
67 | 67 | |
68 | 68 | |
69 | - return $query; |
|
69 | + return $query; |
|
70 | 70 | } |
@@ -41,28 +41,35 @@ |
||
41 | 41 | 'where r.course_id=c.id and r.tool_id='. |
42 | 42 | reports_getToolId(TOOL_QUIZ). |
43 | 43 | ' order by r.course_id, r.child_name'); |
44 | - if (Database::num_rows($columns) == 0) |
|
45 | - die('<b>'.get_lang('no data found').'</b>'); |
|
44 | + if (Database::num_rows($columns) == 0) { |
|
45 | + die('<b>'.get_lang('no data found').'</b>'); |
|
46 | + } |
|
46 | 47 | $query = 'select u.lastname Name, u.firstname Firstname'; |
47 | 48 | $columns = Database::store_result($columns); |
48 | - if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max') |
|
49 | - $function = $_REQUEST['tattempt']; |
|
50 | - else |
|
51 | - $function = 'avg'; |
|
52 | - foreach ($columns as $key => $column) |
|
53 | - $query .= ', '.$function.'(k'.$key.'.score) as `'. |
|
49 | + if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max') { |
|
50 | + $function = $_REQUEST['tattempt']; |
|
51 | + } else { |
|
52 | + $function = 'avg'; |
|
53 | + } |
|
54 | + foreach ($columns as $key => $column) { |
|
55 | + $query .= ', '.$function.'(k'.$key.'.score) as `'. |
|
54 | 56 | $column['course'].' - '. |
55 | 57 | $column['test'].'` '; |
58 | + } |
|
56 | 59 | $query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
57 | - foreach ($columns as $key => $column) // fixme sessions |
|
60 | + foreach ($columns as $key => $column) { |
|
61 | + // fixme sessions |
|
58 | 62 | $query .= 'left outer join '. |
59 | 63 | Database::get_main_table(TABLE_MAIN_REPORTS_VALUES). |
60 | 64 | ' k'.$key. |
61 | 65 | ' on k'.$key.'.key_id = '.$column['kid']. |
62 | 66 | ' and k'.$key.'.user_id = u.user_id '; |
67 | + } |
|
63 | 68 | $query .= ' group by '; |
64 | - foreach ($columns as $key => $column) // grouping attempt |
|
69 | + foreach ($columns as $key => $column) { |
|
70 | + // grouping attempt |
|
65 | 71 | $query .= 'k'.$key.'.attempt, '; |
72 | + } |
|
66 | 73 | $query = substr($query, 0, -2); // removing last ', '; |
67 | 74 | |
68 | 75 |
@@ -37,20 +37,20 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -37,20 +37,20 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -31,27 +31,27 @@ discard block |
||
31 | 31 | function search_coachs($needle) |
32 | 32 | { |
33 | 33 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
34 | - $xajax_response = new xajaxResponse(); |
|
35 | - $return = ''; |
|
34 | + $xajax_response = new xajaxResponse(); |
|
35 | + $return = ''; |
|
36 | 36 | |
37 | - if (!empty($needle)) { |
|
38 | - $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; |
|
37 | + if (!empty($needle)) { |
|
38 | + $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; |
|
39 | 39 | |
40 | - // search users where username or firstname or lastname begins likes $needle |
|
41 | - $sql = 'SELECT username, lastname, firstname |
|
40 | + // search users where username or firstname or lastname begins likes $needle |
|
41 | + $sql = 'SELECT username, lastname, firstname |
|
42 | 42 | FROM '.$tbl_user.' user |
43 | 43 | WHERE (username LIKE "'.$needle.'%" |
44 | 44 | OR firstname LIKE "'.$needle.'%" |
45 | 45 | OR lastname LIKE "'.$needle.'%") |
46 | 46 | AND status=1'. |
47 | - $order_clause. |
|
48 | - ' LIMIT 10'; |
|
49 | - |
|
50 | - if (api_is_multiple_url_enabled()) { |
|
51 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
52 | - $access_url_id = api_get_current_access_url_id(); |
|
53 | - if ($access_url_id != -1) { |
|
54 | - $sql = 'SELECT username, lastname, firstname |
|
47 | + $order_clause. |
|
48 | + ' LIMIT 10'; |
|
49 | + |
|
50 | + if (api_is_multiple_url_enabled()) { |
|
51 | + $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
52 | + $access_url_id = api_get_current_access_url_id(); |
|
53 | + if ($access_url_id != -1) { |
|
54 | + $sql = 'SELECT username, lastname, firstname |
|
55 | 55 | FROM '.$tbl_user.' user |
56 | 56 | INNER JOIN '.$tbl_user_rel_access_url.' url_user |
57 | 57 | ON (url_user.user_id=user.user_id) |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | AND status=1'. |
66 | 66 | $order_clause.' |
67 | 67 | LIMIT 10'; |
68 | - } |
|
69 | - } |
|
70 | - |
|
71 | - $rs = Database::query($sql); |
|
72 | - while ($user = Database :: fetch_array($rs)) { |
|
73 | - $return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\''.$user['username'].'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />'; |
|
74 | - } |
|
75 | - } |
|
76 | - $xajax_response -> addAssign('ajax_list_coachs','innerHTML', api_utf8_encode($return)); |
|
77 | - return $xajax_response; |
|
68 | + } |
|
69 | + } |
|
70 | + |
|
71 | + $rs = Database::query($sql); |
|
72 | + while ($user = Database :: fetch_array($rs)) { |
|
73 | + $return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\''.$user['username'].'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />'; |
|
74 | + } |
|
75 | + } |
|
76 | + $xajax_response -> addAssign('ajax_list_coachs','innerHTML', api_utf8_encode($return)); |
|
77 | + return $xajax_response; |
|
78 | 78 | } |
79 | 79 | $xajax -> processRequests(); |
80 | 80 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | </script>"; |
118 | 118 | |
119 | 119 | if (isset($_POST['formSent']) && $_POST['formSent']) { |
120 | - $formSent = 1; |
|
120 | + $formSent = 1; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | $tool_name = get_lang('AddSession'); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | Display::display_header($tool_name); |
210 | 210 | |
211 | 211 | if (!empty($return)) { |
212 | - Display::display_error_message($return, false); |
|
212 | + Display::display_error_message($return, false); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | echo '<div class="actions">'; |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | $errorMsg = ''; |
24 | 24 | |
25 | 25 | // Crop picture plugin for session images |
26 | -$htmlHeadXtra[] = '<link href="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">'; |
|
27 | -$htmlHeadXtra[] = '<script src="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.js"></script>'; |
|
26 | +$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">'; |
|
27 | +$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.js"></script>'; |
|
28 | 28 | $htmlHeadXtra[] = '<script> |
29 | 29 | $(document).ready(function() { |
30 | 30 | var $image = $("#previewImage"); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ' LIMIT 10'; |
100 | 100 | |
101 | 101 | if (api_is_multiple_url_enabled()) { |
102 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
102 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
103 | 103 | $access_url_id = api_get_current_access_url_id(); |
104 | 104 | if ($access_url_id != -1) { |
105 | 105 | $sql = 'SELECT username, lastname, firstname |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\''.$user['username'].'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />'; |
125 | 125 | } |
126 | 126 | } |
127 | - $xajax_response -> addAssign('ajax_list_coachs','innerHTML', api_utf8_encode($return)); |
|
127 | + $xajax_response -> addAssign('ajax_list_coachs', 'innerHTML', api_utf8_encode($return)); |
|
128 | 128 | return $xajax_response; |
129 | 129 | } |
130 | 130 | $xajax -> processRequests(); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $form->addElement('header', $tool_name); |
186 | 186 | $result = SessionManager::setForm($form); |
187 | 187 | |
188 | -$htmlHeadXtra[] =' |
|
188 | +$htmlHeadXtra[] = ' |
|
189 | 189 | <script> |
190 | 190 | $(function() { |
191 | 191 | '.$result['js'].' |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $form->addButtonNext(get_lang('NextStep')); |
211 | 211 | |
212 | 212 | if (!$formSent) { |
213 | - $formDefaults['access_start_date'] = $formDefaults['display_start_date'] = api_get_local_time(); |
|
213 | + $formDefaults['access_start_date'] = $formDefaults['display_start_date'] = api_get_local_time(); |
|
214 | 214 | $formDefaults['coach_username'] = api_get_user_id(); |
215 | 215 | } else { |
216 | 216 | $formDefaults['name'] = api_htmlentities($name, ENT_QUOTES, $charset); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $id_visibility = $params['session_visibility']; |
236 | 236 | $duration = isset($params['duration']) ? $params['duration'] : null; |
237 | 237 | $description = $params['description']; |
238 | - $showDescription = isset($params['show_description']) ? 1: 0; |
|
238 | + $showDescription = isset($params['show_description']) ? 1 : 0; |
|
239 | 239 | $sendSubscriptionNotification = isset($params['send_subscription_notification']); |
240 | 240 | $isThisImageCropped = isset($params['cropResult']); |
241 | 241 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | if ($return == strval(intval($return))) { |
274 | 274 | // integer => no error on session creation |
275 | - header('Location: add_courses_to_session.php?id_session=' . $return . '&add=true&msg='); |
|
275 | + header('Location: add_courses_to_session.php?id_session='.$return.'&add=true&msg='); |
|
276 | 276 | exit(); |
277 | 277 | } |
278 | 278 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | |
286 | 286 | echo '<div class="actions">'; |
287 | 287 | echo '<a href="../session/session_list.php">'. |
288 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
288 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
289 | 289 | echo '</div>'; |
290 | 290 | |
291 | 291 | $form->display(); |
@@ -8,7 +8,7 @@ discard block |
||
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 |
||
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 |
||
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&blog_id='.Security::remove_XSS($_GET['blog_id']); |
|
40 | + $my_url = 'action=edit&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 |
||
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')); |
@@ -8,7 +8,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | ); |