Completed
Push — 1.11.x ( d00fca...f1f062 )
by José
28:05
created
src/Chamilo/CourseBundle/Component/CourseCopy/CourseRecycler.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
     }
620 620
 
621 621
     /**
622
-    * Recycle Thematics
623
-    */
622
+     * Recycle Thematics
623
+     */
624 624
     public function recycle_thematic($session_id = 0)
625 625
     {
626 626
         if ($this->course->has_resources(RESOURCE_THEMATIC)) {
@@ -685,8 +685,8 @@  discard block
 block discarded – undo
685 685
     }
686 686
 
687 687
     /**
688
-    * Recycle Attendances
689
-    */
688
+     * Recycle Attendances
689
+     */
690 690
     public function recycle_attendance($session_id = 0)
691 691
     {
692 692
         if ($this->course->has_resources(RESOURCE_ATTENDANCE)) {
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      * course
38 38
      * @param string $backupType 'full_backup' or 'select_items'
39 39
      *
40
-     * @return bool
40
+     * @return false|null
41 41
      *
42 42
      * @assert (null) === false
43 43
      */
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     public function recycle_glossary()
157 157
     {
158 158
         if ($this->course->has_resources(RESOURCE_GLOSSARY)) {
159
-            $table_glossary	= Database::get_course_table(TABLE_GLOSSARY);
159
+            $table_glossary = Database::get_course_table(TABLE_GLOSSARY);
160 160
             $ids = implode(',', array_filter(array_keys($this->course->resources[RESOURCE_GLOSSARY])));
161 161
             if (!empty($ids)) {
162 162
                 $sql = "DELETE FROM ".$table_glossary."
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
                     if (trim($learnpath->path) != '') {
555 555
                         // when $learnpath->path value is incorrect for some reason.
556 556
                         // The directory trat contains files of the SCORM package is to be deleted.
557
-                        $scorm_package_dir = realpath($this->course->path . 'scorm/' . $learnpath->path);
557
+                        $scorm_package_dir = realpath($this->course->path.'scorm/'.$learnpath->path);
558 558
                         rmdirr($scorm_package_dir);
559 559
                     }
560 560
                 }
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
             $resources = $this->course->resources;
630 630
             foreach ($resources[RESOURCE_THEMATIC] as $last_id => $thematic) {
631 631
                 if (is_numeric($last_id)) {
632
-                    foreach($thematic->thematic_advance_list as $thematic_advance) {
632
+                    foreach ($thematic->thematic_advance_list as $thematic_advance) {
633 633
                         $cond = array(
634 634
                             'id = ? AND  c_id = ?' => array(
635 635
                                 $thematic_advance['id'],
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                         Database::delete($table_thematic_advance, $cond);
647 647
                     }
648 648
 
649
-                    foreach($thematic->thematic_plan_list as $thematic_plan) {
649
+                    foreach ($thematic->thematic_plan_list as $thematic_plan) {
650 650
                         $cond = array(
651 651
                             'id = ? AND  c_id = ?' => array(
652 652
                                 $thematic_plan['id'],
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
                         'ThematicDeleted',
676 676
                         api_get_user_id()
677 677
                     );
678
-                    Database::delete($table_thematic,$cond);
678
+                    Database::delete($table_thematic, $cond);
679 679
                 }
680 680
             }
681 681
         }
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
             $resources = $this->course->resources;
694 694
             foreach ($resources[RESOURCE_ATTENDANCE] as $last_id => $obj) {
695 695
                 if (is_numeric($last_id)) {
696
-                    foreach($obj->attendance_calendar as $attendance_calendar) {
696
+                    foreach ($obj->attendance_calendar as $attendance_calendar) {
697 697
                         $cond = array('id = ? AND c_id = ? '=>array($attendance_calendar['id'], $this->course_id));
698 698
                         Database::delete($table_attendance_calendar, $cond);
699 699
                     }
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
     public function recycle_work($session_id = 0)
718 718
     {
719 719
         if ($this->course->has_resources(RESOURCE_WORK)) {
720
-            $table_work          = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
720
+            $table_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
721 721
             $table_work_assignment = Database :: get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
722 722
 
723 723
             $resources = $this->course->resources;
Please login to merge, or discard this patch.
src/Chamilo/CourseBundle/Component/CourseCopy/Course.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -326,9 +326,9 @@  discard block
 block discarded – undo
326 326
     }
327 327
 
328 328
     /**
329
-    * Serialize the course with the best serializer available
330
-    * @return string
331
-    */
329
+     * Serialize the course with the best serializer available
330
+     * @return string
331
+     */
332 332
     public static function serialize($course)
333 333
     {
334 334
         if (extension_loaded('igbinary')) {
@@ -339,9 +339,9 @@  discard block
 block discarded – undo
339 339
     }
340 340
 
341 341
     /**
342
-    * Unserialize the course with the best serializer available
343
-    * @param string $course
344
-    */
342
+     * Unserialize the course with the best serializer available
343
+     * @param string $course
344
+     */
345 345
     public static function unserialize($course)
346 346
     {
347 347
         if (extension_loaded('igbinary')) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 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.
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Glossary.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@
 block discarded – undo
22 22
      * @param string $description
23 23
      * @param int $display_order
24 24
      */
25
-    public function __construct($id,$name,$description,$display_order)
25
+    public function __construct($id, $name, $description, $display_order)
26 26
     {
27
-        parent::__construct($id,RESOURCE_GLOSSARY);
27
+        parent::__construct($id, RESOURCE_GLOSSARY);
28 28
         $this->glossary_id = $id;
29 29
         $this->name = $name;
30 30
         $this->description = $description;
Please login to merge, or discard this patch.
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/ForumPost.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.
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CalendarEvent.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -66,19 +66,19 @@
 block discarded – undo
66 66
         $attachment_comment = null,
67 67
         $all_day = 0
68 68
     ) {
69
-		parent::__construct($id, RESOURCE_EVENT);
69
+        parent::__construct($id, RESOURCE_EVENT);
70 70
 
71
-		$this->title = $title;
72
-		$this->content = $content;
73
-		$this->start_date = $start_date;
74
-		$this->end_date = $end_date;
75
-		$this->all_day = $all_day;
71
+        $this->title = $title;
72
+        $this->content = $content;
73
+        $this->start_date = $start_date;
74
+        $this->end_date = $end_date;
75
+        $this->all_day = $all_day;
76 76
 
77
-		$this->attachment_path = $attachment_path;
78
-		$this->attachment_filename = $attachment_filename;
79
-		$this->attachment_size = $attachment_size;
80
-		$this->attachment_comment = $attachment_comment;
81
-	}
77
+        $this->attachment_path = $attachment_path;
78
+        $this->attachment_filename = $attachment_filename;
79
+        $this->attachment_size = $attachment_size;
80
+        $this->attachment_comment = $attachment_comment;
81
+    }
82 82
 
83 83
     /**
84 84
      * Show this Event
Please login to merge, or discard this patch.
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseSession.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      * @param int $id
19 19
      * @param string $title
20 20
      */
21
-    public function __construct($id,$title)
21
+    public function __construct($id, $title)
22 22
     {
23 23
         parent::__construct($id, RESOURCE_SESSION_COURSE);
24 24
         $this->title = $title;
Please login to merge, or discard this patch.
Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php 2 patches
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -84,120 +84,120 @@
 block discarded – undo
84 84
      */
85 85
     public $author;
86 86
 
87
-	/**
88
-	 * Author's image
89
-	 */
90
-	public $preview_image;
87
+    /**
88
+     * Author's image
89
+     */
90
+    public $preview_image;
91 91
 
92
-	/**
93
-	 * Create a new learnpath
94
-	 * @param integer ID
95
-	 * @param integer Type (1,2,3,...)
96
-	 * @param string $name
97
-	 * @param string $path
98
-	 * @param string $ref
99
-	 * @param string $description
100
-	 * @param string $content_local
101
-	 * @param string $default_encoding
102
-	 * @param string $default_view_mode
103
-	 * @param bool   $prevent_reinit
104
-	 * @param bool   $force_commit
105
-	 * @param string $content_maker
106
-	 * @param integer $display_order
107
-	 * @param string $js_lib
108
-	 * @param string $content_license
109
-	 * @param integer $debug
110
-	 * @param string $visibility
111
-	 * @param array  $items
112
-	 */
113
-	public function __construct(
114
-		$id,
115
-		$type,
116
-		$name,
117
-		$path,
118
-		$ref,
119
-		$description,
120
-		$content_local,
121
-		$default_encoding,
122
-		$default_view_mode,
123
-		$prevent_reinit,
124
-		$force_commit,
125
-		$content_maker,
126
-		$display_order,
127
-		$js_lib,
128
-		$content_license,
129
-		$debug,
130
-		$visibility,
131
-		$author,
132
-		$preview_image,
133
-		$use_max_score,
134
-		$autolaunch,
135
-		$created_on,
136
-		$modified_on,
137
-		$publicated_on,
138
-		$expired_on,
139
-		$session_id,
140
-		$items
141
-	) {
142
-		parent::__construct($id, RESOURCE_LEARNPATH);
143
-		$this->lp_type = $type;
144
-		$this->name = $name;
145
-		$this->path = $path;
146
-		$this->ref = $ref;
147
-		$this->description = $description;
148
-		$this->content_local = $content_local;
149
-		$this->default_encoding = $default_encoding;
150
-		$this->default_view_mod = $default_view_mode;
151
-		$this->prevent_reinit = $prevent_reinit;
152
-		$this->force_commit = $force_commit;
153
-		$this->content_maker = $content_maker;
154
-		$this->display_order = $display_order;
155
-		$this->js_lib = $js_lib;
156
-		$this->content_license = $content_license;
157
-		$this->debug = $debug;
158
-		$this->visibility=$visibility;
92
+    /**
93
+     * Create a new learnpath
94
+     * @param integer ID
95
+     * @param integer Type (1,2,3,...)
96
+     * @param string $name
97
+     * @param string $path
98
+     * @param string $ref
99
+     * @param string $description
100
+     * @param string $content_local
101
+     * @param string $default_encoding
102
+     * @param string $default_view_mode
103
+     * @param bool   $prevent_reinit
104
+     * @param bool   $force_commit
105
+     * @param string $content_maker
106
+     * @param integer $display_order
107
+     * @param string $js_lib
108
+     * @param string $content_license
109
+     * @param integer $debug
110
+     * @param string $visibility
111
+     * @param array  $items
112
+     */
113
+    public function __construct(
114
+        $id,
115
+        $type,
116
+        $name,
117
+        $path,
118
+        $ref,
119
+        $description,
120
+        $content_local,
121
+        $default_encoding,
122
+        $default_view_mode,
123
+        $prevent_reinit,
124
+        $force_commit,
125
+        $content_maker,
126
+        $display_order,
127
+        $js_lib,
128
+        $content_license,
129
+        $debug,
130
+        $visibility,
131
+        $author,
132
+        $preview_image,
133
+        $use_max_score,
134
+        $autolaunch,
135
+        $created_on,
136
+        $modified_on,
137
+        $publicated_on,
138
+        $expired_on,
139
+        $session_id,
140
+        $items
141
+    ) {
142
+        parent::__construct($id, RESOURCE_LEARNPATH);
143
+        $this->lp_type = $type;
144
+        $this->name = $name;
145
+        $this->path = $path;
146
+        $this->ref = $ref;
147
+        $this->description = $description;
148
+        $this->content_local = $content_local;
149
+        $this->default_encoding = $default_encoding;
150
+        $this->default_view_mod = $default_view_mode;
151
+        $this->prevent_reinit = $prevent_reinit;
152
+        $this->force_commit = $force_commit;
153
+        $this->content_maker = $content_maker;
154
+        $this->display_order = $display_order;
155
+        $this->js_lib = $js_lib;
156
+        $this->content_license = $content_license;
157
+        $this->debug = $debug;
158
+        $this->visibility=$visibility;
159 159
 
160
-		$this->use_max_score=$use_max_score;
161
-		$this->autolaunch=$autolaunch;
162
-		$this->created_on=$created_on;
163
-		$this->modified_on=$modified_on;
164
-		$this->publicated_on=$publicated_on;
165
-		$this->expired_on=$expired_on;
166
-		$this->session_id=$session_id;
160
+        $this->use_max_score=$use_max_score;
161
+        $this->autolaunch=$autolaunch;
162
+        $this->created_on=$created_on;
163
+        $this->modified_on=$modified_on;
164
+        $this->publicated_on=$publicated_on;
165
+        $this->expired_on=$expired_on;
166
+        $this->session_id=$session_id;
167 167
 
168
-		$this->author= $author;
169
-		$this->preview_image= $preview_image;
168
+        $this->author= $author;
169
+        $this->preview_image= $preview_image;
170 170
 
171
-		$this->items = $items;
172
-	}
173
-	/**
174
-	 * Get the items
175
-	 */
176
-	function get_items()
177
-	{
178
-		return $this->items;
179
-	}
171
+        $this->items = $items;
172
+    }
173
+    /**
174
+     * Get the items
175
+     */
176
+    function get_items()
177
+    {
178
+        return $this->items;
179
+    }
180 180
 
181
-	/**
182
-	 * Check if a given resource is used as an item in this chapter
183
-	 */
184
-	function has_item($resource)
185
-	{
186
-		foreach ($this->items as $item) {
187
-			if ($item['id'] == $resource->get_id() &&
188
-				isset($item['type']) && $item['type'] == $resource->get_type()
189
-			) {
190
-				return true;
191
-			}
192
-		}
193
-		return false;
194
-	}
181
+    /**
182
+     * Check if a given resource is used as an item in this chapter
183
+     */
184
+    function has_item($resource)
185
+    {
186
+        foreach ($this->items as $item) {
187
+            if ($item['id'] == $resource->get_id() &&
188
+                isset($item['type']) && $item['type'] == $resource->get_type()
189
+            ) {
190
+                return true;
191
+            }
192
+        }
193
+        return false;
194
+    }
195 195
 
196
-	/**
197
-	 * Show this learnpath
198
-	 */
199
-	function show() {
200
-		parent::show();
201
-		echo $this->name;
202
-	}
196
+    /**
197
+     * Show this learnpath
198
+     */
199
+    function show() {
200
+        parent::show();
201
+        echo $this->name;
202
+    }
203 203
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -153,18 +153,18 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Link.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         $category_id,
47 47
         $on_homepage
48 48
     ) {
49
-        parent::__construct($id,RESOURCE_LINK);
49
+        parent::__construct($id, RESOURCE_LINK);
50 50
         $this->title = $title;
51 51
         $this->url = $url;
52 52
         $this->description = $description;
Please login to merge, or discard this patch.
src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Document.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public function __construct($id, $path, $comment, $title, $file_type, $size)
29 29
     {
30 30
         parent::__construct($id, RESOURCE_DOCUMENT);
31
-        $this->path = 'document' . $path;
31
+        $this->path = 'document'.$path;
32 32
         $this->comment = $comment;
33 33
         $this->title = $title;
34 34
         $this->file_type = $file_type;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         echo preg_replace('@^document@', '', $this->path);
45 45
         if (!empty($this->title)) {
46 46
             if (strpos($this->path, $this->title) === false) {
47
-                echo " - " . $this->title;
47
+                echo " - ".$this->title;
48 48
             }
49 49
         }
50 50
     }
Please login to merge, or discard this patch.