Completed
Push — 1.10.x ( 501d19...0db498 )
by Yannick
89:35 queued 49:03
created
main/coursecopy/classes/ForumPost.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
main/coursecopy/classes/CourseArchiver.class.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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')) {
Please login to merge, or discard this patch.
main/coursecopy/classes/Course.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
main/coursecopy/classes/CourseRecycler.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
main/coursecopy/classes/Document.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
main/coursecopy/classes/ForumTopic.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,6 +47,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
main/coursecopy/copy_course_session.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
main/coursecopy/copy_course_session_selected.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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')
Please login to merge, or discard this patch.
main/coursecopy/recycle_course.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
  */
10 10
 
11 11
 require_once '../inc/global.inc.php';
12
-$current_course_tool  = TOOL_COURSE_MAINTENANCE;
12
+$current_course_tool = TOOL_COURSE_MAINTENANCE;
13 13
 api_protect_course_script(true);
14 14
 
15 15
 // Check access rights (only teachers are allowed here)
Please login to merge, or discard this patch.