@@ -307,8 +307,8 @@ discard block |
||
307 | 307 | } |
308 | 308 | } |
309 | 309 | |
310 | - return $block_data; |
|
311 | - } |
|
310 | + return $block_data; |
|
311 | + } |
|
312 | 312 | |
313 | 313 | /** |
314 | 314 | * get data about enabled dashboard block (stored insise block table) |
@@ -491,42 +491,42 @@ discard block |
||
491 | 491 | return $data; |
492 | 492 | } |
493 | 493 | |
494 | - /** |
|
495 | - * This function update extra user blocks data after closing a dashboard block |
|
496 | - * @param int User id |
|
497 | - * @param string plugin path |
|
498 | - * @param integer $user_id |
|
499 | - * @return bool |
|
500 | - */ |
|
501 | - public static function close_user_block($user_id, $path) |
|
494 | + /** |
|
495 | + * This function update extra user blocks data after closing a dashboard block |
|
496 | + * @param int User id |
|
497 | + * @param string plugin path |
|
498 | + * @param integer $user_id |
|
499 | + * @return bool |
|
500 | + */ |
|
501 | + public static function close_user_block($user_id, $path) |
|
502 | 502 | { |
503 | - $enabled_dashboard_blocks = self::get_enabled_dashboard_blocks($path); |
|
504 | - $user_block_data = self::get_user_block_data($user_id); |
|
505 | - |
|
506 | - foreach ($enabled_dashboard_blocks as $enabled_block) { |
|
507 | - unset($user_block_data[$enabled_block['id']]); |
|
508 | - } |
|
509 | - |
|
510 | - // get columns and blocks id for updating extra user data |
|
511 | - $columns = array(); |
|
512 | - $user_blocks_id = array(); |
|
513 | - foreach ($user_block_data as $data) { |
|
514 | - $user_blocks_id[$data['block_id']] = true; |
|
515 | - $columns[$data['block_id']] = $data['column']; |
|
516 | - } |
|
517 | - |
|
518 | - // update extra user blocks data |
|
519 | - $upd_extra_field = self::store_user_blocks($user_id, $user_blocks_id, $columns); |
|
520 | - |
|
521 | - return $upd_extra_field; |
|
522 | - } |
|
523 | - |
|
524 | - /** |
|
525 | - * get links for styles from dashboard plugins |
|
526 | - * @return string links |
|
527 | - */ |
|
528 | - public static function get_links_for_styles_from_dashboard_plugins() { |
|
529 | - |
|
530 | - return '<link rel="stylesheet" href="'.api_get_path(WEB_PLUGIN_PATH).'dashboard/css/default.css" type="text/css" />'.PHP_EOL; |
|
531 | - } |
|
503 | + $enabled_dashboard_blocks = self::get_enabled_dashboard_blocks($path); |
|
504 | + $user_block_data = self::get_user_block_data($user_id); |
|
505 | + |
|
506 | + foreach ($enabled_dashboard_blocks as $enabled_block) { |
|
507 | + unset($user_block_data[$enabled_block['id']]); |
|
508 | + } |
|
509 | + |
|
510 | + // get columns and blocks id for updating extra user data |
|
511 | + $columns = array(); |
|
512 | + $user_blocks_id = array(); |
|
513 | + foreach ($user_block_data as $data) { |
|
514 | + $user_blocks_id[$data['block_id']] = true; |
|
515 | + $columns[$data['block_id']] = $data['column']; |
|
516 | + } |
|
517 | + |
|
518 | + // update extra user blocks data |
|
519 | + $upd_extra_field = self::store_user_blocks($user_id, $user_blocks_id, $columns); |
|
520 | + |
|
521 | + return $upd_extra_field; |
|
522 | + } |
|
523 | + |
|
524 | + /** |
|
525 | + * get links for styles from dashboard plugins |
|
526 | + * @return string links |
|
527 | + */ |
|
528 | + public static function get_links_for_styles_from_dashboard_plugins() { |
|
529 | + |
|
530 | + return '<link rel="stylesheet" href="'.api_get_path(WEB_PLUGIN_PATH).'dashboard/css/default.css" type="text/css" />'.PHP_EOL; |
|
531 | + } |
|
532 | 532 | } |
@@ -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 | } |
@@ -498,7 +498,7 @@ |
||
498 | 498 | * @param int User id |
499 | 499 | * @param string plugin path |
500 | 500 | * @param integer $user_id |
501 | - * @return bool |
|
501 | + * @return false|string |
|
502 | 502 | */ |
503 | 503 | public static function close_user_block($user_id, $path) |
504 | 504 | { |
@@ -477,6 +477,7 @@ discard block |
||
477 | 477 | * |
478 | 478 | * Get link info |
479 | 479 | * @param int link id |
480 | + * @param integer $id |
|
480 | 481 | * @return array link info |
481 | 482 | * |
482 | 483 | **/ |
@@ -1058,7 +1059,9 @@ discard block |
||
1058 | 1059 | /** |
1059 | 1060 | * Displays the edit, delete and move icons |
1060 | 1061 | * @param int Category ID |
1061 | - * @return void |
|
1062 | + * @param integer $currentCategory |
|
1063 | + * @param integer $countCategories |
|
1064 | + * @return string |
|
1062 | 1065 | * @author Patrick Cool <[email protected]>, Ghent University |
1063 | 1066 | */ |
1064 | 1067 | public static function showCategoryAdminTools($category, $currentCategory, $countCategories) |
@@ -1222,6 +1225,7 @@ discard block |
||
1222 | 1225 | /** |
1223 | 1226 | * CSV file import functions |
1224 | 1227 | * @author René Haentjens , Ghent University |
1228 | + * @param string $catname |
|
1225 | 1229 | */ |
1226 | 1230 | public static function get_cat($catname) |
1227 | 1231 | { |
@@ -1261,6 +1265,11 @@ discard block |
||
1261 | 1265 | /** |
1262 | 1266 | * CSV file import functions |
1263 | 1267 | * @author René Haentjens , Ghent University |
1268 | + * @param string $url |
|
1269 | + * @param string $title |
|
1270 | + * @param string $description |
|
1271 | + * @param string $on_homepage |
|
1272 | + * @param string $hidden |
|
1264 | 1273 | */ |
1265 | 1274 | public static function put_link($url, $cat, $title, $description, $on_homepage, $hidden) |
1266 | 1275 | { |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | $params['session_id'] = api_get_session_id(); |
80 | 80 | $params['category_id'] = isset($params['category_id']) ? $params['category_id'] : 0; |
81 | 81 | |
82 | - $sql = "SELECT MAX(display_order) |
|
82 | + $sql = "SELECT MAX(display_order) |
|
83 | 83 | FROM ".$this->table." |
84 | 84 | WHERE |
85 | 85 | c_id = $courseId AND |
86 | - category_id = '" . intval($params['category_id'])."'"; |
|
86 | + category_id = '".intval($params['category_id'])."'"; |
|
87 | 87 | $result = Database:: query($sql); |
88 | 88 | list ($orderMax) = Database:: fetch_row($result); |
89 | 89 | $order = $orderMax + 1; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | // We ensure URL to be absolute. |
186 | 186 | if (strpos($urllink, '://') === false) { |
187 | - $urllink = 'http://' . $urllink; |
|
187 | + $urllink = 'http://'.$urllink; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | // If the title is empty, we use the URL as title. |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | 'c_id' => $course_id, |
207 | 207 | 'url' => $urllink, |
208 | 208 | 'title' => $title, |
209 | - 'description' => $description , |
|
209 | + 'description' => $description, |
|
210 | 210 | 'category_id' => $selectcategory, |
211 | 211 | 'on_homepage' => $onhomepage, |
212 | 212 | 'target' => $target, |
@@ -217,9 +217,9 @@ discard block |
||
217 | 217 | if ((api_get_setting('search_enabled') == 'true') && |
218 | 218 | $link_id && extension_loaded('xapian') |
219 | 219 | ) { |
220 | - require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php'; |
|
221 | - require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php'; |
|
222 | - require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'; |
|
220 | + require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
|
221 | + require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php'; |
|
222 | + require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
223 | 223 | |
224 | 224 | $course_int_id = $_course['real_id']; |
225 | 225 | $courseCode = $_course['code']; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | if (isset($_REQUEST[$specific_field['code']])) { |
233 | 233 | $sterms = trim($_REQUEST[$specific_field['code']]); |
234 | 234 | if (!empty($sterms)) { |
235 | - $all_specific_terms .= ' ' . $sterms; |
|
235 | + $all_specific_terms .= ' '.$sterms; |
|
236 | 236 | $sterms = explode(',', $sterms); |
237 | 237 | foreach ($sterms as $sterm) { |
238 | 238 | $ic_slide->addTerm( |
@@ -259,12 +259,12 @@ discard block |
||
259 | 259 | SE_COURSE_ID => $courseCode, |
260 | 260 | SE_TOOL_ID => TOOL_LINK, |
261 | 261 | SE_DATA => array( |
262 | - 'link_id' => (int)$link_id |
|
262 | + 'link_id' => (int) $link_id |
|
263 | 263 | ), |
264 | - SE_USER => (int)api_get_user_id(), |
|
264 | + SE_USER => (int) api_get_user_id(), |
|
265 | 265 | ); |
266 | 266 | $ic_slide->xapian_data = serialize($xapian_data); |
267 | - $description = $all_specific_terms . ' ' . $description; |
|
267 | + $description = $all_specific_terms.' '.$description; |
|
268 | 268 | $ic_slide->addValue('content', $description); |
269 | 269 | |
270 | 270 | // Add category name if set. |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $sql_cat = sprintf( |
277 | 277 | $sql_cat, |
278 | 278 | $table_link_category, |
279 | - (int)$selectcategory, |
|
279 | + (int) $selectcategory, |
|
280 | 280 | $course_int_id |
281 | 281 | ); |
282 | 282 | $result = Database:: query($sql_cat); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | // but the visibility is set to 2 (in item_property). |
394 | 394 | // This will make a restore function possible for the platform administrator. |
395 | 395 | $sql = "UPDATE $tbl_link SET on_homepage='0' |
396 | - WHERE c_id = $course_id AND id='" . $id . "'"; |
|
396 | + WHERE c_id = $course_id AND id='".$id."'"; |
|
397 | 397 | Database:: query($sql); |
398 | 398 | |
399 | 399 | api_item_property_update( |
@@ -409,12 +409,12 @@ discard block |
||
409 | 409 | break; |
410 | 410 | case 'category': |
411 | 411 | // First we delete the category itself and afterwards all the links of this category. |
412 | - $sql = "DELETE FROM " . $tbl_categories . " |
|
413 | - WHERE c_id = $course_id AND id='" . $id . "'"; |
|
412 | + $sql = "DELETE FROM ".$tbl_categories." |
|
413 | + WHERE c_id = $course_id AND id='".$id."'"; |
|
414 | 414 | Database:: query($sql); |
415 | 415 | |
416 | - $sql = "DELETE FROM " . $tbl_link . " |
|
417 | - WHERE c_id = $course_id AND category_id='" . $id . "'"; |
|
416 | + $sql = "DELETE FROM ".$tbl_link." |
|
417 | + WHERE c_id = $course_id AND category_id='".$id."'"; |
|
418 | 418 | Database:: query($sql); |
419 | 419 | |
420 | 420 | api_item_property_update( |
@@ -451,16 +451,16 @@ discard block |
||
451 | 451 | $res = Database:: query($sql); |
452 | 452 | if (Database:: num_rows($res) > 0) { |
453 | 453 | $row = Database:: fetch_array($res); |
454 | - require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php'; |
|
454 | + require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
|
455 | 455 | $di = new ChamiloIndexer(); |
456 | - $di->remove_document((int)$row['search_did']); |
|
456 | + $di->remove_document((int) $row['search_did']); |
|
457 | 457 | } |
458 | 458 | $sql = 'DELETE FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_high_level=%s LIMIT 1'; |
459 | 459 | $sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_LINK, $link_id); |
460 | 460 | Database:: query($sql); |
461 | 461 | |
462 | 462 | // Remove terms from db. |
463 | - require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'; |
|
463 | + require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
464 | 464 | delete_all_values_for_item($course_id, TOOL_DOCUMENT, $link_id); |
465 | 465 | } |
466 | 466 | } |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | } |
483 | 483 | |
484 | 484 | $sql = "SELECT * FROM $tbl_link |
485 | - WHERE c_id = $course_id AND id='" . intval($id) . "' "; |
|
485 | + WHERE c_id = $course_id AND id='".intval($id)."' "; |
|
486 | 486 | $result = Database::query($sql); |
487 | 487 | $data = array(); |
488 | 488 | if (Database::num_rows($result)) { |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | |
513 | 513 | // We ensure URL to be absolute. |
514 | 514 | if (strpos($values['url'], '://') === false) { |
515 | - $values['url'] = 'http://' . $_POST['url']; |
|
515 | + $values['url'] = 'http://'.$_POST['url']; |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | // If the title is empty, we use the URL as title. |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | |
536 | 536 | // Finding the old category_id. |
537 | 537 | $sql = "SELECT * FROM $tbl_link |
538 | - WHERE c_id = $course_id AND id='" . $id . "'"; |
|
538 | + WHERE c_id = $course_id AND id='".$id."'"; |
|
539 | 539 | $result = Database:: query($sql); |
540 | 540 | $row = Database:: fetch_array($result); |
541 | 541 | $category_id = $row['category_id']; |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | FROM $tbl_link |
546 | 546 | WHERE |
547 | 547 | c_id = $course_id AND |
548 | - category_id='" . intval($values['category_id']) . "'"; |
|
548 | + category_id='".intval($values['category_id'])."'"; |
|
549 | 549 | $result = Database:: query($sql); |
550 | 550 | list ($max_display_order) = Database:: fetch_row($result); |
551 | 551 | $max_display_order++; |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | $_REQUEST[$specific_field['code']] |
615 | 615 | ); |
616 | 616 | if (!empty($sterms)) { |
617 | - $all_specific_terms .= ' ' . $sterms; |
|
617 | + $all_specific_terms .= ' '.$sterms; |
|
618 | 618 | $sterms = explode(',', $sterms); |
619 | 619 | foreach ($sterms as $sterm) { |
620 | 620 | $ic_slide->addTerm( |
@@ -641,13 +641,13 @@ discard block |
||
641 | 641 | SE_COURSE_ID => $course_id, |
642 | 642 | SE_TOOL_ID => TOOL_LINK, |
643 | 643 | SE_DATA => array( |
644 | - 'link_id' => (int)$id |
|
644 | + 'link_id' => (int) $id |
|
645 | 645 | ), |
646 | - SE_USER => (int)api_get_user_id(), |
|
646 | + SE_USER => (int) api_get_user_id(), |
|
647 | 647 | |
648 | 648 | ); |
649 | 649 | $ic_slide->xapian_data = serialize($xapian_data); |
650 | - $link_description = $all_specific_terms . ' ' . $link_description; |
|
650 | + $link_description = $all_specific_terms.' '.$link_description; |
|
651 | 651 | $ic_slide->addValue('content', $link_description); |
652 | 652 | |
653 | 653 | // Add category name if set. |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | $di = new ChamiloIndexer(); |
676 | 676 | isset ($_POST['language']) ? $lang = Database:: escape_string($_POST['language']) : $lang = 'english'; |
677 | 677 | $di->connectDb(null, null, $lang); |
678 | - $di->remove_document((int)$se_ref['search_did']); |
|
678 | + $di->remove_document((int) $se_ref['search_did']); |
|
679 | 679 | $di->addChunk($ic_slide); |
680 | 680 | |
681 | 681 | // Index and return search engine document id. |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | $sql = "SELECT *, linkcat.id |
797 | 797 | FROM $tblLinkCategory linkcat |
798 | 798 | WHERE |
799 | - linkcat.c_id = " . $courseId . " |
|
799 | + linkcat.c_id = ".$courseId." |
|
800 | 800 | $sessionCondition |
801 | 801 | ORDER BY linkcat.display_order DESC"; |
802 | 802 | |
@@ -808,10 +808,10 @@ discard block |
||
808 | 808 | INNER JOIN $tblItemProperty itemproperties |
809 | 809 | ON (linkcat.id = itemproperties.ref AND linkcat.c_id = itemproperties.c_id) |
810 | 810 | WHERE |
811 | - itemproperties.tool = '" . TOOL_LINK_CATEGORY . "' AND |
|
811 | + itemproperties.tool = '".TOOL_LINK_CATEGORY."' AND |
|
812 | 812 | (itemproperties.visibility = '0' OR itemproperties.visibility = '1') |
813 | 813 | $sessionCondition AND |
814 | - linkcat.c_id = " . $courseId . " |
|
814 | + linkcat.c_id = ".$courseId." |
|
815 | 815 | ORDER BY linkcat.display_order DESC"; |
816 | 816 | |
817 | 817 | $result = Database::query($sql); |
@@ -834,10 +834,10 @@ discard block |
||
834 | 834 | INNER JOIN $tblItemProperty itemproperties |
835 | 835 | ON (linkcat.id = itemproperties.ref AND linkcat.c_id = itemproperties.c_id) |
836 | 836 | WHERE |
837 | - itemproperties.tool = '" . TOOL_LINK_CATEGORY . "' AND |
|
837 | + itemproperties.tool = '".TOOL_LINK_CATEGORY."' AND |
|
838 | 838 | (itemproperties.visibility = '0' OR itemproperties.visibility = '1') |
839 | 839 | $sessionCondition AND |
840 | - linkcat.c_id = " . $courseId . " |
|
840 | + linkcat.c_id = ".$courseId." |
|
841 | 841 | ORDER BY linkcat.display_order DESC |
842 | 842 | "; |
843 | 843 | $result = Database::query($sql); |
@@ -867,12 +867,12 @@ discard block |
||
867 | 867 | INNER JOIN $TABLE_ITEM_PROPERTY itemproperties |
868 | 868 | ON (link.id=itemproperties.ref AND link.c_id = itemproperties.c_id) |
869 | 869 | WHERE |
870 | - itemproperties.tool='" . TOOL_LINK . "' AND |
|
871 | - link.category_id='" . $catid . "' AND |
|
870 | + itemproperties.tool='".TOOL_LINK."' AND |
|
871 | + link.category_id='" . $catid."' AND |
|
872 | 872 | (itemproperties.visibility='0' OR itemproperties.visibility='1') |
873 | 873 | $condition_session AND |
874 | - link.c_id = " . $course_id . " AND |
|
875 | - itemproperties.c_id = " . $course_id . " |
|
874 | + link.c_id = ".$course_id." AND |
|
875 | + itemproperties.c_id = " . $course_id." |
|
876 | 876 | ORDER BY link.display_order ASC"; |
877 | 877 | $result = Database:: query($sql); |
878 | 878 | $numberoflinks = Database:: num_rows($result); |
@@ -895,23 +895,23 @@ discard block |
||
895 | 895 | 'check-circle-o', |
896 | 896 | 'default btn-sm', |
897 | 897 | array( |
898 | - 'onclick' => "check_url('" . $myrow['id'] . "', '" . addslashes($myrow['url']) . "');", |
|
898 | + 'onclick' => "check_url('".$myrow['id']."', '".addslashes($myrow['url'])."');", |
|
899 | 899 | 'title' => get_lang('CheckURL') |
900 | 900 | ) |
901 | 901 | ); |
902 | 902 | $link_validator .= Display::span( |
903 | 903 | '', |
904 | 904 | array( |
905 | - 'id' => 'url_id_' . $myrow['id'], |
|
905 | + 'id' => 'url_id_'.$myrow['id'], |
|
906 | 906 | 'class' => 'check-link' |
907 | 907 | ) |
908 | 908 | ); |
909 | 909 | |
910 | 910 | if ($session_id == $myrow['session_id']) { |
911 | - $url = api_get_self() . '?' . api_get_cidreq() . |
|
912 | - '&action=editlink&category=' . (!empty ($category) ? $category : '') . |
|
913 | - '&id=' . $myrow['id'] . |
|
914 | - '&category_id=' . $myrow['id']; |
|
911 | + $url = api_get_self().'?'.api_get_cidreq(). |
|
912 | + '&action=editlink&category='.(!empty ($category) ? $category : ''). |
|
913 | + '&id='.$myrow['id']. |
|
914 | + '&category_id='.$myrow['id']; |
|
915 | 915 | $title = get_lang('Edit'); |
916 | 916 | $toolbar .= Display::toolbarButton( |
917 | 917 | '', |
@@ -924,10 +924,10 @@ discard block |
||
924 | 924 | ); |
925 | 925 | |
926 | 926 | if ($myrow['visibility'] == '1') { |
927 | - $url .= 'link.php?' . api_get_cidreq() . |
|
928 | - '&sec_token=' . $token . |
|
929 | - '&action=invisible&id=' . $myrow['id'] . |
|
930 | - '&scope=link&category_id=' . $myrow['category_id']; |
|
927 | + $url .= 'link.php?'.api_get_cidreq(). |
|
928 | + '&sec_token='.$token. |
|
929 | + '&action=invisible&id='.$myrow['id']. |
|
930 | + '&scope=link&category_id='.$myrow['category_id']; |
|
931 | 931 | $title = get_lang('MakeInvisible'); |
932 | 932 | $toolbar .= Display::toolbarButton( |
933 | 933 | '', |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | } |
942 | 942 | |
943 | 943 | if ($myrow['visibility'] == '0') { |
944 | - $url .= 'link.php?' . api_get_cidreq() .'&sec_token=' . $token .'&action=visible&id=' . $myrow['id'] .'&scope=link&category_id=' . $myrow['category_id']; |
|
944 | + $url .= 'link.php?'.api_get_cidreq().'&sec_token='.$token.'&action=visible&id='.$myrow['id'].'&scope=link&category_id='.$myrow['category_id']; |
|
945 | 945 | $title = get_lang('MakeVisible'); |
946 | 946 | $toolbar .= Display::toolbarButton( |
947 | 947 | '', |
@@ -962,24 +962,24 @@ discard block |
||
962 | 962 | ]; |
963 | 963 | $toolbar .= Display::toolbarButton( |
964 | 964 | get_lang('MoveUp'), |
965 | - 'link.php?' . api_get_cidreq() . '&' . http_build_query($moveLinkParams), |
|
965 | + 'link.php?'.api_get_cidreq().'&'.http_build_query($moveLinkParams), |
|
966 | 966 | 'level-up', |
967 | 967 | 'default', |
968 | - ['class' => 'btn-sm ' . ($i === 1 ? 'disabled' : '')], |
|
968 | + ['class' => 'btn-sm '.($i === 1 ? 'disabled' : '')], |
|
969 | 969 | false |
970 | 970 | ); |
971 | 971 | $moveLinkParams['action'] = 'move_link_down'; |
972 | 972 | $toolbar .= Display::toolbarButton( |
973 | 973 | get_lang('MoveDown'), |
974 | - 'link.php?' . api_get_cidreq() . '&' . http_build_query($moveLinkParams), |
|
974 | + 'link.php?'.api_get_cidreq().'&'.http_build_query($moveLinkParams), |
|
975 | 975 | 'level-down', |
976 | 976 | 'default', |
977 | - ['class' => 'btn-sm ' . ($i === $numberoflinks ? 'disabled' : '')], |
|
977 | + ['class' => 'btn-sm '.($i === $numberoflinks ? 'disabled' : '')], |
|
978 | 978 | false |
979 | 979 | ); |
980 | 980 | |
981 | - $url .= api_get_self() . '?' . api_get_cidreq() .'&sec_token=' . $token .'&action=deletelink&id=' . $myrow['id'] .'&category_id=' . $myrow['category_id']; |
|
982 | - $event = "javascript: if(!confirm('" . get_lang('LinkDelconfirm') . "'))return false;"; |
|
981 | + $url .= api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=deletelink&id='.$myrow['id'].'&category_id='.$myrow['category_id']; |
|
982 | + $event = "javascript: if(!confirm('".get_lang('LinkDelconfirm')."'))return false;"; |
|
983 | 983 | $title = get_lang('Delete'); |
984 | 984 | |
985 | 985 | $toolbar .= Display::toolbarButton( |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | $content .= '<div class="pull-right"><div class="btn-group">'.$toolbar.'</div></div>'; |
1018 | 1018 | $content .= '<h4 class="list-group-item-heading">'; |
1019 | 1019 | $content .= $iconLink; |
1020 | - $url = 'link_goto.php?' . api_get_cidreq() .'&link_id=' . $myrow['id'] .'&link_url=' . urlencode($myrow['url']); |
|
1020 | + $url = 'link_goto.php?'.api_get_cidreq().'&link_id='.$myrow['id'].'&link_url='.urlencode($myrow['url']); |
|
1021 | 1021 | $content .= Display::tag( |
1022 | 1022 | 'a', |
1023 | 1023 | Security:: remove_XSS($myrow['title']), |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | $content .= $session_img; |
1031 | 1031 | $content .= '</h4>'; |
1032 | 1032 | |
1033 | - $content .= '<p class="list-group-item-text">' . $myrow['description'] . '</p>'; |
|
1033 | + $content .= '<p class="list-group-item-text">'.$myrow['description'].'</p>'; |
|
1034 | 1034 | $content .= '</div>'; |
1035 | 1035 | } else { |
1036 | 1036 | if (api_is_allowed_to_edit(null, true)) { |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | $content .= '<div class="pull-right"><div class="btn-group">'.$toolbar.'</div></div>'; |
1039 | 1039 | $content .= '<h4 class="list-group-item-heading">'; |
1040 | 1040 | $content .= $iconLink; |
1041 | - $url = 'link_goto.php?' . api_get_cidreq() .'&link_id=' . $myrow['id'] . "&link_url=" . urlencode($myrow['url']); |
|
1041 | + $url = 'link_goto.php?'.api_get_cidreq().'&link_id='.$myrow['id']."&link_url=".urlencode($myrow['url']); |
|
1042 | 1042 | $content .= Display::tag( |
1043 | 1043 | 'a', |
1044 | 1044 | Security:: remove_XSS($myrow['title']), |
@@ -1051,7 +1051,7 @@ discard block |
||
1051 | 1051 | $content .= $link_validator; |
1052 | 1052 | $content .= $session_img; |
1053 | 1053 | $content .= '</h4>'; |
1054 | - $content .= '<p class="list-group-item-text">' . $myrow['description'] . '</p>'; |
|
1054 | + $content .= '<p class="list-group-item-text">'.$myrow['description'].'</p>'; |
|
1055 | 1055 | $content .= '</div>'; |
1056 | 1056 | } |
1057 | 1057 | } |
@@ -1073,58 +1073,58 @@ discard block |
||
1073 | 1073 | { |
1074 | 1074 | $categoryId = $category['id']; |
1075 | 1075 | $token = null; |
1076 | - $tools = '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&sec_token=' . $token . '&action=editcategory&id=' . $categoryId . '&category_id=' . $categoryId . '" title=' . get_lang('Modify') . '">' . |
|
1076 | + $tools = '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=editcategory&id='.$categoryId.'&category_id='.$categoryId.'" title='.get_lang('Modify').'">'. |
|
1077 | 1077 | Display:: return_icon( |
1078 | 1078 | 'edit.png', |
1079 | 1079 | get_lang('Modify'), |
1080 | 1080 | array(), |
1081 | 1081 | ICON_SIZE_SMALL |
1082 | - ) . '</a>'; |
|
1082 | + ).'</a>'; |
|
1083 | 1083 | |
1084 | 1084 | // DISPLAY MOVE UP COMMAND only if it is not the top link. |
1085 | 1085 | if ($currentCategory != 0) { |
1086 | - $tools .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&sec_token=' . $token . '&action=up&up='.$categoryId.'&category_id='.$categoryId.'" title="'.get_lang('Up').'">'. |
|
1086 | + $tools .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=up&up='.$categoryId.'&category_id='.$categoryId.'" title="'.get_lang('Up').'">'. |
|
1087 | 1087 | Display:: return_icon( |
1088 | 1088 | 'up.png', |
1089 | 1089 | get_lang('Up'), |
1090 | 1090 | array(), |
1091 | 1091 | ICON_SIZE_SMALL |
1092 | - ) . '</a>'; |
|
1092 | + ).'</a>'; |
|
1093 | 1093 | } else { |
1094 | 1094 | $tools .= Display:: return_icon( |
1095 | 1095 | 'up_na.png', |
1096 | 1096 | get_lang('Up'), |
1097 | 1097 | array(), |
1098 | 1098 | ICON_SIZE_SMALL |
1099 | - ) . '</a>'; |
|
1099 | + ).'</a>'; |
|
1100 | 1100 | } |
1101 | 1101 | |
1102 | 1102 | // DISPLAY MOVE DOWN COMMAND only if it is not the bottom link. |
1103 | - if ($currentCategory < $countCategories-1) { |
|
1104 | - $tools .= '<a href="' . api_get_self() . '?' . api_get_cidreq() .'&sec_token=' . $token .'&action=down&down=' . $categoryId .'&category_id=' . $categoryId . '">'. |
|
1103 | + if ($currentCategory < $countCategories - 1) { |
|
1104 | + $tools .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=down&down='.$categoryId.'&category_id='.$categoryId.'">'. |
|
1105 | 1105 | Display:: return_icon( |
1106 | 1106 | 'down.png', |
1107 | 1107 | get_lang('Down'), |
1108 | 1108 | array(), |
1109 | 1109 | ICON_SIZE_SMALL |
1110 | - ) . '</a>'; |
|
1110 | + ).'</a>'; |
|
1111 | 1111 | } else { |
1112 | 1112 | $tools .= Display:: return_icon( |
1113 | 1113 | 'down_na.png', |
1114 | 1114 | get_lang('Down'), |
1115 | 1115 | array(), |
1116 | 1116 | ICON_SIZE_SMALL |
1117 | - ) . '</a>'; |
|
1117 | + ).'</a>'; |
|
1118 | 1118 | } |
1119 | 1119 | |
1120 | - $tools .= '<a href="' . api_get_self() . '?' . api_get_cidreq() .'&sec_token=' . $token .'&action=deletecategory&id='.$categoryId. "&category_id=$categoryId\" |
|
1121 | - onclick=\"javascript: if(!confirm('" . get_lang('CategoryDelconfirm') . "')) return false;\">". |
|
1120 | + $tools .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=deletecategory&id='.$categoryId."&category_id=$categoryId\" |
|
1121 | + onclick=\"javascript: if(!confirm('".get_lang('CategoryDelconfirm')."')) return false;\">". |
|
1122 | 1122 | Display:: return_icon( |
1123 | 1123 | 'delete.png', |
1124 | 1124 | get_lang('Delete'), |
1125 | 1125 | array(), |
1126 | 1126 | ICON_SIZE_SMALL |
1127 | - ) . '</a>'; |
|
1127 | + ).'</a>'; |
|
1128 | 1128 | |
1129 | 1129 | return $tools; |
1130 | 1130 | } |
@@ -1180,12 +1180,12 @@ discard block |
||
1180 | 1180 | $nextlinkOrder = $sortrow['display_order']; |
1181 | 1181 | |
1182 | 1182 | Database:: query( |
1183 | - "UPDATE " . $movetable . " |
|
1183 | + "UPDATE ".$movetable." |
|
1184 | 1184 | SET display_order = '$nextlinkOrder' |
1185 | 1185 | WHERE c_id = $courseId AND id = '$thiscatlinkId'" |
1186 | 1186 | ); |
1187 | 1187 | Database:: query( |
1188 | - "UPDATE " . $movetable . " |
|
1188 | + "UPDATE ".$movetable." |
|
1189 | 1189 | SET display_order = '$thislinkOrder' |
1190 | 1190 | WHERE c_id = $courseId AND id = '$nextlinkId'" |
1191 | 1191 | ); |
@@ -1213,10 +1213,10 @@ discard block |
||
1213 | 1213 | $course_id = api_get_course_int_id(); |
1214 | 1214 | |
1215 | 1215 | $result = Database:: query( |
1216 | - "SELECT id FROM " . $tbl_categories . " |
|
1217 | - WHERE c_id = $course_id AND category_title='" . Database::escape_string( |
|
1216 | + "SELECT id FROM ".$tbl_categories." |
|
1217 | + WHERE c_id = $course_id AND category_title='".Database::escape_string( |
|
1218 | 1218 | $catname |
1219 | - ) . "'" |
|
1219 | + )."'" |
|
1220 | 1220 | ); |
1221 | 1221 | if (Database:: num_rows($result) >= 1 && ($row = Database:: fetch_array( |
1222 | 1222 | $result |
@@ -1226,7 +1226,7 @@ discard block |
||
1226 | 1226 | } |
1227 | 1227 | |
1228 | 1228 | $result = Database:: query( |
1229 | - "SELECT MAX(display_order) FROM " . $tbl_categories . " WHERE c_id = $course_id " |
|
1229 | + "SELECT MAX(display_order) FROM ".$tbl_categories." WHERE c_id = $course_id " |
|
1230 | 1230 | ); |
1231 | 1231 | list ($max_order) = Database:: fetch_row($result); |
1232 | 1232 | |
@@ -1253,19 +1253,19 @@ discard block |
||
1253 | 1253 | $tbl_link = Database:: get_course_table(TABLE_LINK); |
1254 | 1254 | $course_id = api_get_course_int_id(); |
1255 | 1255 | |
1256 | - $urleq = "url='" . Database:: escape_string($url) . "'"; |
|
1257 | - $cateq = "category_id=" . intval($cat); |
|
1256 | + $urleq = "url='".Database:: escape_string($url)."'"; |
|
1257 | + $cateq = "category_id=".intval($cat); |
|
1258 | 1258 | |
1259 | 1259 | $result = Database:: query(" |
1260 | 1260 | SELECT id FROM $tbl_link |
1261 | - WHERE c_id = $course_id AND " . $urleq . ' AND ' . $cateq |
|
1261 | + WHERE c_id = $course_id AND ".$urleq.' AND '.$cateq |
|
1262 | 1262 | ); |
1263 | 1263 | |
1264 | 1264 | if (Database:: num_rows($result) >= 1 && ($row = Database:: fetch_array($result))) { |
1265 | 1265 | $sql = "UPDATE $tbl_link SET |
1266 | - title = '" . Database:: escape_string($title) . "', |
|
1267 | - description = '" . Database:: escape_string($description) . "' |
|
1268 | - WHERE c_id = $course_id AND id='" . Database:: escape_string($row['id']) . "'"; |
|
1266 | + title = '".Database:: escape_string($title)."', |
|
1267 | + description = '" . Database:: escape_string($description)."' |
|
1268 | + WHERE c_id = $course_id AND id='".Database:: escape_string($row['id'])."'"; |
|
1269 | 1269 | Database:: query($sql); |
1270 | 1270 | |
1271 | 1271 | $ipu = 'LinkUpdated'; |
@@ -1274,18 +1274,18 @@ discard block |
||
1274 | 1274 | // Add new link |
1275 | 1275 | $result = Database:: query( |
1276 | 1276 | "SELECT MAX(display_order) FROM $tbl_link |
1277 | - WHERE c_id = $course_id AND category_id='" . intval($cat) . "'" |
|
1277 | + WHERE c_id = $course_id AND category_id='".intval($cat)."'" |
|
1278 | 1278 | ); |
1279 | 1279 | list ($max_order) = Database:: fetch_row($result); |
1280 | 1280 | |
1281 | 1281 | Database:: query( |
1282 | 1282 | "INSERT INTO $tbl_link (c_id, url, title, description, category_id, display_order, on_homepage) |
1283 | - VALUES (" . api_get_course_int_id() . ", |
|
1284 | - '" . Database:: escape_string($url) . "', |
|
1285 | - '" . Database:: escape_string($title) . "', |
|
1286 | - '" . Database:: escape_string($description) . "', |
|
1287 | - '" . intval($cat) . "','" . (intval($max_order) + 1) . "', |
|
1288 | - '" . intval($on_homepage) . |
|
1283 | + VALUES (".api_get_course_int_id().", |
|
1284 | + '" . Database:: escape_string($url)."', |
|
1285 | + '" . Database:: escape_string($title)."', |
|
1286 | + '" . Database:: escape_string($description)."', |
|
1287 | + '" . intval($cat)."','".(intval($max_order) + 1)."', |
|
1288 | + '" . intval($on_homepage). |
|
1289 | 1289 | "')" |
1290 | 1290 | ); |
1291 | 1291 | |
@@ -1362,30 +1362,30 @@ discard block |
||
1362 | 1362 | ) |
1363 | 1363 | ) { // possibly in <...> |
1364 | 1364 | if (($kwlist = trim($regs[1])) != '') { |
1365 | - $kw = '<i kw="' . htmlspecialchars($kwlist) . '">'; |
|
1365 | + $kw = '<i kw="'.htmlspecialchars($kwlist).'">'; |
|
1366 | 1366 | } else { |
1367 | 1367 | $kw = ''; |
1368 | 1368 | } |
1369 | 1369 | // i.e. assume only one of the $hide_fields will be present |
1370 | 1370 | // and if found, hide the value as expando property of an <i> tag |
1371 | 1371 | } elseif (trim($value)) { |
1372 | - $d .= ', ' . $key . ':' . $value; |
|
1372 | + $d .= ', '.$key.':'.$value; |
|
1373 | 1373 | } |
1374 | 1374 | } |
1375 | 1375 | } |
1376 | 1376 | if (!empty($d)) { |
1377 | - $d = substr($d, 2) . ' - '; |
|
1377 | + $d = substr($d, 2).' - '; |
|
1378 | 1378 | } |
1379 | 1379 | |
1380 | 1380 | return Link::put_link( |
1381 | 1381 | $url, |
1382 | 1382 | $cat, |
1383 | 1383 | $title, |
1384 | - $kw . ereg_replace( |
|
1384 | + $kw.ereg_replace( |
|
1385 | 1385 | '\[((/?(b|big|i|small|sub|sup|u))|br/)\]', |
1386 | 1386 | '<\\1>', |
1387 | - htmlspecialchars($d . $linkdata['description']) |
|
1388 | - ) . ($kw ? '</i>' : ''), |
|
1387 | + htmlspecialchars($d.$linkdata['description']) |
|
1388 | + ).($kw ? '</i>' : ''), |
|
1389 | 1389 | $linkdata['on_homepage'] ? '1' : '0', |
1390 | 1390 | $linkdata['hidden'] ? '1' : '0' |
1391 | 1391 | ); |
@@ -1506,19 +1506,19 @@ discard block |
||
1506 | 1506 | echo '<div class="actions">'; |
1507 | 1507 | if (api_is_allowed_to_edit(null, true)) { |
1508 | 1508 | echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addlink&category_id='.$categoryId.'">'. |
1509 | - Display::return_icon('new_link.png', get_lang('LinkAdd'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
1509 | + Display::return_icon('new_link.png', get_lang('LinkAdd'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
1510 | 1510 | echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addcategory&category_id='.$categoryId.'">'. |
1511 | - Display::return_icon('new_folder.png', get_lang('CategoryAdd'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
1511 | + Display::return_icon('new_folder.png', get_lang('CategoryAdd'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
1512 | 1512 | } |
1513 | 1513 | |
1514 | 1514 | $categories = Link::getLinkCategories($course_id, $session_id); |
1515 | 1515 | $count = count($categories); |
1516 | 1516 | if (!empty($count)) { |
1517 | 1517 | echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=list&show=none">'; |
1518 | - echo Display::return_icon('forum_listview.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . ' </a>'; |
|
1518 | + echo Display::return_icon('forum_listview.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).' </a>'; |
|
1519 | 1519 | |
1520 | 1520 | echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=list&show=all">'; |
1521 | - echo Display::return_icon('forum_nestedview.png', get_lang('NestedView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
1521 | + echo Display::return_icon('forum_nestedview.png', get_lang('NestedView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
1522 | 1522 | } |
1523 | 1523 | echo '</div>'; |
1524 | 1524 | |
@@ -1550,12 +1550,12 @@ discard block |
||
1550 | 1550 | $strVisibility = ''; |
1551 | 1551 | $visibilityClass = null; |
1552 | 1552 | if ($myrow['visibility'] == '1') { |
1553 | - $strVisibility = '<a href="link.php?' . api_get_cidreq() . '&sec_token='.$token.'&action=invisible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Hide') . '">' . |
|
1554 | - Display :: return_icon('visible.png', get_lang('Hide'), array (), ICON_SIZE_SMALL) . '</a>'; |
|
1553 | + $strVisibility = '<a href="link.php?'.api_get_cidreq().'&sec_token='.$token.'&action=invisible&id='.$myrow['id'].'&scope='.TOOL_LINK_CATEGORY.'" title="'.get_lang('Hide').'">'. |
|
1554 | + Display :: return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL).'</a>'; |
|
1555 | 1555 | } elseif ($myrow['visibility'] == '0') { |
1556 | 1556 | $visibilityClass = 'text-muted'; |
1557 | - $strVisibility = ' <a href="link.php?' . api_get_cidreq() . '&sec_token='.$token.'&action=visible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Show') . '">' . |
|
1558 | - Display :: return_icon('invisible.png', get_lang('Show'), array (), ICON_SIZE_SMALL) . '</a>'; |
|
1557 | + $strVisibility = ' <a href="link.php?'.api_get_cidreq().'&sec_token='.$token.'&action=visible&id='.$myrow['id'].'&scope='.TOOL_LINK_CATEGORY.'" title="'.get_lang('Show').'">'. |
|
1558 | + Display :: return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL).'</a>'; |
|
1559 | 1559 | } |
1560 | 1560 | |
1561 | 1561 | $header = ''; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | public function __construct($in_c_id = 0, $in_id = 0) |
38 | 38 | { |
39 | - if ($in_c_id > 0 && $in_id >0) { |
|
39 | + if ($in_c_id > 0 && $in_id > 0) { |
|
40 | 40 | $item_view_table = Database::get_course_table(TABLE_LP_ITEM); |
41 | 41 | $sql = "SELECT * FROM $item_view_table |
42 | 42 | WHERE |
@@ -181,7 +181,7 @@ |
||
181 | 181 | |
182 | 182 | /** |
183 | 183 | * set threadPeerQualify |
184 | - * @param $threadPeerQualify |
|
184 | + * @param integer $threadPeerQualify |
|
185 | 185 | * @return $this |
186 | 186 | */ |
187 | 187 | public function setThreadPeerQualify($threadPeerQualify) |
@@ -607,7 +607,7 @@ |
||
607 | 607 | .' width="40px">'; |
608 | 608 | $userInfo = api_get_user_info($user_invitation_id); |
609 | 609 | $invitations .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_invitation_id.'">' |
610 | - .api_get_person_name($userInfo['firstname'],$userInfo['lastname']).'</a>'; |
|
610 | + .api_get_person_name($userInfo['firstname'],$userInfo['lastname']).'</a>'; |
|
611 | 611 | |
612 | 612 | $invitations .='<div class="pull-right">'; |
613 | 613 | $invitations .= '<a title="'.get_lang('SocialAddToFriends').'" id="btn_accepted_'.$user_invitation_id.'" class="btn btn-default btn-sm" onclick="register_friend(this)" href="javascript:void(0)">' |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | |
59 | 59 | Display::addFlash(Display::return_message(get_lang('MessageSent'))); |
60 | 60 | |
61 | - $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php'; |
|
61 | + $url = api_get_path(WEB_CODE_PATH).'social/profile.php'; |
|
62 | 62 | $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']); |
63 | - header('Location: ' . $url); |
|
63 | + header('Location: '.$url); |
|
64 | 64 | exit; |
65 | 65 | |
66 | 66 | } else if (!empty($_POST['social_wall_new_msg']) && !empty($_POST['messageId'])) { |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | MESSAGE_STATUS_WALL |
76 | 76 | ); |
77 | 77 | Display::addFlash(Display::return_message(get_lang('MessageSent'))); |
78 | - $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php'; |
|
78 | + $url = api_get_path(WEB_CODE_PATH).'social/profile.php'; |
|
79 | 79 | $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']); |
80 | - header('Location: ' . $url); |
|
80 | + header('Location: '.$url); |
|
81 | 81 | exit; |
82 | 82 | |
83 | 83 | } else if (isset($_GET['messageId'])) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $status = SocialManager::deleteMessage($messageId); |
90 | 90 | |
91 | 91 | Display::addFlash(Display::return_message(get_lang('MessageDeleted'))); |
92 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/profile.php'); |
|
92 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/profile.php'); |
|
93 | 93 | exit; |
94 | 94 | } |
95 | 95 | } |
@@ -153,16 +153,16 @@ discard block |
||
153 | 153 | |
154 | 154 | $ajax_url = api_get_path(WEB_AJAX_PATH).'message.ajax.php'; |
155 | 155 | $socialAjaxUrl = api_get_path(WEB_AJAX_PATH).'social.ajax.php'; |
156 | -$javascriptDir = api_get_path(LIBRARY_PATH) . 'javascript/'; |
|
156 | +$javascriptDir = api_get_path(LIBRARY_PATH).'javascript/'; |
|
157 | 157 | api_block_anonymous_users(); |
158 | 158 | $locale = api_get_language_isocode(); |
159 | 159 | // Add Jquery scroll pagination plugin |
160 | 160 | $htmlHeadXtra[] = api_get_js('jscroll/jquery.jscroll.js'); |
161 | 161 | // Add Jquery Time ago plugin |
162 | 162 | $htmlHeadXtra[] = api_get_asset('jquery-timeago/jquery.timeago.js'); |
163 | -$timeAgoLocaleDir = $javascriptDir . 'jquery-timeago/locales/jquery.timeago.' . $locale . '.js'; |
|
163 | +$timeAgoLocaleDir = $javascriptDir.'jquery-timeago/locales/jquery.timeago.'.$locale.'.js'; |
|
164 | 164 | if (file_exists($timeAgoLocaleDir)) { |
165 | - $htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.' . $locale . '.js'); |
|
165 | + $htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.'.$locale.'.js'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | $htmlHeadXtra[] = '<script> |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $(document).ready(function (){ |
171 | 171 | var container = $("#wallMessages"); |
172 | 172 | container.jscroll({ |
173 | - loadingHtml: "<div class=\"well_border\">' . get_lang('Loading') . ' </div>", |
|
173 | + loadingHtml: "<div class=\"well_border\">' . get_lang('Loading').' </div>", |
|
174 | 174 | nextSelector: "a.nextPage:last", |
175 | 175 | contentSelector: "", |
176 | 176 | callback: timeAgo |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | ); |
201 | 201 | |
202 | 202 | if (isset($_GET['u']) && is_numeric($_GET['u']) && $_GET['u'] != api_get_user_id()) { |
203 | - $info_user = api_get_user_info($_GET['u']); |
|
204 | - $interbreadcrumb[]= array( |
|
203 | + $info_user = api_get_user_info($_GET['u']); |
|
204 | + $interbreadcrumb[] = array( |
|
205 | 205 | 'url' => '#', |
206 | 206 | 'name' => $info_user['complete_name'] |
207 | 207 | ); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $list = []; |
226 | 226 | if (is_array($personal_course_list)) { |
227 | 227 | foreach ($personal_course_list as $my_course) { |
228 | - if ($i<=10) { |
|
228 | + if ($i <= 10) { |
|
229 | 229 | $list[] = SocialManager::get_logged_user_course_html($my_course, $i); |
230 | 230 | $course_list_code[] = array('code' => $my_course['code']); |
231 | 231 | } else { |
@@ -263,13 +263,13 @@ discard block |
||
263 | 263 | $social_wall_block = $wallSocialAddPost; |
264 | 264 | |
265 | 265 | // Social Post Wall |
266 | -$posts = SocialManager::getWallMessagesByUser($my_user_id, $friendId) ; |
|
266 | +$posts = SocialManager::getWallMessagesByUser($my_user_id, $friendId); |
|
267 | 267 | |
268 | 268 | $social_post_wall_block = empty($posts) ? '<p>'.get_lang("NoPosts").'</p>' : $posts; |
269 | 269 | |
270 | 270 | $socialAutoExtendLink = Display::url( |
271 | 271 | get_lang('SeeMore'), |
272 | - $socialAjaxUrl . '?u='. $my_user_id . '&a=listWallMessage&start=10&length=5', |
|
272 | + $socialAjaxUrl.'?u='.$my_user_id.'&a=listWallMessage&start=10&length=5', |
|
273 | 273 | array( |
274 | 274 | 'class' => 'nextPage next', |
275 | 275 | ) |
@@ -291,12 +291,12 @@ discard block |
||
291 | 291 | $(".spinner").html("'. |
292 | 292 | '<div class=\'text-center\'>'. |
293 | 293 | '<em class=\'fa fa-spinner fa-pulse fa-1x\'></em>'. |
294 | - '<p>'. get_lang('Loading') . ' ' . get_lang('Preview') .'</p>'. |
|
294 | + '<p>'.get_lang('Loading').' '.get_lang('Preview').'</p>'. |
|
295 | 295 | '</div>'. |
296 | 296 | '"); |
297 | 297 | }, |
298 | 298 | type: "POST", |
299 | - url: "'. api_get_path(WEB_AJAX_PATH) .'social.ajax.php?a=readUrlWithOpenGraph", |
|
299 | + url: "'. api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=readUrlWithOpenGraph", |
|
300 | 300 | data: "social_wall_new_msg_main=" + e.originalEvent.clipboardData.getData("text"), |
301 | 301 | success: function(response) { |
302 | 302 | $("[name=\'wall_post_button\']").prop( "disabled", false ); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | .$tags['tag'] |
392 | 392 | .'</a>'; |
393 | 393 | } |
394 | - if (is_array($user_tags) && count($user_tags)>0) { |
|
394 | + if (is_array($user_tags) && count($user_tags) > 0) { |
|
395 | 395 | $extra_information_value .= '<li class="list-group-item">'.ucfirst($extraFieldInfo['display_text']).': ' |
396 | 396 | .' '.implode('', $tag_tmp).'</li>'; |
397 | 397 | } |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $extra_information_value .= '<li class="list-group-item">'.$data.'</li>'; |
416 | 416 | break; |
417 | 417 | default: |
418 | - $extra_information_value .= '<li class="list-group-item">'.ucfirst($extraFieldInfo['display_text']) . ': ' . $data . '</li>'; |
|
418 | + $extra_information_value .= '<li class="list-group-item">'.ucfirst($extraFieldInfo['display_text']).': '.$data.'</li>'; |
|
419 | 419 | break; |
420 | 420 | } |
421 | 421 | } |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | // if there are information to show |
425 | 425 | if (!empty($extra_information_value)) { |
426 | 426 | |
427 | - $extra_information_value = '<ul class="list-group">' . $extra_information_value . '</ul>'; |
|
427 | + $extra_information_value = '<ul class="list-group">'.$extra_information_value.'</ul>'; |
|
428 | 428 | |
429 | 429 | $extra_information .= Display::panelCollapse( |
430 | 430 | get_lang('ExtraInformation'), |
@@ -504,10 +504,10 @@ discard block |
||
504 | 504 | |
505 | 505 | if ($i > $max_numbers_of_group) { |
506 | 506 | if (api_get_user_id() == $user_id) { |
507 | - $my_groups .= '<div class="box_shared_profile_group_actions">' |
|
507 | + $my_groups .= '<div class="box_shared_profile_group_actions">' |
|
508 | 508 | .'<a href="groups.php?#tab_browse-1">'.get_lang('SeeAllMyGroups').'</a></div>'; |
509 | 509 | } else { |
510 | - $my_groups .= '<div class="box_shared_profile_group_actions">' |
|
510 | + $my_groups .= '<div class="box_shared_profile_group_actions">' |
|
511 | 511 | .'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php' |
512 | 512 | .'?view=mygroups&height=390&width=610&user_id='.$user_id.'"' |
513 | 513 | .' class="ajax" title="'.get_lang('SeeAll').'" >' |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | $i = 1; |
521 | 521 | foreach ($grid_my_groups as $group) { |
522 | 522 | $my_groups .= '<div class="panel-body">'; |
523 | - $my_groups .= $group[0]; |
|
523 | + $my_groups .= $group[0]; |
|
524 | 524 | $my_groups .= '</div>'; |
525 | 525 | $i++; |
526 | 526 | } |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | $i++; |
544 | 544 | } |
545 | 545 | } |
546 | - $social_course_block .= $my_courses; |
|
546 | + $social_course_block .= $my_courses; |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | // Block Social Sessions |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | |
565 | 565 | // Images uploaded by course |
566 | 566 | $file_list = ''; |
567 | - if (is_array($course_list_code) && count($course_list_code)>0) { |
|
567 | + if (is_array($course_list_code) && count($course_list_code) > 0) { |
|
568 | 568 | foreach ($course_list_code as $course) { |
569 | 569 | $file_list .= UserManager::get_user_upload_files_by_course( |
570 | 570 | $user_id, |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | |
577 | 577 | $count_pending_invitations = 0; |
578 | 578 | if (!isset($_GET['u']) || |
579 | - (isset($_GET['u']) && $_GET['u']==api_get_user_id()) |
|
579 | + (isset($_GET['u']) && $_GET['u'] == api_get_user_id()) |
|
580 | 580 | ) { |
581 | 581 | $pending_invitations = SocialManager::get_list_invitation_of_friends_by_user_id(api_get_user_id()); |
582 | 582 | $list_get_path_web = SocialManager::get_list_web_path_user_invitation_by_user_id(api_get_user_id()); |
@@ -585,23 +585,23 @@ discard block |
||
585 | 585 | |
586 | 586 | if (!empty($production_list) || !empty($file_list) || $count_pending_invitations > 0) { |
587 | 587 | // Pending invitations |
588 | - if (!isset($_GET['u']) || (isset($_GET['u']) && $_GET['u']==api_get_user_id())) { |
|
588 | + if (!isset($_GET['u']) || (isset($_GET['u']) && $_GET['u'] == api_get_user_id())) { |
|
589 | 589 | if ($count_pending_invitations > 0) { |
590 | - $invitations = '<ul class="list-group">'; |
|
590 | + $invitations = '<ul class="list-group">'; |
|
591 | 591 | for ($i = 0; $i < $count_pending_invitations; $i++) { |
592 | 592 | $user_invitation_id = $pending_invitations[$i]['user_sender_id']; |
593 | - $invitations .= '<li id="dpending_'.$user_invitation_id.'" class="list-group-item">'; |
|
594 | - $invitations .= '<img class="img-rounded" ' |
|
593 | + $invitations .= '<li id="dpending_'.$user_invitation_id.'" class="list-group-item">'; |
|
594 | + $invitations .= '<img class="img-rounded" ' |
|
595 | 595 | .' src="'.$list_get_path_web[$i]['dir'].'/'.$list_get_path_web[$i]['file'].'"' |
596 | 596 | .' width="40px">'; |
597 | 597 | $userInfo = api_get_user_info($user_invitation_id); |
598 | 598 | $invitations .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_invitation_id.'">' |
599 | - .api_get_person_name($userInfo['firstname'],$userInfo['lastname']).'</a>'; |
|
599 | + .api_get_person_name($userInfo['firstname'], $userInfo['lastname']).'</a>'; |
|
600 | 600 | |
601 | - $invitations .='<div class="pull-right">'; |
|
601 | + $invitations .= '<div class="pull-right">'; |
|
602 | 602 | $invitations .= Display::toolbarButton( |
603 | 603 | get_lang('SocialAddToFriends'), |
604 | - api_get_path(WEB_AJAX_PATH) . 'social.ajax.php?' . http_build_query([ |
|
604 | + api_get_path(WEB_AJAX_PATH).'social.ajax.php?'.http_build_query([ |
|
605 | 605 | 'a' => 'add_friend', |
606 | 606 | 'friend_id' => $user_invitation_id, |
607 | 607 | 'is_my_friend' => 'friend' |
@@ -612,8 +612,8 @@ discard block |
||
612 | 612 | false |
613 | 613 | ); |
614 | 614 | $invitations .= '</div>'; |
615 | - $invitations .= '<div id="id_response"></div>'; |
|
616 | - $invitations .= '</li>'; |
|
615 | + $invitations .= '<div id="id_response"></div>'; |
|
616 | + $invitations .= '</li>'; |
|
617 | 617 | } |
618 | 618 | $invitations .= '</ul>'; |
619 | 619 | $listInvitations = Display::panelCollapse( |
@@ -628,51 +628,51 @@ discard block |
||
628 | 628 | } |
629 | 629 | |
630 | 630 | // Productions |
631 | - $production_list = UserManager::build_production_list($user_id); |
|
631 | + $production_list = UserManager::build_production_list($user_id); |
|
632 | 632 | $product_content = ''; |
633 | 633 | if (!empty($production_list)) { |
634 | 634 | $product_content .= '<div><h3>'.get_lang('MyProductions').'</h3></div>'; |
635 | - $product_content .= $production_list; |
|
636 | - $socialRightInformation .= SocialManager::social_wrapper_div($product_content, 4); |
|
635 | + $product_content .= $production_list; |
|
636 | + $socialRightInformation .= SocialManager::social_wrapper_div($product_content, 4); |
|
637 | 637 | } |
638 | 638 | |
639 | 639 | $images_uploaded = null; |
640 | 640 | // Images uploaded by course |
641 | 641 | if (!empty($file_list)) { |
642 | - $images_uploaded .= '<div><h3>'.get_lang('ImagesUploaded').'</h3></div>'; |
|
643 | - $images_uploaded .= '<div class="social-content-information">'; |
|
644 | - $images_uploaded .= $file_list; |
|
645 | - $images_uploaded .= '</div>'; |
|
646 | - $socialRightInformation .= SocialManager::social_wrapper_div($images_uploaded, 4); |
|
642 | + $images_uploaded .= '<div><h3>'.get_lang('ImagesUploaded').'</h3></div>'; |
|
643 | + $images_uploaded .= '<div class="social-content-information">'; |
|
644 | + $images_uploaded .= $file_list; |
|
645 | + $images_uploaded .= '</div>'; |
|
646 | + $socialRightInformation .= SocialManager::social_wrapper_div($images_uploaded, 4); |
|
647 | 647 | } |
648 | 648 | } |
649 | 649 | |
650 | 650 | if (!empty($user_info['competences']) || !empty($user_info['diplomas']) |
651 | - || !empty($user_info['openarea']) || !empty($user_info['teach']) ) { |
|
651 | + || !empty($user_info['openarea']) || !empty($user_info['teach'])) { |
|
652 | 652 | |
653 | - $more_info .= '<div><h3>'.get_lang('MoreInformation').'</h3></div>'; |
|
653 | + $more_info .= '<div><h3>'.get_lang('MoreInformation').'</h3></div>'; |
|
654 | 654 | if (!empty($user_info['competences'])) { |
655 | - $more_info .= '<br />'; |
|
656 | - $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyCompetences').'</strong></div>'; |
|
657 | - $more_info .= '<div class="social-profile-extended">'.$user_info['competences'].'</div>'; |
|
658 | - $more_info .= '<br />'; |
|
655 | + $more_info .= '<br />'; |
|
656 | + $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyCompetences').'</strong></div>'; |
|
657 | + $more_info .= '<div class="social-profile-extended">'.$user_info['competences'].'</div>'; |
|
658 | + $more_info .= '<br />'; |
|
659 | 659 | } |
660 | 660 | if (!empty($user_info['diplomas'])) { |
661 | - $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div>'; |
|
662 | - $more_info .= '<div class="social-profile-extended">'.$user_info['diplomas'].'</div>'; |
|
663 | - $more_info .= '<br />'; |
|
661 | + $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div>'; |
|
662 | + $more_info .= '<div class="social-profile-extended">'.$user_info['diplomas'].'</div>'; |
|
663 | + $more_info .= '<br />'; |
|
664 | 664 | } |
665 | 665 | if (!empty($user_info['openarea'])) { |
666 | - $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>'; |
|
667 | - $more_info .= '<div class="social-profile-extended">'.$user_info['openarea'].'</div>'; |
|
668 | - $more_info .= '<br />'; |
|
666 | + $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>'; |
|
667 | + $more_info .= '<div class="social-profile-extended">'.$user_info['openarea'].'</div>'; |
|
668 | + $more_info .= '<br />'; |
|
669 | 669 | } |
670 | 670 | if (!empty($user_info['teach'])) { |
671 | - $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>'; |
|
672 | - $more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>'; |
|
673 | - $more_info .= '<br />'; |
|
671 | + $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>'; |
|
672 | + $more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>'; |
|
673 | + $more_info .= '<br />'; |
|
674 | 674 | } |
675 | - $socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4); |
|
675 | + $socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4); |
|
676 | 676 | } |
677 | 677 | } |
678 | 678 | |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | $tpl->assign('social_right_information', $socialRightInformation); |
695 | 695 | $tpl->assign('social_auto_extend_link', $socialAutoExtendLink); |
696 | 696 | |
697 | -$formModalTpl = new Template(); |
|
697 | +$formModalTpl = new Template(); |
|
698 | 698 | $formModalTpl->assign('invitation_form', MessageManager::generate_invitation_form('send_invitation')); |
699 | 699 | $formModals = $formModalTpl->fetch('default/social/form_modals.tpl'); |
700 | 700 |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | $vid = isset($_REQUEST['vid']) ? $_REQUEST['vid'] : ''; |
102 | 102 | if ($vid) { |
103 | 103 | $vhosts = Database::select('*', 'vchamilo', array('where' => array('id = ?' => $vid))); |
104 | - $vhost = (object)array_pop($vhosts); |
|
104 | + $vhost = (object) array_pop($vhosts); |
|
105 | 105 | } else { |
106 | - $vhost = (object)$_configuration; |
|
106 | + $vhost = (object) $_configuration; |
|
107 | 107 | $vhost->slug = Virtual::getSlugFromUrl($vhost->root_web); |
108 | 108 | $vhost->id = 0; |
109 | 109 | } |
@@ -284,16 +284,16 @@ discard block |
||
284 | 284 | case 'clearcache': |
285 | 285 | // Removes cache directory. |
286 | 286 | if (empty($automation)) { |
287 | - if (array_key_exists('vids', $_REQUEST)) { |
|
287 | + if (array_key_exists('vids', $_REQUEST)) { |
|
288 | 288 | $toclear = Database::select('*', 'vchamilo', array('where' => array("id IN ('$vidlist')" => array()))); |
289 | 289 | } else { |
290 | 290 | $vid = isset($_REQUEST['vid']) ? $_REQUEST['vid'] : 0; |
291 | 291 | if ($vid) { |
292 | 292 | $vhosts = Database::select('*', 'vchamilo', array('where' => array('id = ?' => $vid))); |
293 | - $vhost = (object)array_pop($vhosts); |
|
293 | + $vhost = (object) array_pop($vhosts); |
|
294 | 294 | $toclear[$vhost->id] = $vhost; |
295 | 295 | } else { |
296 | - $toclear[0] = (object)$_configuration; |
|
296 | + $toclear[0] = (object) $_configuration; |
|
297 | 297 | } |
298 | 298 | } |
299 | 299 | } else { |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | $archivePath = Virtual::getConfig('vchamilo', 'archive_real_root'); |
316 | 316 | |
317 | 317 | // Get instance archive |
318 | - $archivepath = api_get_path(SYS_ARCHIVE_PATH, (array)$instance); |
|
318 | + $archivepath = api_get_path(SYS_ARCHIVE_PATH, (array) $instance); |
|
319 | 319 | $templatepath = $archivePath.'/'.$instance['slug'].'/twig'; |
320 | 320 | Display::addFlash(Display::return_message("Deleting cache $templatepath \n")); |
321 | 321 | removeDir($templatepath); |
@@ -26,10 +26,10 @@ |
||
26 | 26 | if ($id) { |
27 | 27 | $mode = 'update'; |
28 | 28 | } else { |
29 | - $mode = $registeronly ? 'register' : 'add' ; |
|
29 | + $mode = $registeronly ? 'register' : 'add'; |
|
30 | 30 | } |
31 | 31 | |
32 | -$vhost = (array) Virtual::getInstance($id); |
|
32 | +$vhost = (array) Virtual::getInstance($id); |
|
33 | 33 | |
34 | 34 | $form = new InstanceForm($plugin, $mode, $vhost); |
35 | 35 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $event = $agenda->get_event($id); |
44 | 44 | |
45 | 45 | if (!empty($event)) { |
46 | - define('ICAL_LANG', api_get_language_isocode()); |
|
46 | + define('ICAL_LANG', api_get_language_isocode()); |
|
47 | 47 | |
48 | 48 | $ical = new vcalendar(); |
49 | 49 | $ical->setConfig('unique_id',api_get_path(WEB_PATH)); |
@@ -46,9 +46,9 @@ |
||
46 | 46 | define('ICAL_LANG', api_get_language_isocode()); |
47 | 47 | |
48 | 48 | $ical = new vcalendar(); |
49 | - $ical->setConfig('unique_id',api_get_path(WEB_PATH)); |
|
50 | - $ical->setProperty( 'method', 'PUBLISH' ); |
|
51 | - $ical->setConfig('url',api_get_path(WEB_PATH)); |
|
49 | + $ical->setConfig('unique_id', api_get_path(WEB_PATH)); |
|
50 | + $ical->setProperty('method', 'PUBLISH'); |
|
51 | + $ical->setConfig('url', api_get_path(WEB_PATH)); |
|
52 | 52 | $vevent = new vevent(); |
53 | 53 | |
54 | 54 | switch ($_GET['class']) { |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | if ($current_session == $details['lp_session']) { |
339 | 339 | $dsp_edit_lp = Display::url( |
340 | 340 | Display::return_icon('settings.png', get_lang('CourseSettings'), '', ICON_SIZE_SMALL), |
341 | - "lp_controller.php?" . api_get_cidreq() . "&action=edit&lp_id=$id" |
|
341 | + "lp_controller.php?".api_get_cidreq()."&action=edit&lp_id=$id" |
|
342 | 342 | ); |
343 | 343 | } else { |
344 | 344 | $dsp_edit_lp = Display::return_icon( |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | if ($details['lp_type'] == 1 || $details['lp_type'] == 2) { |
355 | 355 | $dsp_build = Display::url( |
356 | 356 | Display::return_icon('edit.png', get_lang('LearnpathEditLearnpath'), '', ICON_SIZE_SMALL), |
357 | - 'lp_controller.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
357 | + 'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ |
|
358 | 358 | 'action' => 'add_item', |
359 | 359 | 'type' => 'step', |
360 | 360 | 'lp_id' => $id, |
@@ -388,19 +388,19 @@ discard block |
||
388 | 388 | if ($details['lp_visibility'] == 0) { |
389 | 389 | $dsp_visible = Display::url( |
390 | 390 | Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL), |
391 | - api_get_self() . '?' . api_get_cidreq() . "&lp_id=$id&action=toggle_visible&new_status=1" |
|
391 | + api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_visible&new_status=1" |
|
392 | 392 | ); |
393 | 393 | } else { |
394 | 394 | $dsp_visible = Display::url( |
395 | 395 | Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL), |
396 | - api_get_self() . '?' . api_get_cidreq() . "&lp_id=$id&action=toggle_visible&new_status=0" |
|
396 | + api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_visible&new_status=0" |
|
397 | 397 | ); |
398 | 398 | } |
399 | 399 | } |
400 | 400 | |
401 | 401 | //Tracking command |
402 | 402 | $trackingActionUrl = 'lp_controller.php?' |
403 | - . api_get_cidreq() . '&' |
|
403 | + . api_get_cidreq().'&' |
|
404 | 404 | . http_build_query([ |
405 | 405 | 'action' => 'report', |
406 | 406 | 'lp_id' => $id, |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | '', |
422 | 422 | ICON_SIZE_SMALL |
423 | 423 | ), |
424 | - api_get_self() . '?' . api_get_cidreq() . "&lp_id=$id&action=toggle_publish&new_status=v" |
|
424 | + api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_publish&new_status=v" |
|
425 | 425 | ); |
426 | 426 | } else { |
427 | 427 | $dsp_publish = "<a href='".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_publish&new_status=i'>". |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | '', |
439 | 439 | ICON_SIZE_SMALL |
440 | 440 | ), |
441 | - api_get_self() . '?' . api_get_cidreq() . "&lp_id=$id&action=toggle_publish&new_status=i" |
|
441 | + api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_publish&new_status=i" |
|
442 | 442 | ); |
443 | 443 | } |
444 | 444 | } else { |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | '', |
467 | 467 | ICON_SIZE_SMALL |
468 | 468 | ), |
469 | - "lp_controller.php?" . api_get_cidreq() . "&action=switch_attempt_mode&lp_id=$id" |
|
469 | + "lp_controller.php?".api_get_cidreq()."&action=switch_attempt_mode&lp_id=$id" |
|
470 | 470 | ); |
471 | 471 | } |
472 | 472 | if ($details['seriousgame_mode'] == 0 && $details['lp_prevent_reinit'] == 1) { //single mode | next = multiple |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | '', |
478 | 478 | ICON_SIZE_SMALL |
479 | 479 | ), |
480 | - "lp_controller.php?" . api_get_cidreq() . "&action=switch_attempt_mode&lp_id=$id" |
|
480 | + "lp_controller.php?".api_get_cidreq()."&action=switch_attempt_mode&lp_id=$id" |
|
481 | 481 | ); |
482 | 482 | } |
483 | 483 | if ($details['seriousgame_mode'] == 0 && $details['lp_prevent_reinit'] == 0) { //multiple mode | next = seriousgame |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | '', |
489 | 489 | ICON_SIZE_SMALL |
490 | 490 | ), |
491 | - "lp_controller.php?" . api_get_cidreq() . "&action=switch_attempt_mode&lp_id=$id" |
|
491 | + "lp_controller.php?".api_get_cidreq()."&action=switch_attempt_mode&lp_id=$id" |
|
492 | 492 | ); |
493 | 493 | } |
494 | 494 | } else { |
@@ -511,8 +511,8 @@ discard block |
||
511 | 511 | '', |
512 | 512 | ICON_SIZE_SMALL |
513 | 513 | ), |
514 | - 'lp_controller.php?' . api_get_cidreq() |
|
515 | - . '&action=switch_view_mode&lp_id=' . $id . $token_parameter |
|
514 | + 'lp_controller.php?'.api_get_cidreq() |
|
515 | + . '&action=switch_view_mode&lp_id='.$id.$token_parameter |
|
516 | 516 | ); |
517 | 517 | break; |
518 | 518 | case 'embedded': |
@@ -523,8 +523,8 @@ discard block |
||
523 | 523 | '', |
524 | 524 | ICON_SIZE_SMALL |
525 | 525 | ), |
526 | - 'lp_controller.php?' . api_get_cidreq() |
|
527 | - . '&action=switch_view_mode&lp_id=' . $id . $token_parameter |
|
526 | + 'lp_controller.php?'.api_get_cidreq() |
|
527 | + . '&action=switch_view_mode&lp_id='.$id.$token_parameter |
|
528 | 528 | ); |
529 | 529 | break; |
530 | 530 | case 'embedframe': |
@@ -535,8 +535,8 @@ discard block |
||
535 | 535 | '', |
536 | 536 | ICON_SIZE_SMALL |
537 | 537 | ), |
538 | - 'lp_controller.php?' . api_get_cidreq() |
|
539 | - . '&action=switch_view_mode&lp_id=' . $id . $token_parameter |
|
538 | + 'lp_controller.php?'.api_get_cidreq() |
|
539 | + . '&action=switch_view_mode&lp_id='.$id.$token_parameter |
|
540 | 540 | ); |
541 | 541 | break; |
542 | 542 | case 'impress': |
@@ -547,8 +547,8 @@ discard block |
||
547 | 547 | '', |
548 | 548 | ICON_SIZE_SMALL |
549 | 549 | ), |
550 | - 'lp_controller.php?' . api_get_cidreq() |
|
551 | - . '&action=switch_view_mode&lp_id=' . $id . $token_parameter |
|
550 | + 'lp_controller.php?'.api_get_cidreq() |
|
551 | + . '&action=switch_view_mode&lp_id='.$id.$token_parameter |
|
552 | 552 | ); |
553 | 553 | break; |
554 | 554 | } |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | '', |
581 | 581 | ICON_SIZE_SMALL |
582 | 582 | ), |
583 | - "lp_controller.php?" . api_get_cidreq() . "&action=switch_scorm_debug&lp_id=$id" |
|
583 | + "lp_controller.php?".api_get_cidreq()."&action=switch_scorm_debug&lp_id=$id" |
|
584 | 584 | ); |
585 | 585 | } else { |
586 | 586 | $dsp_debug = Display::url( |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | '', |
591 | 591 | ICON_SIZE_SMALL |
592 | 592 | ), |
593 | - "lp_controller.php?" . api_get_cidreq() . "&action=switch_scorm_debug&lp_id=$id" |
|
593 | + "lp_controller.php?".api_get_cidreq()."&action=switch_scorm_debug&lp_id=$id" |
|
594 | 594 | ); |
595 | 595 | } |
596 | 596 | } |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | if ($details['subscribe_users'] == 1) { |
644 | 644 | $subscribeUsers = Display::url( |
645 | 645 | Display::return_icon('user.png', get_lang('SubscribeUsersToLp')), |
646 | - api_get_path(WEB_CODE_PATH) . "lp/lp_subscribe_users.php?lp_id=$id&".api_get_cidreq() |
|
646 | + api_get_path(WEB_CODE_PATH)."lp/lp_subscribe_users.php?lp_id=$id&".api_get_cidreq() |
|
647 | 647 | ); |
648 | 648 | } |
649 | 649 | |
@@ -653,12 +653,12 @@ discard block |
||
653 | 653 | $autolaunch_exists = true; |
654 | 654 | $lp_auto_launch_icon = Display::url( |
655 | 655 | Display::return_icon('launch.png', get_lang('DisableLPAutoLaunch')), |
656 | - api_get_self() . '?' . api_get_cidreq() . "&action=auto_launch&status=0&lp_id=$id" |
|
656 | + api_get_self().'?'.api_get_cidreq()."&action=auto_launch&status=0&lp_id=$id" |
|
657 | 657 | ); |
658 | 658 | } else { |
659 | 659 | $lp_auto_launch_icon = Display::url( |
660 | 660 | Display::return_icon('launch_na.png', get_lang('EnableLPAutoLaunch')), |
661 | - api_get_self() . '?' . api_get_cidreq() . "&action=auto_launch&status=1&lp_id=$id" |
|
661 | + api_get_self().'?'.api_get_cidreq()."&action=auto_launch&status=1&lp_id=$id" |
|
662 | 662 | ); |
663 | 663 | } |
664 | 664 | } |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | '', |
672 | 672 | ICON_SIZE_SMALL |
673 | 673 | ), |
674 | - api_get_self() . '?' . api_get_cidreq() . "&action=export_to_pdf&lp_id=$id" |
|
674 | + api_get_self().'?'.api_get_cidreq()."&action=export_to_pdf&lp_id=$id" |
|
675 | 675 | ); |
676 | 676 | |
677 | 677 | /* Delete */ |
@@ -683,8 +683,8 @@ discard block |
||
683 | 683 | '', |
684 | 684 | ICON_SIZE_SMALL |
685 | 685 | ), |
686 | - 'lp_controller.php?' . api_get_cidreq() . "&action=delete&lp_id=$id", |
|
687 | - ['onclick' => "javascript: return confirmation('" . addslashes($name) . "');"] |
|
686 | + 'lp_controller.php?'.api_get_cidreq()."&action=delete&lp_id=$id", |
|
687 | + ['onclick' => "javascript: return confirmation('".addslashes($name)."');"] |
|
688 | 688 | ); |
689 | 689 | } else { |
690 | 690 | $dsp_delete = Display::return_icon( |
@@ -701,23 +701,23 @@ discard block |
||
701 | 701 | if ($details['lp_display_order'] == 1 && $max != 1) { |
702 | 702 | $dsp_order .= Display::url( |
703 | 703 | Display::return_icon('down.png', get_lang('MoveDown'), '', ICON_SIZE_SMALL), |
704 | - "lp_controller.php?" . api_get_cidreq() . "&action=move_lp_down&lp_id=$id" |
|
704 | + "lp_controller.php?".api_get_cidreq()."&action=move_lp_down&lp_id=$id" |
|
705 | 705 | ); |
706 | 706 | } elseif ($current == $max - 1 && $max != 1) { |
707 | 707 | $dsp_order .= Display::url( |
708 | 708 | Display::return_icon('up.png', get_lang('MoveUp'), '', ICON_SIZE_SMALL), |
709 | - "lp_controller.php?" . api_get_cidreq() . "&action=move_lp_up&lp_id=$id" |
|
709 | + "lp_controller.php?".api_get_cidreq()."&action=move_lp_up&lp_id=$id" |
|
710 | 710 | ); |
711 | 711 | } elseif ($max == 1) { |
712 | 712 | $dsp_order = ''; |
713 | 713 | } else { |
714 | 714 | $dsp_order .= Display::url( |
715 | 715 | Display::return_icon('down.png', get_lang('MoveDown'), '', ICON_SIZE_SMALL), |
716 | - "lp_controller.php?" . api_get_cidreq() . "&action=move_lp_down&lp_id=$id" |
|
716 | + "lp_controller.php?".api_get_cidreq()."&action=move_lp_down&lp_id=$id" |
|
717 | 717 | ); |
718 | 718 | $dsp_order .= Display::url( |
719 | 719 | Display::return_icon('up.png', get_lang('MoveUp'), '', ICON_SIZE_SMALL), |
720 | - "lp_controller.php?" . api_get_cidreq() . "&action=move_lp_up&lp_id=$id" |
|
720 | + "lp_controller.php?".api_get_cidreq()."&action=move_lp_up&lp_id=$id" |
|
721 | 721 | ); |
722 | 722 | } |
723 | 723 | } |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | if ($details['seriousgame_mode'] == 0) { |
734 | 734 | $actionSeriousGame = Display::toolbarButton( |
735 | 735 | null, |
736 | - api_get_self() . '?' . api_get_cidreq() . "&lp_id=$id&action=toggle_seriousgame", |
|
736 | + api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_seriousgame", |
|
737 | 737 | 'trophy', |
738 | 738 | 'default', |
739 | 739 | [ |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | } else { |
745 | 745 | $actionSeriousGame = Display::toolbarButton( |
746 | 746 | null, |
747 | - api_get_self() . '?' . api_get_cidreq() . "&lp_id=$id&action=toggle_seriousgame", |
|
747 | + api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_seriousgame", |
|
748 | 748 | 'trophy', |
749 | 749 | 'warning', |
750 | 750 | [ |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | // Student |
759 | 759 | $export_icon = Display::url( |
760 | 760 | Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL), |
761 | - api_get_self() . '?' . api_get_cidreq() . "&action=export_to_pdf&lp_id=$id" |
|
761 | + api_get_self().'?'.api_get_cidreq()."&action=export_to_pdf&lp_id=$id" |
|
762 | 762 | ); |
763 | 763 | } |
764 | 764 |