@@ -25,6 +25,6 @@ |
||
25 | 25 | public function show() |
26 | 26 | { |
27 | 27 | parent::show(); |
28 | - echo $this->obj->title . ' (' . $this->obj->poster_name . ', ' . $this->obj->post_date . ')'; |
|
28 | + echo $this->obj->title.' ('.$this->obj->poster_name.', '.$this->obj->post_date.')'; |
|
29 | 29 | } |
30 | 30 | } |
@@ -22,9 +22,9 @@ |
||
22 | 22 | * @param string $description |
23 | 23 | * @param int $display_order |
24 | 24 | */ |
25 | - public function __construct($id,$name,$description,$display_order) |
|
25 | + public function __construct($id, $name, $description, $display_order) |
|
26 | 26 | { |
27 | - parent::__construct($id,RESOURCE_GLOSSARY); |
|
27 | + parent::__construct($id, RESOURCE_GLOSSARY); |
|
28 | 28 | $this->glossary_id = $id; |
29 | 29 | $this->name = $name; |
30 | 30 | $this->description = $description; |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $on_homepage |
48 | 48 | ) |
49 | 49 | { |
50 | - parent::__construct($id,RESOURCE_LINK); |
|
50 | + parent::__construct($id, RESOURCE_LINK); |
|
51 | 51 | $this->title = $title; |
52 | 52 | $this->url = $url; |
53 | 53 | $this->description = $description; |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * @param string $invitation_date |
41 | 41 | * @param string $reminder_date |
42 | 42 | */ |
43 | - public function __construct($id,$code,$user,$invitation_code,$invitation_date,$reminder_date) |
|
43 | + public function __construct($id, $code, $user, $invitation_code, $invitation_date, $reminder_date) |
|
44 | 44 | { |
45 | 45 | parent::__construct($id, RESOURCE_SURVEYINVITATION); |
46 | 46 | $this->code = $code; |
@@ -29,9 +29,9 @@ |
||
29 | 29 | * @param string $title |
30 | 30 | * @param string $description |
31 | 31 | */ |
32 | - function __construct($id,$title,$description,$display_order) |
|
32 | + function __construct($id, $title, $description, $display_order) |
|
33 | 33 | { |
34 | - parent::__construct($id,RESOURCE_LINKCATEGORY); |
|
34 | + parent::__construct($id, RESOURCE_LINKCATEGORY); |
|
35 | 35 | $this->title = $title; |
36 | 36 | $this->description = $description; |
37 | 37 | $this->display_order = $display_order; |
@@ -29,9 +29,9 @@ |
||
29 | 29 | * @param string $title |
30 | 30 | * @param string $content |
31 | 31 | */ |
32 | - public function __construct($id,$title,$content,$description_type) |
|
32 | + public function __construct($id, $title, $content, $description_type) |
|
33 | 33 | { |
34 | - parent::__construct($id,RESOURCE_COURSEDESCRIPTION); |
|
34 | + parent::__construct($id, RESOURCE_COURSEDESCRIPTION); |
|
35 | 35 | $this->title = $title; |
36 | 36 | $this->content = $content; |
37 | 37 | $this->description_type = $description_type; |
@@ -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')) { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function __construct($id, $path, $title) |
23 | 23 | { |
24 | - parent::__construct($id,RESOURCE_SCORM); |
|
24 | + parent::__construct($id, RESOURCE_SCORM); |
|
25 | 25 | $this->path = 'scorm'.$path; |
26 | 26 | $this->title = $title; |
27 | 27 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | echo $path; |
37 | 37 | if (!empty($this->title)) { |
38 | 38 | if (strpos($path, $this->title) === false) { |
39 | - echo " - " . $this->title; |
|
39 | + echo " - ".$this->title; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |