@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | $work_id = $_GET['id']; |
11 | 11 | require_once '../inc/global.inc.php'; |
12 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
12 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
13 | 13 | $_course = api_get_course_info(); |
14 | 14 | |
15 | 15 | // Protection |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | if (!empty($files)) { |
179 | 179 | $fileName = api_replace_dangerous_char($work_data['title']); |
180 | 180 | // Logging |
181 | - Event::event_download($fileName .'.zip (folder)'); |
|
181 | + Event::event_download($fileName.'.zip (folder)'); |
|
182 | 182 | |
183 | 183 | //start download of created file |
184 | - $name = $fileName .'.zip'; |
|
184 | + $name = $fileName.'.zip'; |
|
185 | 185 | if (Security::check_abs_path($temp_zip_file, api_get_path(SYS_ARCHIVE_PATH))) { |
186 | 186 | DocumentManager::file_send_for_download($temp_zip_file, true, $name); |
187 | 187 | @unlink($temp_zip_file); |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | $usersAdded[] = $myUserId; |
75 | 75 | $userInfo = api_get_user_info($myUserId); |
76 | 76 | $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=delete&id='.$workId.'&user_id='.$myUserId; |
77 | - $link = Display::url('<em class="fa fa-trash"></em> ' . get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm')); |
|
78 | - echo '<li class="list-group-item">' . $userInfo['complete_name_with_username'] . '<div class="pull-right">' . $link . '</div></li>'; |
|
77 | + $link = Display::url('<em class="fa fa-trash"></em> '.get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm')); |
|
78 | + echo '<li class="list-group-item">'.$userInfo['complete_name_with_username'].'<div class="pull-right">'.$link.'</div></li>'; |
|
79 | 79 | } |
80 | 80 | echo '</ul>'; |
81 | 81 | } |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | foreach ($userToAddList as $user) { |
109 | 109 | $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') '; |
110 | 110 | $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=add&id='.$workId.'&user_id='.$user['user_id']; |
111 | - $link = Display::url('<em class="fa fa-plus"></em> ' . get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm')); |
|
112 | - echo '<li class="list-group-item">' . $userName . '<div class="pull-right"> ' . $link . '</div></li>'; |
|
111 | + $link = Display::url('<em class="fa fa-plus"></em> '.get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm')); |
|
112 | + echo '<li class="list-group-item">'.$userName.'<div class="pull-right"> '.$link.'</div></li>'; |
|
113 | 113 | } |
114 | 114 | echo '</ul>'; |
115 | 115 | } else { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use ChamiloSession as Session; |
5 | 5 | |
6 | 6 | require_once '../inc/global.inc.php'; |
7 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
7 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
8 | 8 | |
9 | 9 | api_protect_course_script(true); |
10 | 10 |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | $zip_file = CourseArchiver::write_course($course); |
74 | 74 | Display::display_confirmation_message(get_lang('BackupCreated')); |
75 | - echo '<br /><a class="btn btn-primary btn-large" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive=' . $zip_file . '&' . api_get_cidreq() . '"> |
|
76 | - ' . get_lang('Download') . '</a>'; |
|
75 | + echo '<br /><a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'"> |
|
76 | + ' . get_lang('Download').'</a>'; |
|
77 | 77 | |
78 | 78 | } elseif (Security::check_token('post') && ( |
79 | 79 | isset($_POST['backup_option']) && |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if (!$course->has_resources()) { |
96 | 96 | echo get_lang('NoResourcesToBackup'); |
97 | 97 | } else { |
98 | - $form = new FormValidator('create_backup_form', 'post', api_get_self() . '?' . api_get_cidreq()); |
|
98 | + $form = new FormValidator('create_backup_form', 'post', api_get_self().'?'.api_get_cidreq()); |
|
99 | 99 | $form->addElement('header', get_lang('SelectOptionForBackup')); |
100 | 100 | $form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup'); |
101 | 101 | $form->addElement('radio', 'backup_option', '', get_lang('LetMeSelectItems'), 'select_items'); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | // Setting the global file that gets the general configuration, the databases, the languages, ... |
9 | 9 | require_once '../inc/global.inc.php'; |
10 | -$current_course_tool = TOOL_COURSE_MAINTENANCE; |
|
10 | +$current_course_tool = TOOL_COURSE_MAINTENANCE; |
|
11 | 11 | api_protect_course_script(true); |
12 | 12 | |
13 | 13 | // Including additional libraries |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $form->addGroup($group, '', get_lang('SameFilename')); |
121 | 121 | $form->add_progress_bar(); |
122 | 122 | $form->addButtonSave(get_lang('CopyCourse')); |
123 | - $form->setDefaults(array('copy_option' =>'select_items','same_file_name_option' => FILE_OVERWRITE)); |
|
123 | + $form->setDefaults(array('copy_option' =>'select_items', 'same_file_name_option' => FILE_OVERWRITE)); |
|
124 | 124 | |
125 | 125 | // Add Security token |
126 | 126 | $token = Security::get_token(); |
@@ -153,18 +153,18 @@ |
||
153 | 153 | $this->js_lib = $js_lib; |
154 | 154 | $this->content_license = $content_license; |
155 | 155 | $this->debug = $debug; |
156 | - $this->visibility=$visibility; |
|
156 | + $this->visibility = $visibility; |
|
157 | 157 | |
158 | - $this->use_max_score=$use_max_score; |
|
159 | - $this->autolaunch=$autolaunch; |
|
160 | - $this->created_on=$created_on; |
|
161 | - $this->modified_on=$modified_on; |
|
162 | - $this->publicated_on=$publicated_on; |
|
163 | - $this->expired_on=$expired_on; |
|
164 | - $this->session_id=$session_id; |
|
158 | + $this->use_max_score = $use_max_score; |
|
159 | + $this->autolaunch = $autolaunch; |
|
160 | + $this->created_on = $created_on; |
|
161 | + $this->modified_on = $modified_on; |
|
162 | + $this->publicated_on = $publicated_on; |
|
163 | + $this->expired_on = $expired_on; |
|
164 | + $this->session_id = $session_id; |
|
165 | 165 | |
166 | - $this->author= $author; |
|
167 | - $this->preview_image= $preview_image; |
|
166 | + $this->author = $author; |
|
167 | + $this->preview_image = $preview_image; |
|
168 | 168 | |
169 | 169 | $this->items = $items; |
170 | 170 | } |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | $table_doc = Database:: get_course_table(TABLE_DOCUMENT); |
596 | 596 | |
597 | 597 | if (!empty($courseId) && !empty($session_id)) { |
598 | - $session_id = intval($session_id); |
|
598 | + $session_id = intval($session_id); |
|
599 | 599 | if ($with_base_content) { |
600 | 600 | $session_condition = api_get_session_condition( |
601 | 601 | $session_id, |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | 'title' => get_lang('OrphanQuestions', ''), |
805 | 805 | 'type' => 2 |
806 | 806 | ); |
807 | - $newQuiz = new Quiz((object)$obj); |
|
807 | + $newQuiz = new Quiz((object) $obj); |
|
808 | 808 | if (!empty($orphanQuestionIds)) { |
809 | 809 | foreach ($orphanQuestionIds as $index => $orphanId) { |
810 | 810 | $order = $index + 1; |
@@ -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 | } |
@@ -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)) { |