Completed
Pull Request — 1.11.x (#1421)
by José
46:34 queued 10:32
created
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/SurveyQuestion.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
      * @param string $option_text
86 86
      * @param int	 $sort
87 87
      */
88
-    public function add_answer($option_text,$sort)
88
+    public function add_answer($option_text, $sort)
89 89
     {
90 90
         $answer = array();
91 91
         $answer['option_text'] = $option_text;
Please login to merge, or discard this patch.
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/ScormDocument.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Chamilo/CourseBundle/Component/CourseCopy/Resources/DummyCourseCreator.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $this->default_property['to_user_id'] = null;
32 32
         $this->default_property['visibility'] = '1';
33 33
         $this->default_property['start_visible'] = null;
34
-        $this->default_property['end_visible'] =  null;
34
+        $this->default_property['end_visible'] = null;
35 35
 
36 36
         $course = api_get_course_info($course_code);
37 37
         $this->course = new Course();
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
         $course = api_get_course_info();
59 59
         $course_doc_path = $this->course->backup_path.'/document/';
60 60
         $number_of_documents = rand(10, 30);
61
-        $extensions = array ('html', 'doc');
61
+        $extensions = array('html', 'doc');
62 62
         $directories = array();
63 63
         $property = $this->default_property;
64 64
         $property['lastedit_type'] = 'DocumentAdded';
65 65
         $property['tool'] = TOOL_DOCUMENT;
66 66
         $doc_id = 0;
67
-        for ($doc_id = 1; $doc_id < $number_of_documents; $doc_id ++)
67
+        for ($doc_id = 1; $doc_id < $number_of_documents; $doc_id++)
68 68
         {
69 69
             $path = '';
70 70
             $doc_type = rand(0, count($extensions) - 1);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             $filename = $this->get_dummy_content('title').'_'.$doc_id.'.'.$extension;
73 73
             $content = $this->get_dummy_content('text');
74 74
             $dirs = rand(0, 3);
75
-            for ($i = 0; $i < $dirs; $i ++)
75
+            for ($i = 0; $i < $dirs; $i++)
76 76
             {
77 77
                 $path .= 'directory/';
78 78
                 $directories[$path] = 1;
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
             fwrite($fp, $content);
88 88
             fclose($fp);
89 89
             $size = filesize($file);
90
-            $document = new Document($doc_id, '/'.$path.$filename,$this->get_dummy_content('description'),$this->get_dummy_content('title'), 'file', $size);
90
+            $document = new Document($doc_id, '/'.$path.$filename, $this->get_dummy_content('description'), $this->get_dummy_content('title'), 'file', $size);
91 91
             $document->item_properties[] = $property;
92 92
             $this->course->add_resource($document);
93 93
         }
94
-        foreach($directories as $path => $flag)
94
+        foreach ($directories as $path => $flag)
95 95
         {
96
-            $path = substr($path,0,strlen($path)-1);
97
-            $document = new Document($doc_id++,'/'.$path, $this->get_dummy_content('description'),$this->get_dummy_content('title'),'folder',0);
96
+            $path = substr($path, 0, strlen($path) - 1);
97
+            $document = new Document($doc_id++, '/'.$path, $this->get_dummy_content('description'), $this->get_dummy_content('title'), 'folder', 0);
98 98
             $property['lastedit_type'] = 'FolderCreated';
99 99
             $document->item_properties[] = $property;
100 100
             $this->course->add_resource($document);
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
         $property['lastedit_type'] = 'AnnouncementAdded';
110 110
         $property['tool'] = TOOL_ANNOUNCEMENT;
111 111
         $number_of_announcements = rand(10, 30);
112
-        for ($i = 0; $i < $number_of_announcements; $i ++)
112
+        for ($i = 0; $i < $number_of_announcements; $i++)
113 113
         {
114 114
             $time = mktime(rand(1, 24), rand(1, 60), 0, rand(1, 12), rand(1, 28), intval(date('Y')));
115 115
             $date = date('Y-m-d', $time);
116
-            $announcement = new Announcement($i,$this->get_dummy_content('title'),$this->get_dummy_content('text'), $date,0);
116
+            $announcement = new Announcement($i, $this->get_dummy_content('title'), $this->get_dummy_content('text'), $date, 0);
117 117
             $announcement->item_properties[] = $property;
118 118
             $this->course->add_resource($announcement);
119 119
         }
@@ -127,23 +127,23 @@  discard block
 block discarded – undo
127 127
         $property = $this->default_property;
128 128
         $property['lastedit_type'] = 'AgendaAdded';
129 129
         $property['tool'] = TOOL_CALENDAR_EVENT;
130
-        for ($i = 0; $i < $number_of_events; $i ++)
130
+        for ($i = 0; $i < $number_of_events; $i++)
131 131
         {
132
-            $hour = rand(1,24);
133
-            $minute = rand(1,60);
134
-            $second = rand(1,60);
135
-            $day = rand(1,28);
136
-            $month = rand(1,12);
132
+            $hour = rand(1, 24);
133
+            $minute = rand(1, 60);
134
+            $second = rand(1, 60);
135
+            $day = rand(1, 28);
136
+            $month = rand(1, 12);
137 137
             $year = intval(date('Y'));
138
-            $time = mktime($hour,$minute,$second,$month,$day,$year);
138
+            $time = mktime($hour, $minute, $second, $month, $day, $year);
139 139
             $start_date = date('Y-m-d H:m:s', $time);
140
-            $hour = rand($hour,24);
141
-            $minute = rand($minute,60);
142
-            $second = rand($second,60);
143
-            $day = rand($day,28);
144
-            $month = rand($month,12);
140
+            $hour = rand($hour, 24);
141
+            $minute = rand($minute, 60);
142
+            $second = rand($second, 60);
143
+            $day = rand($day, 28);
144
+            $month = rand($month, 12);
145 145
             $year = intval(date('Y'));
146
-            $time = mktime($hour,$minute,$second,$month,$day,$year);
146
+            $time = mktime($hour, $minute, $second, $month, $day, $year);
147 147
             $end_date = date('Y-m-d H:m:s', $time);
148 148
             $event = new CalendarEvent(
149 149
                 $i,
@@ -163,20 +163,20 @@  discard block
 block discarded – undo
163 163
     {
164 164
         // create categorys
165 165
         $number_of_categories = rand(5, 10);
166
-        for ($i = 0; $i < $number_of_categories; $i ++)
166
+        for ($i = 0; $i < $number_of_categories; $i++)
167 167
         {
168
-            $linkcat = new LinkCategory($i, $this->get_dummy_content('title'), $this->get_dummy_content('description'),$i);
168
+            $linkcat = new LinkCategory($i, $this->get_dummy_content('title'), $this->get_dummy_content('description'), $i);
169 169
             $this->course->add_resource($linkcat);
170 170
         }
171 171
         // create links
172 172
         $number_of_links = rand(5, 50);
173
-        $on_homepage = rand(0,20) == 0 ? 1 : 0;
173
+        $on_homepage = rand(0, 20) == 0 ? 1 : 0;
174 174
         $property = $this->default_property;
175 175
         $property['lastedit_type'] = 'LinkAdded';
176 176
         $property['tool'] = TOOL_LINK;
177
-        for ($i = 0; $i < $number_of_links; $i ++)
177
+        for ($i = 0; $i < $number_of_links; $i++)
178 178
         {
179
-            $link = new Link($i, $this->get_dummy_content('title'), 'http://www.google.com/search?q='.$this->get_dummy_content('title'), $this->get_dummy_content('description'), rand(0, $number_of_categories -1),$on_homepage);
179
+            $link = new Link($i, $this->get_dummy_content('title'), 'http://www.google.com/search?q='.$this->get_dummy_content('title'), $this->get_dummy_content('description'), rand(0, $number_of_categories - 1), $on_homepage);
180 180
             $link->item_properties[] = $property;
181 181
             $this->course->add_resource($link);
182 182
         }
@@ -190,18 +190,18 @@  discard block
 block discarded – undo
190 190
         $number_of_forums = rand(5, 50);
191 191
         $number_of_topics = rand(30, 100);
192 192
         $number_of_posts = rand(100, 1000);
193
-        $last_forum_post = array ();
194
-        $last_topic_post = array ();
193
+        $last_forum_post = array();
194
+        $last_topic_post = array();
195 195
         // create categorys
196 196
         $order = 1;
197
-        for ($i = 1; $i <= $number_of_categories; $i ++)
197
+        for ($i = 1; $i <= $number_of_categories; $i++)
198 198
         {
199 199
             $forumcat = new ForumCategory($i, $this->get_dummy_content('title'), $this->get_dummy_content('description'), $order, 0, 0);
200 200
             $this->course->add_resource($forumcat);
201 201
             $order++;
202 202
         }
203 203
         // create posts
204
-        for ($post_id = 1; $post_id <= $number_of_posts; $post_id ++)
204
+        for ($post_id = 1; $post_id <= $number_of_posts; $post_id++)
205 205
         {
206 206
             $topic_id = rand(1, $number_of_topics);
207 207
             $last_topic_post[$topic_id] = $post_id;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             $this->course->add_resource($post);
210 210
         }
211 211
         // create topics
212
-        for ($topic_id = 1; $topic_id <= $number_of_topics; $topic_id ++)
212
+        for ($topic_id = 1; $topic_id <= $number_of_topics; $topic_id++)
213 213
         {
214 214
             $forum_id = rand(1, $number_of_forums);
215 215
             $last_forum_post[$forum_id] = $last_topic_post[$topic_id];
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
             $this->course->add_resource($topic);
218 218
         }
219 219
         // create forums
220
-        for ($forum_id = 1; $forum_id <= $number_of_forums; $forum_id ++)
220
+        for ($forum_id = 1; $forum_id <= $number_of_forums; $forum_id++)
221 221
         {
222
-            $forum = new Forum($forum_id, $this->get_dummy_content('title'),$this->get_dummy_content('description'), rand(1, $number_of_categories), $last_forum_post[$forum_id]);
222
+            $forum = new Forum($forum_id, $this->get_dummy_content('title'), $this->get_dummy_content('description'), rand(1, $number_of_categories), $last_forum_post[$forum_id]);
223 223
             $this->course->add_resource($forum);
224 224
         }
225 225
     }
@@ -228,25 +228,25 @@  discard block
 block discarded – undo
228 228
      */
229 229
     function create_dummy_learnpaths()
230 230
     {
231
-        $number_of_learnpaths = rand(3,5);
231
+        $number_of_learnpaths = rand(3, 5);
232 232
         $global_item_id = 1;
233
-        for($i=1; $i<=$number_of_learnpaths;$i++)
233
+        for ($i = 1; $i <= $number_of_learnpaths; $i++)
234 234
         {
235 235
         $chapters = array();
236
-        $number_of_chapters = rand(1,6);
237
-        for($chapter_id = 1; $chapter_id <= $number_of_chapters; $chapter_id++)
236
+        $number_of_chapters = rand(1, 6);
237
+        for ($chapter_id = 1; $chapter_id <= $number_of_chapters; $chapter_id++)
238 238
         {
239 239
             $chapter['name'] = $this->get_dummy_content('title');
240 240
             $chapter['description'] = $this->get_dummy_content('description');
241 241
             $chapter['display_order'] = $chapter_id;
242 242
             $chapter['items'] = array();
243
-            $number_of_items = rand(5,20);
244
-            for( $item_id = 1; $item_id<$number_of_items; $item_id++)
243
+            $number_of_items = rand(5, 20);
244
+            for ($item_id = 1; $item_id < $number_of_items; $item_id++)
245 245
             {
246
-                $types = array(RESOURCE_ANNOUNCEMENT, RESOURCE_EVENT, RESOURCE_DOCUMENT,RESOURCE_LINK,RESOURCE_FORUM,RESOURCE_FORUMPOST,RESOURCE_FORUMTOPIC);
247
-                $type = $types[rand(0,count($types)-1)];
246
+                $types = array(RESOURCE_ANNOUNCEMENT, RESOURCE_EVENT, RESOURCE_DOCUMENT, RESOURCE_LINK, RESOURCE_FORUM, RESOURCE_FORUMPOST, RESOURCE_FORUMTOPIC);
247
+                $type = $types[rand(0, count($types) - 1)];
248 248
                 $resources = $this->course->resources[$type];
249
-                $resource = $resources[rand(0,count($resources)-1)];
249
+                $resource = $resources[rand(0, count($resources) - 1)];
250 250
                 $item = array();
251 251
                 $item['type'] = $resource->type;
252 252
                 $item['id'] = $resource->source_id;
@@ -254,17 +254,17 @@  discard block
 block discarded – undo
254 254
                 $item['title'] = $this->get_dummy_content('title');
255 255
                 $item['description'] = $this->get_dummy_content('description');
256 256
                 $item['ref_id'] = $global_item_id;
257
-                if( rand(0,5) == 1 && $item_id > 1)
257
+                if (rand(0, 5) == 1 && $item_id > 1)
258 258
                 {
259 259
                     $item['prereq_type'] = 'i';
260
-                    $item['prereq'] = rand($global_item_id - $item_id,$global_item_id-1);
260
+                    $item['prereq'] = rand($global_item_id - $item_id, $global_item_id - 1);
261 261
                 }
262 262
                 $chapter['items'][] = $item;
263 263
                 $global_item_id++;
264 264
             }
265 265
             $chapters[] = $chapter;
266 266
         }
267
-        $lp = new CourseCopyLearnpath($i,$this->get_dummy_content('title'),$this->get_dummy_content('description'),1,$chapters);
267
+        $lp = new CourseCopyLearnpath($i, $this->get_dummy_content('title'), $this->get_dummy_content('description'), 1, $chapters);
268 268
         $this->course->add_resource($lp);
269 269
         }
270 270
     }
@@ -278,20 +278,20 @@  discard block
 block discarded – undo
278 278
         Aenean ac wisi non enim aliquam scelerisque. Praesent eget mi. Vestibulum volutpat pulvinar justo. Phasellus sapien ante, pharetra id, bibendum sed, porta non, purus. Maecenas leo velit, luctus quis, porta non, feugiat sit amet, sapien. Proin vitae augue ut massa adipiscing placerat. Morbi ac risus. Proin dapibus eros egestas quam. Fusce fermentum lobortis elit. Duis lectus tellus, convallis nec, lobortis vel, accumsan ut, nunc. Nunc est. Donec ullamcorper laoreet quam.
279 279
         Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Suspendisse potenti. Mauris mi. Vivamus risus lacus, faucibus sit amet, sollicitudin a, blandit et, justo. In hendrerit. Sed imperdiet, eros at fringilla tempor, turpis augue semper enim, quis rhoncus nibh enim quis dui. Sed massa sapien, mattis et, laoreet sit amet, dignissim nec, urna. Integer laoreet quam quis lectus. Curabitur convallis gravida dui. Nam metus. Ut sit amet augue in nibh interdum scelerisque. Donec venenatis, lacus et pulvinar euismod, libero massa condimentum pede, commodo tristique nunc massa eu quam. Donec vulputate. Aenean in nibh. Phasellus porttitor. Donec molestie, sem ac porttitor vulputate, mauris dui egestas libero, ac lobortis dolor sem vel ligula. Nam vulputate pretium libero. Cras accumsan. Vivamus lacinia sapien sit amet elit.
280 280
         Duis bibendum elementum justo. Duis posuere. Fusce nulla odio, posuere eget, condimentum nec, venenatis eu, elit. In hac habitasse platea dictumst. Aenean ac sem in enim imperdiet feugiat. Integer tincidunt lectus at elit. Integer magna lacus, vehicula quis, eleifend eget, suscipit vitae, leo. Nunc porta augue nec enim. Curabitur vehicula volutpat enim. Aliquam consequat. Vestibulum rhoncus tellus vitae erat. Integer est. Quisque fermentum leo nec odio. Suspendisse lobortis sollicitudin augue. Nullam urna mi, suscipit eu, sagittis laoreet, ultrices ac, sem. Aliquam enim tortor, hendrerit non, cursus a, tristique sit amet, sapien. Suspendisse potenti. Aenean semper placerat neque.';
281
-        switch($type)
281
+        switch ($type)
282 282
         {
283 283
          case 'description':
284
-            $descriptions = explode(".",$dummy_text);
285
-            return $descriptions[rand(0,count($descriptions)-1)];
284
+            $descriptions = explode(".", $dummy_text);
285
+            return $descriptions[rand(0, count($descriptions) - 1)];
286 286
             break;
287 287
          case 'title':
288
-            $dummy_text = str_replace(array("\n",'.',',',"\t"),array(' ','','',' '),$dummy_text);
289
-            $titles = explode(" ",$dummy_text);
290
-            return trim($titles[rand(0,count($titles)-1)]);
288
+            $dummy_text = str_replace(array("\n", '.', ',', "\t"), array(' ', '', '', ' '), $dummy_text);
289
+            $titles = explode(" ", $dummy_text);
290
+            return trim($titles[rand(0, count($titles) - 1)]);
291 291
             break;
292 292
          case 'text':
293
-            $texts = explode("\n",$dummy_text);
294
-            return $texts[rand(0,count($texts)-1)];
293
+            $texts = explode("\n", $dummy_text);
294
+            return $texts[rand(0, count($texts) - 1)];
295 295
             break;
296 296
         }
297 297
     }
Please login to merge, or discard this patch.
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/LinkCategory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@
 block discarded – undo
29 29
      * @param string $title
30 30
      * @param string $description
31 31
      */
32
-    public function __construct($id,$title,$description,$display_order)
32
+    public 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;
Please login to merge, or discard this patch.
main/coursecopy/copy_course_session.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -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
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
     //destination
110 110
     $html .= '<div class="form-group">';
111
-    $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>';
111
+    $html .= '<label class="col-sm-2 control-label">'.get_lang('DestinationCoursesFromSession').': </label>';
112 112
     $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">';
113 113
     $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">';
114 114
     $html .= '<option value = "0">'.get_lang('ThereIsNotStillASession').'</option></select ></div>';
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     $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>';
131 131
 
132 132
     // Add Security token
133
-    $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">';
133
+    $html .= '<input type="hidden" value="'.Security::get_token().'" name="sec_token">';
134 134
     $html .= '</div></div>';
135 135
     $html .= '</form>';
136 136
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 /* HTML head extra */
229 229
 
230
-$htmlHeadXtra[] = $xajax->getJavascript( api_get_path(WEB_LIBRARY_PATH).'xajax/');
230
+$htmlHeadXtra[] = $xajax->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax/');
231 231
 $htmlHeadXtra[] = '<script type="text/javascript">
232 232
 function checkSelected(id_select,id_radio,id_title,id_destination) {
233 233
    var num=0;
@@ -297,22 +297,22 @@  discard block
 block discarded – undo
297 297
         display_form();
298 298
     } else {
299 299
 
300
-        $arr_course_origin 		= array();
300
+        $arr_course_origin = array();
301 301
         $arr_course_destination = array();
302
-        $destination_session 	= '';
303
-        $origin_session 		= '';
302
+        $destination_session = '';
303
+        $origin_session = '';
304 304
 
305 305
         if (isset($_POST['SessionCoursesListOrigin'])) {
306
-            $arr_course_origin 		= $_POST['SessionCoursesListOrigin'];
306
+            $arr_course_origin = $_POST['SessionCoursesListOrigin'];
307 307
         }
308 308
         if (isset($_POST['SessionCoursesListDestination'])) {
309 309
             $arr_course_destination = $_POST['SessionCoursesListDestination'];
310 310
         }
311 311
         if (isset($_POST['sessions_list_destination'])) {
312
-            $destination_session 	= $_POST['sessions_list_destination'];
312
+            $destination_session = $_POST['sessions_list_destination'];
313 313
         }
314 314
         if (isset($_POST['sessions_list_origin'])) {
315
-            $origin_session 		= $_POST['sessions_list_origin'];
315
+            $origin_session = $_POST['sessions_list_origin'];
316 316
         }
317 317
 
318 318
         if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) {
@@ -352,22 +352,22 @@  discard block
 block discarded – undo
352 352
         Display::display_normal_message(get_lang('ToExportDocumentsWithGlossaryYouHaveToSelectGlossary'));
353 353
     }
354 354
 
355
-    $arr_course_origin 		= array();
355
+    $arr_course_origin = array();
356 356
     $arr_course_destination = array();
357
-    $destination_session 	= '';
358
-    $origin_session 		= '';
357
+    $destination_session = '';
358
+    $origin_session = '';
359 359
 
360 360
     if (isset($_POST['SessionCoursesListOrigin'])) {
361
-        $arr_course_origin 		= $_POST['SessionCoursesListOrigin'];
361
+        $arr_course_origin = $_POST['SessionCoursesListOrigin'];
362 362
     }
363 363
     if (isset($_POST['SessionCoursesListDestination'])) {
364 364
         $arr_course_destination = $_POST['SessionCoursesListDestination'];
365 365
     }
366 366
     if (isset($_POST['sessions_list_destination'])) {
367
-        $destination_session 	= $_POST['sessions_list_destination'];
367
+        $destination_session = $_POST['sessions_list_destination'];
368 368
     }
369 369
     if (isset($_POST['sessions_list_origin'])) {
370
-        $origin_session 		= $_POST['sessions_list_origin'];
370
+        $origin_session = $_POST['sessions_list_origin'];
371 371
     }
372 372
 
373 373
     if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) {
@@ -376,10 +376,10 @@  discard block
 block discarded – undo
376 376
         $cb = new CourseBuilder('', $course_origin);
377 377
         $course = $cb->build($origin_session, $arr_course_origin[0], $with_base_content);
378 378
         //$hiddenFields['same_file_name_option'] = $_POST['same_file_name_option'];
379
-        $hiddenFields['destination_course'] 	= $arr_course_destination[0];
380
-        $hiddenFields['origin_course'] 		= $arr_course_origin[0];
381
-        $hiddenFields['destination_session'] 	= $destination_session;
382
-        $hiddenFields['origin_session'] 		= $origin_session;
379
+        $hiddenFields['destination_course'] = $arr_course_destination[0];
380
+        $hiddenFields['origin_course'] = $arr_course_origin[0];
381
+        $hiddenFields['destination_session'] = $destination_session;
382
+        $hiddenFields['origin_session'] = $origin_session;
383 383
         // Add token to Course select form
384 384
         $hiddenFields['sec_token'] = Security::get_token();
385 385
 
Please login to merge, or discard this patch.
main/coursecopy/copy_course_session_selected.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
 $this_section = SECTION_COURSES;
49 49
 $nameTools = get_lang('CopyCourse');
50
-$returnLink = api_get_path(WEB_CODE_PATH) . 'course_info/maintenance_coach.php?' . api_get_cidreq();
50
+$returnLink = api_get_path(WEB_CODE_PATH).'course_info/maintenance_coach.php?'.api_get_cidreq();
51 51
 $interbreadcrumb[] = array(
52 52
     'url' => $returnLink,
53 53
     'name' => get_lang('Maintenance')
@@ -73,29 +73,29 @@  discard block
 block discarded – undo
73 73
     $attrs = '';
74 74
     if (count($attr) > 0) {
75 75
         foreach ($attr as $key => $value) {
76
-            $attrs .= ' ' . $key . '="' . $value . '"';
76
+            $attrs .= ' '.$key.'="'.$value.'"';
77 77
         }
78 78
     }
79
-    $output = '<select name="' . $name . '" ' . $attrs . '>';
79
+    $output = '<select name="'.$name.'" '.$attrs.'>';
80 80
 
81 81
     if (count($sessions) == 0) {
82
-        $output .= '<option value = "0">' . get_lang(
82
+        $output .= '<option value = "0">'.get_lang(
83 83
                 'ThereIsNotStillASession'
84
-            ) . '</option>';
84
+            ).'</option>';
85 85
     } else {
86
-        $output .= '<option value = "0">' . get_lang(
86
+        $output .= '<option value = "0">'.get_lang(
87 87
                 'SelectASession'
88
-            ) . '</option>';
88
+            ).'</option>';
89 89
     }
90 90
 
91 91
     if (is_array($sessions)) {
92 92
         foreach ($sessions as $session) {
93 93
             $category_name = '';
94 94
             if (!empty($session['category_name'])) {
95
-                $category_name = ' (' . $session['category_name'] . ')';
95
+                $category_name = ' ('.$session['category_name'].')';
96 96
             }
97 97
 
98
-            $output .= '<option value="' . $session['id'] . '">' . $session['name'] . ' ' . $category_name . '</option>';
98
+            $output .= '<option value="'.$session['id'].'">'.$session['name'].' '.$category_name.'</option>';
99 99
         }
100 100
     }
101 101
     $output .= '</select>';
@@ -120,43 +120,43 @@  discard block
 block discarded – undo
120 120
     // Actions
121 121
     $html .= '<div class="actions">';
122 122
     // Link back to the documents overview
123
-    $html .= '<a href="' . $returnLink . '">' . Display::return_icon(
124
-            'back.png', get_lang('BackTo') . ' ' . get_lang('Maintenance'), '', ICON_SIZE_MEDIUM
125
-        ) . '</a>';
123
+    $html .= '<a href="'.$returnLink.'">'.Display::return_icon(
124
+            'back.png', get_lang('BackTo').' '.get_lang('Maintenance'), '', ICON_SIZE_MEDIUM
125
+        ).'</a>';
126 126
     $html .= '</div>';
127 127
 
128 128
     $html .= Display::return_message(
129 129
             get_lang('CopyCourseFromSessionToSessionExplanation')
130 130
     );
131 131
 
132
-    $html .= '<form name="formulaire" method="post" action="' . api_get_self(
133
-        ) . '?' . api_get_cidreq() . '" >';
132
+    $html .= '<form name="formulaire" method="post" action="'.api_get_self(
133
+        ).'?'.api_get_cidreq().'" >';
134 134
     $html .= '<table border="0" cellpadding="5" cellspacing="0" width="100%">';
135 135
 
136 136
     // Source
137
-    $html .= '<tr><td width="15%"><b>' . get_lang(
137
+    $html .= '<tr><td width="15%"><b>'.get_lang(
138 138
             'OriginCoursesFromSession'
139
-        ) . ':</b></td>';
140
-    $html .= '<td width="10%" align="left">' . api_get_session_name(
139
+        ).':</b></td>';
140
+    $html .= '<td width="10%" align="left">'.api_get_session_name(
141 141
             $sessionId
142
-        ) . '</td>';
142
+        ).'</td>';
143 143
     $html .= '<td width="50%">';
144
-    $html .= "{$courseInfo['title']} ({$courseInfo['code']})" . '</td></tr>';
144
+    $html .= "{$courseInfo['title']} ({$courseInfo['code']})".'</td></tr>';
145 145
 
146 146
     // Destination
147
-    $html .= '<tr><td width="15%"><b>' . get_lang(
147
+    $html .= '<tr><td width="15%"><b>'.get_lang(
148 148
             'DestinationCoursesFromSession'
149
-        ) . ':</b></td>';
149
+        ).':</b></td>';
150 150
     $html .= '<td width="10%" align="left"><div id="ajax_sessions_list_destination">';
151 151
     $html .= '<select name="sessions_list_destination" onchange="javascript: xajax_searchCourses(this.value,\'destination\');">';
152 152
     if (empty($sessions)) {
153
-        $html .= '<option value = "0">' . get_lang(
153
+        $html .= '<option value = "0">'.get_lang(
154 154
                 'ThereIsNotStillASession'
155
-            ) . '</option>';
155
+            ).'</option>';
156 156
     } else {
157
-        $html .= '<option value = "0">' . get_lang(
157
+        $html .= '<option value = "0">'.get_lang(
158 158
                 'SelectASession'
159
-            ) . '</option>';
159
+            ).'</option>';
160 160
         foreach ($sessions as $session) {
161 161
             if ($session['id'] == $sessionId) {
162 162
                 continue;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                 continue;
167 167
             }
168 168
 
169
-            $html .= '<option value="' . $session['id'] . '">' . $session['name'] . '</option>';
169
+            $html .= '<option value="'.$session['id'].'">'.$session['name'].'</option>';
170 170
         }
171 171
     }
172 172
 
@@ -178,17 +178,17 @@  discard block
 block discarded – undo
178 178
     $html .= '</tr></table>';
179 179
 
180 180
     $html .= "<fieldset>";
181
-    $html .= '<legend>' . get_lang('TypeOfCopy') . ' <small>(' . get_lang('CopyOnlySessionItems') . ')</small></legend>';
181
+    $html .= '<legend>'.get_lang('TypeOfCopy').' <small>('.get_lang('CopyOnlySessionItems').')</small></legend>';
182 182
     $html .= '<label class="radio"><input type="radio" id="copy_option_1" name="copy_option" value="full_copy" checked="checked"/>';
183
-    $html .= get_lang('FullCopy') . '</label>';
183
+    $html .= get_lang('FullCopy').'</label>';
184 184
     $html .= '<label class="radio"><input type="radio" id="copy_option_2" name="copy_option" value="select_items"/>';
185
-    $html .= ' ' . get_lang('LetMeSelectItems') . '</label><br/>';
185
+    $html .= ' '.get_lang('LetMeSelectItems').'</label><br/>';
186 186
 
187 187
     $html .= "</fieldset>";
188 188
 
189
-    $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm(' . "'" . addslashes(
189
+    $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes(
190 190
             api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)
191
-        ) . "'" . ')) return false;">' . get_lang('CopyCourse') . '</button>';
191
+        )."'".')) return false;">'.get_lang('CopyCourse').'</button>';
192 192
     $html .= '</form>';
193 193
     echo $html;
194 194
 }
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 
215 215
             $courseTitle = str_replace("'", "\'", $course['title']);
216 216
 
217
-            $return .= '<option value="' . $course['code'] . '" title="' . @htmlspecialchars(
218
-                    $course['title'] . ' (' . $course['visual_code'] . ')', ENT_QUOTES, api_get_system_encoding()
219
-                ) . '">' .
220
-                $course['title'] . ' (' . $course['visual_code'] . ')</option>';
217
+            $return .= '<option value="'.$course['code'].'" title="'.@htmlspecialchars(
218
+                    $course['title'].' ('.$course['visual_code'].')', ENT_QUOTES, api_get_system_encoding()
219
+                ).'">'.
220
+                $course['title'].' ('.$course['visual_code'].')</option>';
221 221
         }
222 222
         $return .= '</select>';
223 223
         $_SESSION['course_list_destination'] = $course_list_destination;
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 /* HTML head extra */
236 236
 
237 237
 $htmlHeadXtra[] = $xajax->getJavascript(
238
-    api_get_path(WEB_LIBRARY_PATH) . 'xajax/'
238
+    api_get_path(WEB_LIBRARY_PATH).'xajax/'
239 239
 );
240 240
 $htmlHeadXtra[] = '<script>
241 241
 	function checkSelected(id_select,id_radio,id_title,id_destination) {
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 
381 381
         CourseSelectForm :: display_form($course, $hiddenFields, true);
382 382
 
383
-        echo '<div style="float:right"><a href="javascript:window.history.go(-1);">' .
383
+        echo '<div style="float:right"><a href="javascript:window.history.go(-1);">'.
384 384
             Display::return_icon(
385 385
                 'back.png',
386 386
                 get_lang('Back').' '.get_lang('To').' '.get_lang(
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                 ),
389 389
                 array('style' => 'vertical-align:middle')
390 390
             ).
391
-            get_lang('Back') . '</a></div>';
391
+            get_lang('Back').'</a></div>';
392 392
     } else {
393 393
         Display::display_error_message(
394 394
             get_lang('You must select a course from original session and select a destination session')
Please login to merge, or discard this patch.
main/inc/local.inc.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
             // is necessary verify check
218 218
             if ($legal_type == 1) {
219
-                if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) {
219
+                if ((isset($_POST['legal_accept']) && $_POST['legal_accept'] == '1')) {
220 220
                     $legal_option = true;
221 221
                 } else {
222 222
                     $legal_option = false;
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
                  * Process external authentication
519 519
                  * on the basis of the given login name
520 520
                  */
521
-                $loginFailed = true;  // Default initialisation. It could
521
+                $loginFailed = true; // Default initialisation. It could
522 522
                 // change after the external authentication
523 523
                 $key = $uData['auth_source']; //'ldap','shibboleth'...
524 524
                 /* >>>>>>>> External authentication modules <<<<<<<<< */
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
             }
538 538
         } else {
539 539
             // login failed, Database::num_rows($result) <= 0
540
-            $loginFailed = true;  // Default initialisation. It could
540
+            $loginFailed = true; // Default initialisation. It could
541 541
             // change after the external authentication
542 542
 
543 543
             /*
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
                         include_once($thisAuthSource['newUser']);
564 564
                     } else {
565 565
                         error_log(
566
-                            'Chamilo Authentication external file' .
566
+                            'Chamilo Authentication external file'.
567 567
                             ' could not be found - this might prevent your system from using'.
568 568
                             ' the authentication process in the user creation process',
569 569
                             0
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
             online_logout(null, false);
673 673
             $osso->logout(); //redirects and exits
674 674
         }
675
-    } elseif (api_get_setting('openid_authentication')=='true') {
675
+    } elseif (api_get_setting('openid_authentication') == 'true') {
676 676
         if (!empty($_POST['openid_url'])) {
677 677
             include api_get_path(SYS_CODE_PATH).'auth/openid/login.php';
678 678
             openid_begin(trim($_POST['openid_url']), api_get_path(WEB_PATH).'index.php');
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
             if ($res['status'] == 'success') {
686 686
                 $id1 = Database::escape_string($res['openid.identity']);
687 687
                 //have another id with or without the final '/'
688
-                $id2 = (substr($id1, -1, 1)=='/'?substr($id1, 0, -1):$id1.'/');
688
+                $id2 = (substr($id1, -1, 1) == '/' ? substr($id1, 0, -1) : $id1.'/');
689 689
                 //lookup the user in the main database
690 690
                 $user_table = Database::get_main_table(TABLE_MAIN_USER);
691 691
                 $sql = "SELECT user_id, username, password, auth_source, active, expiration_date
@@ -694,14 +694,14 @@  discard block
 block discarded – undo
694 694
                         OR openid = '$id2' ";
695 695
                 $result = Database::query($sql);
696 696
                 if ($result !== false) {
697
-                    if (Database::num_rows($result)>0) {
697
+                    if (Database::num_rows($result) > 0) {
698 698
                         $uData = Database::fetch_array($result);
699 699
 
700 700
                         if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {
701 701
                             //the authentification of this user is managed by Chamilo itself
702 702
 
703 703
                             // check if the account is active (not locked)
704
-                            if ($uData['active']=='1') {
704
+                            if ($uData['active'] == '1') {
705 705
                                 // check if the expiration date has not been reached
706 706
                                 if ($uData['expiration_date'] > date('Y-m-d H:i:s')
707 707
                                     || empty($uData['expiration_date'])
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
     (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))
781 781
 ) {
782 782
     $cidReset = true;
783
-    $gidReset = true;    // As groups depend from courses, group id is reset
783
+    $gidReset = true; // As groups depend from courses, group id is reset
784 784
 }
785 785
 
786 786
 /* USER INIT */
@@ -930,8 +930,8 @@  discard block
 block discarded – undo
930 930
             $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
931 931
 
932 932
             if (!empty($_GET['id_session'])) {
933
-                $sql = 'SELECT name FROM '.$tbl_session . '
934
-                        WHERE id="'.intval($_GET['id_session']) . '"';
933
+                $sql = 'SELECT name FROM '.$tbl_session.'
934
+                        WHERE id="'.intval($_GET['id_session']).'"';
935 935
                 $rs = Database::query($sql);
936 936
                 if (Database::num_rows($rs)) {
937 937
                     list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
         // Moreover, if we want to track a course with another session it can be usefull
1020 1020
         if (!empty($_GET['id_session']) && is_numeric($_GET['id_session'])) {
1021 1021
             $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
1022
-            $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"';
1022
+            $sql = 'SELECT name FROM '.$tbl_session.' WHERE id="'.intval($_GET['id_session']).'"';
1023 1023
             $rs = Database::query($sql);
1024 1024
             if (Database::num_rows($rs)) {
1025 1025
                 list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
                     }
1145 1145
                 }
1146 1146
                 $url = api_get_path(WEB_CODE_PATH).'auth/inscription.php';
1147
-                header("Location:". $url);
1147
+                header("Location:".$url);
1148 1148
                 exit;
1149 1149
             }
1150 1150
         }
@@ -1165,8 +1165,8 @@  discard block
 block discarded – undo
1165 1165
         if (Database::num_rows($result) > 0) { // this  user have a recorded state for this course
1166 1166
             $cuData = Database::fetch_array($result, 'ASSOC');
1167 1167
 
1168
-            $is_courseAdmin = (bool)($cuData['status'] == 1);
1169
-            $is_courseTutor = (bool)($cuData['is_tutor'] == 1);
1168
+            $is_courseAdmin = (bool) ($cuData['status'] == 1);
1169
+            $is_courseTutor = (bool) ($cuData['is_tutor'] == 1);
1170 1170
             $is_courseMember = true;
1171 1171
         }
1172 1172
 
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
                 // This user has no status related to this course
1178 1178
                 // The user is subscribed in a session? The user is a Session coach a Session admin ?
1179 1179
 
1180
-                $tbl_session  = Database :: get_main_table(TABLE_MAIN_SESSION);
1180
+                $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
1181 1181
                 $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
1182 1182
                 $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
1183 1183
 
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
 
1291 1291
             //If I'm the admin platform i'm a teacher of the course
1292 1292
             if ($is_platformAdmin) {
1293
-                $is_courseAdmin     = true;
1293
+                $is_courseAdmin = true;
1294 1294
             }
1295 1295
         }
1296 1296
     } else { // keys missing => not anymore in the course - user relation
@@ -1448,12 +1448,12 @@  discard block
 block discarded – undo
1448 1448
     ($logging_in && exist_firstpage_parameter())
1449 1449
 ) {
1450 1450
     $redirectCourseDir = api_get_firstpage_parameter();
1451
-    api_delete_firstpage_parameter();    // delete the cookie
1451
+    api_delete_firstpage_parameter(); // delete the cookie
1452 1452
 
1453 1453
     if (!isset($_SESSION['request_uri'])) {
1454 1454
         if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1455 1455
             $_SESSION['noredirection'] = false;
1456
-            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1456
+            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1457 1457
         }
1458 1458
     }
1459 1459
 } elseif (api_user_is_login() && exist_firstpage_parameter()) {
@@ -1461,7 +1461,7 @@  discard block
 block discarded – undo
1461 1461
     api_delete_firstpage_parameter(); // delete the cookie
1462 1462
     if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1463 1463
         $_SESSION['noredirection'] = false;
1464
-        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1464
+        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1465 1465
     }
1466 1466
 }
1467 1467
 
Please login to merge, or discard this patch.
main/survey/create_new_survey.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 $form = new FormValidator(
101 101
     'survey',
102 102
     'post',
103
-    api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&survey_id='.$survey_id. '&' . api_get_cidreq()
103
+    api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&survey_id='.$survey_id.'&'.api_get_cidreq()
104 104
 );
105 105
 
106 106
 $form->addElement('header', $tool_name);
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             foreach ($field_list as $key => & $field) {
217 217
                 if ($field['visibility'] == 1) {
218 218
                     $form->addElement('checkbox', 'profile_'.$key, ' ', '&nbsp;&nbsp;'.$field['name']);
219
-                    $input_name_list.= 'profile_'.$key.',';
219
+                    $input_name_list .= 'profile_'.$key.',';
220 220
                 }
221 221
             }
222 222
 
Please login to merge, or discard this patch.
src/Chamilo/CourseBundle/Component/CourseCopy/Course.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@
 block discarded – undo
40 40
             if (is_array($resources)) {
41 41
                 foreach ($resources as $resource) {
42 42
                     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
                         }
Please login to merge, or discard this patch.