@@ -281,7 +281,7 @@ |
||
281 | 281 | $correct_answer_index = array_search($matches[1], $answers_array); |
282 | 282 | $exercise_info['question'][$question_index]['title'] = $matches[1]; |
283 | 283 | } elseif (preg_match('/^TAGS:\s?([A-Z])\s?/', $info, $matches)) { |
284 | - //TAGS for chamilo >= 1.10 |
|
284 | + //TAGS for chamilo >= 1.10 |
|
285 | 285 | $exercise_info['question'][$question_index]['answer_tags'] = explode(',', $matches[1]); |
286 | 286 | } elseif (preg_match('/^ETIQUETAS:\s?([A-Z])\s?/', $info, $matches)) { |
287 | 287 | //TAGS for chamilo >= 1.10 (Spanish e-ducativa format) |
@@ -20,9 +20,9 @@ |
||
20 | 20 | * @param int $user_id User ID |
21 | 21 | * @param int $view_id View ID |
22 | 22 | * @param int $item_id Item ID |
23 | - * @param float $score Current score |
|
24 | - * @param float $max Maximum score |
|
25 | - * @param float $min Minimum score |
|
23 | + * @param integer $score Current score |
|
24 | + * @param integer $max Maximum score |
|
25 | + * @param integer $min Minimum score |
|
26 | 26 | * @param string $status Lesson status |
27 | 27 | * @param int $time Session time |
28 | 28 | * @param string $suspend Suspend data |
@@ -458,7 +458,7 @@ |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | if ($myLP->get_type() == 2) { |
461 | - $return .= "update_stats();"; |
|
461 | + $return .= "update_stats();"; |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | // To be sure progress is updated. |
@@ -55,7 +55,8 @@ discard block |
||
55 | 55 | $lmsFinish = 0, |
56 | 56 | $userNavigatesAway = 0, |
57 | 57 | $statusSignalReceived = 0 |
58 | -) { |
|
58 | +) |
|
59 | +{ |
|
59 | 60 | //global $debug; |
60 | 61 | $debug = 0; |
61 | 62 | $return = null; |
@@ -477,7 +478,8 @@ discard block |
||
477 | 478 | if (is_array($_REQUEST['interact'])) { |
478 | 479 | foreach ($_REQUEST['interact'] as $idx => $interac) { |
479 | 480 | $interactions[$idx] = preg_split('/,/', substr($interac, 1, -1)); |
480 | - if (!isset($interactions[$idx][7])) { // Make sure there are 7 elements. |
|
481 | + if (!isset($interactions[$idx][7])) { |
|
482 | +// Make sure there are 7 elements. |
|
481 | 483 | $interactions[$idx][7] = ''; |
482 | 484 | } |
483 | 485 | } |
@@ -450,7 +450,7 @@ |
||
450 | 450 | $current_time = api_get_utc_datetime(); |
451 | 451 | $row = Database::fetch_array($q_last_connection); |
452 | 452 | $i_id_last_connection = $row['login_id']; |
453 | - $sql = "UPDATE $tbl_track_login |
|
453 | + $sql = "update $tbl_track_login |
|
454 | 454 | SET logout_date='".$current_time."' |
455 | 455 | WHERE login_id = $i_id_last_connection"; |
456 | 456 | Database::query($sql); |
@@ -13,11 +13,11 @@ |
||
13 | 13 | 'Accent', |
14 | 14 | 'Accenture', |
15 | 15 | 'ADLNet', |
16 | - 'Articulate', |
|
17 | - 'ATutor', |
|
18 | - 'Blackboard', |
|
19 | - 'Calfat', |
|
20 | - 'Captivate', |
|
16 | + 'Articulate', |
|
17 | + 'ATutor', |
|
18 | + 'Blackboard', |
|
19 | + 'Calfat', |
|
20 | + 'Captivate', |
|
21 | 21 | 'Chamilo', |
22 | 22 | 'Chamilo 2', |
23 | 23 | 'Claroline', |
@@ -15,52 +15,52 @@ |
||
15 | 15 | } |
16 | 16 | |
17 | 17 | switch ($_REQUEST['action']) { |
18 | - case "get": |
|
19 | - print storage_get($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
20 | - break; |
|
21 | - case "set": |
|
22 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
23 | - print storage_set($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
24 | - } |
|
25 | - break; |
|
26 | - case "getall": |
|
27 | - print storage_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco']); |
|
28 | - break; |
|
29 | - case "stackpush": |
|
30 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
31 | - print storage_stack_push($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
32 | - } |
|
33 | - break; |
|
34 | - case "stackpop": |
|
35 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
36 | - print storage_stack_pop($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
37 | - } |
|
38 | - break; |
|
39 | - case "stacklength": |
|
40 | - print storage_stack_length($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
41 | - break; |
|
42 | - case "stackclear": |
|
43 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
44 | - print storage_stack_clear($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
45 | - } |
|
46 | - break; |
|
47 | - case "stackgetall": |
|
48 | - if (storage_can_set($_REQUEST['svuser'])) |
|
49 | - print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | - break; |
|
51 | - case "getposition": |
|
52 | - print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
|
53 | - break; |
|
54 | - case "getleaders": |
|
55 | - print storage_get_leaders($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc'], $_REQUEST['svlength']); |
|
56 | - break; |
|
57 | - case "usersgetall": |
|
58 | -// security issue |
|
59 | - print "NOT allowed, security issue, see sources"; |
|
60 | -// print storage_get_all_users(); |
|
61 | - break; |
|
62 | - default: |
|
63 | - // Do nothing |
|
18 | + case "get": |
|
19 | + print storage_get($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
20 | + break; |
|
21 | + case "set": |
|
22 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
23 | + print storage_set($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
24 | + } |
|
25 | + break; |
|
26 | + case "getall": |
|
27 | + print storage_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco']); |
|
28 | + break; |
|
29 | + case "stackpush": |
|
30 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
31 | + print storage_stack_push($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
32 | + } |
|
33 | + break; |
|
34 | + case "stackpop": |
|
35 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
36 | + print storage_stack_pop($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
37 | + } |
|
38 | + break; |
|
39 | + case "stacklength": |
|
40 | + print storage_stack_length($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
41 | + break; |
|
42 | + case "stackclear": |
|
43 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
44 | + print storage_stack_clear($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
45 | + } |
|
46 | + break; |
|
47 | + case "stackgetall": |
|
48 | + if (storage_can_set($_REQUEST['svuser'])) |
|
49 | + print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | + break; |
|
51 | + case "getposition": |
|
52 | + print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
|
53 | + break; |
|
54 | + case "getleaders": |
|
55 | + print storage_get_leaders($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc'], $_REQUEST['svlength']); |
|
56 | + break; |
|
57 | + case "usersgetall": |
|
58 | + // security issue |
|
59 | + print "NOT allowed, security issue, see sources"; |
|
60 | + // print storage_get_all_users(); |
|
61 | + break; |
|
62 | + default: |
|
63 | + // Do nothing |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | function storage_can_set($sv_user) { |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | } |
46 | 46 | break; |
47 | 47 | case "stackgetall": |
48 | - if (storage_can_set($_REQUEST['svuser'])) |
|
49 | - print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
48 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
49 | + print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | + } |
|
50 | 51 | break; |
51 | 52 | case "getposition": |
52 | 53 | print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
@@ -63,7 +64,8 @@ discard block |
||
63 | 64 | // Do nothing |
64 | 65 | } |
65 | 66 | |
66 | -function storage_can_set($sv_user) { |
|
67 | +function storage_can_set($sv_user) |
|
68 | +{ |
|
67 | 69 | // platform admin can change any user's stored values, other users can only change their own values |
68 | 70 | $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id())); |
69 | 71 | if (!$allowed) { |
@@ -72,7 +74,8 @@ discard block |
||
72 | 74 | return $allowed; |
73 | 75 | } |
74 | 76 | |
75 | -function storage_get($sv_user, $sv_course, $sv_sco, $sv_key) { |
|
77 | +function storage_get($sv_user, $sv_course, $sv_sco, $sv_key) |
|
78 | +{ |
|
76 | 79 | $sql = "select sv_value |
77 | 80 | from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." |
78 | 81 | where user_id= '$sv_user' |
@@ -87,13 +90,13 @@ discard block |
||
87 | 90 | } else { |
88 | 91 | return $row['sv_value']; |
89 | 92 | } |
90 | - } |
|
91 | - else { |
|
93 | + } else { |
|
92 | 94 | return null; |
93 | 95 | } |
94 | 96 | } |
95 | 97 | |
96 | -function storage_get_leaders($sv_user, $sv_course, $sv_sco, $sv_key, $sv_asc, $sv_length) { |
|
98 | +function storage_get_leaders($sv_user, $sv_course, $sv_sco, $sv_key, $sv_asc, $sv_length) |
|
99 | +{ |
|
97 | 100 | |
98 | 101 | // get leaders |
99 | 102 | $sql_leaders = "select u.user_id, firstname, lastname, email, username, sv_value as value |
@@ -127,7 +130,8 @@ discard block |
||
127 | 130 | return json_encode($result); |
128 | 131 | } |
129 | 132 | |
130 | -function storage_get_position($sv_user, $sv_course, $sv_sco, $sv_key, $sv_asc, $sv_length) { |
|
133 | +function storage_get_position($sv_user, $sv_course, $sv_sco, $sv_key, $sv_asc, $sv_length) |
|
134 | +{ |
|
131 | 135 | $sql = "select count(list.user_id) as position |
132 | 136 | from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." search, |
133 | 137 | ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." list |
@@ -144,13 +148,13 @@ discard block |
||
144 | 148 | if (Database::num_rows($res) > 0) { |
145 | 149 | $row = Database::fetch_assoc($res); |
146 | 150 | return $row['position']; |
147 | - } |
|
148 | - else { |
|
151 | + } else { |
|
149 | 152 | return null; |
150 | 153 | } |
151 | 154 | } |
152 | 155 | |
153 | -function storage_set($sv_user, $sv_course, $sv_sco, $sv_key, $sv_value) { |
|
156 | +function storage_set($sv_user, $sv_course, $sv_sco, $sv_key, $sv_value) |
|
157 | +{ |
|
154 | 158 | $sv_value = Database::escape_string($sv_value); |
155 | 159 | $sql = "replace into ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." |
156 | 160 | (user_id, sco_id, course_id, sv_key, sv_value) |
@@ -160,7 +164,8 @@ discard block |
||
160 | 164 | return Database::affected_rows($res); |
161 | 165 | } |
162 | 166 | |
163 | -function storage_getall($sv_user, $sv_course, $sv_sco) { |
|
167 | +function storage_getall($sv_user, $sv_course, $sv_sco) |
|
168 | +{ |
|
164 | 169 | $sql = "select sv_key, sv_value |
165 | 170 | from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." |
166 | 171 | where user_id= '$sv_user' |
@@ -177,7 +182,8 @@ discard block |
||
177 | 182 | return json_encode($data); |
178 | 183 | } |
179 | 184 | |
180 | -function storage_stack_push($sv_user, $sv_course, $sv_sco, $sv_key, $sv_value) { |
|
185 | +function storage_stack_push($sv_user, $sv_course, $sv_sco, $sv_key, $sv_value) |
|
186 | +{ |
|
181 | 187 | $sv_value = Database::escape_string($sv_value); |
182 | 188 | Database::query("start transaction"); |
183 | 189 | $sqlorder = "select ifnull((select max(stack_order) |
@@ -198,14 +204,14 @@ discard block |
||
198 | 204 | if ($resorder && $resinsert) { |
199 | 205 | Database::query("commit"); |
200 | 206 | return 1; |
201 | - } |
|
202 | - else { |
|
207 | + } else { |
|
203 | 208 | Database::query("rollback"); |
204 | 209 | return 0; |
205 | 210 | } |
206 | 211 | } |
207 | 212 | |
208 | -function storage_stack_pop($sv_user, $sv_course, $sv_sco, $sv_key) { |
|
213 | +function storage_stack_pop($sv_user, $sv_course, $sv_sco, $sv_key) |
|
214 | +{ |
|
209 | 215 | Database::query("start transaction"); |
210 | 216 | $sqlselect = "select sv_value, stack_order |
211 | 217 | from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK)." |
@@ -239,7 +245,8 @@ discard block |
||
239 | 245 | } |
240 | 246 | } |
241 | 247 | |
242 | -function storage_stack_length($sv_user, $sv_course, $sv_sco, $sv_key) { |
|
248 | +function storage_stack_length($sv_user, $sv_course, $sv_sco, $sv_key) |
|
249 | +{ |
|
243 | 250 | $sql = "select count(*) as length |
244 | 251 | from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK)." |
245 | 252 | where user_id= '$sv_user' |
@@ -251,7 +258,8 @@ discard block |
||
251 | 258 | return $row['length']; |
252 | 259 | } |
253 | 260 | |
254 | -function storage_stack_clear($sv_user, $sv_course, $sv_sco, $sv_key) { |
|
261 | +function storage_stack_clear($sv_user, $sv_course, $sv_sco, $sv_key) |
|
262 | +{ |
|
255 | 263 | $sql = "delete |
256 | 264 | from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK)." |
257 | 265 | where user_id= '$sv_user' |
@@ -262,7 +270,8 @@ discard block |
||
262 | 270 | return Database::num_rows($res); |
263 | 271 | } |
264 | 272 | |
265 | -function storage_stack_getall($sv_user, $sv_course, $sv_sco, $sv_key) { |
|
273 | +function storage_stack_getall($sv_user, $sv_course, $sv_sco, $sv_key) |
|
274 | +{ |
|
266 | 275 | $sql = "select stack_order as stack_order, sv_value as value |
267 | 276 | from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK)." |
268 | 277 | where user_id= '$sv_user' |
@@ -280,7 +289,8 @@ discard block |
||
280 | 289 | return json_encode($results); |
281 | 290 | } |
282 | 291 | |
283 | -function storage_get_all_users() { |
|
292 | +function storage_get_all_users() |
|
293 | +{ |
|
284 | 294 | $sql = "select user_id, username, firstname, lastname |
285 | 295 | from ".Database::get_main_table(TABLE_MAIN_USER)." |
286 | 296 | order by user_id asc"; |
@@ -1154,7 +1154,7 @@ discard block |
||
1154 | 1154 | /** |
1155 | 1155 | * Returns an array containing the list of options used to populate the gradebook_number_decimals variable |
1156 | 1156 | * This function is called through a call_user_func() in the generate_settings_form function. |
1157 | - * @return array List of gradebook_number_decimals options |
|
1157 | + * @return string[] List of gradebook_number_decimals options |
|
1158 | 1158 | * |
1159 | 1159 | * @author Guillaume Viguier <[email protected]> |
1160 | 1160 | */ |
@@ -1575,8 +1575,9 @@ discard block |
||
1575 | 1575 | } |
1576 | 1576 | /** |
1577 | 1577 | * Helper function to generates a form elements group |
1578 | - * @param object $form The form where the elements group has to be added |
|
1578 | + * @param FormValidator $form The form where the elements group has to be added |
|
1579 | 1579 | * @param array $values Values to browse through |
1580 | + * @param string $elementName |
|
1580 | 1581 | * @return array |
1581 | 1582 | */ |
1582 | 1583 | function formGenerateElementsGroup($form, $values = array(), $elementName) |
@@ -1592,7 +1593,7 @@ discard block |
||
1592 | 1593 | } |
1593 | 1594 | /** |
1594 | 1595 | * Helper function with allowed file types for CSS |
1595 | - * @return array Array of file types (no indexes) |
|
1596 | + * @return string[] Array of file types (no indexes) |
|
1596 | 1597 | */ |
1597 | 1598 | function getAllowedFileTypes() |
1598 | 1599 | { |
@@ -426,8 +426,8 @@ |
||
426 | 426 | if ($status) { |
427 | 427 | echo Display::return_message(get_lang('NewLogoUpdated')); |
428 | 428 | echo '<script>' |
429 | - . '$("#header-logo").attr("src","'.$url.$newLogoFileName.'");' |
|
430 | - . '</script>'; |
|
429 | + . '$("#header-logo").attr("src","'.$url.$newLogoFileName.'");' |
|
430 | + . '</script>'; |
|
431 | 431 | } else { |
432 | 432 | echo Display::return_message('Error - '.get_lang('UplNoFileUploaded'), 'error'); |
433 | 433 | } |
@@ -732,7 +732,7 @@ |
||
732 | 732 | } |
733 | 733 | |
734 | 734 | /** |
735 | - * @param null $course_code |
|
735 | + * @param string $course_code |
|
736 | 736 | * @param int $gradebook_model_id |
737 | 737 | * @return mixed |
738 | 738 | */ |
@@ -250,7 +250,7 @@ |
||
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
253 | - $modify_icons .= '<a href="gradebook_edit_all.php?selectcat='.$cat->get_id().'&'.$courseParams.'">'. |
|
253 | + $modify_icons .= '<a href="gradebook_edit_all.php?selectcat='.$cat->get_id().'&'.$courseParams.'">'. |
|
254 | 254 | Display::return_icon( |
255 | 255 | 'percentage.png', |
256 | 256 | get_lang('EditAllWeights'), |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @param array $values Array of title + description (name => $title, description => $comment) |
97 | 97 | * |
98 | - * @return mixed Term id on success, false on failure |
|
98 | + * @return false|string Term id on success, false on failure |
|
99 | 99 | * |
100 | 100 | */ |
101 | 101 | public static function save_glossary($values, $showMessage = true) |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | |
449 | 449 | /** |
450 | 450 | * Display the glossary terms in a list |
451 | - * @return bool true |
|
451 | + * @return string true |
|
452 | 452 | */ |
453 | 453 | public static function displayGlossaryList() |
454 | 454 | { |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | * Update action icons column |
586 | 586 | * |
587 | 587 | * @param integer $glossary_id |
588 | - * @param array $url_params Parameters to use to affect links |
|
588 | + * @param string $url_params Parameters to use to affect links |
|
589 | 589 | * @param array $row The line of results from a query on the glossary table |
590 | 590 | * |
591 | 591 | * @return string HTML string for the action icons columns |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $id = Database::insert($t_glossary, $params); |
135 | 135 | |
136 | 136 | if ($id) { |
137 | - $sql = "UPDATE $t_glossary SET glossary_id = $id WHERE iid = $id"; |
|
137 | + $sql = "update $t_glossary SET glossary_id = $id WHERE iid = $id"; |
|
138 | 138 | Database::query($sql); |
139 | 139 | |
140 | 140 | //insert into item_property |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | return false; |
182 | 182 | } else { |
183 | - $sql = "UPDATE $t_glossary SET |
|
183 | + $sql = "update $t_glossary SET |
|
184 | 184 | name = '".Database::escape_string($values['name'])."', |
185 | 185 | description = '".Database::escape_string($values['description'])."' |
186 | 186 | WHERE |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | |
640 | 640 | $i = 1; |
641 | 641 | while ($data = Database::fetch_array($res)) { |
642 | - $sql = "UPDATE $t_glossary SET display_order = $i |
|
642 | + $sql = "update $t_glossary SET display_order = $i |
|
643 | 643 | WHERE c_id = $course_id AND glossary_id = '".intval($data['glossary_id'])."'"; |
644 | 644 | Database::query($sql); |
645 | 645 | $i++; |
@@ -682,9 +682,9 @@ discard block |
||
682 | 682 | $found = true; |
683 | 683 | } |
684 | 684 | } |
685 | - $sql1 = "UPDATE $t_glossary SET display_order = '".Database::escape_string($next_display_order)."' |
|
685 | + $sql1 = "update $t_glossary SET display_order = '".Database::escape_string($next_display_order)."' |
|
686 | 686 | WHERE c_id = $course_id AND glossary_id = '".Database::escape_string($current_id)."'"; |
687 | - $sql2 = "UPDATE $t_glossary SET display_order = '".Database::escape_string($current_display_order)."' |
|
687 | + $sql2 = "update $t_glossary SET display_order = '".Database::escape_string($current_display_order)."' |
|
688 | 688 | WHERE c_id = $course_id AND glossary_id = '".Database::escape_string($next_id)."'"; |
689 | 689 | Database::query($sql1); |
690 | 690 | Database::query($sql2); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | |
360 | 360 | /** |
361 | 361 | * Get description titles by default |
362 | - * @return array |
|
362 | + * @return string[] |
|
363 | 363 | */ |
364 | 364 | public function get_default_description_title() |
365 | 365 | { |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | |
379 | 379 | /** |
380 | 380 | * Get description titles editable by default |
381 | - * @return array |
|
381 | + * @return boolean[] |
|
382 | 382 | */ |
383 | 383 | public function get_default_description_title_editable() |
384 | 384 | { |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | |
398 | 398 | /** |
399 | 399 | * Get description icons by default |
400 | - * @return array |
|
400 | + * @return string[] |
|
401 | 401 | */ |
402 | 402 | public function get_default_description_icon() |
403 | 403 | { |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | |
418 | 418 | /** |
419 | 419 | * Get questions by default for help |
420 | - * @return array |
|
420 | + * @return string[] |
|
421 | 421 | */ |
422 | 422 | public function get_default_question() |
423 | 423 | { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | |
437 | 437 | /** |
438 | 438 | * Get informations by default for help |
439 | - * @return array |
|
439 | + * @return string[] |
|
440 | 440 | */ |
441 | 441 | public function get_default_information() |
442 | 442 | { |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | /** |
575 | 575 | * get progress of a description |
576 | 576 | * |
577 | - * @return int |
|
577 | + * @return string |
|
578 | 578 | */ |
579 | 579 | public function get_progress() |
580 | 580 | { |
@@ -219,7 +219,7 @@ |
||
219 | 219 | $last_id = Database::insert($table, $params); |
220 | 220 | |
221 | 221 | if ($last_id > 0) { |
222 | - $sql = "UPDATE $table SET id = iid WHERE iid = $last_id"; |
|
222 | + $sql = "update $table SET id = iid WHERE iid = $last_id"; |
|
223 | 223 | Database::query($sql); |
224 | 224 | |
225 | 225 | // insert into item_property |
@@ -186,9 +186,9 @@ |
||
186 | 186 | |
187 | 187 | /** |
188 | 188 | * Get images files from remote host (with webservices) |
189 | - * @param array $file current ppt file details |
|
189 | + * @param string $file current ppt file details |
|
190 | 190 | * @param string $size The expected final size of the rendered slides |
191 | - * @return array images files |
|
191 | + * @return string images files |
|
192 | 192 | */ |
193 | 193 | private function _get_remote_ppt2lp_files($file, $size = null) |
194 | 194 | { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | // Create the directory |
54 | 54 | $result = $this->generate_lp_folder($_course, $this->file_name); |
55 | 55 | |
56 | - // Create the directory |
|
56 | + // Create the directory |
|
57 | 57 | $this->base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
58 | 58 | ///learning_path/ppt_dirname directory |
59 | 59 | $this->created_dir = $result['dir']; |
@@ -103,7 +103,8 @@ discard block |
||
103 | 103 | //var_dump( $this->base_work_dir.$this->created_dir.$this->file_path); |
104 | 104 | $perm = api_get_setting('permissions_for_new_files'); |
105 | 105 | |
106 | - if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
|
106 | + if (IS_WINDOWS_OS) { |
|
107 | +// IS_WINDOWS_OS has been defined in main_api.lib.php |
|
107 | 108 | $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
108 | 109 | $class_path = $converter_path.';'.$converter_path.'/jodconverter-2.2.2.jar;'.$converter_path.'/jodconverter-cli-2.2.2.jar'; |
109 | 110 | //$cmd = 'java -cp "'.$class_path.'" DokeosConverter'; |
@@ -130,7 +131,8 @@ discard block |
||
130 | 131 | $return = 0; |
131 | 132 | $shell = exec($cmd, $files, $return); |
132 | 133 | |
133 | - if ($return != 0) { // If the java application returns an error code. |
|
134 | + if ($return != 0) { |
|
135 | +// If the java application returns an error code. |
|
134 | 136 | switch ($return) { |
135 | 137 | case 1: |
136 | 138 | // Can't connect to openoffice. |
@@ -285,7 +287,8 @@ discard block |
||
285 | 287 | } |
286 | 288 | |
287 | 289 | if ($ppt2lpHost == 'localhost') { |
288 | - if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
|
290 | + if (IS_WINDOWS_OS) { |
|
291 | +// IS_WINDOWS_OS has been defined in main_api.lib.php |
|
289 | 292 | $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
290 | 293 | $classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar'; |
291 | 294 | $cmd = 'java -Dfile.encoding=UTF-8 -jar "'.$classPath.'/jodconverter-2.2.2.jar"'; |
@@ -312,7 +315,8 @@ discard block |
||
312 | 315 | @chown($this->base_work_dir.'/'.$this->created_dir, 'www-data'); |
313 | 316 | @chmod($this->base_work_dir.'/'.$this->created_dir, $permissionFile); |
314 | 317 | |
315 | - if ($return != 0) { // If the java application returns an error code. |
|
318 | + if ($return != 0) { |
|
319 | +// If the java application returns an error code. |
|
316 | 320 | switch ($return) { |
317 | 321 | case 1: |
318 | 322 | // Can't connect to openoffice. |