@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | return "<script> |
30 | 30 | function confirmation (name) |
31 | 31 | { |
32 | - if (confirm(\" " . get_lang("NoteConfirmDelete") . " \"+ name + \" ?\")) |
|
32 | + if (confirm(\" " . get_lang("NoteConfirmDelete")." \"+ name + \" ?\")) |
|
33 | 33 | {return true;} |
34 | 34 | else |
35 | 35 | {return false;} |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | description AS note_comment, |
107 | 107 | session_id AS session_id |
108 | 108 | FROM $t_notebook |
109 | - WHERE c_id = $course_id AND notebook_id = '" . intval($notebook_id) . "' "; |
|
109 | + WHERE c_id = $course_id AND notebook_id = '".intval($notebook_id)."' "; |
|
110 | 110 | $result = Database::query($sql); |
111 | 111 | if (Database::num_rows($result) != 1) { |
112 | 112 | return array(); |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | $sql = "DELETE FROM $t_notebook |
185 | 185 | WHERE |
186 | 186 | c_id = $course_id AND |
187 | - notebook_id='" . intval($notebook_id) . "' AND |
|
188 | - user_id = '" . api_get_user_id() . "'"; |
|
187 | + notebook_id='".intval($notebook_id)."' AND |
|
188 | + user_id = '" . api_get_user_id()."'"; |
|
189 | 189 | $result = Database::query($sql); |
190 | 190 | $affected_rows = Database::affected_rows($result); |
191 | 191 | if ($affected_rows != 1) { |
@@ -223,22 +223,22 @@ discard block |
||
223 | 223 | echo '<div class="actions">'; |
224 | 224 | if (!api_is_anonymous()) { |
225 | 225 | if (api_get_session_id() == 0) |
226 | - echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . |
|
227 | - Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; |
|
226 | + echo '<a href="index.php?'.api_get_cidreq().'&action=addnote">'. |
|
227 | + Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>'; |
|
228 | 228 | elseif (api_is_allowed_to_session_edit(false, true)) { |
229 | - echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . |
|
230 | - Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; |
|
229 | + echo '<a href="index.php?'.api_get_cidreq().'&action=addnote">'. |
|
230 | + Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>'; |
|
231 | 231 | } |
232 | 232 | } else { |
233 | - echo '<a href="javascript:void(0)">' . Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; |
|
233 | + echo '<a href="javascript:void(0)">'.Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>'; |
|
234 | 234 | } |
235 | 235 | |
236 | - echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=creation_date&direction=' . $link_sort_direction . '">' . |
|
237 | - Display::return_icon('notes_order_by_date_new.png', get_lang('OrderByCreationDate'), '', '32') . '</a>'; |
|
238 | - echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=update_date&direction=' . $link_sort_direction . '">' . |
|
239 | - Display::return_icon('notes_order_by_date_mod.png', get_lang('OrderByModificationDate'), '', '32') . '</a>'; |
|
240 | - echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=title&direction=' . $link_sort_direction . '">' . |
|
241 | - Display::return_icon('notes_order_by_title.png', get_lang('OrderByTitle'), '', '32') . '</a>'; |
|
236 | + echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=creation_date&direction='.$link_sort_direction.'">'. |
|
237 | + Display::return_icon('notes_order_by_date_new.png', get_lang('OrderByCreationDate'), '', '32').'</a>'; |
|
238 | + echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=update_date&direction='.$link_sort_direction.'">'. |
|
239 | + Display::return_icon('notes_order_by_date_mod.png', get_lang('OrderByModificationDate'), '', '32').'</a>'; |
|
240 | + echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=title&direction='.$link_sort_direction.'">'. |
|
241 | + Display::return_icon('notes_order_by_title.png', get_lang('OrderByTitle'), '', '32').'</a>'; |
|
242 | 242 | echo '</div>'; |
243 | 243 | |
244 | 244 | if (!isset($_SESSION['notebook_view']) || !in_array($_SESSION['notebook_view'], array('creation_date', 'update_date', 'title'))) { |
@@ -248,9 +248,9 @@ discard block |
||
248 | 248 | // Database table definition |
249 | 249 | $t_notebook = Database :: get_course_table(TABLE_NOTEBOOK); |
250 | 250 | if ($_SESSION['notebook_view'] == 'creation_date' || $_SESSION['notebook_view'] == 'update_date') { |
251 | - $order_by = " ORDER BY " . $_SESSION['notebook_view'] . " $sort_direction "; |
|
251 | + $order_by = " ORDER BY ".$_SESSION['notebook_view']." $sort_direction "; |
|
252 | 252 | } else { |
253 | - $order_by = " ORDER BY " . $_SESSION['notebook_view'] . " $sort_direction "; |
|
253 | + $order_by = " ORDER BY ".$_SESSION['notebook_view']." $sort_direction "; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | //condition for the session |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $sql = "SELECT * FROM $t_notebook |
264 | 264 | WHERE |
265 | 265 | c_id = $course_id AND |
266 | - user_id = '" . api_get_user_id() . "' |
|
266 | + user_id = '".api_get_user_id()."' |
|
267 | 267 | $condition_session |
268 | 268 | $cond_extra $order_by |
269 | 269 | "; |
@@ -273,18 +273,18 @@ discard block |
||
273 | 273 | $session_img = api_get_session_image($row['session_id'], $_user['status']); |
274 | 274 | $updateValue = ''; |
275 | 275 | if ($row['update_date'] <> $row['creation_date']) { |
276 | - $updateValue = ', ' . get_lang('UpdateDate') . ': ' . Display::dateToStringAgoAndLongDate($row['update_date']); |
|
276 | + $updateValue = ', '.get_lang('UpdateDate').': '.Display::dateToStringAgoAndLongDate($row['update_date']); |
|
277 | 277 | } |
278 | 278 | |
279 | - $actions = '<a href="' . api_get_self() . '?action=editnote¬ebook_id=' . $row['notebook_id'] . '">' . |
|
280 | - Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>'; |
|
281 | - $actions .= '<a href="' . api_get_self() . '?action=deletenote¬ebook_id=' . $row['notebook_id'] . '" onclick="return confirmation(\'' . $row['title'] . '\');">' . |
|
282 | - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>'; |
|
279 | + $actions = '<a href="'.api_get_self().'?action=editnote¬ebook_id='.$row['notebook_id'].'">'. |
|
280 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
281 | + $actions .= '<a href="'.api_get_self().'?action=deletenote¬ebook_id='.$row['notebook_id'].'" onclick="return confirmation(\''.$row['title'].'\');">'. |
|
282 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
283 | 283 | |
284 | 284 | echo Display::panel( |
285 | 285 | $row['description'], |
286 | - $row['title'] . $session_img.' <div class="pull-right">'.$actions.'</div>', |
|
287 | - get_lang('CreationDate') . ': ' . Display::dateToStringAgoAndLongDate($row['creation_date']). $updateValue |
|
286 | + $row['title'].$session_img.' <div class="pull-right">'.$actions.'</div>', |
|
287 | + get_lang('CreationDate').': '.Display::dateToStringAgoAndLongDate($row['creation_date']).$updateValue |
|
288 | 288 | ); |
289 | 289 | } |
290 | 290 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | // Creating new name |
205 | 205 | $name = md5($this->user_id.$this->certificate_data['cat_id']).'.html'; |
206 | 206 | $my_path_certificate = $this->certification_user_path.$name; |
207 | - $path_certificate ='/'.$name; |
|
207 | + $path_certificate = '/'.$name; |
|
208 | 208 | |
209 | 209 | //Getting QR filename |
210 | 210 | $file_info = pathinfo($path_certificate); |
@@ -350,11 +350,11 @@ discard block |
||
350 | 350 | $final_content['gradebook_institution'].' - '. |
351 | 351 | $final_content['gradebook_sitename'].' - '. |
352 | 352 | get_lang('Certification').$break_space. |
353 | - get_lang('Student'). ': '.$final_content['user_firstname'].' '.$final_content['user_lastname'].$break_space. |
|
354 | - get_lang('Teacher'). ': '.$final_content['teacher_firstname'].' '.$final_content['teacher_lastname'].$break_space. |
|
355 | - get_lang('Date'). ': '.$final_content['date_certificate'].$break_space. |
|
356 | - get_lang('Score'). ': '.$final_content['gradebook_grade'].$break_space. |
|
357 | - 'URL'. ': '.$final_content['certificate_link']; |
|
353 | + get_lang('Student').': '.$final_content['user_firstname'].' '.$final_content['user_lastname'].$break_space. |
|
354 | + get_lang('Teacher').': '.$final_content['teacher_firstname'].' '.$final_content['teacher_lastname'].$break_space. |
|
355 | + get_lang('Date').': '.$final_content['date_certificate'].$break_space. |
|
356 | + get_lang('Score').': '.$final_content['gradebook_grade'].$break_space. |
|
357 | + 'URL'.': '.$final_content['certificate_link']; |
|
358 | 358 | |
359 | 359 | return $text; |
360 | 360 | } |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | return false; |
408 | 408 | } |
409 | 409 | |
410 | - $user_certificate = $this->certification_user_path . basename($this->certificate_data['path_certificate']); |
|
410 | + $user_certificate = $this->certification_user_path.basename($this->certificate_data['path_certificate']); |
|
411 | 411 | |
412 | 412 | if (!file_exists($user_certificate)) { |
413 | 413 | return false; |
@@ -421,9 +421,9 @@ discard block |
||
421 | 421 | */ |
422 | 422 | public function show() |
423 | 423 | { |
424 | - header('Content-Type: text/html; charset='. api_get_system_encoding()); |
|
424 | + header('Content-Type: text/html; charset='.api_get_system_encoding()); |
|
425 | 425 | |
426 | - $user_certificate = $this->certification_user_path . basename($this->certificate_data['path_certificate']); |
|
426 | + $user_certificate = $this->certification_user_path.basename($this->certificate_data['path_certificate']); |
|
427 | 427 | $certificateContent = file_get_contents($user_certificate); |
428 | 428 | |
429 | 429 | $certificate = new DOMDocument(); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | 'tr', |
69 | 69 | Display::tag( |
70 | 70 | 'td', |
71 | - get_lang('CheckFilePermissions') . ' ' . Security::remove_XSS($plugin_info_file), |
|
71 | + get_lang('CheckFilePermissions').' '.Security::remove_XSS($plugin_info_file), |
|
72 | 72 | array('colspan' => '3') |
73 | 73 | ) |
74 | 74 | ); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | foreach ($disabled_blocks_data as $disabled_block) { |
82 | 82 | echo '<tr style="background-color:#eee">'; |
83 | 83 | echo '<td><center><input type="checkbox" name="disabled_block" value="true" checked disabled /></center>'; |
84 | - for ($j = 0 ; $j < count($table_cols); $j++) { |
|
84 | + for ($j = 0; $j < count($table_cols); $j++) { |
|
85 | 85 | if (isset($disabled_block[strtolower($table_cols[$j])])) { |
86 | 86 | if ($j == 2) { |
87 | 87 | echo '<td>'; |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | // clean from block data |
193 | 193 | if (!empty($not_selected_blocks_id)) { |
194 | 194 | $sql_check = "SELECT id FROM $tbl_block |
195 | - WHERE id IN(".implode(',',$not_selected_blocks_id).")"; |
|
195 | + WHERE id IN(".implode(',', $not_selected_blocks_id).")"; |
|
196 | 196 | $rs_check = Database::query($sql_check); |
197 | 197 | if (Database::num_rows($rs_check) > 0) { |
198 | - $del = "DELETE FROM $tbl_block WHERE id IN(".implode(',',$not_selected_blocks_id).")"; |
|
198 | + $del = "DELETE FROM $tbl_block WHERE id IN(".implode(',', $not_selected_blocks_id).")"; |
|
199 | 199 | Database::query($del); |
200 | 200 | } |
201 | 201 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $affected_rows = Database::affected_rows($result); |
216 | 216 | } else { |
217 | 217 | // insert |
218 | - $plugin_info_file = $dashboard_pluginpath . $testplugin . "/$testplugin.info"; |
|
218 | + $plugin_info_file = $dashboard_pluginpath.$testplugin."/$testplugin.info"; |
|
219 | 219 | $plugin_info = array(); |
220 | 220 | if (file_exists($plugin_info_file)) { |
221 | 221 | $plugin_info = api_parse_info_file($plugin_info_file); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | // We check if plugin exists inside directory for updating active field |
286 | 286 | $sql = "SELECT * FROM $tbl_block"; |
287 | 287 | $rs = Database::query($sql); |
288 | - if (Database::num_rows($rs) > 0){ |
|
288 | + if (Database::num_rows($rs) > 0) { |
|
289 | 289 | while ($row = Database::fetch_array($rs)) { |
290 | 290 | if (!in_array($row['path'], $possibleplugins)) { |
291 | 291 | $active = 0; |
@@ -393,13 +393,13 @@ discard block |
||
393 | 393 | echo '<td>'.$block['description'].'</td>'; |
394 | 394 | echo '<td> |
395 | 395 | <select class="selectpicker show-tick form-control" name="columns['.$block['id'].']"> |
396 | - <option value="1" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==1?'selected':'').' >1</option> |
|
397 | - <option value="2" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==2?'selected':'').' >2</option> |
|
396 | + <option value="1" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column'] == 1 ? 'selected' : '').' >1</option> |
|
397 | + <option value="2" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column'] == 2 ? 'selected' : '').' >2</option> |
|
398 | 398 | </select> |
399 | 399 | </td>'; |
400 | 400 | echo '</tr>'; |
401 | 401 | } else { |
402 | - echo Display::tag('tr', Display::tag('td', get_lang('Error').' '.$controller_class, array('colspan'=>'3'))); |
|
402 | + echo Display::tag('tr', Display::tag('td', get_lang('Error').' '.$controller_class, array('colspan'=>'3'))); |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | */ |
450 | 450 | public static function store_user_blocks($user_id, $enabled_blocks, $columns) |
451 | 451 | { |
452 | - $selected_blocks_id = array(); |
|
452 | + $selected_blocks_id = array(); |
|
453 | 453 | if (is_array($enabled_blocks) && count($enabled_blocks) > 0) { |
454 | 454 | $selected_blocks_id = array_keys($enabled_blocks); |
455 | 455 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | // menu actions for dashboard views |
14 | 14 | $views = array('blocks', 'list'); |
15 | 15 | |
16 | -if(isset($_GET['view']) && in_array($_GET['view'], $views)){ |
|
16 | +if (isset($_GET['view']) && in_array($_GET['view'], $views)) { |
|
17 | 17 | $dashboard_view = $_GET['view']; |
18 | 18 | } |
19 | 19 | |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | |
22 | 22 | if (isset($dashboard_view) && $dashboard_view == 'list') { |
23 | 23 | $link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'. |
24 | - Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
24 | + Display::return_icon('blocks.png', get_lang('DashboardBlocks'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
25 | 25 | } else { |
26 | 26 | $link_list_view = '<a href="'.api_get_self().'?view=list">'. |
27 | - Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
27 | + Display::return_icon('edit.png', get_lang('EditBlocks'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | $configuration_link = null; |
31 | 31 | if (api_is_platform_admin()) { |
32 | 32 | $configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">' |
33 | - .Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
33 | + .Display::return_icon('settings.png', get_lang('ConfigureDashboardPlugin'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | echo '<div class="actions">'; |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | $attributes = array( |
804 | 804 | 'skill_id' => $skill_id, |
805 | 805 | 'parent_id' => $parent_id, |
806 | - 'relation_type' => (isset($params['relation_type'])?$params['relation_type']:0), |
|
806 | + 'relation_type' => (isset($params['relation_type']) ? $params['relation_type'] : 0), |
|
807 | 807 | //'level' => $params['level'], |
808 | 808 | ); |
809 | 809 | $skill_rel_skill->save($attributes); |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | $skills[$skill_id] = $skill_info; |
1013 | 1013 | // Uncomment code below to hide the searched skill |
1014 | 1014 | $skills[$skill_id]['data']['parent_id'] = $skill_info['extra']['parent_id']; |
1015 | - $skills[$skill_id]['parent_id'] = 1; |
|
1015 | + $skills[$skill_id]['parent_id'] = 1; |
|
1016 | 1016 | } |
1017 | 1017 | } |
1018 | 1018 | } |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | $skill['data']['skill_has_gradebook'] = true; |
1078 | 1078 | } |
1079 | 1079 | $refs[$skill['id']] = &$skill; |
1080 | - $flat_array[$skill['id']] = &$skill; |
|
1080 | + $flat_array[$skill['id']] = &$skill; |
|
1081 | 1081 | } |
1082 | 1082 | |
1083 | 1083 | // Checking family value |
@@ -1098,7 +1098,7 @@ discard block |
||
1098 | 1098 | $refs['root']['children'][0] = $skills[1]; |
1099 | 1099 | $skills[$skill_id]['data']['family_id'] = 1; |
1100 | 1100 | $refs['root']['children'][0]['children'][0] = $skills[$skill_id]; |
1101 | - $flat_array[$skill_id] = $skills[$skill_id]; |
|
1101 | + $flat_array[$skill_id] = $skills[$skill_id]; |
|
1102 | 1102 | } else { |
1103 | 1103 | // Moving node to the children index of their parents |
1104 | 1104 | |
@@ -1107,7 +1107,7 @@ discard block |
||
1107 | 1107 | $skill['data']['family_id'] = $new_family_array[$skill['id']]; |
1108 | 1108 | } |
1109 | 1109 | $refs[$skill['parent_id']]['children'][] = &$skill; |
1110 | - $flat_array[$my_skill_id] = $skill; |
|
1110 | + $flat_array[$my_skill_id] = $skill; |
|
1111 | 1111 | } |
1112 | 1112 | } |
1113 | 1113 | |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | INNER JOIN {$this->table_skill_rel_user} su |
1220 | 1220 | ON (s.id = su.skill_id) |
1221 | 1221 | WHERE user_id = $user_id"; |
1222 | - $result = Database::query($sql); |
|
1222 | + $result = Database::query($sql); |
|
1223 | 1223 | if (Database::num_rows($result)) { |
1224 | 1224 | $result = Database::fetch_row($result); |
1225 | 1225 | return $result[0]; |
@@ -1261,7 +1261,7 @@ discard block |
||
1261 | 1261 | */ |
1262 | 1262 | public function get_user_list_skill_ranking_count() |
1263 | 1263 | { |
1264 | - $sql = "SELECT count(*) FROM ( |
|
1264 | + $sql = "SELECT count(*) FROM ( |
|
1265 | 1265 | SELECT count(distinct 1) |
1266 | 1266 | FROM {$this->table} s |
1267 | 1267 | INNER JOIN {$this->table_skill_rel_user} su |
@@ -1316,7 +1316,7 @@ discard block |
||
1316 | 1316 | ON c.code = g.course_code |
1317 | 1317 | WHERE sg.skill_id = $skill_id |
1318 | 1318 | AND (g.session_id IS NULL OR g.session_id = 0)"; |
1319 | - $result = Database::query($sql); |
|
1319 | + $result = Database::query($sql); |
|
1320 | 1320 | |
1321 | 1321 | return Database::store_result($result, 'ASSOC'); |
1322 | 1322 | } |
@@ -1505,7 +1505,7 @@ discard block |
||
1505 | 1505 | WHERE sg.skill_id = $skillId |
1506 | 1506 | AND g.session_id > 0"; |
1507 | 1507 | |
1508 | - $result = Database::query($sql); |
|
1508 | + $result = Database::query($sql); |
|
1509 | 1509 | |
1510 | 1510 | return Database::store_result($result, 'ASSOC'); |
1511 | 1511 | } |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | $tok = Security::get_token(); |
18 | 18 | |
19 | 19 | if (isset($_REQUEST['user_friend'])) { |
20 | - $info_user_friend=array(); |
|
21 | - $info_path_friend=array(); |
|
20 | + $info_user_friend = array(); |
|
21 | + $info_path_friend = array(); |
|
22 | 22 | $userfriend_id = intval($_REQUEST['user_friend']); |
23 | 23 | $info_user_friend = api_get_user_info($userfriend_id); |
24 | 24 | $info_path_friend = UserManager::get_user_picture_path_by_id($userfriend_id, 'web'); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; |
29 | 29 | $actions = array('add_message_group', 'edit_message_group', 'reply_message_group'); |
30 | 30 | |
31 | -$allowed_action = isset($_GET['action']) && in_array($_GET['action'],$actions) ? Security::remove_XSS($_GET['action']):''; |
|
31 | +$allowed_action = isset($_GET['action']) && in_array($_GET['action'], $actions) ? Security::remove_XSS($_GET['action']) : ''; |
|
32 | 32 | |
33 | 33 | $to_group = ''; |
34 | 34 | $subject = ''; |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | -$page_item = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']):1; |
|
58 | -$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id']) ? ('&items_'.intval($_GET['topic_id']).'_page_nr='.(!empty($_GET['topics_page_nr'])?intval($_GET['topics_page_nr']):1)):''; |
|
57 | +$page_item = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; |
|
58 | +$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id']) ? ('&items_'.intval($_GET['topic_id']).'_page_nr='.(!empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1)) : ''; |
|
59 | 59 | if (isset($_GET['topic_id'])) { |
60 | 60 | $param_item_page .= '&topic_id='.intval($_GET['topic_id']); |
61 | 61 | } |
62 | -$page_topic = isset($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; |
|
63 | -$anchor_topic = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null; |
|
62 | +$page_topic = isset($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; |
|
63 | +$anchor_topic = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null; |
|
64 | 64 | |
65 | 65 | $url = api_get_path(WEB_CODE_PATH).'social/group_topics.php?id='.$group_id.'&anchor_topic='.$anchor_topic.'&topics_page_nr='.$page_topic.$param_item_page; |
66 | 66 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ' |
97 | 97 | <div id="link-more-attach"> |
98 | 98 | <a class="btn btn-default" href="javascript://" onclick="return add_image_form()"> |
99 | - ' . get_lang('AddOneMoreFile') . ' |
|
99 | + ' . get_lang('AddOneMoreFile').' |
|
100 | 100 | </a> |
101 | 101 | </div> |
102 | 102 | ' |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | function display_form() |
87 | 87 | { |
88 | - $html = ''; |
|
88 | + $html = ''; |
|
89 | 89 | $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC')); |
90 | 90 | |
91 | 91 | // Link back to the documents overview |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | //destination |
111 | 111 | $html .= '<div class="form-group">'; |
112 | - $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>'; |
|
112 | + $html .= '<label class="col-sm-2 control-label">'.get_lang('DestinationCoursesFromSession').': </label>'; |
|
113 | 113 | $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">'; |
114 | 114 | $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">'; |
115 | 115 | $html .= '<option value = "0">'.get_lang('ThereIsNotStillASession').'</option></select ></div>'; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $html .= '<button class="btn btn-success" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><em class="fa fa-files-o"></em> '.get_lang('CopyCourse').'</button>'; |
132 | 132 | |
133 | 133 | // Add Security token |
134 | - $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">'; |
|
134 | + $html .= '<input type="hidden" value="'.Security::get_token().'" name="sec_token">'; |
|
135 | 135 | $html .= '</div></div>'; |
136 | 136 | $html .= '</form>'; |
137 | 137 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | /* HTML head extra */ |
229 | 229 | |
230 | -$htmlHeadXtra[] = $xajax->getJavascript( api_get_path(WEB_LIBRARY_PATH).'xajax/'); |
|
230 | +$htmlHeadXtra[] = $xajax->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax/'); |
|
231 | 231 | $htmlHeadXtra[] = '<script> |
232 | 232 | function checkSelected(id_select,id_radio,id_title,id_destination) { |
233 | 233 | var num=0; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <div id="actions" class="actions"> |
19 | 19 | <?php if ($action != 'createcoursecategory') { ?> |
20 | 20 | <a href="<?php echo api_get_self(); ?>?action=createcoursecategory"> |
21 | - <?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a> |
|
21 | + <?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'), '', '32'); ?></a> |
|
22 | 22 | <?php } ?> |
23 | 23 | </div> |
24 | 24 | |
@@ -50,26 +50,26 @@ discard block |
||
50 | 50 | $max_category_key = count($user_course_categories); |
51 | 51 | if ($action != 'unsubscribe') { ?> |
52 | 52 | <a href="courses.php?action=sortmycourses&categoryid=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>#category<?php echo $row['id']; ?>"> |
53 | - <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?> |
|
53 | + <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> |
|
54 | 54 | </a> |
55 | 55 | |
56 | 56 | <?php if ($row['id'] != $user_course_categories[0]['id']) { ?> |
57 | 57 | <a href="courses.php?action=<?php echo $action ?>&move=up&category=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>"> |
58 | - <?php echo Display::return_icon('up.png', get_lang('Up'),'',22); ?> |
|
58 | + <?php echo Display::return_icon('up.png', get_lang('Up'), '', 22); ?> |
|
59 | 59 | </a> |
60 | 60 | <?php } else { ?> |
61 | - <?php echo Display::return_icon('up_na.png', get_lang('Up'),'',22); ?> |
|
61 | + <?php echo Display::return_icon('up_na.png', get_lang('Up'), '', 22); ?> |
|
62 | 62 | <?php } ?> |
63 | 63 | |
64 | 64 | <?php if ($row['id'] != $user_course_categories[$max_category_key - 1]['id']) { ?> |
65 | 65 | <a href="courses.php?action=<?php echo $action; ?>&move=down&category=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>"> |
66 | - <?php echo Display::return_icon('down.png', get_lang('Down'),'',22); ?> |
|
66 | + <?php echo Display::return_icon('down.png', get_lang('Down'), '', 22); ?> |
|
67 | 67 | </a> |
68 | 68 | <?php } else { ?> |
69 | - <?php echo Display::return_icon('down_na.png', get_lang('Down'),'',22); ?> |
|
69 | + <?php echo Display::return_icon('down_na.png', get_lang('Down'), '', 22); ?> |
|
70 | 70 | <?php } ?> |
71 | 71 | <a href="courses.php?action=deletecoursecategory&id=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>"> |
72 | - <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"),22) ?> |
|
72 | + <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"), 22) ?> |
|
73 | 73 | </a> |
74 | 74 | <?php } |
75 | 75 | echo '<br /><br />'; |
@@ -123,35 +123,35 @@ discard block |
||
123 | 123 | <div style="float:left;width:110px;"> |
124 | 124 | <?php |
125 | 125 | if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
126 | - $icon_title = get_lang('CourseDetails') . ' - ' . $course['title']; |
|
126 | + $icon_title = get_lang('CourseDetails').' - '.$course['title']; |
|
127 | 127 | ?> |
128 | 128 | <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax"> |
129 | - <?php echo Display::return_icon('info.png', $icon_title,'','22') ?> |
|
129 | + <?php echo Display::return_icon('info.png', $icon_title, '', '22') ?> |
|
130 | 130 | <?php } ?> |
131 | 131 | </a> |
132 | 132 | |
133 | 133 | <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?> |
134 | - <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?> |
|
134 | + <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?> |
|
135 | 135 | <?php } else { ?> |
136 | 136 | <a href="courses.php?action=<?php echo $action; ?>&edit=<?php echo $course['code']; ?>&sec_token=<?php echo $stok; ?>"> |
137 | - <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?> |
|
137 | + <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> |
|
138 | 138 | </a> |
139 | 139 | <?php } ?> |
140 | 140 | |
141 | 141 | <?php if ($key > 0) { ?> |
142 | 142 | <a href="courses.php?action=<?php echo $action; ?>&move=up&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
143 | - <?php echo Display::display_icon('up.png', get_lang('Up'),'',22); ?> |
|
143 | + <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22); ?> |
|
144 | 144 | </a> |
145 | 145 | <?php } else { ?> |
146 | - <?php echo Display::display_icon('up_na.png', get_lang('Up'),'',22); ?> |
|
146 | + <?php echo Display::display_icon('up_na.png', get_lang('Up'), '', 22); ?> |
|
147 | 147 | <?php } ?> |
148 | 148 | |
149 | 149 | <?php if ($key < $number_of_courses - 1) { ?> |
150 | 150 | <a href="courses.php?action=<?php echo $action; ?>&move=down&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
151 | - <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?> |
|
151 | + <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?> |
|
152 | 152 | </a> |
153 | 153 | <?php } else { ?> |
154 | - <?php echo Display::display_icon('down_na.png', get_lang('Down'),'',22); ?> |
|
154 | + <?php echo Display::display_icon('down_na.png', get_lang('Down'), '', 22); ?> |
|
155 | 155 | <?php } ?> |
156 | 156 | |
157 | 157 | </div> |
@@ -219,36 +219,36 @@ discard block |
||
219 | 219 | <div style="float:left; width:110px"> |
220 | 220 | <?php |
221 | 221 | if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
222 | - $icon_title = get_lang('CourseDetails') . ' - ' . $course['title']; |
|
222 | + $icon_title = get_lang('CourseDetails').' - '.$course['title']; |
|
223 | 223 | ?> |
224 | 224 | <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax"> |
225 | - <?php echo Display::return_icon('info.png', $icon_title, '','22'); ?> |
|
225 | + <?php echo Display::return_icon('info.png', $icon_title, '', '22'); ?> |
|
226 | 226 | </a> |
227 | 227 | <?php } ?> |
228 | 228 | |
229 | 229 | <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?> |
230 | - <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?> |
|
230 | + <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?> |
|
231 | 231 | <?php } else { ?> |
232 | 232 | <a href="courses.php?action=<?php echo $action; ?>&edit=<?php echo $course['code']; ?>&sec_token=<?php echo $stok; ?>"> |
233 | - <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?> |
|
233 | + <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> |
|
234 | 234 | </a> |
235 | 235 | <?php } ?> |
236 | 236 | |
237 | 237 | <!-- up /down icons--> |
238 | 238 | <?php if ($key > 0) { ?> |
239 | 239 | <a href="courses.php?action=<?php echo $action; ?>&move=up&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
240 | - <?php echo Display::display_icon('up.png', get_lang('Up'),'',22) ?> |
|
240 | + <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22) ?> |
|
241 | 241 | </a> |
242 | 242 | <?php } else { |
243 | - echo Display::display_icon('up_na.png', get_lang('Up'),'',22); |
|
243 | + echo Display::display_icon('up_na.png', get_lang('Up'), '', 22); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | if ($key < $number_of_courses - 1) { ?> |
247 | 247 | <a href="courses.php?action=<?php echo $action; ?>&move=down&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
248 | - <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?> |
|
248 | + <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?> |
|
249 | 249 | </a> |
250 | 250 | <?php } else { |
251 | - echo Display::display_icon('down_na.png', get_lang('Down'),'',22); |
|
251 | + echo Display::display_icon('down_na.png', get_lang('Down'), '', 22); |
|
252 | 252 | }?> |
253 | 253 | </div> |
254 | 254 | <div style="float:left; margin-right:10px;"> |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | public static function get_last_condition_version($language) |
81 | 81 | { |
82 | 82 | $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); |
83 | - $language= Database::escape_string($language); |
|
83 | + $language = Database::escape_string($language); |
|
84 | 84 | $sql = "SELECT version FROM $legal_conditions_table |
85 | 85 | WHERE language_id = '".$language."' |
86 | 86 | ORDER BY id DESC LIMIT 1 "; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | public static function get_last_condition($language) |
102 | 102 | { |
103 | 103 | $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); |
104 | - $language= Database::escape_string($language); |
|
104 | + $language = Database::escape_string($language); |
|
105 | 105 | $sql = "SELECT * FROM $legal_conditions_table |
106 | 106 | WHERE language_id = '".$language."' |
107 | 107 | ORDER BY version DESC |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | ORDER BY version DESC |
152 | 152 | LIMIT 1 "; |
153 | 153 | $result = Database::query($sql); |
154 | - if (Database::num_rows($result)>0){ |
|
154 | + if (Database::num_rows($result) > 0) { |
|
155 | 155 | $version = Database::fetch_array($result); |
156 | - $version = explode(':',$version[0]); |
|
156 | + $version = explode(':', $version[0]); |
|
157 | 157 | |
158 | 158 | return $version[0]; |
159 | 159 | } else { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | break; |
185 | 185 | // Page link |
186 | 186 | case 1: |
187 | - $preview ='<fieldset> |
|
187 | + $preview = '<fieldset> |
|
188 | 188 | <legend>'.get_lang('TermsAndConditions').'</legend>'; |
189 | 189 | $preview .= '<div id="legal-accept-wrapper" class="form-item"> |
190 | 190 | <label class="option" for="legal-accept"> |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $number_of_items = intval($number_of_items); |
218 | 218 | $column = intval($column); |
219 | 219 | |
220 | - $sql = "SELECT version, original_name as language, content, changes, type, FROM_UNIXTIME(date) |
|
220 | + $sql = "SELECT version, original_name as language, content, changes, type, FROM_UNIXTIME(date) |
|
221 | 221 | FROM $legal_conditions_table inner join $lang_table l on(language_id = l.id) "; |
222 | 222 | $sql .= "ORDER BY language, version ASC "; |
223 | 223 | $sql .= "LIMIT $from, $number_of_items "; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | FROM $legal_conditions_table |
253 | 253 | ORDER BY id DESC "; |
254 | 254 | $result = Database::query($sql); |
255 | - $url = Database::fetch_array($result,'ASSOC'); |
|
255 | + $url = Database::fetch_array($result, 'ASSOC'); |
|
256 | 256 | $result = $url['count_result']; |
257 | 257 | |
258 | 258 | return $result; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | WHERE id = "'.$legal_id.'" AND language_id="'.$language_id.'"'; |
274 | 274 | $rs = Database::query($sql); |
275 | 275 | |
276 | - return Database::result($rs,0,'type'); |
|
276 | + return Database::result($rs, 0, 'type'); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |