@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | |
137 | 137 | //get destination course title |
138 | 138 | if (!empty($hidden_fields['destination_course'])) { |
139 | - $sessionTitle = !empty($hidden_fields['destination_session']) ? ' (' . api_get_session_name( |
|
139 | + $sessionTitle = !empty($hidden_fields['destination_session']) ? ' ('.api_get_session_name( |
|
140 | 140 | $hidden_fields['destination_session'] |
141 | - ) . ')' : null; |
|
141 | + ).')' : null; |
|
142 | 142 | |
143 | 143 | $course_infos = CourseManager::get_course_information($hidden_fields['destination_course']); |
144 | 144 | echo '<h3>'; |
145 | - echo get_lang('DestinationCourse').' : '.$course_infos['title'] . ' ('.$course_infos['code'].') '.$sessionTitle; |
|
145 | + echo get_lang('DestinationCourse').' : '.$course_infos['title'].' ('.$course_infos['code'].') '.$sessionTitle; |
|
146 | 146 | echo '</h3>'; |
147 | 147 | } |
148 | 148 | echo '<script src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/upload.js" type="text/javascript"></script>'; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | /*Documents are avoided due the huge amount of memory that the serialize php function "eats" |
299 | 299 | (when there are directories with hundred/thousand of files) */ |
300 | 300 | // this is a known issue of serialize |
301 | - $course->resources['document']= null; |
|
301 | + $course->resources['document'] = null; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | echo '<input type="hidden" name="course" value="'.base64_encode(Course::serialize($course)).'"/>'; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | Display::display_warning_message(get_lang('NoDataAvailable')); |
316 | 316 | } else { |
317 | 317 | if (!empty($hidden_fields['destination_session'])) { |
318 | - echo '<br /><button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES, $charset))."'".')) return false;" >'. |
|
318 | + echo '<br /><button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;" >'. |
|
319 | 319 | get_lang('Ok').'</button>'; |
320 | 320 | } else { |
321 | 321 | if ($recycleOption) { |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | static function display_hidden_quiz_questions($course) |
341 | 341 | { |
342 | - if(is_array($course->resources)){ |
|
342 | + if (is_array($course->resources)) { |
|
343 | 343 | foreach ($course->resources as $type => $resources) { |
344 | 344 | if (count($resources) > 0) { |
345 | 345 | switch ($type) { |
@@ -359,10 +359,10 @@ discard block |
||
359 | 359 | */ |
360 | 360 | static function display_hidden_scorm_directories($course) |
361 | 361 | { |
362 | - if (is_array($course->resources)){ |
|
362 | + if (is_array($course->resources)) { |
|
363 | 363 | foreach ($course->resources as $type => $resources) { |
364 | 364 | if (count($resources) > 0) { |
365 | - switch($type) { |
|
365 | + switch ($type) { |
|
366 | 366 | case RESOURCE_SCORM: |
367 | 367 | foreach ($resources as $id => $resource) { |
368 | 368 | echo '<input type="hidden" name="resource['.RESOURCE_SCORM.']['.$id.']" id="resource['.RESOURCE_SCORM.']['.$id.']" value="On" />'; |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | if (is_array($resource)) { |
409 | 409 | $resource = array_keys($resource); |
410 | 410 | |
411 | - foreach ($resource as $resource_item) { |
|
411 | + foreach ($resource as $resource_item) { |
|
412 | 412 | |
413 | 413 | $condition_session = ''; |
414 | 414 | if (!empty($session_id)) { |
@@ -444,8 +444,8 @@ discard block |
||
444 | 444 | tool = '".RESOURCE_DOCUMENT."' AND |
445 | 445 | ref = $resource_item "; |
446 | 446 | $res = Database::query($sql); |
447 | - $all_properties = array (); |
|
448 | - while ($item_property = Database::fetch_array($res,'ASSOC')) { |
|
447 | + $all_properties = array(); |
|
448 | + while ($item_property = Database::fetch_array($res, 'ASSOC')) { |
|
449 | 449 | $all_properties[] = $item_property; |
450 | 450 | } |
451 | 451 | $course->resources[RESOURCE_DOCUMENT][$resource_item]->item_properties = $all_properties; |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | |
461 | 461 | switch ($type) { |
462 | 462 | case RESOURCE_SURVEYQUESTION: |
463 | - foreach($resources as $id => $obj) { |
|
463 | + foreach ($resources as $id => $obj) { |
|
464 | 464 | if (isset($_POST['resource'][RESOURCE_SURVEY]) && |
465 | 465 | is_array($_POST['resource'][RESOURCE_SURVEY]) && |
466 | 466 | !in_array($obj->survey_id, array_keys($_POST['resource'][RESOURCE_SURVEY])) |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | ) { |
536 | 536 | foreach ($documents as $id_to_check => $post_value) { |
537 | 537 | $obj_to_check = $resources[$id_to_check]; |
538 | - $shared_path_part = substr($obj_to_check->path,0,strlen($obj->path)); |
|
538 | + $shared_path_part = substr($obj_to_check->path, 0, strlen($obj->path)); |
|
539 | 539 | if ($id_to_check != $id && $obj->path == $shared_path_part) { |
540 | 540 | $_POST['resource'][RESOURCE_DOCUMENT][$id] = 1; |
541 | 541 | break; |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | $resource_is_used_elsewhere = $course->is_linked_resource($obj); |
550 | 550 | // check if document is in a quiz (audio/video) |
551 | 551 | if ($type == RESOURCE_DOCUMENT && $course->has_resources(RESOURCE_QUIZ)) { |
552 | - foreach($course->resources[RESOURCE_QUIZ] as $quiz) { |
|
552 | + foreach ($course->resources[RESOURCE_QUIZ] as $quiz) { |
|
553 | 553 | $quiz = $quiz->obj; |
554 | 554 | if (isset($quiz->media) && $quiz->media == $id) { |
555 | 555 | $resource_is_used_elsewhere = true; |
@@ -618,15 +618,15 @@ discard block |
||
618 | 618 | <?php |
619 | 619 | |
620 | 620 | //get destination course title |
621 | - if(!empty($hidden_fields['destination_course'])) { |
|
621 | + if (!empty($hidden_fields['destination_course'])) { |
|
622 | 622 | if (!empty($hidden_fields['destination_session'])) { |
623 | - $sessionTitle = ' (' . api_get_session_name($hidden_fields['destination_session']) . ')'; |
|
623 | + $sessionTitle = ' ('.api_get_session_name($hidden_fields['destination_session']).')'; |
|
624 | 624 | } else { |
625 | 625 | $sessionTitle = null; |
626 | 626 | } |
627 | 627 | $course_infos = CourseManager::get_course_information($hidden_fields['destination_course']); |
628 | 628 | echo '<h3>'; |
629 | - echo get_lang('DestinationCourse') . ' : ' . $course_infos['title'] . $sessionTitle; |
|
629 | + echo get_lang('DestinationCourse').' : '.$course_infos['title'].$sessionTitle; |
|
630 | 630 | echo '</h3>'; |
631 | 631 | } |
632 | 632 | |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | echo '<script type="text/javascript">var myUpload = new upload(1000);</script>'; |
635 | 635 | echo '<form method="post" id="upload_form" name="course_select_form" onsubmit="myUpload.start(\'dynamic_div\',\''.api_get_path(WEB_CODE_PATH).'img/progress_bar.gif\',\''.get_lang('PleaseStandBy').'\',\'upload_form\')">'; |
636 | 636 | echo '<input type="hidden" name="action" value="course_select_form"/>'; |
637 | - foreach ($list_course as $course){ |
|
637 | + foreach ($list_course as $course) { |
|
638 | 638 | foreach ($course->resources as $type => $resources) { |
639 | 639 | if (count($resources) > 0) { |
640 | 640 | echo '<img id="img_'.$course->code.'" src="../img/1.gif" onclick="javascript:exp('."'$course->code'".');" />'; |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | if ($avoid_serialize) { |
663 | 663 | //Documents are avoided due the huge amount of memory that the serialize php function "eats" (when there are directories with hundred/thousand of files) |
664 | 664 | // this is a known issue of serialize |
665 | - $course->resources['document']= null; |
|
665 | + $course->resources['document'] = null; |
|
666 | 666 | } |
667 | 667 | echo '<input type="hidden" name="course" value="'.base64_encode(Course::serialize($course)).'"/>'; |
668 | 668 | if (is_array($hidden_fields)) { |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | while (($file = readdir($handle)) !== false) { |
24 | 24 | if ($file != "." && $file != ".." && |
25 | 25 | strpos($file, 'CourseArchiver_') === 0 && |
26 | - is_dir($dir . '/' . $file) |
|
26 | + is_dir($dir.'/'.$file) |
|
27 | 27 | ) { |
28 | - rmdirr($dir . '/' . $file); |
|
28 | + rmdirr($dir.'/'.$file); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | closedir($handle); |
@@ -43,48 +43,48 @@ discard block |
||
43 | 43 | CourseArchiver::clean_backup_dir(); |
44 | 44 | |
45 | 45 | // Create a temp directory |
46 | - $tmp_dir_name = 'CourseArchiver_' . api_get_unique_id(); |
|
47 | - $backup_dir = api_get_path(SYS_ARCHIVE_PATH) . $tmp_dir_name . '/'; |
|
46 | + $tmp_dir_name = 'CourseArchiver_'.api_get_unique_id(); |
|
47 | + $backup_dir = api_get_path(SYS_ARCHIVE_PATH).$tmp_dir_name.'/'; |
|
48 | 48 | |
49 | 49 | // All course-information will be stored in course_info.dat |
50 | - $course_info_file = $backup_dir . 'course_info.dat'; |
|
50 | + $course_info_file = $backup_dir.'course_info.dat'; |
|
51 | 51 | $zip_dir = api_get_path(SYS_ARCHIVE_PATH); |
52 | 52 | $user = api_get_user_info(); |
53 | 53 | $date = new DateTime(api_get_local_time()); |
54 | - $zip_file = $user['user_id'] . '_' . $course->code . '_' . $date->format('Ymd-His') . '.zip'; |
|
54 | + $zip_file = $user['user_id'].'_'.$course->code.'_'.$date->format('Ymd-His').'.zip'; |
|
55 | 55 | $php_errormsg = ''; |
56 | 56 | $res = @mkdir($backup_dir, $perm_dirs); |
57 | 57 | if ($res === false) { |
58 | 58 | //TODO set and handle an error message telling the user to review the permissions on the archive directory |
59 | - error_log(__FILE__ . ' line ' . __LINE__ . ': ' . (ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini') . ' - This error, occuring because your archive directory will not let this script write data into it, will prevent courses backups to be created', 0); |
|
59 | + error_log(__FILE__.' line '.__LINE__.': '.(ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini').' - This error, occuring because your archive directory will not let this script write data into it, will prevent courses backups to be created', 0); |
|
60 | 60 | } |
61 | 61 | // Write the course-object to the file |
62 | 62 | $fp = @fopen($course_info_file, 'w'); |
63 | 63 | if ($fp === false) { |
64 | - error_log(__FILE__ . ' line ' . __LINE__ . ': ' . (ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
64 | + error_log(__FILE__.' line '.__LINE__.': '.(ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $res = @fwrite($fp, base64_encode(serialize($course))); |
68 | 68 | if ($res === false) { |
69 | - error_log(__FILE__ . ' line ' . __LINE__ . ': ' . (ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
69 | + error_log(__FILE__.' line '.__LINE__.': '.(ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $res = @fclose($fp); |
73 | 73 | if ($res === false) { |
74 | - error_log(__FILE__ . ' line ' . __LINE__ . ': ' . (ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
74 | + error_log(__FILE__.' line '.__LINE__.': '.(ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | // Copy all documents to the temp-dir |
78 | 78 | if (isset($course->resources[RESOURCE_DOCUMENT]) && is_array($course->resources[RESOURCE_DOCUMENT])) { |
79 | 79 | foreach ($course->resources[RESOURCE_DOCUMENT] as $document) { |
80 | 80 | if ($document->file_type == DOCUMENT) { |
81 | - $doc_dir = $backup_dir . $document->path; |
|
81 | + $doc_dir = $backup_dir.$document->path; |
|
82 | 82 | @mkdir(dirname($doc_dir), $perm_dirs, true); |
83 | - if (file_exists($course->path . $document->path)) { |
|
84 | - copy($course->path . $document->path, $doc_dir); |
|
83 | + if (file_exists($course->path.$document->path)) { |
|
84 | + copy($course->path.$document->path, $doc_dir); |
|
85 | 85 | } |
86 | 86 | } else { |
87 | - @mkdir($backup_dir . $document->path, $perm_dirs, true); |
|
87 | + @mkdir($backup_dir.$document->path, $perm_dirs, true); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | } |
@@ -92,49 +92,49 @@ discard block |
||
92 | 92 | // Copy all scorm documents to the temp-dir |
93 | 93 | if (isset($course->resources[RESOURCE_SCORM]) && is_array($course->resources[RESOURCE_SCORM])) { |
94 | 94 | foreach ($course->resources[RESOURCE_SCORM] as $document) { |
95 | - $doc_dir = dirname($backup_dir . $document->path); |
|
95 | + $doc_dir = dirname($backup_dir.$document->path); |
|
96 | 96 | @mkdir($doc_dir, $perm_dirs, true); |
97 | - copyDirTo($course->path . $document->path, $doc_dir, false); |
|
97 | + copyDirTo($course->path.$document->path, $doc_dir, false); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | 101 | // Copy calendar attachments. |
102 | 102 | |
103 | 103 | if (isset($course->resources[RESOURCE_EVENT]) && is_array($course->resources[RESOURCE_EVENT])) { |
104 | - $doc_dir = dirname($backup_dir . '/upload/calendar/'); |
|
104 | + $doc_dir = dirname($backup_dir.'/upload/calendar/'); |
|
105 | 105 | @mkdir($doc_dir, $perm_dirs, true); |
106 | - copyDirTo($course->path . 'upload/calendar/', $doc_dir, false); |
|
106 | + copyDirTo($course->path.'upload/calendar/', $doc_dir, false); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | // Copy Learning path author image. |
110 | 110 | if (isset($course->resources[RESOURCE_LEARNPATH]) && is_array($course->resources[RESOURCE_LEARNPATH])) { |
111 | - $doc_dir = dirname($backup_dir . '/upload/learning_path/'); |
|
111 | + $doc_dir = dirname($backup_dir.'/upload/learning_path/'); |
|
112 | 112 | @mkdir($doc_dir, $perm_dirs, true); |
113 | - copyDirTo($course->path . 'upload/learning_path/', $doc_dir, false); |
|
113 | + copyDirTo($course->path.'upload/learning_path/', $doc_dir, false); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | // Copy announcements attachments. |
117 | 117 | if (isset($course->resources[RESOURCE_ANNOUNCEMENT]) && is_array($course->resources[RESOURCE_ANNOUNCEMENT])) { |
118 | - $doc_dir = dirname($backup_dir . '/upload/announcements/'); |
|
118 | + $doc_dir = dirname($backup_dir.'/upload/announcements/'); |
|
119 | 119 | @mkdir($doc_dir, $perm_dirs, true); |
120 | - copyDirTo($course->path . 'upload/announcements/', $doc_dir, false); |
|
120 | + copyDirTo($course->path.'upload/announcements/', $doc_dir, false); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | // Copy work folders (only folders) |
124 | 124 | if (isset($course->resources[RESOURCE_WORK]) && is_array($course->resources[RESOURCE_WORK])) { |
125 | - $doc_dir = dirname($backup_dir . '/upload/work/'); |
|
125 | + $doc_dir = dirname($backup_dir.'/upload/work/'); |
|
126 | 126 | @mkdir($doc_dir, $perm_dirs, true); |
127 | 127 | // @todo: adjust to only create subdirs, but not copy files |
128 | - copyDirTo($course->path . 'upload/work/', $doc_dir, false); |
|
128 | + copyDirTo($course->path.'upload/work/', $doc_dir, false); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | // Zip the course-contents |
132 | - $zip = new PclZip($zip_dir . $zip_file); |
|
133 | - $zip->create($zip_dir . $tmp_dir_name, PCLZIP_OPT_REMOVE_PATH, $zip_dir . $tmp_dir_name . '/'); |
|
132 | + $zip = new PclZip($zip_dir.$zip_file); |
|
133 | + $zip->create($zip_dir.$tmp_dir_name, PCLZIP_OPT_REMOVE_PATH, $zip_dir.$tmp_dir_name.'/'); |
|
134 | 134 | //$zip->deleteByIndex(0); |
135 | 135 | // Remove the temp-dir. |
136 | 136 | rmdirr($backup_dir); |
137 | - return '' . $zip_file; |
|
137 | + return ''.$zip_file; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | { |
146 | 146 | global $dateTimeFormatLong; |
147 | 147 | $backup_files = array(); |
148 | - $dirname = api_get_path(SYS_ARCHIVE_PATH) . ''; |
|
148 | + $dirname = api_get_path(SYS_ARCHIVE_PATH).''; |
|
149 | 149 | if ($dir = opendir($dirname)) { |
150 | 150 | while (($file = readdir($dir)) !== false) { |
151 | 151 | $file_parts = explode('_', $file); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $date = $file_parts[0]; |
157 | 157 | $ext = isset($file_parts[1]) ? $file_parts[1] : null; |
158 | 158 | if ($ext == 'zip' && ($user_id != null && $owner_id == $user_id || $user_id == null)) { |
159 | - $date = substr($date, 0, 4) . '-' . substr($date, 4, 2) . '-' . substr($date, 6, 2) . ' ' . substr($date, 9, 2) . ':' . substr($date, 11, 2) . ':' . substr($date, 13, 2); |
|
159 | + $date = substr($date, 0, 4).'-'.substr($date, 4, 2).'-'.substr($date, 6, 2).' '.substr($date, 9, 2).':'.substr($date, 11, 2).':'.substr($date, 13, 2); |
|
160 | 160 | $backup_files[] = array( |
161 | 161 | 'file' => $file, |
162 | 162 | 'date' => $date, |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public static function import_uploaded_file($file) |
179 | 179 | { |
180 | - $new_filename = uniqid('') . '.zip'; |
|
180 | + $new_filename = uniqid('').'.zip'; |
|
181 | 181 | $new_dir = api_get_path(SYS_ARCHIVE_PATH); |
182 | 182 | if (is_dir($new_dir) && is_writable($new_dir)) { |
183 | 183 | move_uploaded_file($file, api_get_path(SYS_ARCHIVE_PATH).$new_filename); |
@@ -200,17 +200,17 @@ discard block |
||
200 | 200 | { |
201 | 201 | CourseArchiver::clean_backup_dir(); |
202 | 202 | // Create a temp directory |
203 | - $tmp_dir_name = 'CourseArchiver_' . uniqid(''); |
|
204 | - $unzip_dir = api_get_path(SYS_ARCHIVE_PATH) . '' . $tmp_dir_name; |
|
203 | + $tmp_dir_name = 'CourseArchiver_'.uniqid(''); |
|
204 | + $unzip_dir = api_get_path(SYS_ARCHIVE_PATH).''.$tmp_dir_name; |
|
205 | 205 | @mkdir($unzip_dir, api_get_permissions_for_new_directories(), true); |
206 | - @copy(api_get_path(SYS_ARCHIVE_PATH) . '' . $filename, $unzip_dir . '/backup.zip'); |
|
206 | + @copy(api_get_path(SYS_ARCHIVE_PATH).''.$filename, $unzip_dir.'/backup.zip'); |
|
207 | 207 | // unzip the archive |
208 | - $zip = new PclZip($unzip_dir . '/backup.zip'); |
|
208 | + $zip = new PclZip($unzip_dir.'/backup.zip'); |
|
209 | 209 | @chdir($unzip_dir); |
210 | 210 | $zip->extract(PCLZIP_OPT_TEMP_FILE_ON); |
211 | 211 | // remove the archive-file |
212 | 212 | if ($delete) { |
213 | - @unlink(api_get_path(SYS_ARCHIVE_PATH) . '' . $filename); |
|
213 | + @unlink(api_get_path(SYS_ARCHIVE_PATH).''.$filename); |
|
214 | 214 | } |
215 | 215 | // read the course |
216 | 216 | if (!is_file('course_info.dat')) { |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | if (is_array($resources)) { |
41 | 41 | foreach ($resources as $resource) { |
42 | 42 | Coursecopy\Resource::setClassType($resource); |
43 | - if ($resource->links_to($resource_to_check) ) { |
|
43 | + if ($resource->links_to($resource_to_check)) { |
|
44 | 44 | return true; |
45 | 45 | } |
46 | - if ($type == RESOURCE_LEARNPATH && get_class($resource)=='CourseCopyLearnpath') { |
|
46 | + if ($type == RESOURCE_LEARNPATH && get_class($resource) == 'CourseCopyLearnpath') { |
|
47 | 47 | if ($resource->has_item($resource_to_check)) { |
48 | 48 | return true; |
49 | 49 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function has_resources($resource_type = null) |
72 | 72 | { |
73 | - if( $resource_type != null) { |
|
73 | + if ($resource_type != null) { |
|
74 | 74 | return isset($this->resources[$resource_type]) && is_array($this->resources[$resource_type]) && (count( |
75 | 75 | $this->resources[$resource_type] |
76 | 76 | ) > 0); |
@@ -177,12 +177,12 @@ discard block |
||
177 | 177 | $description = $resource->content; |
178 | 178 | break; |
179 | 179 | case RESOURCE_THEMATIC: |
180 | - $title = $resource->title; |
|
181 | - $description = $resource->content; |
|
180 | + $title = $resource->title; |
|
181 | + $description = $resource->content; |
|
182 | 182 | break; |
183 | 183 | case RESOURCE_ATTENDANCE: |
184 | - $title = $resource->params['name']; |
|
185 | - $description = $resource->params['description']; |
|
184 | + $title = $resource->params['name']; |
|
185 | + $description = $resource->params['description']; |
|
186 | 186 | break; |
187 | 187 | case RESOURCE_WORK: |
188 | 188 | $title = $resource->title; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | public function recycle_glossary() |
161 | 161 | { |
162 | 162 | if ($this->course->has_resources(RESOURCE_GLOSSARY)) { |
163 | - $table_glossary = Database::get_course_table(TABLE_GLOSSARY); |
|
163 | + $table_glossary = Database::get_course_table(TABLE_GLOSSARY); |
|
164 | 164 | $ids = implode(',', array_filter(array_keys($this->course->resources[RESOURCE_GLOSSARY]))); |
165 | 165 | if (!empty($ids)) { |
166 | 166 | $sql = "DELETE FROM ".$table_glossary." |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | if (trim($learnpath->path) != '') { |
557 | 557 | // when $learnpath->path value is incorrect for some reason. |
558 | 558 | // The directory trat contains files of the SCORM package is to be deleted. |
559 | - $scorm_package_dir = realpath($this->course->path . 'scorm/' . $learnpath->path); |
|
559 | + $scorm_package_dir = realpath($this->course->path.'scorm/'.$learnpath->path); |
|
560 | 560 | rmdirr($scorm_package_dir); |
561 | 561 | } |
562 | 562 | } |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | foreach ($resources[RESOURCE_THEMATIC] as $last_id => $thematic) { |
633 | 633 | if (is_numeric($last_id)) { |
634 | 634 | |
635 | - foreach($thematic->thematic_advance_list as $thematic_advance) { |
|
635 | + foreach ($thematic->thematic_advance_list as $thematic_advance) { |
|
636 | 636 | $cond = array( |
637 | 637 | 'id = ? AND c_id = ?' => array( |
638 | 638 | $thematic_advance['id'], |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | Database::delete($table_thematic_advance, $cond); |
650 | 650 | } |
651 | 651 | |
652 | - foreach($thematic->thematic_plan_list as $thematic_plan) { |
|
652 | + foreach ($thematic->thematic_plan_list as $thematic_plan) { |
|
653 | 653 | $cond = array( |
654 | 654 | 'id = ? AND c_id = ?' => array( |
655 | 655 | $thematic_plan['id'], |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | 'ThematicDeleted', |
679 | 679 | api_get_user_id() |
680 | 680 | ); |
681 | - Database::delete($table_thematic,$cond); |
|
681 | + Database::delete($table_thematic, $cond); |
|
682 | 682 | } |
683 | 683 | } |
684 | 684 | } |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | $resources = $this->course->resources; |
697 | 697 | foreach ($resources[RESOURCE_ATTENDANCE] as $last_id => $obj) { |
698 | 698 | if (is_numeric($last_id)) { |
699 | - foreach($obj->attendance_calendar as $attendance_calendar) { |
|
699 | + foreach ($obj->attendance_calendar as $attendance_calendar) { |
|
700 | 700 | $cond = array('id = ? AND c_id = ? '=>array($attendance_calendar['id'], $this->course_id)); |
701 | 701 | Database::delete($table_attendance_calendar, $cond); |
702 | 702 | } |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | public function recycle_work($session_id = 0) |
721 | 721 | { |
722 | 722 | if ($this->course->has_resources(RESOURCE_WORK)) { |
723 | - $table_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); |
|
723 | + $table_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); |
|
724 | 724 | $table_work_assignment = Database :: get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT); |
725 | 725 | |
726 | 726 | $resources = $this->course->resources; |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | require_once 'Resource.class.php'; |
5 | 5 | |
6 | -define('DOCUMENT','file'); |
|
7 | -define('FOLDER','folder'); |
|
6 | +define('DOCUMENT', 'file'); |
|
7 | +define('FOLDER', 'folder'); |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * Class Document |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function __construct($id, $path, $comment, $title, $file_type, $size) |
32 | 32 | { |
33 | 33 | parent::__construct($id, RESOURCE_DOCUMENT); |
34 | - $this->path = 'document' . $path; |
|
34 | + $this->path = 'document'.$path; |
|
35 | 35 | $this->comment = $comment; |
36 | 36 | $this->title = $title; |
37 | 37 | $this->file_type = $file_type; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | echo preg_replace('@^document@', '', $this->path); |
48 | 48 | if (!empty($this->title)) { |
49 | 49 | if (strpos($this->path, $this->title) === false) { |
50 | - echo " - " . $this->title; |
|
50 | + echo " - ".$this->title; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -47,6 +47,6 @@ |
||
47 | 47 | $user_info = api_get_user_info($this->obj->thread_poster_id); |
48 | 48 | $extra = $user_info['complete_name'].', '.$extra; |
49 | 49 | } |
50 | - echo $this->obj->thread_title . ' (' . $extra . ')'; |
|
50 | + echo $this->obj->thread_title.' ('.$extra.')'; |
|
51 | 51 | } |
52 | 52 | } |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | $this->course->backup_path, |
521 | 521 | $this->course->info['path'] |
522 | 522 | ); |
523 | - file_put_contents($path.$document->path,$content); |
|
523 | + file_put_contents($path.$document->path, $content); |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | $params = [ |
@@ -564,14 +564,14 @@ discard block |
||
564 | 564 | $new_file_name = $file_name_no_ext.'_'.$i.$ext; |
565 | 565 | $file_exists = file_exists($path.$new_file_name); |
566 | 566 | while ($file_exists) { |
567 | - $i ++; |
|
567 | + $i++; |
|
568 | 568 | $new_file_name = $file_name_no_ext.'_'.$i.$ext; |
569 | 569 | $file_exists = file_exists($path.$new_file_name); |
570 | 570 | } |
571 | 571 | |
572 | 572 | if (!empty($session_id)) { |
573 | 573 | |
574 | - $document_path = explode('/',$document->path,3); |
|
574 | + $document_path = explode('/', $document->path, 3); |
|
575 | 575 | $course_path = $path; |
576 | 576 | $orig_base_folder = $document_path[1]; |
577 | 577 | $orig_base_path = $course_path.$document_path[0].'/'.$document_path[1]; |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | |
590 | 590 | $folder_exists = file_exists($new_base_path); |
591 | 591 | if ($folder_exists) { |
592 | - $_SESSION['orig_base_foldername'] = $new_base_foldername; // e.g: carpeta1 in session |
|
592 | + $_SESSION['orig_base_foldername'] = $new_base_foldername; // e.g: carpeta1 in session |
|
593 | 593 | $x = ''; |
594 | 594 | while ($folder_exists) { |
595 | 595 | $x = $x + 1; |
@@ -609,9 +609,9 @@ discard block |
||
609 | 609 | $new_base_path = $_SESSION['new_base_path']; |
610 | 610 | } |
611 | 611 | |
612 | - $dest_document_path = $new_base_path.'/'.$document_path[2]; // e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1/collaborative.png" |
|
613 | - $basedir_dest_path = dirname($dest_document_path); // e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1" |
|
614 | - $base_path_document = $course_path.$document_path[0]; // e.g: "/var/www/wiener/courses/CURSO4/document" |
|
612 | + $dest_document_path = $new_base_path.'/'.$document_path[2]; // e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1/collaborative.png" |
|
613 | + $basedir_dest_path = dirname($dest_document_path); // e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1" |
|
614 | + $base_path_document = $course_path.$document_path[0]; // e.g: "/var/www/wiener/courses/CURSO4/document" |
|
615 | 615 | |
616 | 616 | $path_title = '/'.$new_base_foldername.'/'.$document_path[2]; |
617 | 617 | |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | //Replace old course code with the new destination code see BT#1985 |
632 | 632 | if (file_exists($dest_document_path)) { |
633 | 633 | $file_info = pathinfo($dest_document_path); |
634 | - if (in_array($file_info['extension'], array('html','htm'))) { |
|
634 | + if (in_array($file_info['extension'], array('html', 'htm'))) { |
|
635 | 635 | $content = file_get_contents($dest_document_path); |
636 | 636 | if (UTF8_CONVERT) { |
637 | 637 | $content = utf8_encode($content); |
@@ -687,8 +687,8 @@ discard block |
||
687 | 687 | //Replace old course code with the new destination code see BT#1985 |
688 | 688 | if (file_exists($path.$new_file_name)) { |
689 | 689 | $file_info = pathinfo($path.$new_file_name); |
690 | - if (in_array($file_info['extension'], array('html','htm'))) { |
|
691 | - $content = file_get_contents($path.$new_file_name); |
|
690 | + if (in_array($file_info['extension'], array('html', 'htm'))) { |
|
691 | + $content = file_get_contents($path.$new_file_name); |
|
692 | 692 | if (UTF8_CONVERT) { |
693 | 693 | $content = utf8_encode($content); |
694 | 694 | } |
@@ -741,8 +741,8 @@ discard block |
||
741 | 741 | //Replace old course code with the new destination code see BT#1985 |
742 | 742 | if (file_exists($path.$new_file_name)) { |
743 | 743 | $file_info = pathinfo($path.$new_file_name); |
744 | - if (in_array($file_info['extension'], array('html','htm'))) { |
|
745 | - $content = file_get_contents($path.$new_file_name); |
|
744 | + if (in_array($file_info['extension'], array('html', 'htm'))) { |
|
745 | + $content = file_get_contents($path.$new_file_name); |
|
746 | 746 | if (UTF8_CONVERT) { |
747 | 747 | $content = utf8_encode($content); |
748 | 748 | } |
@@ -805,8 +805,8 @@ discard block |
||
805 | 805 | //Replace old course code with the new destination code see BT#1985 |
806 | 806 | if (file_exists($path.$document->path)) { |
807 | 807 | $file_info = pathinfo($path.$document->path); |
808 | - if (in_array($file_info['extension'], array('html','htm'))) { |
|
809 | - $content = file_get_contents($path.$document->path); |
|
808 | + if (in_array($file_info['extension'], array('html', 'htm'))) { |
|
809 | + $content = file_get_contents($path.$document->path); |
|
810 | 810 | if (UTF8_CONVERT) { |
811 | 811 | $content = utf8_encode($content); |
812 | 812 | } |
@@ -896,8 +896,8 @@ discard block |
||
896 | 896 | case FILE_OVERWRITE: |
897 | 897 | rmdirr($path.$document->path); |
898 | 898 | copyDirTo( |
899 | - $this->course->backup_path . '/' . $document->path, |
|
900 | - $path . dirname($document->path), |
|
899 | + $this->course->backup_path.'/'.$document->path, |
|
900 | + $path.dirname($document->path), |
|
901 | 901 | false |
902 | 902 | ); |
903 | 903 | break; |
@@ -919,23 +919,23 @@ discard block |
||
919 | 919 | $file_exists = file_exists($path.$new_file_name); |
920 | 920 | |
921 | 921 | while ($file_exists) { |
922 | - $i ++; |
|
922 | + $i++; |
|
923 | 923 | $new_file_name = $file_name_no_ext.'_'.$i.$ext; |
924 | 924 | $file_exists = file_exists($path.$new_file_name); |
925 | 925 | } |
926 | 926 | |
927 | 927 | rename( |
928 | - $this->course->backup_path . '/' . $document->path, |
|
929 | - $this->course->backup_path . '/' . $new_file_name |
|
928 | + $this->course->backup_path.'/'.$document->path, |
|
929 | + $this->course->backup_path.'/'.$new_file_name |
|
930 | 930 | ); |
931 | 931 | copyDirTo( |
932 | - $this->course->backup_path . '/' . $new_file_name, |
|
933 | - $path . dirname($new_file_name), |
|
932 | + $this->course->backup_path.'/'.$new_file_name, |
|
933 | + $path.dirname($new_file_name), |
|
934 | 934 | false |
935 | 935 | ); |
936 | 936 | rename( |
937 | - $this->course->backup_path . '/' . $new_file_name, |
|
938 | - $this->course->backup_path . '/' . $document->path |
|
937 | + $this->course->backup_path.'/'.$new_file_name, |
|
938 | + $this->course->backup_path.'/'.$document->path |
|
939 | 939 | ); |
940 | 940 | |
941 | 941 | break; |
@@ -943,8 +943,8 @@ discard block |
||
943 | 943 | } else { |
944 | 944 | // end if file exists |
945 | 945 | copyDirTo( |
946 | - $this->course->backup_path . '/' . $document->path, |
|
947 | - $path . dirname($document->path), |
|
946 | + $this->course->backup_path.'/'.$document->path, |
|
947 | + $path.dirname($document->path), |
|
948 | 948 | false |
949 | 949 | ); |
950 | 950 | } |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | $table_forum = Database::get_course_table(TABLE_FORUM); |
963 | 963 | $resources = $this->course->resources; |
964 | 964 | foreach ($resources[RESOURCE_FORUM] as $id => $forum) { |
965 | - $params = (array)$forum->obj; |
|
965 | + $params = (array) $forum->obj; |
|
966 | 966 | $cat_id = ''; |
967 | 967 | if (isset($this->course->resources[RESOURCE_FORUMCATEGORY]) && |
968 | 968 | isset($this->course->resources[RESOURCE_FORUMCATEGORY][$params['forum_category']])) { |
@@ -1014,13 +1014,13 @@ discard block |
||
1014 | 1014 | foreach ($this->course->resources[RESOURCE_FORUMTOPIC] as $topic_id => $topic) { |
1015 | 1015 | if ($topic->obj->forum_id == $id) { |
1016 | 1016 | $this->restore_topic($topic_id, $new_id, $sessionId); |
1017 | - $forum_topics ++; |
|
1017 | + $forum_topics++; |
|
1018 | 1018 | } |
1019 | 1019 | } |
1020 | 1020 | } |
1021 | 1021 | if ($forum_topics > 0) { |
1022 | 1022 | $sql = "UPDATE ".$table_forum." SET forum_threads = ".$forum_topics." |
1023 | - WHERE c_id = {$this->destination_course_id} AND forum_id = ".(int)$new_id; |
|
1023 | + WHERE c_id = {$this->destination_course_id} AND forum_id = ".(int) $new_id; |
|
1024 | 1024 | Database::query($sql); |
1025 | 1025 | } |
1026 | 1026 | } |
@@ -1090,13 +1090,13 @@ discard block |
||
1090 | 1090 | $table = Database :: get_course_table(TABLE_FORUM_THREAD); |
1091 | 1091 | $topic = $this->course->resources[RESOURCE_FORUMTOPIC][$thread_id]; |
1092 | 1092 | |
1093 | - $params = (array)$topic->obj; |
|
1093 | + $params = (array) $topic->obj; |
|
1094 | 1094 | $params = self::DBUTF8_array($params); |
1095 | 1095 | $params['c_id'] = $this->destination_course_id; |
1096 | 1096 | $params['forum_id'] = $forum_id; |
1097 | 1097 | $params['thread_poster_id'] = $this->first_teacher_id; |
1098 | 1098 | $params['thread_date'] = api_get_utc_datetime(); |
1099 | - $params['thread_close_date'] = '0000-00-00 00:00:00'; |
|
1099 | + $params['thread_close_date'] = '0000-00-00 00:00:00'; |
|
1100 | 1100 | $params['thread_last_post'] = 0; |
1101 | 1101 | $params['thread_replies'] = 0; |
1102 | 1102 | $params['thread_views'] = 0; |
@@ -1202,7 +1202,7 @@ discard block |
||
1202 | 1202 | FROM $link_table |
1203 | 1203 | WHERE |
1204 | 1204 | c_id = ".$this->destination_course_id." AND |
1205 | - category_id='" . intval($cat_id). "'"; |
|
1205 | + category_id='" . intval($cat_id)."'"; |
|
1206 | 1206 | $result = Database::query($sql); |
1207 | 1207 | list($max_order) = Database::fetch_array($result); |
1208 | 1208 | |
@@ -1217,7 +1217,7 @@ discard block |
||
1217 | 1217 | $params['description'] = self::DBUTF8($link->description); |
1218 | 1218 | $params['category_id'] = $cat_id; |
1219 | 1219 | $params['on_homepage'] = $link->on_homepage; |
1220 | - $params['display_order'] = $max_order+1; |
|
1220 | + $params['display_order'] = $max_order + 1; |
|
1221 | 1221 | |
1222 | 1222 | $id = Database::insert($link_table, $params); |
1223 | 1223 | |
@@ -1261,9 +1261,9 @@ discard block |
||
1261 | 1261 | if (is_object($link_cat) && !$link_cat->is_restored()) { |
1262 | 1262 | $sql = "SELECT MAX(display_order) FROM $link_cat_table |
1263 | 1263 | WHERE c_id = ".$this->destination_course_id." "; |
1264 | - $result=Database::query($sql); |
|
1265 | - list($orderMax)=Database::fetch_array($result,'NUM'); |
|
1266 | - $display_order=$orderMax+1; |
|
1264 | + $result = Database::query($sql); |
|
1265 | + list($orderMax) = Database::fetch_array($result, 'NUM'); |
|
1266 | + $display_order = $orderMax + 1; |
|
1267 | 1267 | |
1268 | 1268 | $params['c_id'] = $this->destination_course_id; |
1269 | 1269 | $params['category_title'] = self::DBUTF8($link_cat->title); |
@@ -1639,9 +1639,9 @@ discard block |
||
1639 | 1639 | if (!empty($quiz->sound)) { |
1640 | 1640 | if (isset($this->course->resources[RESOURCE_DOCUMENT][$quiz->sound]) && |
1641 | 1641 | $this->course->resources[RESOURCE_DOCUMENT][$quiz->sound]->is_restored()) { |
1642 | - $sql = "SELECT path FROM " . $table_doc . " |
|
1642 | + $sql = "SELECT path FROM ".$table_doc." |
|
1643 | 1643 | WHERE |
1644 | - c_id = " . $this->destination_course_id . " AND |
|
1644 | + c_id = " . $this->destination_course_id." AND |
|
1645 | 1645 | id = " . $resources[RESOURCE_DOCUMENT][$quiz->sound]->destination_id; |
1646 | 1646 | $doc = Database::query($sql); |
1647 | 1647 | $doc = Database::fetch_object($doc); |
@@ -1675,19 +1675,19 @@ discard block |
||
1675 | 1675 | 'random' => $quiz->random, |
1676 | 1676 | 'active' => $quiz->active, |
1677 | 1677 | 'sound' => self::DBUTF8($doc), |
1678 | - 'max_attempt' => (int)$quiz->max_attempt, |
|
1679 | - 'results_disabled' => (int)$quiz->results_disabled, |
|
1678 | + 'max_attempt' => (int) $quiz->max_attempt, |
|
1679 | + 'results_disabled' => (int) $quiz->results_disabled, |
|
1680 | 1680 | 'access_condition' => $quiz->access_condition, |
1681 | 1681 | 'start_time' => $quiz->start_time, |
1682 | 1682 | 'pass_percentage' => $quiz->pass_percentage, |
1683 | 1683 | 'end_time' => $quiz->end_time, |
1684 | - 'feedback_type' => (int)$quiz->feedback_type, |
|
1685 | - 'random_answers' => (int)$quiz->random_answers, |
|
1684 | + 'feedback_type' => (int) $quiz->feedback_type, |
|
1685 | + 'random_answers' => (int) $quiz->random_answers, |
|
1686 | 1686 | 'random_by_category' => $quiz->random_by_category, |
1687 | 1687 | 'review_answers' => $quiz->review_answers, |
1688 | 1688 | 'propagate_neg' => $quiz->propagate_neg, |
1689 | 1689 | 'text_when_finished' => $quiz->text_when_finished, |
1690 | - 'expired_time' => (int)$quiz->expired_time, |
|
1690 | + 'expired_time' => (int) $quiz->expired_time, |
|
1691 | 1691 | ); |
1692 | 1692 | |
1693 | 1693 | if ($respect_base_content) { |
@@ -1723,9 +1723,9 @@ discard block |
||
1723 | 1723 | $qid = $this->restore_quiz_question($question_id); |
1724 | 1724 | $question_order = $quiz->question_orders[$index] ? $quiz->question_orders[$index] : ++$order; |
1725 | 1725 | $sql = "INSERT IGNORE INTO $table_rel SET |
1726 | - c_id = " . $this->destination_course_id . ", |
|
1727 | - question_id = " . $qid . ", |
|
1728 | - exercice_id = " . $new_id . ", |
|
1726 | + c_id = ".$this->destination_course_id.", |
|
1727 | + question_id = " . $qid.", |
|
1728 | + exercice_id = " . $new_id.", |
|
1729 | 1729 | question_order = " . $question_order; |
1730 | 1730 | Database::query($sql); |
1731 | 1731 | } |
@@ -1800,7 +1800,7 @@ discard block |
||
1800 | 1800 | $sql = "UPDATE $table_que SET |
1801 | 1801 | picture = '$picture_name' |
1802 | 1802 | WHERE |
1803 | - c_id = " . $this->destination_course_id . " AND |
|
1803 | + c_id = ".$this->destination_course_id." AND |
|
1804 | 1804 | id = $new_id "; |
1805 | 1805 | Database::query($sql); |
1806 | 1806 | } |
@@ -1955,7 +1955,7 @@ discard block |
||
1955 | 1955 | } |
1956 | 1956 | } |
1957 | 1957 | |
1958 | - foreach($correct_answers as $answer_id => $correct_answer) { |
|
1958 | + foreach ($correct_answers as $answer_id => $correct_answer) { |
|
1959 | 1959 | $params = array(); |
1960 | 1960 | $params['correct'] = $new_options[$correct_answer]; |
1961 | 1961 | Database::update( |
@@ -1989,7 +1989,7 @@ discard block |
||
1989 | 1989 | $tab_test_category_id_old_new = array(); // used to build the quiz_question_rel_category table |
1990 | 1990 | if ($this->course->has_resources(RESOURCE_TEST_CATEGORY)) { |
1991 | 1991 | $resources = $this->course->resources; |
1992 | - foreach ($resources[RESOURCE_TEST_CATEGORY] as $id => $CourseCopyTestcategory ) { |
|
1992 | + foreach ($resources[RESOURCE_TEST_CATEGORY] as $id => $CourseCopyTestcategory) { |
|
1993 | 1993 | $tab_test_category_id_old_new[$CourseCopyTestcategory->source_id] = $id; |
1994 | 1994 | // check if this test_category already exist in the destination BDD |
1995 | 1995 | // do not Database::escape_string $title and $description, it will be done later |
@@ -2135,7 +2135,7 @@ discard block |
||
2135 | 2135 | break; |
2136 | 2136 | case FILE_RENAME: |
2137 | 2137 | $survey_code = $survey->code.'_'; |
2138 | - $i=1; |
|
2138 | + $i = 1; |
|
2139 | 2139 | $temp_survey_code = $survey_code.$i; |
2140 | 2140 | while (!$this->is_survey_code_available($temp_survey_code)) { |
2141 | 2141 | $temp_survey_code = $survey_code.++$i; |
@@ -2167,15 +2167,15 @@ discard block |
||
2167 | 2167 | $sql = "SELECT * FROM $table_sur |
2168 | 2168 | WHERE |
2169 | 2169 | c_id = ".$this->destination_course_id." AND |
2170 | - survey_id='".self::DBUTF8escapestring(Database::result($result_check,0,0))."'"; |
|
2170 | + survey_id='".self::DBUTF8escapestring(Database::result($result_check, 0, 0))."'"; |
|
2171 | 2171 | $result = Database::query($sql); |
2172 | - $survey_data = Database::fetch_array($result,'ASSOC'); |
|
2172 | + $survey_data = Database::fetch_array($result, 'ASSOC'); |
|
2173 | 2173 | |
2174 | 2174 | // if the survey is shared => also delete the shared content |
2175 | 2175 | if (isset($survey_data['survey_share']) && is_numeric($survey_data['survey_share'])) { |
2176 | - SurveyManager::delete_survey($survey_data['survey_share'], true,$this->destination_course_id); |
|
2176 | + SurveyManager::delete_survey($survey_data['survey_share'], true, $this->destination_course_id); |
|
2177 | 2177 | } |
2178 | - SurveyManager :: delete_survey($survey_data['survey_id'],false,$this->destination_course_id); |
|
2178 | + SurveyManager :: delete_survey($survey_data['survey_id'], false, $this->destination_course_id); |
|
2179 | 2179 | |
2180 | 2180 | // Insert the new source survey |
2181 | 2181 | $new_id = Database::insert($table_sur, $params); |
@@ -2251,7 +2251,7 @@ discard block |
||
2251 | 2251 | $resources = $this->course->resources; |
2252 | 2252 | $question = $resources[RESOURCE_SURVEYQUESTION][$id]; |
2253 | 2253 | |
2254 | - $new_id=0; |
|
2254 | + $new_id = 0; |
|
2255 | 2255 | |
2256 | 2256 | if (is_object($question)) { |
2257 | 2257 | if ($question->is_restored()) { |
@@ -2356,14 +2356,14 @@ discard block |
||
2356 | 2356 | |
2357 | 2357 | // Adding the author's image |
2358 | 2358 | if (!empty($lp->preview_image)) { |
2359 | - $new_filename = uniqid('').substr($lp->preview_image,strlen($lp->preview_image)-7, strlen($lp->preview_image)); |
|
2359 | + $new_filename = uniqid('').substr($lp->preview_image, strlen($lp->preview_image) - 7, strlen($lp->preview_image)); |
|
2360 | 2360 | if (file_exists($origin_path.$lp->preview_image) && !is_dir($origin_path.$lp->preview_image)) { |
2361 | 2361 | $copy_result = copy($origin_path.$lp->preview_image, $destination_path.$new_filename); |
2362 | 2362 | //$copy_result = true; |
2363 | 2363 | if ($copy_result) { |
2364 | 2364 | $lp->preview_image = $new_filename; |
2365 | 2365 | } else { |
2366 | - $lp->preview_image =''; |
|
2366 | + $lp->preview_image = ''; |
|
2367 | 2367 | } |
2368 | 2368 | } |
2369 | 2369 | } |
@@ -2524,20 +2524,20 @@ discard block |
||
2524 | 2524 | $next_item_ids[$new_item_id] = $item['next_item_id']; |
2525 | 2525 | |
2526 | 2526 | if (!empty($item['prerequisite'])) { |
2527 | - if ($lp->lp_type =='2') { |
|
2527 | + if ($lp->lp_type == '2') { |
|
2528 | 2528 | // if is an sco |
2529 | - $old_prerequisite[$new_item_id]= $item['prerequisite']; |
|
2529 | + $old_prerequisite[$new_item_id] = $item['prerequisite']; |
|
2530 | 2530 | } else { |
2531 | - $old_prerequisite[$new_item_id]= $new_item_ids[$item['prerequisite']]; |
|
2531 | + $old_prerequisite[$new_item_id] = $new_item_ids[$item['prerequisite']]; |
|
2532 | 2532 | } |
2533 | 2533 | } |
2534 | 2534 | |
2535 | 2535 | if (!empty($ref)) { |
2536 | - if ($lp->lp_type =='2') { |
|
2536 | + if ($lp->lp_type == '2') { |
|
2537 | 2537 | // if is an sco |
2538 | - $old_refs[$new_item_id]= $ref; |
|
2538 | + $old_refs[$new_item_id] = $ref; |
|
2539 | 2539 | } else { |
2540 | - $old_refs[$new_item_id]= $new_item_ids[$ref]; |
|
2540 | + $old_refs[$new_item_id] = $new_item_ids[$ref]; |
|
2541 | 2541 | } |
2542 | 2542 | } |
2543 | 2543 | |
@@ -2546,7 +2546,7 @@ discard block |
||
2546 | 2546 | |
2547 | 2547 | // Updating prerequisites |
2548 | 2548 | foreach ($old_prerequisite as $key=>$my_old_prerequisite) { |
2549 | - if($my_old_prerequisite != ''){ |
|
2549 | + if ($my_old_prerequisite != '') { |
|
2550 | 2550 | $sql = "UPDATE ".$table_item." SET prerequisite = '".$my_old_prerequisite."' |
2551 | 2551 | WHERE c_id = ".$this->destination_course_id." AND id = '".$key."' "; |
2552 | 2552 | Database::query($sql); |
@@ -2564,7 +2564,7 @@ discard block |
||
2564 | 2564 | |
2565 | 2565 | foreach ($parent_item_ids as $new_item_id => $parent_item_old_id) { |
2566 | 2566 | $parent_new_id = 0; |
2567 | - if($parent_item_old_id != 0){ |
|
2567 | + if ($parent_item_old_id != 0) { |
|
2568 | 2568 | $parent_new_id = $new_item_ids[$parent_item_old_id]; |
2569 | 2569 | } |
2570 | 2570 | $sql = "UPDATE ".$table_item." SET parent_item_id = '".$parent_new_id."' |
@@ -2573,7 +2573,7 @@ discard block |
||
2573 | 2573 | } |
2574 | 2574 | foreach ($previous_item_ids as $new_item_id => $previous_item_old_id) { |
2575 | 2575 | $previous_new_id = 0; |
2576 | - if($previous_item_old_id != 0){ |
|
2576 | + if ($previous_item_old_id != 0) { |
|
2577 | 2577 | $previous_new_id = $new_item_ids[$previous_item_old_id]; |
2578 | 2578 | } |
2579 | 2579 | $sql = "UPDATE ".$table_item." SET previous_item_id = '".$previous_new_id."' |
@@ -2583,7 +2583,7 @@ discard block |
||
2583 | 2583 | |
2584 | 2584 | foreach ($next_item_ids as $new_item_id => $next_item_old_id) { |
2585 | 2585 | $next_new_id = 0; |
2586 | - if($next_item_old_id != 0){ |
|
2586 | + if ($next_item_old_id != 0) { |
|
2587 | 2587 | $next_new_id = $new_item_ids[$next_item_old_id]; |
2588 | 2588 | } |
2589 | 2589 | $sql = "UPDATE ".$table_item." SET next_item_id = '".$next_new_id."' |
@@ -2593,7 +2593,7 @@ discard block |
||
2593 | 2593 | |
2594 | 2594 | foreach ($prerequisite_ids as $new_item_id => $prerequisite_old_id) { |
2595 | 2595 | $prerequisite_new_id = 0; |
2596 | - if($prerequisite_old_id != 0){ |
|
2596 | + if ($prerequisite_old_id != 0) { |
|
2597 | 2597 | $prerequisite_new_id = $new_item_ids[$prerequisite_old_id]; |
2598 | 2598 | } |
2599 | 2599 | $sql = "UPDATE ".$table_item." SET prerequisite = '".$prerequisite_new_id."' |
@@ -2613,9 +2613,9 @@ discard block |
||
2613 | 2613 | public function restore_student_publication($sessionId = 0) |
2614 | 2614 | { |
2615 | 2615 | $sessionId = intval($sessionId); |
2616 | - $work_assignment_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT); |
|
2616 | + $work_assignment_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT); |
|
2617 | 2617 | $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); |
2618 | - $item_property_table = Database :: get_course_table(TABLE_ITEM_PROPERTY); |
|
2618 | + $item_property_table = Database :: get_course_table(TABLE_ITEM_PROPERTY); |
|
2619 | 2619 | |
2620 | 2620 | // Query in student publication |
2621 | 2621 | $sql = 'SELECT * FROM '.$work_table.' |
@@ -2693,7 +2693,7 @@ discard block |
||
2693 | 2693 | |
2694 | 2694 | $destination = '../../courses/'.$this->course->destination_path.'/work/'; |
2695 | 2695 | $origin = '../../courses/'.$this->course->info['path'].'/work/'; |
2696 | - self::allow_create_all_directory($origin,$destination,false); |
|
2696 | + self::allow_create_all_directory($origin, $destination, false); |
|
2697 | 2697 | } |
2698 | 2698 | |
2699 | 2699 | /** |
@@ -2712,16 +2712,16 @@ discard block |
||
2712 | 2712 | if ($handle = opendir($source)) { // if the folder exploration is sucsessful, continue |
2713 | 2713 | while (false !== ($file = readdir($handle))) { // as long as storing the next file to $file is successful, continue |
2714 | 2714 | if ($file != '.' && $file != '..') { |
2715 | - $path = $source . '/' . $file; |
|
2715 | + $path = $source.'/'.$file; |
|
2716 | 2716 | if (is_file($path)) { |
2717 | 2717 | /* if (!is_file($dest . '/' . $file) || $overwrite) |
2718 | 2718 | if (!@copy($path, $dest . '/' . $file)) { |
2719 | 2719 | echo '<font color="red">File ('.$path.') '.get_lang('NotHavePermission').'</font>'; |
2720 | 2720 | }*/ |
2721 | - } elseif(is_dir($path)) { |
|
2722 | - if (!is_dir($dest . '/' . $file)) |
|
2723 | - mkdir($dest . '/' . $file); |
|
2724 | - self:: allow_create_all_directory($path, $dest . '/' . $file, $overwrite); |
|
2721 | + } elseif (is_dir($path)) { |
|
2722 | + if (!is_dir($dest.'/'.$file)) |
|
2723 | + mkdir($dest.'/'.$file); |
|
2724 | + self:: allow_create_all_directory($path, $dest.'/'.$file, $overwrite); |
|
2725 | 2725 | } |
2726 | 2726 | } |
2727 | 2727 | } |
@@ -2908,7 +2908,7 @@ discard block |
||
2908 | 2908 | $this->course->backup_path, |
2909 | 2909 | $this->course->info['path'] |
2910 | 2910 | ); |
2911 | - $thematic->params['c_id'] = $this->destination_course_id; |
|
2911 | + $thematic->params['c_id'] = $this->destination_course_id; |
|
2912 | 2912 | unset($thematic->params['id']); |
2913 | 2913 | unset($thematic->params['iid']); |
2914 | 2914 | |
@@ -2932,7 +2932,7 @@ discard block |
||
2932 | 2932 | unset($thematic_advance['iid']); |
2933 | 2933 | $thematic_advance['attendance_id'] = 0; |
2934 | 2934 | $thematic_advance['thematic_id'] = $last_id; |
2935 | - $thematic_advance['c_id'] = $this->destination_course_id; |
|
2935 | + $thematic_advance['c_id'] = $this->destination_course_id; |
|
2936 | 2936 | $my_id = Database::insert( |
2937 | 2937 | $table_thematic_advance, |
2938 | 2938 | $thematic_advance, |
@@ -2954,7 +2954,7 @@ discard block |
||
2954 | 2954 | } |
2955 | 2955 | } |
2956 | 2956 | |
2957 | - foreach($thematic->thematic_plan_list as $thematic_plan) { |
|
2957 | + foreach ($thematic->thematic_plan_list as $thematic_plan) { |
|
2958 | 2958 | unset($thematic_plan['id']); |
2959 | 2959 | unset($thematic_plan['iid']); |
2960 | 2960 | $thematic_plan['thematic_id'] = $last_id; |
@@ -3070,7 +3070,7 @@ discard block |
||
3070 | 3070 | // re-create dir |
3071 | 3071 | // @todo check security against injection of dir in crafted course backup here! |
3072 | 3072 | $path = $obj->params['url']; |
3073 | - $path = '/'.str_replace('/','',substr($path,1)); |
|
3073 | + $path = '/'.str_replace('/', '', substr($path, 1)); |
|
3074 | 3074 | |
3075 | 3075 | $workData = array(); |
3076 | 3076 | switch ($this->file_option) { |
@@ -3092,9 +3092,9 @@ discard block |
||
3092 | 3092 | $obj->params['new_dir'] = $obj->params['title']; |
3093 | 3093 | |
3094 | 3094 | if (!empty($this->course_origin_id)) { |
3095 | - $sql = 'SELECT * FROM ' . $table_work_assignment . ' |
|
3095 | + $sql = 'SELECT * FROM '.$table_work_assignment.' |
|
3096 | 3096 | WHERE |
3097 | - c_id = ' . $this->course_origin_id . ' AND |
|
3097 | + c_id = ' . $this->course_origin_id.' AND |
|
3098 | 3098 | publication_id = ' . $id_work; |
3099 | 3099 | |
3100 | 3100 | $result = Database::query($sql); |
@@ -3206,7 +3206,7 @@ discard block |
||
3206 | 3206 | public function DBUTF8_array($array) |
3207 | 3207 | { |
3208 | 3208 | if (UTF8_CONVERT) { |
3209 | - foreach ($array as &$item) { |
|
3209 | + foreach ($array as &$item) { |
|
3210 | 3210 | $item = utf8_encode($item); |
3211 | 3211 | } |
3212 | 3212 | return $array; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | $cidReset = true; |
13 | 13 | require_once '../inc/global.inc.php'; |
14 | -$current_course_tool = TOOL_COURSE_MAINTENANCE; |
|
14 | +$current_course_tool = TOOL_COURSE_MAINTENANCE; |
|
15 | 15 | |
16 | 16 | api_protect_global_admin_script(); |
17 | 17 | api_protect_limit_for_session_admin(); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | function display_form() |
84 | 84 | { |
85 | - $html = ''; |
|
85 | + $html = ''; |
|
86 | 86 | $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC')); |
87 | 87 | |
88 | 88 | // Actions |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | //destination |
111 | 111 | $html .= '<div class="form-group">'; |
112 | - $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>'; |
|
112 | + $html .= '<label class="col-sm-2 control-label">'.get_lang('DestinationCoursesFromSession').': </label>'; |
|
113 | 113 | $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">'; |
114 | 114 | $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">'; |
115 | 115 | $html .= '<option value = "0">'.get_lang('ThereIsNotStillASession').'</option></select ></div>'; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $html .= '<button class="btn btn-success" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><em class="fa fa-files-o"></em> '.get_lang('CopyCourse').'</button>'; |
132 | 132 | |
133 | 133 | // Add Security token |
134 | - $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">'; |
|
134 | + $html .= '<input type="hidden" value="'.Security::get_token().'" name="sec_token">'; |
|
135 | 135 | $html .= '</div></div>'; |
136 | 136 | |
137 | 137 | $html .= '</form>'; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | /* HTML head extra */ |
231 | 231 | |
232 | -$htmlHeadXtra[] = $xajax->getJavascript( api_get_path(WEB_LIBRARY_PATH).'xajax/'); |
|
232 | +$htmlHeadXtra[] = $xajax->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax/'); |
|
233 | 233 | $htmlHeadXtra[] = '<script type="text/javascript"> |
234 | 234 | function checkSelected(id_select,id_radio,id_title,id_destination) { |
235 | 235 | var num=0; |
@@ -299,22 +299,22 @@ discard block |
||
299 | 299 | display_form(); |
300 | 300 | } else { |
301 | 301 | |
302 | - $arr_course_origin = array(); |
|
302 | + $arr_course_origin = array(); |
|
303 | 303 | $arr_course_destination = array(); |
304 | - $destination_session = ''; |
|
305 | - $origin_session = ''; |
|
304 | + $destination_session = ''; |
|
305 | + $origin_session = ''; |
|
306 | 306 | |
307 | 307 | if (isset($_POST['SessionCoursesListOrigin'])) { |
308 | - $arr_course_origin = $_POST['SessionCoursesListOrigin']; |
|
308 | + $arr_course_origin = $_POST['SessionCoursesListOrigin']; |
|
309 | 309 | } |
310 | 310 | if (isset($_POST['SessionCoursesListDestination'])) { |
311 | 311 | $arr_course_destination = $_POST['SessionCoursesListDestination']; |
312 | 312 | } |
313 | 313 | if (isset($_POST['sessions_list_destination'])) { |
314 | - $destination_session = $_POST['sessions_list_destination']; |
|
314 | + $destination_session = $_POST['sessions_list_destination']; |
|
315 | 315 | } |
316 | 316 | if (isset($_POST['sessions_list_origin'])) { |
317 | - $origin_session = $_POST['sessions_list_origin']; |
|
317 | + $origin_session = $_POST['sessions_list_origin']; |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) { |
@@ -354,22 +354,22 @@ discard block |
||
354 | 354 | Display::display_normal_message(get_lang('ToExportDocumentsWithGlossaryYouHaveToSelectGlossary')); |
355 | 355 | } |
356 | 356 | |
357 | - $arr_course_origin = array(); |
|
357 | + $arr_course_origin = array(); |
|
358 | 358 | $arr_course_destination = array(); |
359 | - $destination_session = ''; |
|
360 | - $origin_session = ''; |
|
359 | + $destination_session = ''; |
|
360 | + $origin_session = ''; |
|
361 | 361 | |
362 | 362 | if (isset($_POST['SessionCoursesListOrigin'])) { |
363 | - $arr_course_origin = $_POST['SessionCoursesListOrigin']; |
|
363 | + $arr_course_origin = $_POST['SessionCoursesListOrigin']; |
|
364 | 364 | } |
365 | 365 | if (isset($_POST['SessionCoursesListDestination'])) { |
366 | 366 | $arr_course_destination = $_POST['SessionCoursesListDestination']; |
367 | 367 | } |
368 | 368 | if (isset($_POST['sessions_list_destination'])) { |
369 | - $destination_session = $_POST['sessions_list_destination']; |
|
369 | + $destination_session = $_POST['sessions_list_destination']; |
|
370 | 370 | } |
371 | 371 | if (isset($_POST['sessions_list_origin'])) { |
372 | - $origin_session = $_POST['sessions_list_origin']; |
|
372 | + $origin_session = $_POST['sessions_list_origin']; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) { |
@@ -378,10 +378,10 @@ discard block |
||
378 | 378 | $cb = new CourseBuilder('', $course_origin); |
379 | 379 | $course = $cb->build($origin_session, $arr_course_origin[0], $with_base_content); |
380 | 380 | //$hiddenFields['same_file_name_option'] = $_POST['same_file_name_option']; |
381 | - $hiddenFields['destination_course'] = $arr_course_destination[0]; |
|
382 | - $hiddenFields['origin_course'] = $arr_course_origin[0]; |
|
383 | - $hiddenFields['destination_session'] = $destination_session; |
|
384 | - $hiddenFields['origin_session'] = $origin_session; |
|
381 | + $hiddenFields['destination_course'] = $arr_course_destination[0]; |
|
382 | + $hiddenFields['origin_course'] = $arr_course_origin[0]; |
|
383 | + $hiddenFields['destination_session'] = $destination_session; |
|
384 | + $hiddenFields['origin_session'] = $origin_session; |
|
385 | 385 | // Add token to Course select form |
386 | 386 | $hiddenFields['sec_token'] = Security::get_token(); |
387 | 387 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $nameTools = get_lang('CopyCourse'); |
49 | 49 | $returnLink = api_get_path( |
50 | 50 | WEB_CODE_PATH |
51 | - ) . 'course_info/maintenance_coach.php?' . api_get_cidreq(); |
|
51 | + ).'course_info/maintenance_coach.php?'.api_get_cidreq(); |
|
52 | 52 | $interbreadcrumb[] = array( |
53 | 53 | 'url' => $returnLink, |
54 | 54 | 'name' => get_lang('Maintenance') |
@@ -71,29 +71,29 @@ discard block |
||
71 | 71 | $attrs = ''; |
72 | 72 | if (count($attr) > 0) { |
73 | 73 | foreach ($attr as $key => $value) { |
74 | - $attrs .= ' ' . $key . '="' . $value . '"'; |
|
74 | + $attrs .= ' '.$key.'="'.$value.'"'; |
|
75 | 75 | } |
76 | 76 | } |
77 | - $output = '<select name="' . $name . '" ' . $attrs . '>'; |
|
77 | + $output = '<select name="'.$name.'" '.$attrs.'>'; |
|
78 | 78 | |
79 | 79 | if (count($sessions) == 0) { |
80 | - $output .= '<option value = "0">' . get_lang( |
|
80 | + $output .= '<option value = "0">'.get_lang( |
|
81 | 81 | 'ThereIsNotStillASession' |
82 | - ) . '</option>'; |
|
82 | + ).'</option>'; |
|
83 | 83 | } else { |
84 | - $output .= '<option value = "0">' . get_lang( |
|
84 | + $output .= '<option value = "0">'.get_lang( |
|
85 | 85 | 'SelectASession' |
86 | - ) . '</option>'; |
|
86 | + ).'</option>'; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | if (is_array($sessions)) { |
90 | 90 | foreach ($sessions as $session) { |
91 | 91 | $category_name = ''; |
92 | 92 | if (!empty($session['category_name'])) { |
93 | - $category_name = ' (' . $session['category_name'] . ')'; |
|
93 | + $category_name = ' ('.$session['category_name'].')'; |
|
94 | 94 | } |
95 | 95 | |
96 | - $output .= '<option value="' . $session['id'] . '">' . $session['name'] . ' ' . $category_name . '</option>'; |
|
96 | + $output .= '<option value="'.$session['id'].'">'.$session['name'].' '.$category_name.'</option>'; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | $output .= '</select>'; |
@@ -118,43 +118,43 @@ discard block |
||
118 | 118 | // Actions |
119 | 119 | $html .= '<div class="actions">'; |
120 | 120 | // Link back to the documents overview |
121 | - $html .= '<a href="' . $returnLink . '">' . Display::return_icon( |
|
122 | - 'back.png', get_lang('BackTo') . ' ' . get_lang('Maintenance'), '', ICON_SIZE_MEDIUM |
|
123 | - ) . '</a>'; |
|
121 | + $html .= '<a href="'.$returnLink.'">'.Display::return_icon( |
|
122 | + 'back.png', get_lang('BackTo').' '.get_lang('Maintenance'), '', ICON_SIZE_MEDIUM |
|
123 | + ).'</a>'; |
|
124 | 124 | $html .= '</div>'; |
125 | 125 | |
126 | 126 | $html .= Display::return_message( |
127 | 127 | get_lang('CopyCourseFromSessionToSessionExplanation') |
128 | 128 | ); |
129 | 129 | |
130 | - $html .= '<form name="formulaire" method="post" action="' . api_get_self( |
|
131 | - ) . '?' . api_get_cidreq() . '" >'; |
|
130 | + $html .= '<form name="formulaire" method="post" action="'.api_get_self( |
|
131 | + ).'?'.api_get_cidreq().'" >'; |
|
132 | 132 | $html .= '<table border="0" cellpadding="5" cellspacing="0" width="100%">'; |
133 | 133 | |
134 | 134 | // Source |
135 | - $html .= '<tr><td width="15%"><b>' . get_lang( |
|
135 | + $html .= '<tr><td width="15%"><b>'.get_lang( |
|
136 | 136 | 'OriginCoursesFromSession' |
137 | - ) . ':</b></td>'; |
|
138 | - $html .= '<td width="10%" align="left">' . api_get_session_name( |
|
137 | + ).':</b></td>'; |
|
138 | + $html .= '<td width="10%" align="left">'.api_get_session_name( |
|
139 | 139 | $sessionId |
140 | - ) . '</td>'; |
|
140 | + ).'</td>'; |
|
141 | 141 | $html .= '<td width="50%">'; |
142 | - $html .= "{$courseInfo['title']} ({$courseInfo['code']})" . '</td></tr>'; |
|
142 | + $html .= "{$courseInfo['title']} ({$courseInfo['code']})".'</td></tr>'; |
|
143 | 143 | |
144 | 144 | // Destination |
145 | - $html .= '<tr><td width="15%"><b>' . get_lang( |
|
145 | + $html .= '<tr><td width="15%"><b>'.get_lang( |
|
146 | 146 | 'DestinationCoursesFromSession' |
147 | - ) . ':</b></td>'; |
|
147 | + ).':</b></td>'; |
|
148 | 148 | $html .= '<td width="10%" align="left"><div id="ajax_sessions_list_destination">'; |
149 | 149 | $html .= '<select name="sessions_list_destination" onchange="javascript: xajax_searchCourses(this.value,\'destination\');">'; |
150 | 150 | if (empty($sessions)) { |
151 | - $html .= '<option value = "0">' . get_lang( |
|
151 | + $html .= '<option value = "0">'.get_lang( |
|
152 | 152 | 'ThereIsNotStillASession' |
153 | - ) . '</option>'; |
|
153 | + ).'</option>'; |
|
154 | 154 | } else { |
155 | - $html .= '<option value = "0">' . get_lang( |
|
155 | + $html .= '<option value = "0">'.get_lang( |
|
156 | 156 | 'SelectASession' |
157 | - ) . '</option>'; |
|
157 | + ).'</option>'; |
|
158 | 158 | foreach ($sessions as $session) { |
159 | 159 | if ($session['id'] == $sessionId) { |
160 | 160 | continue; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | continue; |
165 | 165 | } |
166 | 166 | |
167 | - $html .= '<option value="' . $session['id'] . '">' . $session['name'] . '</option>'; |
|
167 | + $html .= '<option value="'.$session['id'].'">'.$session['name'].'</option>'; |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
@@ -176,17 +176,17 @@ discard block |
||
176 | 176 | $html .= '</tr></table>'; |
177 | 177 | |
178 | 178 | $html .= "<fieldset>"; |
179 | - $html .= '<legend>' . get_lang('TypeOfCopy') . ' <small>(' . get_lang('CopyOnlySessionItems') . ')</small></legend>'; |
|
179 | + $html .= '<legend>'.get_lang('TypeOfCopy').' <small>('.get_lang('CopyOnlySessionItems').')</small></legend>'; |
|
180 | 180 | $html .= '<label class="radio"><input type="radio" id="copy_option_1" name="copy_option" value="full_copy" checked="checked"/>'; |
181 | - $html .= get_lang('FullCopy') . '</label>'; |
|
181 | + $html .= get_lang('FullCopy').'</label>'; |
|
182 | 182 | $html .= '<label class="radio"><input type="radio" id="copy_option_2" name="copy_option" value="select_items"/>'; |
183 | - $html .= ' ' . get_lang('LetMeSelectItems') . '</label><br/>'; |
|
183 | + $html .= ' '.get_lang('LetMeSelectItems').'</label><br/>'; |
|
184 | 184 | |
185 | 185 | $html .= "</fieldset>"; |
186 | 186 | |
187 | - $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm(' . "'" . addslashes( |
|
187 | + $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes( |
|
188 | 188 | api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES) |
189 | - ) . "'" . ')) return false;">' . get_lang('CopyCourse') . '</button>'; |
|
189 | + )."'".')) return false;">'.get_lang('CopyCourse').'</button>'; |
|
190 | 190 | $html .= '</form>'; |
191 | 191 | echo $html; |
192 | 192 | } |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | |
213 | 213 | $courseTitle = str_replace("'", "\'", $course['title']); |
214 | 214 | |
215 | - $return .= '<option value="' . $course['code'] . '" title="' . @htmlspecialchars( |
|
216 | - $course['title'] . ' (' . $course['visual_code'] . ')', ENT_QUOTES, api_get_system_encoding() |
|
217 | - ) . '">' . |
|
218 | - $course['title'] . ' (' . $course['visual_code'] . ')</option>'; |
|
215 | + $return .= '<option value="'.$course['code'].'" title="'.@htmlspecialchars( |
|
216 | + $course['title'].' ('.$course['visual_code'].')', ENT_QUOTES, api_get_system_encoding() |
|
217 | + ).'">'. |
|
218 | + $course['title'].' ('.$course['visual_code'].')</option>'; |
|
219 | 219 | } |
220 | 220 | $return .= '</select>'; |
221 | 221 | $_SESSION['course_list_destination'] = $course_list_destination; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | /* HTML head extra */ |
234 | 234 | |
235 | 235 | $htmlHeadXtra[] = $xajax->getJavascript( |
236 | - api_get_path(WEB_LIBRARY_PATH) . 'xajax/' |
|
236 | + api_get_path(WEB_LIBRARY_PATH).'xajax/' |
|
237 | 237 | ); |
238 | 238 | $htmlHeadXtra[] = '<script> |
239 | 239 | function checkSelected(id_select,id_radio,id_title,id_destination) { |
@@ -378,13 +378,13 @@ discard block |
||
378 | 378 | |
379 | 379 | CourseSelectForm :: display_form($course, $hiddenFields, true); |
380 | 380 | |
381 | - echo '<div style="float:right"><a href="javascript:window.history.go(-1);">' . |
|
381 | + echo '<div style="float:right"><a href="javascript:window.history.go(-1);">'. |
|
382 | 382 | Display::return_icon( |
383 | - 'back.png', get_lang('Back') . ' ' . get_lang('To') . ' ' . get_lang( |
|
383 | + 'back.png', get_lang('Back').' '.get_lang('To').' '.get_lang( |
|
384 | 384 | 'PlatformAdmin' |
385 | 385 | ), array('style' => 'vertical-align:middle') |
386 | - ) . |
|
387 | - get_lang('Back') . '</a></div>'; |
|
386 | + ). |
|
387 | + get_lang('Back').'</a></div>'; |
|
388 | 388 | } else { |
389 | 389 | Display::display_error_message( |
390 | 390 | get_lang('You must select a course from original session and select a destination session') |