@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | public function getFunctions() |
| 32 | 32 | { |
| 33 | 33 | return array( |
| 34 | - new \Twig_SimpleFunction('chamilo_settings_all', array($this, 'getSettings')), |
|
| 35 | - new \Twig_SimpleFunction('chamilo_settings_get', array($this, 'getSettingsParameter')), |
|
| 36 | - new \Twig_SimpleFunction('chamilo_settings_has', [$this, 'hasSettingsParameter']), |
|
| 34 | + new \Twig_SimpleFunction('chamilo_settings_all', array($this, 'getSettings')), |
|
| 35 | + new \Twig_SimpleFunction('chamilo_settings_get', array($this, 'getSettingsParameter')), |
|
| 36 | + new \Twig_SimpleFunction('chamilo_settings_has', [$this, 'hasSettingsParameter']), |
|
| 37 | 37 | ); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | public function getFilters() |
| 45 | 45 | { |
| 46 | 46 | return array( |
| 47 | - //new \Twig_SimpleFunction('chamilo_settings_all', array($this, 'getSettings')), |
|
| 48 | - new \Twig_SimpleFilter('get_setting', array($this, 'getSettingsParameter')), |
|
| 49 | - //new \Twig_SimpleFunction('chamilo_settings_has', [$this, 'hasSettingsParameter']), |
|
| 47 | + //new \Twig_SimpleFunction('chamilo_settings_all', array($this, 'getSettings')), |
|
| 48 | + new \Twig_SimpleFilter('get_setting', array($this, 'getSettingsParameter')), |
|
| 49 | + //new \Twig_SimpleFunction('chamilo_settings_has', [$this, 'hasSettingsParameter']), |
|
| 50 | 50 | ); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | $try_new_fsc_id = $try_new_fsc_db = $try_new_fsc_dir = 0; |
| 52 | 52 | |
| 53 | 53 | while (!$keys_are_unique) { |
| 54 | - $keys_course_id = $prefix_for_all . $unique_prefix . $wanted_code . $final_suffix['CourseId']; |
|
| 55 | - $keys_course_repository = $prefix_for_path . $unique_prefix . $wanted_code . $final_suffix['CourseDir']; |
|
| 54 | + $keys_course_id = $prefix_for_all.$unique_prefix.$wanted_code.$final_suffix['CourseId']; |
|
| 55 | + $keys_course_repository = $prefix_for_path.$unique_prefix.$wanted_code.$final_suffix['CourseDir']; |
|
| 56 | 56 | $keys_are_unique = true; |
| 57 | 57 | |
| 58 | 58 | // Check whether they are unique. |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | if (Database::num_rows($result)) { |
| 65 | 65 | $keys_are_unique = false; |
| 66 | - $try_new_fsc_id ++; |
|
| 66 | + $try_new_fsc_id++; |
|
| 67 | 67 | $final_suffix['CourseId'] = substr(md5(uniqid(rand())), 0, 4); |
| 68 | 68 | } |
| 69 | 69 | if (file_exists(api_get_path(SYS_COURSE_PATH).$keys_course_repository)) { |
| 70 | 70 | $keys_are_unique = false; |
| 71 | - $try_new_fsc_dir ++; |
|
| 71 | + $try_new_fsc_dir++; |
|
| 72 | 72 | $final_suffix['CourseDir'] = substr(md5(uniqid(rand())), 0, 4); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | $perm = api_get_permissions_for_new_directories(); |
| 97 | 97 | $perm_file = api_get_permissions_for_new_files(); |
| 98 | 98 | $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>"; |
| 99 | - $cp = api_get_path(SYS_COURSE_PATH) . $course_repository; |
|
| 99 | + $cp = api_get_path(SYS_COURSE_PATH).$course_repository; |
|
| 100 | 100 | |
| 101 | 101 | //Creating document folder |
| 102 | 102 | mkdir($cp, $perm); |
| 103 | - mkdir($cp . '/document', $perm); |
|
| 104 | - $cpt = $cp . '/document/index.html'; |
|
| 103 | + mkdir($cp.'/document', $perm); |
|
| 104 | + $cpt = $cp.'/document/index.html'; |
|
| 105 | 105 | $fd = fopen($cpt, 'w'); |
| 106 | 106 | fwrite($fd, $htmlpage); |
| 107 | 107 | fclose($fd); |
@@ -123,49 +123,49 @@ discard block |
||
| 123 | 123 | @copy($cpt, $cp . '/document/video/index.html'); */ |
| 124 | 124 | |
| 125 | 125 | //Creatind dropbox folder |
| 126 | - mkdir($cp . '/dropbox', $perm); |
|
| 127 | - $cpt = $cp . '/dropbox/index.html'; |
|
| 126 | + mkdir($cp.'/dropbox', $perm); |
|
| 127 | + $cpt = $cp.'/dropbox/index.html'; |
|
| 128 | 128 | $fd = fopen($cpt, 'w'); |
| 129 | 129 | fwrite($fd, $htmlpage); |
| 130 | 130 | fclose($fd); |
| 131 | 131 | @chmod($cpt, $perm_file); |
| 132 | - mkdir($cp . '/group', $perm); |
|
| 133 | - @copy($cpt, $cp . '/group/index.html'); |
|
| 134 | - mkdir($cp . '/page', $perm); |
|
| 135 | - @copy($cpt, $cp . '/page/index.html'); |
|
| 136 | - mkdir($cp . '/scorm', $perm); |
|
| 137 | - @copy($cpt, $cp . '/scorm/index.html'); |
|
| 138 | - mkdir($cp . '/upload', $perm); |
|
| 139 | - @copy($cpt, $cp . '/upload/index.html'); |
|
| 140 | - mkdir($cp . '/upload/forum', $perm); |
|
| 141 | - @copy($cpt, $cp . '/upload/forum/index.html'); |
|
| 142 | - mkdir($cp . '/upload/forum/images', $perm); |
|
| 143 | - @copy($cpt, $cp . '/upload/forum/images/index.html'); |
|
| 144 | - mkdir($cp . '/upload/test', $perm); |
|
| 145 | - @copy($cpt, $cp . '/upload/test/index.html'); |
|
| 146 | - mkdir($cp . '/upload/blog', $perm); |
|
| 147 | - @copy($cpt, $cp . '/upload/blog/index.html'); |
|
| 148 | - mkdir($cp . '/upload/learning_path', $perm); |
|
| 149 | - @copy($cpt, $cp . '/upload/learning_path/index.html'); |
|
| 150 | - mkdir($cp . '/upload/learning_path/images', $perm); |
|
| 151 | - @copy($cpt, $cp . '/upload/learning_path/images/index.html'); |
|
| 152 | - mkdir($cp . '/upload/calendar', $perm); |
|
| 153 | - @copy($cpt, $cp . '/upload/calendar/index.html'); |
|
| 154 | - mkdir($cp . '/upload/calendar/images', $perm); |
|
| 155 | - @copy($cpt, $cp . '/upload/calendar/images/index.html'); |
|
| 156 | - mkdir($cp . '/work', $perm); |
|
| 157 | - @copy($cpt, $cp . '/work/index.html'); |
|
| 158 | - mkdir($cp . '/upload/announcements', $perm); |
|
| 159 | - @copy($cpt, $cp . '/upload/announcements/index.html'); |
|
| 160 | - mkdir($cp . '/upload/announcements/images', $perm); |
|
| 161 | - @copy($cpt, $cp . '/upload/announcements/images/index.html'); |
|
| 132 | + mkdir($cp.'/group', $perm); |
|
| 133 | + @copy($cpt, $cp.'/group/index.html'); |
|
| 134 | + mkdir($cp.'/page', $perm); |
|
| 135 | + @copy($cpt, $cp.'/page/index.html'); |
|
| 136 | + mkdir($cp.'/scorm', $perm); |
|
| 137 | + @copy($cpt, $cp.'/scorm/index.html'); |
|
| 138 | + mkdir($cp.'/upload', $perm); |
|
| 139 | + @copy($cpt, $cp.'/upload/index.html'); |
|
| 140 | + mkdir($cp.'/upload/forum', $perm); |
|
| 141 | + @copy($cpt, $cp.'/upload/forum/index.html'); |
|
| 142 | + mkdir($cp.'/upload/forum/images', $perm); |
|
| 143 | + @copy($cpt, $cp.'/upload/forum/images/index.html'); |
|
| 144 | + mkdir($cp.'/upload/test', $perm); |
|
| 145 | + @copy($cpt, $cp.'/upload/test/index.html'); |
|
| 146 | + mkdir($cp.'/upload/blog', $perm); |
|
| 147 | + @copy($cpt, $cp.'/upload/blog/index.html'); |
|
| 148 | + mkdir($cp.'/upload/learning_path', $perm); |
|
| 149 | + @copy($cpt, $cp.'/upload/learning_path/index.html'); |
|
| 150 | + mkdir($cp.'/upload/learning_path/images', $perm); |
|
| 151 | + @copy($cpt, $cp.'/upload/learning_path/images/index.html'); |
|
| 152 | + mkdir($cp.'/upload/calendar', $perm); |
|
| 153 | + @copy($cpt, $cp.'/upload/calendar/index.html'); |
|
| 154 | + mkdir($cp.'/upload/calendar/images', $perm); |
|
| 155 | + @copy($cpt, $cp.'/upload/calendar/images/index.html'); |
|
| 156 | + mkdir($cp.'/work', $perm); |
|
| 157 | + @copy($cpt, $cp.'/work/index.html'); |
|
| 158 | + mkdir($cp.'/upload/announcements', $perm); |
|
| 159 | + @copy($cpt, $cp.'/upload/announcements/index.html'); |
|
| 160 | + mkdir($cp.'/upload/announcements/images', $perm); |
|
| 161 | + @copy($cpt, $cp.'/upload/announcements/images/index.html'); |
|
| 162 | 162 | |
| 163 | 163 | //Oral expression question type |
| 164 | - mkdir($cp . '/exercises', $perm); |
|
| 165 | - @copy($cpt, $cp . '/exercises/index.html'); |
|
| 164 | + mkdir($cp.'/exercises', $perm); |
|
| 165 | + @copy($cpt, $cp.'/exercises/index.html'); |
|
| 166 | 166 | |
| 167 | 167 | // Create .htaccess in the dropbox directory. |
| 168 | - $fp = fopen($cp . '/dropbox/.htaccess', 'w'); |
|
| 168 | + $fp = fopen($cp.'/dropbox/.htaccess', 'w'); |
|
| 169 | 169 | fwrite( |
| 170 | 170 | $fp, |
| 171 | 171 | "AuthName AllowLocalAccess |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | { |
| 308 | 308 | $list = self::get_course_tables(); |
| 309 | 309 | foreach ($list as $table) { |
| 310 | - $sql = "DROP TABLE IF EXISTS " . DB_COURSE_PREFIX . $table; |
|
| 310 | + $sql = "DROP TABLE IF EXISTS ".DB_COURSE_PREFIX.$table; |
|
| 311 | 311 | Database::query($sql); |
| 312 | 312 | } |
| 313 | 313 | } |
@@ -331,47 +331,47 @@ discard block |
||
| 331 | 331 | if ($media == 'images') { |
| 332 | 332 | $code_path = api_get_path( |
| 333 | 333 | SYS_CODE_PATH |
| 334 | - ) . 'default_course_document/images/'; |
|
| 334 | + ).'default_course_document/images/'; |
|
| 335 | 335 | } |
| 336 | 336 | if ($media == 'audio') { |
| 337 | 337 | $code_path = api_get_path( |
| 338 | 338 | SYS_CODE_PATH |
| 339 | - ) . 'default_course_document/audio/'; |
|
| 339 | + ).'default_course_document/audio/'; |
|
| 340 | 340 | } |
| 341 | 341 | if ($media == 'flash') { |
| 342 | 342 | $code_path = api_get_path( |
| 343 | 343 | SYS_CODE_PATH |
| 344 | - ) . 'default_course_document/flash/'; |
|
| 344 | + ).'default_course_document/flash/'; |
|
| 345 | 345 | } |
| 346 | 346 | if ($media == 'video') { |
| 347 | 347 | $code_path = api_get_path( |
| 348 | 348 | SYS_CODE_PATH |
| 349 | - ) . 'default_course_document/video/'; |
|
| 349 | + ).'default_course_document/video/'; |
|
| 350 | 350 | } |
| 351 | 351 | if ($media == 'certificates') { |
| 352 | 352 | $code_path = api_get_path( |
| 353 | 353 | SYS_CODE_PATH |
| 354 | - ) . 'default_course_document/certificates/'; |
|
| 354 | + ).'default_course_document/certificates/'; |
|
| 355 | 355 | } |
| 356 | 356 | if (is_dir($path)) { |
| 357 | 357 | $handle = opendir($path); |
| 358 | 358 | while (false !== ($file = readdir($handle))) { |
| 359 | - if (is_dir($path . $file) && strpos($file, '.') !== 0) { |
|
| 359 | + if (is_dir($path.$file) && strpos($file, '.') !== 0) { |
|
| 360 | 360 | $files[]['dir'] = str_replace( |
| 361 | 361 | $code_path, |
| 362 | 362 | '', |
| 363 | - $path . $file . '/' |
|
| 363 | + $path.$file.'/' |
|
| 364 | 364 | ); |
| 365 | 365 | $files = self::browse_folders( |
| 366 | - $path . $file . '/', |
|
| 366 | + $path.$file.'/', |
|
| 367 | 367 | $files, |
| 368 | 368 | $media |
| 369 | 369 | ); |
| 370 | - } elseif (is_file($path . $file) && strpos($file, '.') !== 0) { |
|
| 370 | + } elseif (is_file($path.$file) && strpos($file, '.') !== 0) { |
|
| 371 | 371 | $files[]['file'] = str_replace( |
| 372 | 372 | $code_path, |
| 373 | 373 | '', |
| 374 | - $path . $file |
|
| 374 | + $path.$file |
|
| 375 | 375 | ); |
| 376 | 376 | } |
| 377 | 377 | } |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | $perm = api_get_permissions_for_new_directories(); |
| 571 | 571 | $perm_file = api_get_permissions_for_new_files(); |
| 572 | 572 | |
| 573 | - $chat_path = $sys_course_path . $course_repository . '/document/chat_files'; |
|
| 573 | + $chat_path = $sys_course_path.$course_repository.'/document/chat_files'; |
|
| 574 | 574 | |
| 575 | 575 | if (!is_dir($chat_path)) { |
| 576 | 576 | @mkdir($chat_path, api_get_permissions_for_new_directories()); |
@@ -602,11 +602,11 @@ discard block |
||
| 602 | 602 | 'certificates', |
| 603 | 603 | ); |
| 604 | 604 | |
| 605 | - $default_course_path = api_get_path(SYS_CODE_PATH) . 'default_course_document/'; |
|
| 605 | + $default_course_path = api_get_path(SYS_CODE_PATH).'default_course_document/'; |
|
| 606 | 606 | |
| 607 | 607 | $default_document_array = array(); |
| 608 | 608 | foreach ($folders_to_copy_from_default_course as $folder) { |
| 609 | - $default_course_folder_path = $default_course_path . $folder . '/'; |
|
| 609 | + $default_course_folder_path = $default_course_path.$folder.'/'; |
|
| 610 | 610 | $files = self::browse_folders( |
| 611 | 611 | $default_course_folder_path, |
| 612 | 612 | array(), |
@@ -635,30 +635,30 @@ discard block |
||
| 635 | 635 | //hack until feature #5242 is implemented |
| 636 | 636 | if ($media_type == 'images') { |
| 637 | 637 | $media_type = 'images/gallery'; |
| 638 | - $images_folder = $sys_course_path . $course_repository . "/document/images/"; |
|
| 638 | + $images_folder = $sys_course_path.$course_repository."/document/images/"; |
|
| 639 | 639 | |
| 640 | 640 | if (!is_dir($images_folder)) { |
| 641 | 641 | //Creating index.html |
| 642 | 642 | mkdir($images_folder, $perm); |
| 643 | - $fd = fopen($images_folder . 'index.html', 'w'); |
|
| 643 | + $fd = fopen($images_folder.'index.html', 'w'); |
|
| 644 | 644 | fwrite($fd, $htmlpage); |
| 645 | - @chmod($images_folder . 'index.html', $perm_file); |
|
| 645 | + @chmod($images_folder.'index.html', $perm_file); |
|
| 646 | 646 | } |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | - $course_documents_folder = $sys_course_path . $course_repository . "/document/$media_type/"; |
|
| 650 | - $default_course_path = api_get_path(SYS_CODE_PATH) . 'default_course_document' . $path_documents; |
|
| 649 | + $course_documents_folder = $sys_course_path.$course_repository."/document/$media_type/"; |
|
| 650 | + $default_course_path = api_get_path(SYS_CODE_PATH).'default_course_document'.$path_documents; |
|
| 651 | 651 | |
| 652 | 652 | if (!is_dir($course_documents_folder)) { |
| 653 | 653 | // Creating index.html |
| 654 | 654 | mkdir($course_documents_folder, $perm); |
| 655 | 655 | $fd = fopen( |
| 656 | - $course_documents_folder . 'index.html', |
|
| 656 | + $course_documents_folder.'index.html', |
|
| 657 | 657 | 'w' |
| 658 | 658 | ); |
| 659 | 659 | fwrite($fd, $htmlpage); |
| 660 | 660 | @chmod( |
| 661 | - $course_documents_folder . 'index.html', |
|
| 661 | + $course_documents_folder.'index.html', |
|
| 662 | 662 | $perm_file |
| 663 | 663 | ); |
| 664 | 664 | } |
@@ -666,15 +666,15 @@ discard block |
||
| 666 | 666 | if (is_array($array_media) && count($array_media) > 0) { |
| 667 | 667 | foreach ($array_media as $key => $value) { |
| 668 | 668 | if (isset($value['dir']) && !empty($value['dir'])) { |
| 669 | - if (!is_dir($course_documents_folder . $value['dir'])) { |
|
| 669 | + if (!is_dir($course_documents_folder.$value['dir'])) { |
|
| 670 | 670 | //Creating folder |
| 671 | 671 | mkdir( |
| 672 | - $course_documents_folder . $value['dir'], |
|
| 672 | + $course_documents_folder.$value['dir'], |
|
| 673 | 673 | $perm |
| 674 | 674 | ); |
| 675 | 675 | |
| 676 | 676 | //Creating index.html (for light protection) |
| 677 | - $index_html = $course_documents_folder . $value['dir'] . '/index.html'; |
|
| 677 | + $index_html = $course_documents_folder.$value['dir'].'/index.html'; |
|
| 678 | 678 | $fd = fopen($index_html, 'w'); |
| 679 | 679 | fwrite($fd, $htmlpage); |
| 680 | 680 | @chmod($index_html, $perm_file); |
@@ -696,12 +696,12 @@ discard block |
||
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | if ($media_type == 'images/gallery') { |
| 699 | - $folder_path = 'gallery/' . $folder_path; |
|
| 699 | + $folder_path = 'gallery/'.$folder_path; |
|
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | Database::query( |
| 703 | 703 | "INSERT INTO $TABLETOOLDOCUMENT (c_id, path,title,filetype,size) |
| 704 | - VALUES ($course_id,'$path_documents" . $folder_path . "','" . $title . "','folder','0')" |
|
| 704 | + VALUES ($course_id,'$path_documents".$folder_path."','".$title."','folder','0')" |
|
| 705 | 705 | ); |
| 706 | 706 | $image_id = Database:: insert_id(); |
| 707 | 707 | |
@@ -726,33 +726,33 @@ discard block |
||
| 726 | 726 | |
| 727 | 727 | if (isset($value['file']) && !empty($value['file'])) { |
| 728 | 728 | if (!file_exists( |
| 729 | - $course_documents_folder . $value['file'] |
|
| 729 | + $course_documents_folder.$value['file'] |
|
| 730 | 730 | ) |
| 731 | 731 | ) { |
| 732 | 732 | //Copying file |
| 733 | 733 | copy( |
| 734 | - $default_course_path . $value['file'], |
|
| 735 | - $course_documents_folder . $value['file'] |
|
| 734 | + $default_course_path.$value['file'], |
|
| 735 | + $course_documents_folder.$value['file'] |
|
| 736 | 736 | ); |
| 737 | 737 | chmod( |
| 738 | - $course_documents_folder . $value['file'], |
|
| 738 | + $course_documents_folder.$value['file'], |
|
| 739 | 739 | $perm_file |
| 740 | 740 | ); |
| 741 | 741 | //echo $default_course_path.$value['file']; echo ' - '; echo $course_documents_folder.$value['file']; echo '<br />'; |
| 742 | 742 | $temp = explode('/', $value['file']); |
| 743 | 743 | $file_size = filesize( |
| 744 | - $course_documents_folder . $value['file'] |
|
| 744 | + $course_documents_folder.$value['file'] |
|
| 745 | 745 | ); |
| 746 | 746 | |
| 747 | 747 | //hack until feature #5242 is implemented |
| 748 | 748 | if ($media_type == 'images/gallery') { |
| 749 | - $value["file"] = 'gallery/' . $value["file"]; |
|
| 749 | + $value["file"] = 'gallery/'.$value["file"]; |
|
| 750 | 750 | } |
| 751 | 751 | |
| 752 | 752 | //Inserting file in the DB |
| 753 | 753 | Database::query( |
| 754 | 754 | "INSERT INTO $TABLETOOLDOCUMENT (c_id, path,title,filetype,size) |
| 755 | - VALUES ($course_id,'$path_documents" . $value["file"] . "','" . $temp[count($temp) - 1] . "','file','$file_size')" |
|
| 755 | + VALUES ($course_id,'$path_documents".$value["file"]."','".$temp[count($temp) - 1]."','file','$file_size')" |
|
| 756 | 756 | ); |
| 757 | 757 | $image_id = Database:: insert_id(); |
| 758 | 758 | if ($image_id) { |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | $sql = "UPDATE $TABLETOOLDOCUMENT SET id = iid WHERE iid = $image_id"; |
| 761 | 761 | Database::query($sql); |
| 762 | 762 | |
| 763 | - if ($path_documents . $value['file'] == '/certificates/default.html') { |
|
| 763 | + if ($path_documents.$value['file'] == '/certificates/default.html') { |
|
| 764 | 764 | $example_cert_id = $image_id; |
| 765 | 765 | } |
| 766 | 766 | $docId = Database::insert( |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | 'c_id' => $course_id, |
| 812 | 812 | 'url' => 'http://www.google.com', |
| 813 | 813 | 'title' => 'Google', |
| 814 | - 'description' => get_lang('Google') , |
|
| 814 | + 'description' => get_lang('Google'), |
|
| 815 | 815 | 'category_id' => 0, |
| 816 | 816 | 'on_homepage' => 0, |
| 817 | 817 | 'target' => '_self', |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | 'c_id' => $course_id, |
| 822 | 822 | 'url' => 'http://www.wikipedia.org', |
| 823 | 823 | 'title' => 'Wikipedia', |
| 824 | - 'description' => get_lang('Wikipedia') , |
|
| 824 | + 'description' => get_lang('Wikipedia'), |
|
| 825 | 825 | 'category_id' => 0, |
| 826 | 826 | 'on_homepage' => 0, |
| 827 | 827 | 'target' => '_self', |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | ] |
| 830 | 830 | ]; |
| 831 | 831 | |
| 832 | - foreach($links as $params) { |
|
| 832 | + foreach ($links as $params) { |
|
| 833 | 833 | $link->save($params); |
| 834 | 834 | } |
| 835 | 835 | |
@@ -847,8 +847,8 @@ discard block |
||
| 847 | 847 | |
| 848 | 848 | /* Introduction text */ |
| 849 | 849 | $intro_text = '<p style="text-align: center;"> |
| 850 | - <img src="' . api_get_path(REL_CODE_PATH) . 'img/mascot.png" alt="Mr. Chamilo" title="Mr. Chamilo" /> |
|
| 851 | - <h2>' . get_lang('IntroductionText') . '</h2> |
|
| 850 | + <img src="' . api_get_path(REL_CODE_PATH).'img/mascot.png" alt="Mr. Chamilo" title="Mr. Chamilo" /> |
|
| 851 | + <h2>' . get_lang('IntroductionText').'</h2> |
|
| 852 | 852 | </p>'; |
| 853 | 853 | |
| 854 | 854 | $toolIntro = new Chamilo\CourseBundle\Entity\CToolIntro(); |
@@ -884,9 +884,9 @@ discard block |
||
| 884 | 884 | $html = '<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
| 885 | 885 | <tr> |
| 886 | 886 | <td width="220" valign="top" align="left"> |
| 887 | - <img src="' . api_get_path(WEB_CODE_PATH) . 'default_course_document/images/mr_chamilo/doubts.png"> |
|
| 887 | + <img src="' . api_get_path(WEB_CODE_PATH).'default_course_document/images/mr_chamilo/doubts.png"> |
|
| 888 | 888 | </td> |
| 889 | - <td valign="top" align="left">' . get_lang('Antique') . '</td></tr> |
|
| 889 | + <td valign="top" align="left">' . get_lang('Antique').'</td></tr> |
|
| 890 | 890 | </table>'; |
| 891 | 891 | $exercise->type = 1; |
| 892 | 892 | $exercise->setRandom(0); |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | 'https://' |
| 1139 | 1139 | ) === false |
| 1140 | 1140 | ) { |
| 1141 | - $department_url = 'http://' . $department_url; |
|
| 1141 | + $department_url = 'http://'.$department_url; |
|
| 1142 | 1142 | } |
| 1143 | 1143 | //just in case |
| 1144 | 1144 | if ($department_url == 'http://') { |
@@ -1184,12 +1184,12 @@ discard block |
||
| 1184 | 1184 | $code |
| 1185 | 1185 | ); |
| 1186 | 1186 | if (!empty($user_id)) { |
| 1187 | - $sql = "INSERT INTO " . $TABLECOURSUSER . " SET |
|
| 1188 | - c_id = '" . $course_id . "', |
|
| 1189 | - user_id = '" . intval($user_id) . "', |
|
| 1187 | + $sql = "INSERT INTO ".$TABLECOURSUSER." SET |
|
| 1188 | + c_id = '" . $course_id."', |
|
| 1189 | + user_id = '" . intval($user_id)."', |
|
| 1190 | 1190 | status = '1', |
| 1191 | 1191 | is_tutor = '0', |
| 1192 | - sort = '" . ($i_course_sort) . "', |
|
| 1192 | + sort = '" . ($i_course_sort)."', |
|
| 1193 | 1193 | relation_type = 0, |
| 1194 | 1194 | user_course_cat = '0'"; |
| 1195 | 1195 | Database::query($sql); |
@@ -1208,12 +1208,12 @@ discard block |
||
| 1208 | 1208 | if (empty($key)) { |
| 1209 | 1209 | continue; |
| 1210 | 1210 | } |
| 1211 | - $sql = "INSERT INTO " . $TABLECOURSUSER . " SET |
|
| 1212 | - c_id = '" . Database::escape_string($course_id) . "', |
|
| 1213 | - user_id = '" . Database::escape_string($key) . "', |
|
| 1211 | + $sql = "INSERT INTO ".$TABLECOURSUSER." SET |
|
| 1212 | + c_id = '" . Database::escape_string($course_id)."', |
|
| 1213 | + user_id = '" . Database::escape_string($key)."', |
|
| 1214 | 1214 | status = '1', |
| 1215 | 1215 | is_tutor = '0', |
| 1216 | - sort = '" . ($sort + 1) . "', |
|
| 1216 | + sort = '" . ($sort + 1)."', |
|
| 1217 | 1217 | relation_type = 0, |
| 1218 | 1218 | user_course_cat = '0'"; |
| 1219 | 1219 | Database::query($sql); |
@@ -1257,18 +1257,18 @@ discard block |
||
| 1257 | 1257 | $iname = api_get_setting('Institution'); |
| 1258 | 1258 | $subject = get_lang( |
| 1259 | 1259 | 'NewCourseCreatedIn' |
| 1260 | - ) . ' ' . $siteName . ' - ' . $iname; |
|
| 1260 | + ).' '.$siteName.' - '.$iname; |
|
| 1261 | 1261 | $message = get_lang( |
| 1262 | 1262 | 'Dear' |
| 1263 | - ) . ' ' . $recipient_name . ",\n\n" . get_lang( |
|
| 1263 | + ).' '.$recipient_name.",\n\n".get_lang( |
|
| 1264 | 1264 | 'MessageOfNewCourseToAdmin' |
| 1265 | - ) . ' ' . $siteName . ' - ' . $iname . "\n"; |
|
| 1266 | - $message .= get_lang('CourseName') . ' ' . $title . "\n"; |
|
| 1265 | + ).' '.$siteName.' - '.$iname."\n"; |
|
| 1266 | + $message .= get_lang('CourseName').' '.$title."\n"; |
|
| 1267 | 1267 | $message .= get_lang( |
| 1268 | 1268 | 'Category' |
| 1269 | - ) . ' ' . $category_code . "\n"; |
|
| 1270 | - $message .= get_lang('Tutor') . ' ' . $tutor_name . "\n"; |
|
| 1271 | - $message .= get_lang('Language') . ' ' . $course_language; |
|
| 1269 | + ).' '.$category_code."\n"; |
|
| 1270 | + $message .= get_lang('Tutor').' '.$tutor_name."\n"; |
|
| 1271 | + $message .= get_lang('Language').' '.$course_language; |
|
| 1272 | 1272 | |
| 1273 | 1273 | $userInfo = api_get_user_info($user_id); |
| 1274 | 1274 | |
@@ -996,7 +996,7 @@ |
||
| 996 | 996 | } |
| 997 | 997 | } |
| 998 | 998 | |
| 999 | - return array( |
|
| 999 | + return array( |
|
| 1000 | 1000 | 'content' => $html, |
| 1001 | 1001 | 'tool_list' => $items |
| 1002 | 1002 | ); |