@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $try_new_fsc_id = $try_new_fsc_db = $try_new_fsc_dir = 0; |
47 | 47 | |
48 | 48 | while (!$keys_are_unique) { |
49 | - $keys_course_id = $prefix_for_all . $unique_prefix . $wanted_code . $final_suffix['CourseId']; |
|
50 | - $keys_course_repository = $prefix_for_path . $unique_prefix . $wanted_code . $final_suffix['CourseDir']; |
|
49 | + $keys_course_id = $prefix_for_all.$unique_prefix.$wanted_code.$final_suffix['CourseId']; |
|
50 | + $keys_course_repository = $prefix_for_path.$unique_prefix.$wanted_code.$final_suffix['CourseDir']; |
|
51 | 51 | $keys_are_unique = true; |
52 | 52 | |
53 | 53 | // Check whether they are unique. |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | |
59 | 59 | if (Database::num_rows($result)) { |
60 | 60 | $keys_are_unique = false; |
61 | - $try_new_fsc_id ++; |
|
61 | + $try_new_fsc_id++; |
|
62 | 62 | $final_suffix['CourseId'] = substr(md5(uniqid(rand())), 0, 4); |
63 | 63 | } |
64 | 64 | if (file_exists(api_get_path(SYS_COURSE_PATH).$keys_course_repository)) { |
65 | 65 | $keys_are_unique = false; |
66 | - $try_new_fsc_dir ++; |
|
66 | + $try_new_fsc_dir++; |
|
67 | 67 | $final_suffix['CourseDir'] = substr(md5(uniqid(rand())), 0, 4); |
68 | 68 | } |
69 | 69 | |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | $perm = api_get_permissions_for_new_directories(); |
92 | 92 | $perm_file = api_get_permissions_for_new_files(); |
93 | 93 | $htmlpage = "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title>Not authorized</title>\n </head>\n <body>\n </body>\n</html>"; |
94 | - $cp = api_get_path(SYS_COURSE_PATH) . $course_repository; |
|
94 | + $cp = api_get_path(SYS_COURSE_PATH).$course_repository; |
|
95 | 95 | |
96 | 96 | //Creating document folder |
97 | 97 | mkdir($cp, $perm); |
98 | - mkdir($cp . '/document', $perm); |
|
99 | - $cpt = $cp . '/document/index.html'; |
|
98 | + mkdir($cp.'/document', $perm); |
|
99 | + $cpt = $cp.'/document/index.html'; |
|
100 | 100 | $fd = fopen($cpt, 'w'); |
101 | 101 | fwrite($fd, $htmlpage); |
102 | 102 | fclose($fd); |
@@ -118,49 +118,49 @@ discard block |
||
118 | 118 | @copy($cpt, $cp . '/document/video/index.html'); */ |
119 | 119 | |
120 | 120 | //Creatind dropbox folder |
121 | - mkdir($cp . '/dropbox', $perm); |
|
122 | - $cpt = $cp . '/dropbox/index.html'; |
|
121 | + mkdir($cp.'/dropbox', $perm); |
|
122 | + $cpt = $cp.'/dropbox/index.html'; |
|
123 | 123 | $fd = fopen($cpt, 'w'); |
124 | 124 | fwrite($fd, $htmlpage); |
125 | 125 | fclose($fd); |
126 | 126 | @chmod($cpt, $perm_file); |
127 | - mkdir($cp . '/group', $perm); |
|
128 | - @copy($cpt, $cp . '/group/index.html'); |
|
129 | - mkdir($cp . '/page', $perm); |
|
130 | - @copy($cpt, $cp . '/page/index.html'); |
|
131 | - mkdir($cp . '/scorm', $perm); |
|
132 | - @copy($cpt, $cp . '/scorm/index.html'); |
|
133 | - mkdir($cp . '/upload', $perm); |
|
134 | - @copy($cpt, $cp . '/upload/index.html'); |
|
135 | - mkdir($cp . '/upload/forum', $perm); |
|
136 | - @copy($cpt, $cp . '/upload/forum/index.html'); |
|
137 | - mkdir($cp . '/upload/forum/images', $perm); |
|
138 | - @copy($cpt, $cp . '/upload/forum/images/index.html'); |
|
139 | - mkdir($cp . '/upload/test', $perm); |
|
140 | - @copy($cpt, $cp . '/upload/test/index.html'); |
|
141 | - mkdir($cp . '/upload/blog', $perm); |
|
142 | - @copy($cpt, $cp . '/upload/blog/index.html'); |
|
143 | - mkdir($cp . '/upload/learning_path', $perm); |
|
144 | - @copy($cpt, $cp . '/upload/learning_path/index.html'); |
|
145 | - mkdir($cp . '/upload/learning_path/images', $perm); |
|
146 | - @copy($cpt, $cp . '/upload/learning_path/images/index.html'); |
|
147 | - mkdir($cp . '/upload/calendar', $perm); |
|
148 | - @copy($cpt, $cp . '/upload/calendar/index.html'); |
|
149 | - mkdir($cp . '/upload/calendar/images', $perm); |
|
150 | - @copy($cpt, $cp . '/upload/calendar/images/index.html'); |
|
151 | - mkdir($cp . '/work', $perm); |
|
152 | - @copy($cpt, $cp . '/work/index.html'); |
|
153 | - mkdir($cp . '/upload/announcements', $perm); |
|
154 | - @copy($cpt, $cp . '/upload/announcements/index.html'); |
|
155 | - mkdir($cp . '/upload/announcements/images', $perm); |
|
156 | - @copy($cpt, $cp . '/upload/announcements/images/index.html'); |
|
127 | + mkdir($cp.'/group', $perm); |
|
128 | + @copy($cpt, $cp.'/group/index.html'); |
|
129 | + mkdir($cp.'/page', $perm); |
|
130 | + @copy($cpt, $cp.'/page/index.html'); |
|
131 | + mkdir($cp.'/scorm', $perm); |
|
132 | + @copy($cpt, $cp.'/scorm/index.html'); |
|
133 | + mkdir($cp.'/upload', $perm); |
|
134 | + @copy($cpt, $cp.'/upload/index.html'); |
|
135 | + mkdir($cp.'/upload/forum', $perm); |
|
136 | + @copy($cpt, $cp.'/upload/forum/index.html'); |
|
137 | + mkdir($cp.'/upload/forum/images', $perm); |
|
138 | + @copy($cpt, $cp.'/upload/forum/images/index.html'); |
|
139 | + mkdir($cp.'/upload/test', $perm); |
|
140 | + @copy($cpt, $cp.'/upload/test/index.html'); |
|
141 | + mkdir($cp.'/upload/blog', $perm); |
|
142 | + @copy($cpt, $cp.'/upload/blog/index.html'); |
|
143 | + mkdir($cp.'/upload/learning_path', $perm); |
|
144 | + @copy($cpt, $cp.'/upload/learning_path/index.html'); |
|
145 | + mkdir($cp.'/upload/learning_path/images', $perm); |
|
146 | + @copy($cpt, $cp.'/upload/learning_path/images/index.html'); |
|
147 | + mkdir($cp.'/upload/calendar', $perm); |
|
148 | + @copy($cpt, $cp.'/upload/calendar/index.html'); |
|
149 | + mkdir($cp.'/upload/calendar/images', $perm); |
|
150 | + @copy($cpt, $cp.'/upload/calendar/images/index.html'); |
|
151 | + mkdir($cp.'/work', $perm); |
|
152 | + @copy($cpt, $cp.'/work/index.html'); |
|
153 | + mkdir($cp.'/upload/announcements', $perm); |
|
154 | + @copy($cpt, $cp.'/upload/announcements/index.html'); |
|
155 | + mkdir($cp.'/upload/announcements/images', $perm); |
|
156 | + @copy($cpt, $cp.'/upload/announcements/images/index.html'); |
|
157 | 157 | |
158 | 158 | //Oral expression question type |
159 | - mkdir($cp . '/exercises', $perm); |
|
160 | - @copy($cpt, $cp . '/exercises/index.html'); |
|
159 | + mkdir($cp.'/exercises', $perm); |
|
160 | + @copy($cpt, $cp.'/exercises/index.html'); |
|
161 | 161 | |
162 | 162 | // Create .htaccess in the dropbox directory. |
163 | - $fp = fopen($cp . '/dropbox/.htaccess', 'w'); |
|
163 | + $fp = fopen($cp.'/dropbox/.htaccess', 'w'); |
|
164 | 164 | fwrite( |
165 | 165 | $fp, |
166 | 166 | "AuthName AllowLocalAccess |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | { |
303 | 303 | $list = self::get_course_tables(); |
304 | 304 | foreach ($list as $table) { |
305 | - $sql = "DROP TABLE IF EXISTS " . DB_COURSE_PREFIX . $table; |
|
305 | + $sql = "DROP TABLE IF EXISTS ".DB_COURSE_PREFIX.$table; |
|
306 | 306 | Database::query($sql); |
307 | 307 | } |
308 | 308 | } |
@@ -326,47 +326,47 @@ discard block |
||
326 | 326 | if ($media == 'images') { |
327 | 327 | $code_path = api_get_path( |
328 | 328 | SYS_CODE_PATH |
329 | - ) . 'default_course_document/images/'; |
|
329 | + ).'default_course_document/images/'; |
|
330 | 330 | } |
331 | 331 | if ($media == 'audio') { |
332 | 332 | $code_path = api_get_path( |
333 | 333 | SYS_CODE_PATH |
334 | - ) . 'default_course_document/audio/'; |
|
334 | + ).'default_course_document/audio/'; |
|
335 | 335 | } |
336 | 336 | if ($media == 'flash') { |
337 | 337 | $code_path = api_get_path( |
338 | 338 | SYS_CODE_PATH |
339 | - ) . 'default_course_document/flash/'; |
|
339 | + ).'default_course_document/flash/'; |
|
340 | 340 | } |
341 | 341 | if ($media == 'video') { |
342 | 342 | $code_path = api_get_path( |
343 | 343 | SYS_CODE_PATH |
344 | - ) . 'default_course_document/video/'; |
|
344 | + ).'default_course_document/video/'; |
|
345 | 345 | } |
346 | 346 | if ($media == 'certificates') { |
347 | 347 | $code_path = api_get_path( |
348 | 348 | SYS_CODE_PATH |
349 | - ) . 'default_course_document/certificates/'; |
|
349 | + ).'default_course_document/certificates/'; |
|
350 | 350 | } |
351 | 351 | if (is_dir($path)) { |
352 | 352 | $handle = opendir($path); |
353 | 353 | while (false !== ($file = readdir($handle))) { |
354 | - if (is_dir($path . $file) && strpos($file, '.') !== 0) { |
|
354 | + if (is_dir($path.$file) && strpos($file, '.') !== 0) { |
|
355 | 355 | $files[]['dir'] = str_replace( |
356 | 356 | $code_path, |
357 | 357 | '', |
358 | - $path . $file . '/' |
|
358 | + $path.$file.'/' |
|
359 | 359 | ); |
360 | 360 | $files = self::browse_folders( |
361 | - $path . $file . '/', |
|
361 | + $path.$file.'/', |
|
362 | 362 | $files, |
363 | 363 | $media |
364 | 364 | ); |
365 | - } elseif (is_file($path . $file) && strpos($file, '.') !== 0) { |
|
365 | + } elseif (is_file($path.$file) && strpos($file, '.') !== 0) { |
|
366 | 366 | $files[]['file'] = str_replace( |
367 | 367 | $code_path, |
368 | 368 | '', |
369 | - $path . $file |
|
369 | + $path.$file |
|
370 | 370 | ); |
371 | 371 | } |
372 | 372 | } |
@@ -444,117 +444,117 @@ discard block |
||
444 | 444 | |
445 | 445 | Database::query( |
446 | 446 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
447 | - VALUES ($course_id, 1, '" . TOOL_COURSE_DESCRIPTION . "','course_description/','info.gif','" . self::string2binary( |
|
447 | + VALUES ($course_id, 1, '".TOOL_COURSE_DESCRIPTION."','course_description/','info.gif','".self::string2binary( |
|
448 | 448 | api_get_setting( |
449 | 449 | 'course_create_active_tools', |
450 | 450 | 'course_description' |
451 | 451 | ) |
452 | - ) . "','0','squaregrey.gif', 0,'_self','authoring','0')" |
|
452 | + )."','0','squaregrey.gif', 0,'_self','authoring','0')" |
|
453 | 453 | ); |
454 | 454 | Database::query( |
455 | 455 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
456 | - VALUES ($course_id, 2, '" . TOOL_CALENDAR_EVENT . "','calendar/agenda.php','agenda.gif','" . self::string2binary( |
|
456 | + VALUES ($course_id, 2, '".TOOL_CALENDAR_EVENT."','calendar/agenda.php','agenda.gif','".self::string2binary( |
|
457 | 457 | api_get_setting('course_create_active_tools', 'agenda') |
458 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
458 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
459 | 459 | ); |
460 | 460 | Database::query( |
461 | 461 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
462 | - VALUES ($course_id, 3, '" . TOOL_DOCUMENT . "','document/document.php','folder_document.gif','" . self::string2binary( |
|
462 | + VALUES ($course_id, 3, '".TOOL_DOCUMENT."','document/document.php','folder_document.gif','".self::string2binary( |
|
463 | 463 | api_get_setting('course_create_active_tools', 'documents') |
464 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
464 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
465 | 465 | ); |
466 | 466 | Database::query( |
467 | 467 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
468 | - VALUES ($course_id, 4, '" . TOOL_LEARNPATH . "','lp/lp_controller.php','scorms.gif','" . self::string2binary( |
|
468 | + VALUES ($course_id, 4, '".TOOL_LEARNPATH."','lp/lp_controller.php','scorms.gif','".self::string2binary( |
|
469 | 469 | api_get_setting('course_create_active_tools', 'learning_path') |
470 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
470 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
471 | 471 | ); |
472 | 472 | Database::query( |
473 | 473 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
474 | - VALUES ($course_id, 5, '" . TOOL_LINK . "','link/link.php','links.gif','" . self::string2binary( |
|
474 | + VALUES ($course_id, 5, '".TOOL_LINK."','link/link.php','links.gif','".self::string2binary( |
|
475 | 475 | api_get_setting('course_create_active_tools', 'links') |
476 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
476 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
477 | 477 | ); |
478 | 478 | Database::query( |
479 | 479 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
480 | - VALUES ($course_id, 6, '" . TOOL_QUIZ . "','exercise/exercise.php','quiz.gif','" . self::string2binary( |
|
480 | + VALUES ($course_id, 6, '".TOOL_QUIZ."','exercise/exercise.php','quiz.gif','".self::string2binary( |
|
481 | 481 | api_get_setting('course_create_active_tools', 'quiz') |
482 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
482 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
483 | 483 | ); |
484 | 484 | Database::query( |
485 | 485 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
486 | - VALUES ($course_id, 7, '" . TOOL_ANNOUNCEMENT . "','announcements/announcements.php','valves.gif','" . self::string2binary( |
|
486 | + VALUES ($course_id, 7, '".TOOL_ANNOUNCEMENT."','announcements/announcements.php','valves.gif','".self::string2binary( |
|
487 | 487 | api_get_setting('course_create_active_tools', 'announcements') |
488 | - ) . "','0','squaregrey.gif', 0,'_self','authoring','0')" |
|
488 | + )."','0','squaregrey.gif', 0,'_self','authoring','0')" |
|
489 | 489 | ); |
490 | 490 | Database::query( |
491 | 491 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
492 | - VALUES ($course_id, 8, '" . TOOL_FORUM . "','forum/index.php','forum.gif','" . self::string2binary( |
|
492 | + VALUES ($course_id, 8, '".TOOL_FORUM."','forum/index.php','forum.gif','".self::string2binary( |
|
493 | 493 | api_get_setting('course_create_active_tools', 'forums') |
494 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
494 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
495 | 495 | ); |
496 | 496 | Database::query( |
497 | 497 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
498 | - VALUES ($course_id, 9, '" . TOOL_DROPBOX . "','dropbox/index.php','dropbox.gif','" . self::string2binary( |
|
498 | + VALUES ($course_id, 9, '".TOOL_DROPBOX."','dropbox/index.php','dropbox.gif','".self::string2binary( |
|
499 | 499 | api_get_setting('course_create_active_tools', 'dropbox') |
500 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
500 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
501 | 501 | ); |
502 | 502 | Database::query( |
503 | 503 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
504 | - VALUES ($course_id, 10, '" . TOOL_USER . "','user/user.php','members.gif','" . self::string2binary( |
|
504 | + VALUES ($course_id, 10, '".TOOL_USER."','user/user.php','members.gif','".self::string2binary( |
|
505 | 505 | api_get_setting('course_create_active_tools', 'users') |
506 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
506 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
507 | 507 | ); |
508 | 508 | Database::query( |
509 | 509 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
510 | - VALUES ($course_id, 11, '" . TOOL_GROUP . "','group/group.php','group.gif','" . self::string2binary( |
|
510 | + VALUES ($course_id, 11, '".TOOL_GROUP."','group/group.php','group.gif','".self::string2binary( |
|
511 | 511 | api_get_setting('course_create_active_tools', 'groups') |
512 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
512 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
513 | 513 | ); |
514 | 514 | Database::query( |
515 | 515 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
516 | - VALUES ($course_id, 12, '" . TOOL_CHAT . "','chat/chat.php','chat.gif','" . self::string2binary( |
|
516 | + VALUES ($course_id, 12, '".TOOL_CHAT."','chat/chat.php','chat.gif','".self::string2binary( |
|
517 | 517 | api_get_setting('course_create_active_tools', 'chat') |
518 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
518 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
519 | 519 | ); |
520 | 520 | Database::query( |
521 | 521 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
522 | - VALUES ($course_id, 13, '" . TOOL_STUDENTPUBLICATION . "','work/work.php','works.gif','" . self::string2binary( |
|
522 | + VALUES ($course_id, 13, '".TOOL_STUDENTPUBLICATION."','work/work.php','works.gif','".self::string2binary( |
|
523 | 523 | api_get_setting( |
524 | 524 | 'course_create_active_tools', |
525 | 525 | 'student_publications' |
526 | 526 | ) |
527 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
527 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
528 | 528 | ); |
529 | 529 | Database::query( |
530 | 530 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
531 | - VALUES ($course_id, 14, '" . TOOL_SURVEY . "','survey/survey_list.php','survey.gif','" . self::string2binary( |
|
531 | + VALUES ($course_id, 14, '".TOOL_SURVEY."','survey/survey_list.php','survey.gif','".self::string2binary( |
|
532 | 532 | api_get_setting('course_create_active_tools', 'survey') |
533 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
533 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
534 | 534 | ); |
535 | 535 | Database::query( |
536 | 536 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
537 | - VALUES ($course_id, 15, '" . TOOL_WIKI . "','wiki/index.php','wiki.gif','" . self::string2binary( |
|
537 | + VALUES ($course_id, 15, '".TOOL_WIKI."','wiki/index.php','wiki.gif','".self::string2binary( |
|
538 | 538 | api_get_setting('course_create_active_tools', 'wiki') |
539 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
539 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
540 | 540 | ); |
541 | 541 | Database::query( |
542 | 542 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
543 | - VALUES ($course_id, 16, '" . TOOL_GRADEBOOK . "','gradebook/index.php','gradebook.gif','" . self::string2binary( |
|
543 | + VALUES ($course_id, 16, '".TOOL_GRADEBOOK."','gradebook/index.php','gradebook.gif','".self::string2binary( |
|
544 | 544 | api_get_setting('course_create_active_tools', 'gradebook') |
545 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
545 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
546 | 546 | ); |
547 | 547 | Database::query( |
548 | 548 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
549 | - VALUES ($course_id, 17, '" . TOOL_GLOSSARY . "','glossary/index.php','glossary.gif','" . self::string2binary( |
|
549 | + VALUES ($course_id, 17, '".TOOL_GLOSSARY."','glossary/index.php','glossary.gif','".self::string2binary( |
|
550 | 550 | api_get_setting('course_create_active_tools', 'glossary') |
551 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
551 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
552 | 552 | ); |
553 | 553 | Database::query( |
554 | 554 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
555 | - VALUES ($course_id, 18, '" . TOOL_NOTEBOOK . "','notebook/index.php','notebook.gif','" . self::string2binary( |
|
555 | + VALUES ($course_id, 18, '".TOOL_NOTEBOOK."','notebook/index.php','notebook.gif','".self::string2binary( |
|
556 | 556 | api_get_setting('course_create_active_tools', 'notebook') |
557 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
557 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
558 | 558 | ); |
559 | 559 | |
560 | 560 | $setting = intval(self::string2binary( |
@@ -563,45 +563,45 @@ discard block |
||
563 | 563 | |
564 | 564 | Database::query( |
565 | 565 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
566 | - VALUES ($course_id, 19, '" . TOOL_ATTENDANCE . "','attendance/index.php','attendance.gif','" . $setting. "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
566 | + VALUES ($course_id, 19, '".TOOL_ATTENDANCE."','attendance/index.php','attendance.gif','".$setting."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
567 | 567 | ); |
568 | 568 | Database::query( |
569 | 569 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
570 | - VALUES ($course_id, 20, '" . TOOL_COURSE_PROGRESS . "','course_progress/index.php','course_progress.gif','" . self::string2binary( |
|
570 | + VALUES ($course_id, 20, '".TOOL_COURSE_PROGRESS."','course_progress/index.php','course_progress.gif','".self::string2binary( |
|
571 | 571 | intval(api_get_setting('course_create_active_tools', 'course_progress')) |
572 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
572 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
573 | 573 | ); |
574 | 574 | |
575 | 575 | if (api_get_setting('search_enabled') === 'true') { |
576 | 576 | Database::query( |
577 | 577 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
578 | - VALUES ($course_id, 23, '" . TOOL_SEARCH . "','search/','info.gif','" . self::string2binary( |
|
578 | + VALUES ($course_id, 23, '".TOOL_SEARCH."','search/','info.gif','".self::string2binary( |
|
579 | 579 | api_get_setting( |
580 | 580 | 'course_create_active_tools', |
581 | 581 | 'enable_search' |
582 | 582 | ) |
583 | - ) . "','0','search.gif',0,'_self','authoring','0')" |
|
583 | + )."','0','search.gif',0,'_self','authoring','0')" |
|
584 | 584 | ); |
585 | 585 | } |
586 | 586 | |
587 | 587 | $sql = "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
588 | - VALUES ($course_id, 24,'" . TOOL_BLOGS . "','blog/blog_admin.php','blog_admin.gif','" . intval(self::string2binary( |
|
588 | + VALUES ($course_id, 24,'".TOOL_BLOGS."','blog/blog_admin.php','blog_admin.gif','".intval(self::string2binary( |
|
589 | 589 | api_get_setting('course_create_active_tools', 'blogs')) |
590 | - ) . "','1','squaregrey.gif',0,'_self','admin','0')"; |
|
590 | + )."','1','squaregrey.gif',0,'_self','admin','0')"; |
|
591 | 591 | Database::query($sql); |
592 | 592 | |
593 | 593 | /* Course homepage tools for course admin only */ |
594 | 594 | Database::query( |
595 | 595 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
596 | - VALUES ($course_id, 25, '" . TOOL_TRACKING . "','tracking/courseLog.php','statistics.gif','$visible_for_course_admin','1','', 0,'_self','admin','0')" |
|
596 | + VALUES ($course_id, 25, '".TOOL_TRACKING."','tracking/courseLog.php','statistics.gif','$visible_for_course_admin','1','', 0,'_self','admin','0')" |
|
597 | 597 | ); |
598 | 598 | Database::query( |
599 | 599 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
600 | - VALUES ($course_id, 26, '" . TOOL_COURSE_SETTING . "','course_info/infocours.php','reference.gif','$visible_for_course_admin','1','', 0,'_self','admin','0')" |
|
600 | + VALUES ($course_id, 26, '".TOOL_COURSE_SETTING."','course_info/infocours.php','reference.gif','$visible_for_course_admin','1','', 0,'_self','admin','0')" |
|
601 | 601 | ); |
602 | 602 | Database::query( |
603 | 603 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
604 | - VALUES ($course_id, 27, '" . TOOL_COURSE_MAINTENANCE . "','course_info/maintenance.php','backup.gif','$visible_for_course_admin','1','',0,'_self', 'admin','0')" |
|
604 | + VALUES ($course_id, 27, '".TOOL_COURSE_MAINTENANCE."','course_info/maintenance.php','backup.gif','$visible_for_course_admin','1','',0,'_self', 'admin','0')" |
|
605 | 605 | ); |
606 | 606 | |
607 | 607 | $alert = api_get_setting('email_alert_manager_on_new_quiz'); |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | $perm = api_get_permissions_for_new_directories(); |
689 | 689 | $perm_file = api_get_permissions_for_new_files(); |
690 | 690 | |
691 | - $chat_path = $sys_course_path . $course_repository . '/document/chat_files'; |
|
691 | + $chat_path = $sys_course_path.$course_repository.'/document/chat_files'; |
|
692 | 692 | |
693 | 693 | if (!is_dir($chat_path)) { |
694 | 694 | @mkdir($chat_path, api_get_permissions_for_new_directories()); |
@@ -720,11 +720,11 @@ discard block |
||
720 | 720 | 'certificates', |
721 | 721 | ); |
722 | 722 | |
723 | - $default_course_path = api_get_path(SYS_CODE_PATH) . 'default_course_document/'; |
|
723 | + $default_course_path = api_get_path(SYS_CODE_PATH).'default_course_document/'; |
|
724 | 724 | |
725 | 725 | $default_document_array = array(); |
726 | 726 | foreach ($folders_to_copy_from_default_course as $folder) { |
727 | - $default_course_folder_path = $default_course_path . $folder . '/'; |
|
727 | + $default_course_folder_path = $default_course_path.$folder.'/'; |
|
728 | 728 | $files = self::browse_folders( |
729 | 729 | $default_course_folder_path, |
730 | 730 | array(), |
@@ -753,30 +753,30 @@ discard block |
||
753 | 753 | //hack until feature #5242 is implemented |
754 | 754 | if ($media_type == 'images') { |
755 | 755 | $media_type = 'images/gallery'; |
756 | - $images_folder = $sys_course_path . $course_repository . "/document/images/"; |
|
756 | + $images_folder = $sys_course_path.$course_repository."/document/images/"; |
|
757 | 757 | |
758 | 758 | if (!is_dir($images_folder)) { |
759 | 759 | //Creating index.html |
760 | 760 | mkdir($images_folder, $perm); |
761 | - $fd = fopen($images_folder . 'index.html', 'w'); |
|
761 | + $fd = fopen($images_folder.'index.html', 'w'); |
|
762 | 762 | fwrite($fd, $htmlpage); |
763 | - @chmod($images_folder . 'index.html', $perm_file); |
|
763 | + @chmod($images_folder.'index.html', $perm_file); |
|
764 | 764 | } |
765 | 765 | } |
766 | 766 | |
767 | - $course_documents_folder = $sys_course_path . $course_repository . "/document/$media_type/"; |
|
768 | - $default_course_path = api_get_path(SYS_CODE_PATH) . 'default_course_document' . $path_documents; |
|
767 | + $course_documents_folder = $sys_course_path.$course_repository."/document/$media_type/"; |
|
768 | + $default_course_path = api_get_path(SYS_CODE_PATH).'default_course_document'.$path_documents; |
|
769 | 769 | |
770 | 770 | if (!is_dir($course_documents_folder)) { |
771 | 771 | // Creating index.html |
772 | 772 | mkdir($course_documents_folder, $perm); |
773 | 773 | $fd = fopen( |
774 | - $course_documents_folder . 'index.html', |
|
774 | + $course_documents_folder.'index.html', |
|
775 | 775 | 'w' |
776 | 776 | ); |
777 | 777 | fwrite($fd, $htmlpage); |
778 | 778 | @chmod( |
779 | - $course_documents_folder . 'index.html', |
|
779 | + $course_documents_folder.'index.html', |
|
780 | 780 | $perm_file |
781 | 781 | ); |
782 | 782 | } |
@@ -784,15 +784,15 @@ discard block |
||
784 | 784 | if (is_array($array_media) && count($array_media) > 0) { |
785 | 785 | foreach ($array_media as $key => $value) { |
786 | 786 | if (isset($value['dir']) && !empty($value['dir'])) { |
787 | - if (!is_dir($course_documents_folder . $value['dir'])) { |
|
787 | + if (!is_dir($course_documents_folder.$value['dir'])) { |
|
788 | 788 | //Creating folder |
789 | 789 | mkdir( |
790 | - $course_documents_folder . $value['dir'], |
|
790 | + $course_documents_folder.$value['dir'], |
|
791 | 791 | $perm |
792 | 792 | ); |
793 | 793 | |
794 | 794 | //Creating index.html (for light protection) |
795 | - $index_html = $course_documents_folder . $value['dir'] . '/index.html'; |
|
795 | + $index_html = $course_documents_folder.$value['dir'].'/index.html'; |
|
796 | 796 | $fd = fopen($index_html, 'w'); |
797 | 797 | fwrite($fd, $htmlpage); |
798 | 798 | @chmod($index_html, $perm_file); |
@@ -814,12 +814,12 @@ discard block |
||
814 | 814 | } |
815 | 815 | |
816 | 816 | if ($media_type == 'images/gallery') { |
817 | - $folder_path = 'gallery/' . $folder_path; |
|
817 | + $folder_path = 'gallery/'.$folder_path; |
|
818 | 818 | } |
819 | 819 | |
820 | 820 | Database::query( |
821 | 821 | "INSERT INTO $TABLETOOLDOCUMENT (c_id, path,title,filetype,size) |
822 | - VALUES ($course_id,'$path_documents" . $folder_path . "','" . $title . "','folder','0')" |
|
822 | + VALUES ($course_id,'$path_documents".$folder_path."','".$title."','folder','0')" |
|
823 | 823 | ); |
824 | 824 | $image_id = Database:: insert_id(); |
825 | 825 | |
@@ -844,33 +844,33 @@ discard block |
||
844 | 844 | |
845 | 845 | if (isset($value['file']) && !empty($value['file'])) { |
846 | 846 | if (!file_exists( |
847 | - $course_documents_folder . $value['file'] |
|
847 | + $course_documents_folder.$value['file'] |
|
848 | 848 | ) |
849 | 849 | ) { |
850 | 850 | //Copying file |
851 | 851 | copy( |
852 | - $default_course_path . $value['file'], |
|
853 | - $course_documents_folder . $value['file'] |
|
852 | + $default_course_path.$value['file'], |
|
853 | + $course_documents_folder.$value['file'] |
|
854 | 854 | ); |
855 | 855 | chmod( |
856 | - $course_documents_folder . $value['file'], |
|
856 | + $course_documents_folder.$value['file'], |
|
857 | 857 | $perm_file |
858 | 858 | ); |
859 | 859 | //echo $default_course_path.$value['file']; echo ' - '; echo $course_documents_folder.$value['file']; echo '<br />'; |
860 | 860 | $temp = explode('/', $value['file']); |
861 | 861 | $file_size = filesize( |
862 | - $course_documents_folder . $value['file'] |
|
862 | + $course_documents_folder.$value['file'] |
|
863 | 863 | ); |
864 | 864 | |
865 | 865 | //hack until feature #5242 is implemented |
866 | 866 | if ($media_type == 'images/gallery') { |
867 | - $value["file"] = 'gallery/' . $value["file"]; |
|
867 | + $value["file"] = 'gallery/'.$value["file"]; |
|
868 | 868 | } |
869 | 869 | |
870 | 870 | //Inserting file in the DB |
871 | 871 | Database::query( |
872 | 872 | "INSERT INTO $TABLETOOLDOCUMENT (c_id, path,title,filetype,size) |
873 | - VALUES ($course_id,'$path_documents" . $value["file"] . "','" . $temp[count($temp) - 1] . "','file','$file_size')" |
|
873 | + VALUES ($course_id,'$path_documents".$value["file"]."','".$temp[count($temp) - 1]."','file','$file_size')" |
|
874 | 874 | ); |
875 | 875 | $image_id = Database:: insert_id(); |
876 | 876 | if ($image_id) { |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | $sql = "UPDATE $TABLETOOLDOCUMENT SET id = iid WHERE iid = $image_id"; |
879 | 879 | Database::query($sql); |
880 | 880 | |
881 | - if ($path_documents . $value['file'] == '/certificates/default.html') { |
|
881 | + if ($path_documents.$value['file'] == '/certificates/default.html') { |
|
882 | 882 | $example_cert_id = $image_id; |
883 | 883 | } |
884 | 884 | $docId = Database::insert( |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | 'c_id' => $course_id, |
930 | 930 | 'url' => 'http://www.google.com', |
931 | 931 | 'title' => 'Google', |
932 | - 'description' => get_lang('Google') , |
|
932 | + 'description' => get_lang('Google'), |
|
933 | 933 | 'category_id' => 0, |
934 | 934 | 'on_homepage' => 0, |
935 | 935 | 'target' => '_self', |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | 'c_id' => $course_id, |
940 | 940 | 'url' => 'http://www.wikipedia.org', |
941 | 941 | 'title' => 'Wikipedia', |
942 | - 'description' => get_lang('Wikipedia') , |
|
942 | + 'description' => get_lang('Wikipedia'), |
|
943 | 943 | 'category_id' => 0, |
944 | 944 | 'on_homepage' => 0, |
945 | 945 | 'target' => '_self', |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | ] |
948 | 948 | ]; |
949 | 949 | |
950 | - foreach($links as $params) { |
|
950 | + foreach ($links as $params) { |
|
951 | 951 | $link->save($params); |
952 | 952 | } |
953 | 953 | |
@@ -965,8 +965,8 @@ discard block |
||
965 | 965 | |
966 | 966 | /* Introduction text */ |
967 | 967 | $intro_text = '<p style="text-align: center;"> |
968 | - <img src="' . api_get_path(REL_CODE_PATH) . 'img/mascot.png" alt="Mr. Chamilo" title="Mr. Chamilo" /> |
|
969 | - <h2>' . get_lang('IntroductionText') . '</h2> |
|
968 | + <img src="' . api_get_path(REL_CODE_PATH).'img/mascot.png" alt="Mr. Chamilo" title="Mr. Chamilo" /> |
|
969 | + <h2>' . get_lang('IntroductionText').'</h2> |
|
970 | 970 | </p>'; |
971 | 971 | |
972 | 972 | $toolIntro = new Chamilo\CourseBundle\Entity\CToolIntro(); |
@@ -1002,9 +1002,9 @@ discard block |
||
1002 | 1002 | $html = '<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
1003 | 1003 | <tr> |
1004 | 1004 | <td width="220" valign="top" align="left"> |
1005 | - <img src="' . api_get_path(WEB_CODE_PATH) . 'default_course_document/images/mr_chamilo/doubts.png"> |
|
1005 | + <img src="' . api_get_path(WEB_CODE_PATH).'default_course_document/images/mr_chamilo/doubts.png"> |
|
1006 | 1006 | </td> |
1007 | - <td valign="top" align="left">' . get_lang('Antique') . '</td></tr> |
|
1007 | + <td valign="top" align="left">' . get_lang('Antique').'</td></tr> |
|
1008 | 1008 | </table>'; |
1009 | 1009 | $exercise->type = 1; |
1010 | 1010 | $exercise->setRandom(0); |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | 'https://' |
1258 | 1258 | ) === false |
1259 | 1259 | ) { |
1260 | - $department_url = 'http://' . $department_url; |
|
1260 | + $department_url = 'http://'.$department_url; |
|
1261 | 1261 | } |
1262 | 1262 | //just in case |
1263 | 1263 | if ($department_url == 'http://') { |
@@ -1303,12 +1303,12 @@ discard block |
||
1303 | 1303 | $code |
1304 | 1304 | ); |
1305 | 1305 | if (!empty($user_id)) { |
1306 | - $sql = "INSERT INTO " . $TABLECOURSUSER . " SET |
|
1307 | - c_id = '" . $course_id . "', |
|
1308 | - user_id = '" . intval($user_id) . "', |
|
1306 | + $sql = "INSERT INTO ".$TABLECOURSUSER." SET |
|
1307 | + c_id = '" . $course_id."', |
|
1308 | + user_id = '" . intval($user_id)."', |
|
1309 | 1309 | status = '1', |
1310 | 1310 | is_tutor = '0', |
1311 | - sort = '" . ($i_course_sort) . "', |
|
1311 | + sort = '" . ($i_course_sort)."', |
|
1312 | 1312 | relation_type = 0, |
1313 | 1313 | user_course_cat = '0'"; |
1314 | 1314 | Database::query($sql); |
@@ -1327,12 +1327,12 @@ discard block |
||
1327 | 1327 | if (empty($key)) { |
1328 | 1328 | continue; |
1329 | 1329 | } |
1330 | - $sql = "INSERT INTO " . $TABLECOURSUSER . " SET |
|
1331 | - c_id = '" . Database::escape_string($course_id) . "', |
|
1332 | - user_id = '" . Database::escape_string($key) . "', |
|
1330 | + $sql = "INSERT INTO ".$TABLECOURSUSER." SET |
|
1331 | + c_id = '" . Database::escape_string($course_id)."', |
|
1332 | + user_id = '" . Database::escape_string($key)."', |
|
1333 | 1333 | status = '1', |
1334 | 1334 | is_tutor = '0', |
1335 | - sort = '" . ($sort + 1) . "', |
|
1335 | + sort = '" . ($sort + 1)."', |
|
1336 | 1336 | relation_type = 0, |
1337 | 1337 | user_course_cat = '0'"; |
1338 | 1338 | Database::query($sql); |
@@ -1376,18 +1376,18 @@ discard block |
||
1376 | 1376 | $iname = api_get_setting('Institution'); |
1377 | 1377 | $subject = get_lang( |
1378 | 1378 | 'NewCourseCreatedIn' |
1379 | - ) . ' ' . $siteName . ' - ' . $iname; |
|
1379 | + ).' '.$siteName.' - '.$iname; |
|
1380 | 1380 | $message = get_lang( |
1381 | 1381 | 'Dear' |
1382 | - ) . ' ' . $recipient_name . ",\n\n" . get_lang( |
|
1382 | + ).' '.$recipient_name.",\n\n".get_lang( |
|
1383 | 1383 | 'MessageOfNewCourseToAdmin' |
1384 | - ) . ' ' . $siteName . ' - ' . $iname . "\n"; |
|
1385 | - $message .= get_lang('CourseName') . ' ' . $title . "\n"; |
|
1384 | + ).' '.$siteName.' - '.$iname."\n"; |
|
1385 | + $message .= get_lang('CourseName').' '.$title."\n"; |
|
1386 | 1386 | $message .= get_lang( |
1387 | 1387 | 'Category' |
1388 | - ) . ' ' . $category_code . "\n"; |
|
1389 | - $message .= get_lang('Tutor') . ' ' . $tutor_name . "\n"; |
|
1390 | - $message .= get_lang('Language') . ' ' . $course_language; |
|
1388 | + ).' '.$category_code."\n"; |
|
1389 | + $message .= get_lang('Tutor').' '.$tutor_name."\n"; |
|
1390 | + $message .= get_lang('Language').' '.$course_language; |
|
1391 | 1391 | |
1392 | 1392 | $userInfo = api_get_user_info($user_id); |
1393 | 1393 |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $newMessageText = ''; |
361 | 361 | $linkToNewMessage = Display::url( |
362 | 362 | get_lang('SeeMessage'), |
363 | - api_get_path(WEB_CODE_PATH) . 'messages/inbox.php' |
|
363 | + api_get_path(WEB_CODE_PATH).'messages/inbox.php' |
|
364 | 364 | ); |
365 | 365 | break; |
366 | 366 | case self::NOTIFICATION_TYPE_MESSAGE: |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | } |
376 | 376 | $linkToNewMessage = Display::url( |
377 | 377 | get_lang('SeeMessage'), |
378 | - api_get_path(WEB_CODE_PATH) . 'messages/inbox.php' |
|
378 | + api_get_path(WEB_CODE_PATH).'messages/inbox.php' |
|
379 | 379 | ); |
380 | 380 | break; |
381 | 381 | case self::NOTIFICATION_TYPE_INVITATION: |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | } |
391 | 391 | $linkToNewMessage = Display::url( |
392 | 392 | get_lang('SeeInvitation'), |
393 | - api_get_path(WEB_CODE_PATH) . 'social/invitations.php' |
|
393 | + api_get_path(WEB_CODE_PATH).'social/invitations.php' |
|
394 | 394 | ); |
395 | 395 | break; |
396 | 396 | case self::NOTIFICATION_TYPE_GROUP: |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | } |
485 | 485 | |
486 | 486 | $headers = [ |
487 | - 'Authorization: key=' . $gdcApiKey, |
|
487 | + 'Authorization: key='.$gdcApiKey, |
|
488 | 488 | 'Content-Type: application/json' |
489 | 489 | ]; |
490 | 490 |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | */ |
1192 | 1192 | public function hasPicture() |
1193 | 1193 | { |
1194 | - return file_exists(api_get_path(SYS_COURSE_PATH) . $this->directory . '/course-pic85x85.png'); |
|
1194 | + return file_exists(api_get_path(SYS_COURSE_PATH).$this->directory.'/course-pic85x85.png'); |
|
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | /** |
@@ -1206,9 +1206,9 @@ discard block |
||
1206 | 1206 | } |
1207 | 1207 | |
1208 | 1208 | if ($fullSize) { |
1209 | - return api_get_path(WEB_COURSE_PATH) . $this->directory . '/course-pic.png'; |
|
1209 | + return api_get_path(WEB_COURSE_PATH).$this->directory.'/course-pic.png'; |
|
1210 | 1210 | } |
1211 | 1211 | |
1212 | - return api_get_path(WEB_COURSE_PATH) . $this->directory . '/course-pic85x85.png'; |
|
1212 | + return api_get_path(WEB_COURSE_PATH).$this->directory.'/course-pic85x85.png'; |
|
1213 | 1213 | } |
1214 | 1214 | } |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | $sql = "UPDATE $table_group SET id = iid WHERE iid = $lastId"; |
213 | 213 | Database::query($sql); |
214 | 214 | |
215 | - $desired_dir_name= '/'.api_replace_dangerous_char($name).'_groupdocs'; |
|
216 | - $my_path = api_get_path(SYS_COURSE_PATH) . $currentCourseRepository . '/document'; |
|
215 | + $desired_dir_name = '/'.api_replace_dangerous_char($name).'_groupdocs'; |
|
216 | + $my_path = api_get_path(SYS_COURSE_PATH).$currentCourseRepository.'/document'; |
|
217 | 217 | |
218 | 218 | $newFolderData = create_unexisting_directory( |
219 | 219 | $_course, |
@@ -276,11 +276,11 @@ discard block |
||
276 | 276 | $values['default_view_type_group']['default_view_type'] = api_get_setting('default_forum_view'); |
277 | 277 | $values['group_forum'] = $lastId; |
278 | 278 | if ($forumState == '1') { |
279 | - $values['public_private_group_forum_group']['public_private_group_forum']='public'; |
|
279 | + $values['public_private_group_forum_group']['public_private_group_forum'] = 'public'; |
|
280 | 280 | } elseif ($forumState == '2') { |
281 | - $values['public_private_group_forum_group']['public_private_group_forum']='private'; |
|
281 | + $values['public_private_group_forum_group']['public_private_group_forum'] = 'private'; |
|
282 | 282 | } elseif ($forumState == '0') { |
283 | - $values['public_private_group_forum_group']['public_private_group_forum']='unavailable'; |
|
283 | + $values['public_private_group_forum_group']['public_private_group_forum'] = 'unavailable'; |
|
284 | 284 | } |
285 | 285 | store_forum($values); |
286 | 286 | } |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | 1 |
313 | 313 | ); |
314 | 314 | $users = self::get_users($group_id); |
315 | - $group_ids = array (); |
|
315 | + $group_ids = array(); |
|
316 | 316 | |
317 | - for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr ++) { |
|
317 | + for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr++) { |
|
318 | 318 | $group_ids[] = self::create_group( |
319 | 319 | get_lang('Subgroup').' '.$group_nr, |
320 | 320 | $category_id, |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | } elseif ($forum_state === 0) { |
616 | 616 | $sql2 .= " forum_group_public_private='unavailable' "; |
617 | 617 | } |
618 | - $sql2 .=" WHERE c_id = $course_id AND forum_of_group=".$group_id; |
|
618 | + $sql2 .= " WHERE c_id = $course_id AND forum_of_group=".$group_id; |
|
619 | 619 | Database::query($sql2); |
620 | 620 | return $result; |
621 | 621 | } |
@@ -645,13 +645,13 @@ discard block |
||
645 | 645 | public static function get_categories($course_code = null) |
646 | 646 | { |
647 | 647 | $course_info = api_get_course_info($course_code); |
648 | - $course_id = $course_info['real_id']; |
|
648 | + $course_id = $course_info['real_id']; |
|
649 | 649 | $table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY); |
650 | 650 | $sql = "SELECT * FROM $table_group_cat |
651 | 651 | WHERE c_id = $course_id |
652 | 652 | ORDER BY display_order"; |
653 | 653 | $res = Database::query($sql); |
654 | - $cats = array (); |
|
654 | + $cats = array(); |
|
655 | 655 | while ($cat = Database::fetch_array($res)) { |
656 | 656 | $cats[] = $cat; |
657 | 657 | } |
@@ -935,7 +935,7 @@ discard block |
||
935 | 935 | */ |
936 | 936 | public static function get_current_max_groups_per_user($category_id = null, $course_code = null) |
937 | 937 | { |
938 | - $course_info = api_get_course_info ($course_code); |
|
938 | + $course_info = api_get_course_info($course_code); |
|
939 | 939 | $group_table = Database :: get_course_table(TABLE_GROUP); |
940 | 940 | $group_user_table = Database :: get_course_table(TABLE_GROUP_USER); |
941 | 941 | $sql = 'SELECT COUNT(gu.group_id) AS current_max |
@@ -1216,7 +1216,7 @@ discard block |
||
1216 | 1216 | * Retrieve course users (reverse) ordered by the number |
1217 | 1217 | * of group they are already enrolled |
1218 | 1218 | */ |
1219 | - for ($i = 0; $i < count($complete_user_list); $i ++) { |
|
1219 | + for ($i = 0; $i < count($complete_user_list); $i++) { |
|
1220 | 1220 | //find # of groups the user is enrolled in |
1221 | 1221 | $number_of_groups = self :: user_in_number_of_groups( |
1222 | 1222 | $complete_user_list[$i]["user_id"], |
@@ -1235,7 +1235,7 @@ discard block |
||
1235 | 1235 | |
1236 | 1236 | //now sort by # of group left |
1237 | 1237 | $complete_user_list = TableSort :: sort_table($complete_user_list, 'number_groups_left', SORT_DESC); |
1238 | - $userToken = array (); |
|
1238 | + $userToken = array(); |
|
1239 | 1239 | foreach ($complete_user_list as $this_user) { |
1240 | 1240 | if ($this_user['number_groups_left'] > 0) { |
1241 | 1241 | $userToken[$this_user['user_id']] = $this_user['number_groups_left']; |
@@ -1435,7 +1435,7 @@ discard block |
||
1435 | 1435 | if ($category['groups_per_user'] == self::GROUP_PER_MEMBER_NO_LIMIT) { |
1436 | 1436 | $category['groups_per_user'] = self::INFINITE; |
1437 | 1437 | } |
1438 | - $result = self:: user_in_number_of_groups($user_id, $category['id'] ) < $category['groups_per_user']; |
|
1438 | + $result = self:: user_in_number_of_groups($user_id, $category['id']) < $category['groups_per_user']; |
|
1439 | 1439 | if ($result == false) { |
1440 | 1440 | return false; |
1441 | 1441 | } |
@@ -1536,7 +1536,7 @@ discard block |
||
1536 | 1536 | $order_clause |
1537 | 1537 | "; |
1538 | 1538 | $db_result = Database::query($sql); |
1539 | - $users = array (); |
|
1539 | + $users = array(); |
|
1540 | 1540 | while ($user = Database::fetch_object($db_result)) { |
1541 | 1541 | if (!$id_only) { |
1542 | 1542 | $member['user_id'] = $user->user_id; |
@@ -1601,8 +1601,8 @@ discard block |
||
1601 | 1601 | foreach ($user_ids as $user_id) { |
1602 | 1602 | $user_id = intval($user_id); |
1603 | 1603 | if (self::can_user_subscribe($user_id, $groupId, false)) { |
1604 | - $sql = "INSERT INTO " . $table_group_tutor . " (c_id, user_id, group_id) |
|
1605 | - VALUES ('$course_id', '" . $user_id . "', '" . $groupId . "')"; |
|
1604 | + $sql = "INSERT INTO ".$table_group_tutor." (c_id, user_id, group_id) |
|
1605 | + VALUES ('$course_id', '".$user_id."', '".$groupId."')"; |
|
1606 | 1606 | $result = Database::query($sql); |
1607 | 1607 | } |
1608 | 1608 | } |
@@ -1618,7 +1618,7 @@ discard block |
||
1618 | 1618 | */ |
1619 | 1619 | public static function unsubscribe_users($user_ids, $group_id) |
1620 | 1620 | { |
1621 | - $user_ids = is_array($user_ids) ? $user_ids : array ($user_ids); |
|
1621 | + $user_ids = is_array($user_ids) ? $user_ids : array($user_ids); |
|
1622 | 1622 | $table_group_user = Database :: get_course_table(TABLE_GROUP_USER); |
1623 | 1623 | $group_id = intval($group_id); |
1624 | 1624 | $course_id = api_get_course_int_id(); |
@@ -2066,7 +2066,7 @@ discard block |
||
2066 | 2066 | * Retrieve course users (reverse) ordered by the number |
2067 | 2067 | * of group they are already enrolled |
2068 | 2068 | */ |
2069 | - for ($i = 0; $i < count($complete_user_list); $i ++) { |
|
2069 | + for ($i = 0; $i < count($complete_user_list); $i++) { |
|
2070 | 2070 | // find # of groups the user is enrolled in |
2071 | 2071 | $number_of_groups = self:: user_in_number_of_groups( |
2072 | 2072 | $complete_user_list[$i]["user_id"], |
@@ -2203,14 +2203,14 @@ discard block |
||
2203 | 2203 | !(api_is_course_coach() && intval($this_group['session_id']) != $session_id) |
2204 | 2204 | ) { |
2205 | 2205 | $edit_actions = '<a href="'.$url.'settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'" title="'.get_lang('Edit').'">'. |
2206 | - Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a> '; |
|
2206 | + Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a> '; |
|
2207 | 2207 | |
2208 | 2208 | if ($this_group['status'] == 1) { |
2209 | - $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true,false) . '&category=' . $category_id . '&action=set_invisible&id=' . $this_group['id'] . '" title="' . get_lang('Hide') . '">' . |
|
2210 | - Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL) . '</a> '; |
|
2209 | + $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_invisible&id='.$this_group['id'].'" title="'.get_lang('Hide').'">'. |
|
2210 | + Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL).'</a> '; |
|
2211 | 2211 | } else { |
2212 | - $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true, false) . '&category=' . $category_id . '&action=set_visible&id=' . $this_group['id'] . '" title="' . get_lang('Show') . '">' . |
|
2213 | - Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL) . '</a> '; |
|
2212 | + $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_visible&id='.$this_group['id'].'" title="'.get_lang('Show').'">'. |
|
2213 | + Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL).'</a> '; |
|
2214 | 2214 | } |
2215 | 2215 | |
2216 | 2216 | $edit_actions .= '<a href="'.$url.'member_settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'" title="'.get_lang('GroupMembers').'">'. |
@@ -2220,10 +2220,10 @@ discard block |
||
2220 | 2220 | Display::return_icon('export_excel.png', get_lang('Export'), '', ICON_SIZE_SMALL).'</a> '; |
2221 | 2221 | |
2222 | 2222 | $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=fill_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('FillGroup').'">'. |
2223 | - Display::return_icon('fill.png',get_lang('FillGroup'),'',ICON_SIZE_SMALL).'</a> '; |
|
2223 | + Display::return_icon('fill.png', get_lang('FillGroup'), '', ICON_SIZE_SMALL).'</a> '; |
|
2224 | 2224 | |
2225 | 2225 | $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=delete_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'">'. |
2226 | - Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a> '; |
|
2226 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a> '; |
|
2227 | 2227 | |
2228 | 2228 | $row[] = $edit_actions; |
2229 | 2229 | } |
@@ -2595,7 +2595,7 @@ discard block |
||
2595 | 2595 | $activeTutor = null; |
2596 | 2596 | $activeMember = null; |
2597 | 2597 | |
2598 | - switch($default) { |
|
2598 | + switch ($default) { |
|
2599 | 2599 | case 'settings': |
2600 | 2600 | $activeSettings = 'active'; |
2601 | 2601 | break; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | if (isset($_GET['editQuestion'])) { |
14 | - $objQuestion = Question::read ($_GET['editQuestion']); |
|
14 | + $objQuestion = Question::read($_GET['editQuestion']); |
|
15 | 15 | $action = api_get_self()."?".api_get_cidreq()."&myid=1&modifyQuestion=".$modifyQuestion."&editQuestion=".$objQuestion->id; |
16 | 16 | } else { |
17 | 17 | $objQuestion = Question :: getInstance($_REQUEST['answerType']); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $wsUrl = ''; |
15 | 15 | |
16 | 16 | // include common authentication functions |
17 | -require_once dirname(__FILE__) . '/functions.inc.php'; |
|
17 | +require_once dirname(__FILE__).'/functions.inc.php'; |
|
18 | 18 | // call the login checker (defined below) |
19 | 19 | $isValid = loginWSAuthenticate($login, $password, $wsUrl); |
20 | 20 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $key = '-+*%$({[]})$%*+-'; |
63 | 63 | // Complete password con PKCS7-specific padding |
64 | 64 | $blockSize = 16; |
65 | - $padding = $blockSize - (strlen($password)%$blockSize); |
|
65 | + $padding = $blockSize - (strlen($password) % $blockSize); |
|
66 | 66 | $password .= str_repeat(chr($padding), $padding); |
67 | 67 | $cipher = new Crypt_AES(CRYPT_AES_MODE_CFB); |
68 | 68 | $cipher->setKeyLength(128); |
@@ -77,9 +77,7 @@ discard block |
||
77 | 77 | Database::query($sql); |
78 | 78 | |
79 | 79 | // Auto subscribe |
80 | - $user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : |
|
81 | - $userInfo['status'] == COURSEMANAGER ? 'teacher' : |
|
82 | - $userInfo['status'] == DRH ? 'DRH' : 'student'; |
|
80 | + $user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : $userInfo['status'] == COURSEMANAGER ? 'teacher' : $userInfo['status'] == DRH ? 'DRH' : 'student'; |
|
83 | 81 | $autoSubscribe = api_get_setting($user_status.'_autosubscribe'); |
84 | 82 | if ($autoSubscribe) { |
85 | 83 | $autoSubscribe = explode('|', $autoSubscribe); |
@@ -336,7 +334,7 @@ discard block |
||
336 | 334 | global $debug; |
337 | 335 | |
338 | 336 | if ($debug) error_log('Called to update_event_exercice'); |
339 | - if ($debug) error_log('duration:' . $duration); |
|
337 | + if ($debug) error_log('duration:'.$duration); |
|
340 | 338 | |
341 | 339 | if ($exeid != '') { |
342 | 340 | /* |
@@ -384,7 +382,7 @@ discard block |
||
384 | 382 | status = '".$status."', |
385 | 383 | questions_to_check = '".$remind_list."', |
386 | 384 | data_tracking = '".implode(',', $question_list)."', |
387 | - user_ip = '" . Database::escape_string(api_get_real_ip()) . "' |
|
385 | + user_ip = '" . Database::escape_string(api_get_real_ip())."' |
|
388 | 386 | WHERE exe_id = '".Database::escape_string($exeid)."'"; |
389 | 387 | $res = Database::query($sql); |
390 | 388 | |
@@ -1055,15 +1053,15 @@ discard block |
||
1055 | 1053 | |
1056 | 1054 | if (!empty($exe_list) && is_array($exe_list) && count($exe_list) > 0) { |
1057 | 1055 | $sql = "DELETE FROM $track_e_exercises |
1058 | - WHERE exe_id IN (" . implode(',', $exe_list) . ")"; |
|
1056 | + WHERE exe_id IN (".implode(',', $exe_list).")"; |
|
1059 | 1057 | Database::query($sql); |
1060 | 1058 | |
1061 | 1059 | $sql = "DELETE FROM $track_attempts |
1062 | - WHERE exe_id IN (" . implode(',', $exe_list) . ")"; |
|
1060 | + WHERE exe_id IN (".implode(',', $exe_list).")"; |
|
1063 | 1061 | Database::query($sql); |
1064 | 1062 | |
1065 | 1063 | $sql = "DELETE FROM $recording_table |
1066 | - WHERE exe_id IN (" . implode(',', $exe_list) . ")"; |
|
1064 | + WHERE exe_id IN (".implode(',', $exe_list).")"; |
|
1067 | 1065 | Database::query($sql); |
1068 | 1066 | } |
1069 | 1067 | |
@@ -1105,7 +1103,7 @@ discard block |
||
1105 | 1103 | Event::addEvent( |
1106 | 1104 | LOG_EXERCISE_RESULT_DELETE, |
1107 | 1105 | LOG_EXERCISE_AND_USER_ID, |
1108 | - $exercise_id . '-' . $user_id, |
|
1106 | + $exercise_id.'-'.$user_id, |
|
1109 | 1107 | null, |
1110 | 1108 | null, |
1111 | 1109 | $course_id, |
@@ -1705,7 +1703,7 @@ discard block |
||
1705 | 1703 | Event::addEvent( |
1706 | 1704 | LOG_QUESTION_RESULT_DELETE, |
1707 | 1705 | LOG_EXERCISE_ATTEMPT_QUESTION_ID, |
1708 | - $exe_id . '-' . $question_id, |
|
1706 | + $exe_id.'-'.$question_id, |
|
1709 | 1707 | null, |
1710 | 1708 | null, |
1711 | 1709 | $courseId, |
@@ -1741,7 +1739,7 @@ discard block |
||
1741 | 1739 | Event::addEvent( |
1742 | 1740 | LOG_QUESTION_RESULT_DELETE, |
1743 | 1741 | LOG_EXERCISE_ATTEMPT_QUESTION_ID, |
1744 | - $exe_id . '-' . $question_id, |
|
1742 | + $exe_id.'-'.$question_id, |
|
1745 | 1743 | null, |
1746 | 1744 | null, |
1747 | 1745 | $courseId, |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | // setting breadcrumbs |
26 | 26 | $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
27 | -$interbreadcrumb[] = array('url' => 'user_list.php','name' => get_lang('UserList')); |
|
27 | +$interbreadcrumb[] = array('url' => 'user_list.php', 'name' => get_lang('UserList')); |
|
28 | 28 | |
29 | 29 | // Database Table Definitions |
30 | 30 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
@@ -44,17 +44,17 @@ discard block |
||
44 | 44 | $isAdmin = UserManager::is_admin($user_id); |
45 | 45 | if ($isAdmin) { |
46 | 46 | $userStatus = PLATFORM_ADMIN; |
47 | - $tool_name= get_lang('AssignUsersToPlatformAdministrator'); |
|
47 | + $tool_name = get_lang('AssignUsersToPlatformAdministrator'); |
|
48 | 48 | } else if ($user_info['status'] == SESSIONADMIN) { |
49 | - $tool_name= get_lang('AssignUsersToSessionsAdministrator'); |
|
50 | -} else if ($user_info['status'] == STUDENT_BOSS) { |
|
51 | - $tool_name= get_lang('AssignUsersToBoss'); |
|
49 | + $tool_name = get_lang('AssignUsersToSessionsAdministrator'); |
|
50 | +} else if ($user_info['status'] == STUDENT_BOSS) { |
|
51 | + $tool_name = get_lang('AssignUsersToBoss'); |
|
52 | 52 | } else { |
53 | - $tool_name= get_lang('AssignUsersToHumanResourcesManager'); |
|
53 | + $tool_name = get_lang('AssignUsersToHumanResourcesManager'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | $add_type = 'multiple'; |
57 | -if (isset($_GET['add_type']) && $_GET['add_type']!='') { |
|
57 | +if (isset($_GET['add_type']) && $_GET['add_type'] != '') { |
|
58 | 58 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
59 | 59 | } |
60 | 60 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | function search_users($needle, $type) |
66 | 66 | { |
67 | - global $tbl_access_url_rel_user, $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus; |
|
67 | + global $tbl_access_url_rel_user, $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus; |
|
68 | 68 | |
69 | 69 | $xajax_response = new xajaxResponse(); |
70 | 70 | $return = ''; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | LEFT JOIN $tbl_access_url_rel_user au ON (au.user_id = user.user_id) |
103 | 103 | WHERE |
104 | 104 | ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND |
105 | - status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND |
|
105 | + status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND |
|
106 | 106 | user.user_id NOT IN ($user_anonymous, $current_user_id, $user_id) |
107 | 107 | $without_assigned_users AND |
108 | 108 | access_url_id = ".api_get_current_access_url_id()." |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | FROM $tbl_user user |
115 | 115 | WHERE |
116 | 116 | ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND |
117 | - status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND |
|
117 | + status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND |
|
118 | 118 | user_id NOT IN ($user_anonymous, $current_user_id, $user_id) |
119 | 119 | $without_assigned_users |
120 | 120 | $order_clause |
121 | 121 | "; |
122 | 122 | } |
123 | - $rs = Database::query($sql); |
|
123 | + $rs = Database::query($sql); |
|
124 | 124 | $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return)); |
125 | 125 | |
126 | 126 | if ($type == 'single') { |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | |
141 | 141 | switch ($userStatus) { |
142 | 142 | case DRH: |
143 | - $sql .= " user.status <> 6 AND user.status <> " . DRH; |
|
143 | + $sql .= " user.status <> 6 AND user.status <> ".DRH; |
|
144 | 144 | break; |
145 | 145 | case STUDENT_BOSS: |
146 | - $sql .= " user.status <> 6 AND user.status <> " . STUDENT_BOSS; |
|
146 | + $sql .= " user.status <> 6 AND user.status <> ".STUDENT_BOSS; |
|
147 | 147 | break; |
148 | 148 | } |
149 | 149 | |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | $return .= '...<br />'; |
161 | 161 | } |
162 | 162 | } |
163 | - $xajax_response->addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return)); |
|
163 | + $xajax_response->addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return)); |
|
164 | 164 | } else { |
165 | 165 | $return .= '<select id="origin" class="form-control" name="NoAssignedUsersList[]" multiple="multiple" size="15" ">'; |
166 | - while($user = Database :: fetch_array($rs)) { |
|
166 | + while ($user = Database :: fetch_array($rs)) { |
|
167 | 167 | $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
168 | - $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name,ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>'; |
|
168 | + $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name, ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>'; |
|
169 | 169 | } |
170 | 170 | $return .= '</select>'; |
171 | 171 | $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return)); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } |
243 | 243 | </script>'; |
244 | 244 | |
245 | -$formSent=0; |
|
245 | +$formSent = 0; |
|
246 | 246 | $errorMsg = ''; |
247 | 247 | $UserList = array(); |
248 | 248 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | $searchForm = new FormValidator('search', 'get', api_get_self().'?user='.$user_id); |
259 | 259 | $searchForm->addHeader(get_lang('AdvancedSearch')); |
260 | -$renderer =& $searchForm->defaultRenderer(); |
|
260 | +$renderer = & $searchForm->defaultRenderer(); |
|
261 | 261 | |
262 | 262 | $searchForm->addElement('hidden', 'user', $user_id); |
263 | 263 | foreach ($filters as $param) { |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | $affected_rows = 0; |
300 | 300 | } |
301 | 301 | |
302 | - if ($affected_rows) { |
|
302 | + if ($affected_rows) { |
|
303 | 303 | $msg = get_lang('AssignedUsersHaveBeenUpdatedSuccessfully'); |
304 | 304 | } |
305 | 305 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | $actionsRight = Display::url( |
325 | - '<em class="fa fa-search"></em> ' . get_lang('AdvancedSearch'), |
|
325 | + '<em class="fa fa-search"></em> '.get_lang('AdvancedSearch'), |
|
326 | 326 | '#', |
327 | 327 | array('class' => 'btn btn-default advanced_options', 'id' => 'advanced_search') |
328 | 328 | ); |
@@ -359,13 +359,13 @@ discard block |
||
359 | 359 | $assigned_users_id = array_keys($assigned_users_to_hrm); |
360 | 360 | $without_assigned_users = ''; |
361 | 361 | if (count($assigned_users_id) > 0) { |
362 | - $without_assigned_users = " user.user_id NOT IN(".implode(',',$assigned_users_id).") AND "; |
|
362 | + $without_assigned_users = " user.user_id NOT IN(".implode(',', $assigned_users_id).") AND "; |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | $search_user = ''; |
366 | 366 | if (!empty($firstLetterUser)) { |
367 | 367 | $needle = Database::escape_string($firstLetterUser); |
368 | - $search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'"; |
|
368 | + $search_user = "AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'"; |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | $sqlConditions = null; |
@@ -406,12 +406,12 @@ discard block |
||
406 | 406 | $sqlConditions |
407 | 407 | ORDER BY firstname "; |
408 | 408 | } |
409 | -$result = Database::query($sql); |
|
409 | +$result = Database::query($sql); |
|
410 | 410 | ?> |
411 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" class="form-horizontal" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
411 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" class="form-horizontal" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
412 | 412 | <input type="hidden" name="formSent" value="1" /> |
413 | 413 | <?php |
414 | -if(!empty($msg)) { |
|
414 | +if (!empty($msg)) { |
|
415 | 415 | Display::display_normal_message($msg); //main API |
416 | 416 | } |
417 | 417 | ?> |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | <?php |
428 | 428 | while ($enreg = Database::fetch_array($result)) { |
429 | 429 | $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']); ?> |
430 | - <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"';?>> |
|
430 | + <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>> |
|
431 | 431 | <?php echo $person_name.' ('.$enreg['username'].')'; ?> |
432 | 432 | </option> |
433 | 433 | <?php } ?> |
@@ -440,8 +440,8 @@ discard block |
||
440 | 440 | </div> |
441 | 441 | <div class="col-md-4"> |
442 | 442 | <div class="code-course"> |
443 | - <?php if($add_type == 'multiple') { ?> |
|
444 | - <p><?php echo get_lang('FirstLetterUser');?></p> |
|
443 | + <?php if ($add_type == 'multiple') { ?> |
|
444 | + <p><?php echo get_lang('FirstLetterUser'); ?></p> |
|
445 | 445 | <select class="selectpicker show-tick form-control" name="firstLetterUser" onchange = "xajax_search_users(this.value,'multiple')"> |
446 | 446 | <option value="%">--</option> |
447 | 447 | <?php echo Display::get_alphabet_options($firstLetterUser); ?> |
@@ -492,10 +492,10 @@ discard block |
||
492 | 492 | <select id='destination' class="form-control" name="UsersList[]" multiple="multiple" size="15" > |
493 | 493 | <?php |
494 | 494 | if (is_array($assigned_users_to_hrm)) { |
495 | - foreach($assigned_users_to_hrm as $enreg) { |
|
495 | + foreach ($assigned_users_to_hrm as $enreg) { |
|
496 | 496 | $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']); |
497 | 497 | ?> |
498 | - <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"'; ?>> |
|
498 | + <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>> |
|
499 | 499 | <?php echo $person_name.' ('.$enreg['username'].')'; ?> |
500 | 500 | </option> |
501 | 501 | <?php } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $add_type = 'multiple'; |
49 | -if (isset($_GET['add_type']) && $_GET['add_type']!='') { |
|
49 | +if (isset($_GET['add_type']) && $_GET['add_type'] != '') { |
|
50 | 50 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
51 | 51 | } |
52 | 52 | |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | $sql = "SELECT s.id, s.name FROM $tbl_session s |
83 | 83 | WHERE s.name LIKE '$needle%' $without_assigned_sessions "; |
84 | 84 | } |
85 | - $rs = Database::query($sql); |
|
85 | + $rs = Database::query($sql); |
|
86 | 86 | $return .= '<select class="form-control" id="origin" name="NoAssignedSessionsList[]" multiple="multiple" size="20">'; |
87 | - while($session = Database :: fetch_array($rs)) { |
|
88 | - $return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'],ENT_QUOTES).'">'.$session['name'].'</option>'; |
|
87 | + while ($session = Database :: fetch_array($rs)) { |
|
88 | + $return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'], ENT_QUOTES).'">'.$session['name'].'</option>'; |
|
89 | 89 | } |
90 | 90 | $return .= '</select>'; |
91 | - $xajax_response->addAssign('ajax_list_sessions_multiple','innerHTML',api_utf8_encode($return)); |
|
91 | + $xajax_response->addAssign('ajax_list_sessions_multiple', 'innerHTML', api_utf8_encode($return)); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | return $xajax_response; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | </script>'; |
149 | 149 | |
150 | -$formSent=0; |
|
150 | +$formSent = 0; |
|
151 | 151 | $firstLetterSession = isset($_POST['firstLetterSession']) ? $_POST['firstLetterSession'] : null; |
152 | 152 | $errorMsg = ''; |
153 | 153 | $UserList = array(); |
@@ -171,10 +171,10 @@ discard block |
||
171 | 171 | |
172 | 172 | // Actions |
173 | 173 | if ($user_info['status'] != SESSIONADMIN) { |
174 | - $actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">' . |
|
175 | - Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM ) . '</a>'; |
|
176 | - $actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">' . |
|
177 | - Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM) . '</a>'; |
|
174 | + $actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">'. |
|
175 | + Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM).'</a>'; |
|
176 | + $actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">'. |
|
177 | + Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM).'</a>'; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | echo Display::toolbarAction('toolbar-dashboard', array($actionsLeft)); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | $without_assigned_sessions = ''; |
191 | 191 | if (count($assigned_sessions_id) > 0) { |
192 | - $without_assigned_sessions = " AND s.id NOT IN (".implode(',',$assigned_sessions_id).") "; |
|
192 | + $without_assigned_sessions = " AND s.id NOT IN (".implode(',', $assigned_sessions_id).") "; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | $needle = '%'; |
@@ -210,9 +210,9 @@ discard block |
||
210 | 210 | WHERE s.name LIKE '$needle%' $without_assigned_sessions |
211 | 211 | ORDER BY s.name"; |
212 | 212 | } |
213 | -$result = Database::query($sql); |
|
213 | +$result = Database::query($sql); |
|
214 | 214 | ?> |
215 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if($ajax_search){ echo ' onsubmit="valide();"';}?>> |
|
215 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if ($ajax_search) { echo ' onsubmit="valide();"'; }?>> |
|
216 | 216 | <input type="hidden" name="formSent" value="1" /> |
217 | 217 | |
218 | 218 | <div class="row"> |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | <?php |
224 | 224 | while ($enreg = Database::fetch_array($result)) { |
225 | 225 | ?> |
226 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"';?>> |
|
226 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>> |
|
227 | 227 | <?php echo $enreg['name']; ?> |
228 | 228 | </option> |
229 | 229 | <?php } ?> |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | <div class="col-md-4"> |
234 | 234 | <div class="code-course"> |
235 | 235 | <?php if ($add_type == 'multiple') { ?> |
236 | - <p><?php echo get_lang('FirstLetterSession');?> :</p> |
|
236 | + <p><?php echo get_lang('FirstLetterSession'); ?> :</p> |
|
237 | 237 | <select class="selectpicker form-control" name="firstLetterSession" onchange = "xajax_search_sessions(this.value, 'multiple')"> |
238 | 238 | <option value="%">--</option> |
239 | 239 | <?php echo Display :: get_alphabet_options($firstLetterSession); ?> |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | <select id='destination' name="SessionsList[]" multiple="multiple" size="20" style="width:320px;"> |
283 | 283 | <?php |
284 | 284 | if (is_array($assigned_sessions_to_hrm)) { |
285 | - foreach($assigned_sessions_to_hrm as $enreg) { |
|
285 | + foreach ($assigned_sessions_to_hrm as $enreg) { |
|
286 | 286 | ?> |
287 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; ?>> |
|
287 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>> |
|
288 | 288 | <?php echo $enreg['name'] ?> |
289 | 289 | </option> |
290 | 290 | <?php } |