Completed
Push — 1.10.x ( fe0e5a...3a6f9c )
by Yannick
134:15 queued 86:39
created
main/work/add_user.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
         $usersAdded[] = $myUserId;
75 75
         $userInfo = api_get_user_info($myUserId);
76 76
         $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=delete&id='.$workId.'&user_id='.$myUserId;
77
-        $link = Display::url('<em class="fa fa-trash"></em> ' . get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm'));
78
-        echo '<li class="list-group-item">' . $userInfo['complete_name_with_username'] . '<div class="pull-right">' . $link . '</div></li>';
77
+        $link = Display::url('<em class="fa fa-trash"></em> '.get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm'));
78
+        echo '<li class="list-group-item">'.$userInfo['complete_name_with_username'].'<div class="pull-right">'.$link.'</div></li>';
79 79
     }
80 80
     echo '</ul>';
81 81
 }
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
     foreach ($userToAddList as $user) {
109 109
         $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') ';
110 110
         $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=add&id='.$workId.'&user_id='.$user['user_id'];
111
-        $link = Display::url('<em class="fa fa-plus"></em> ' . get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm'));
112
-        echo '<li class="list-group-item">' . $userName . '<div class="pull-right"> ' . $link . '</div></li>';
111
+        $link = Display::url('<em class="fa fa-plus"></em> '.get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm'));
112
+        echo '<li class="list-group-item">'.$userName.'<div class="pull-right"> '.$link.'</div></li>';
113 113
     }
114 114
     echo '</ul>';
115 115
 } else {
Please login to merge, or discard this patch.
main/work/upload_from_template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use ChamiloSession as Session;
5 5
 
6 6
 require_once '../inc/global.inc.php';
7
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
7
+$current_course_tool = TOOL_STUDENTPUBLICATION;
8 8
 
9 9
 api_protect_course_script(true);
10 10
 
Please login to merge, or discard this patch.
main/coursecopy/create_backup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
     $zip_file = CourseArchiver::write_course($course);
74 74
     Display::display_confirmation_message(get_lang('BackupCreated'));
75
-    echo '<br /><a class="btn btn-primary btn-large" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive=' . $zip_file . '&' . api_get_cidreq() . '">
76
-    ' . get_lang('Download') . '</a>';
75
+    echo '<br /><a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'">
76
+    ' . get_lang('Download').'</a>';
77 77
 
78 78
 } elseif (Security::check_token('post') && (
79 79
         isset($_POST['backup_option']) &&
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     if (!$course->has_resources()) {
96 96
         echo get_lang('NoResourcesToBackup');
97 97
     } else {
98
-        $form = new FormValidator('create_backup_form', 'post', api_get_self() . '?' . api_get_cidreq());
98
+        $form = new FormValidator('create_backup_form', 'post', api_get_self().'?'.api_get_cidreq());
99 99
         $form->addElement('header', get_lang('SelectOptionForBackup'));
100 100
         $form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup');
101 101
         $form->addElement('radio', 'backup_option', '', get_lang('LetMeSelectItems'), 'select_items');
Please login to merge, or discard this patch.
main/coursecopy/copy_course.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 // Setting the global file that gets the general configuration, the databases, the languages, ...
9 9
 require_once '../inc/global.inc.php';
10
-$current_course_tool  = TOOL_COURSE_MAINTENANCE;
10
+$current_course_tool = TOOL_COURSE_MAINTENANCE;
11 11
 api_protect_course_script(true);
12 12
 
13 13
 // Including additional libraries
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $form->addGroup($group, '', get_lang('SameFilename'));
121 121
         $form->add_progress_bar();
122 122
         $form->addButtonSave(get_lang('CopyCourse'));
123
-        $form->setDefaults(array('copy_option' =>'select_items','same_file_name_option' => FILE_OVERWRITE));
123
+        $form->setDefaults(array('copy_option' =>'select_items', 'same_file_name_option' => FILE_OVERWRITE));
124 124
 
125 125
         // Add Security token
126 126
         $token = Security::get_token();
Please login to merge, or discard this patch.
main/coursecopy/classes/wiki.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		$progress,
46 46
 		$version
47 47
 	) {
48
-		parent::__construct($id,RESOURCE_WIKI);
48
+		parent::__construct($id, RESOURCE_WIKI);
49 49
         $this->id = $id;
50 50
         $this->page_id = $page_id;
51 51
         $this->reflink = $reflink;
@@ -61,6 +61,6 @@  discard block
 block discarded – undo
61 61
 	public function show()
62 62
 	{
63 63
 		parent::show();
64
-		echo $this->reflink.' ('. (empty($this->group_id) ? get_lang('Everyone') : get_lang('Group') . ' ' .  $this->group_id) .') ' . '<i>(' . $this->dtime . ')</i>';
64
+		echo $this->reflink.' ('.(empty($this->group_id) ? get_lang('Everyone') : get_lang('Group').' '.$this->group_id).') '.'<i>('.$this->dtime.')</i>';
65 65
 	}
66 66
 }
Please login to merge, or discard this patch.
main/coursecopy/classes/Announcement.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,13 +49,13 @@
 block discarded – undo
49 49
 	 */
50 50
     function __construct($id, $title, $content, $date, $display_order, $email_sent, $path, $filename, $size, $comment)
51 51
     {
52
-		parent::__construct($id,RESOURCE_ANNOUNCEMENT);
52
+		parent::__construct($id, RESOURCE_ANNOUNCEMENT);
53 53
 
54
-		$this->content	= $content;
55
-		$this->title 	= $title;
56
-		$this->date 	= $date;
57
-		$this->display_order	= $display_order;
58
-		$this->email_sent	 	= $email_sent;
54
+		$this->content = $content;
55
+		$this->title = $title;
56
+		$this->date = $date;
57
+		$this->display_order = $display_order;
58
+		$this->email_sent = $email_sent;
59 59
 
60 60
 		$this->attachment_path 	= $path;
61 61
 		$this->attachment_filename = $filename;
Please login to merge, or discard this patch.
main/coursecopy/classes/DummyCourseCreator.class.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		$this->default_property['to_user_id'] = null;
43 43
 		$this->default_property['visibility'] = '1';
44 44
 		$this->default_property['start_visible'] = '0000-00-00 00:00:00';
45
-		$this->default_property['end_visible'] =  '0000-00-00 00:00:00';
45
+		$this->default_property['end_visible'] = '0000-00-00 00:00:00';
46 46
 
47 47
 		$course = api_get_course_info($course_code);
48 48
 		$this->course = new Course();
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
 		$course = api_get_course_info();
69 69
 		$course_doc_path = $this->course->backup_path.'/document/';
70 70
 		$number_of_documents = rand(10, 30);
71
-		$extensions = array ('html', 'doc');
71
+		$extensions = array('html', 'doc');
72 72
 		$directories = array();
73 73
 		$property = $this->default_property;
74 74
 		$property['lastedit_type'] = 'DocumentAdded';
75 75
 		$property['tool'] = TOOL_DOCUMENT;
76 76
 		$doc_id = 0;
77
-		for ($doc_id = 1; $doc_id < $number_of_documents; $doc_id ++)
77
+		for ($doc_id = 1; $doc_id < $number_of_documents; $doc_id++)
78 78
 		{
79 79
 			$path = '';
80 80
 			$doc_type = rand(0, count($extensions) - 1);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			$filename = $this->get_dummy_content('title').'_'.$doc_id.'.'.$extension;
83 83
 			$content = $this->get_dummy_content('text');
84 84
 			$dirs = rand(0, 3);
85
-			for ($i = 0; $i < $dirs; $i ++)
85
+			for ($i = 0; $i < $dirs; $i++)
86 86
 			{
87 87
 				$path .= 'directory/';
88 88
 				$directories[$path] = 1;
@@ -97,14 +97,14 @@  discard block
 block discarded – undo
97 97
 			fwrite($fp, $content);
98 98
 			fclose($fp);
99 99
 			$size = filesize($file);
100
-			$document = new Document($doc_id, '/'.$path.$filename,$this->get_dummy_content('description'),$this->get_dummy_content('title'), 'file', $size);
100
+			$document = new Document($doc_id, '/'.$path.$filename, $this->get_dummy_content('description'), $this->get_dummy_content('title'), 'file', $size);
101 101
 			$document->item_properties[] = $property;
102 102
 			$this->course->add_resource($document);
103 103
 		}
104
-		foreach($directories as $path => $flag)
104
+		foreach ($directories as $path => $flag)
105 105
 		{
106
-			$path = substr($path,0,strlen($path)-1);
107
-			$document = new Document($doc_id++,'/'.$path, $this->get_dummy_content('description'),$this->get_dummy_content('title'),'folder',0);
106
+			$path = substr($path, 0, strlen($path) - 1);
107
+			$document = new Document($doc_id++, '/'.$path, $this->get_dummy_content('description'), $this->get_dummy_content('title'), 'folder', 0);
108 108
 			$property['lastedit_type'] = 'FolderCreated';
109 109
 			$document->item_properties[] = $property;
110 110
 			$this->course->add_resource($document);
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 		$property['lastedit_type'] = 'AnnouncementAdded';
120 120
 		$property['tool'] = TOOL_ANNOUNCEMENT;
121 121
 		$number_of_announcements = rand(10, 30);
122
-		for ($i = 0; $i < $number_of_announcements; $i ++)
122
+		for ($i = 0; $i < $number_of_announcements; $i++)
123 123
 		{
124 124
 			$time = mktime(rand(1, 24), rand(1, 60), 0, rand(1, 12), rand(1, 28), intval(date('Y')));
125 125
 			$date = date('Y-m-d', $time);
126
-			$announcement = new Announcement($i,$this->get_dummy_content('title'),$this->get_dummy_content('text'), $date,0);
126
+			$announcement = new Announcement($i, $this->get_dummy_content('title'), $this->get_dummy_content('text'), $date, 0);
127 127
 			$announcement->item_properties[] = $property;
128 128
 			$this->course->add_resource($announcement);
129 129
 		}
@@ -137,23 +137,23 @@  discard block
 block discarded – undo
137 137
 		$property = $this->default_property;
138 138
 		$property['lastedit_type'] = 'AgendaAdded';
139 139
 		$property['tool'] = TOOL_CALENDAR_EVENT;
140
-		for ($i = 0; $i < $number_of_events; $i ++)
140
+		for ($i = 0; $i < $number_of_events; $i++)
141 141
 		{
142
-			$hour = rand(1,24);
143
-			$minute = rand(1,60);
144
-			$second = rand(1,60);
145
-			$day = rand(1,28);
146
-			$month = rand(1,12);
142
+			$hour = rand(1, 24);
143
+			$minute = rand(1, 60);
144
+			$second = rand(1, 60);
145
+			$day = rand(1, 28);
146
+			$month = rand(1, 12);
147 147
 			$year = intval(date('Y'));
148
-			$time = mktime($hour,$minute,$second,$month,$day,$year);
148
+			$time = mktime($hour, $minute, $second, $month, $day, $year);
149 149
 			$start_date = date('Y-m-d H:m:s', $time);
150
-			$hour = rand($hour,24);
151
-			$minute = rand($minute,60);
152
-			$second = rand($second,60);
153
-			$day = rand($day,28);
154
-			$month = rand($month,12);
150
+			$hour = rand($hour, 24);
151
+			$minute = rand($minute, 60);
152
+			$second = rand($second, 60);
153
+			$day = rand($day, 28);
154
+			$month = rand($month, 12);
155 155
 			$year = intval(date('Y'));
156
-			$time = mktime($hour,$minute,$second,$month,$day,$year);
156
+			$time = mktime($hour, $minute, $second, $month, $day, $year);
157 157
 			$end_date = date('Y-m-d H:m:s', $time);
158 158
 			$event = new CalendarEvent(
159 159
 				$i,
@@ -173,20 +173,20 @@  discard block
 block discarded – undo
173 173
 	{
174 174
 		// create categorys
175 175
 		$number_of_categories = rand(5, 10);
176
-		for ($i = 0; $i < $number_of_categories; $i ++)
176
+		for ($i = 0; $i < $number_of_categories; $i++)
177 177
 		{
178
-			$linkcat = new LinkCategory($i, $this->get_dummy_content('title'), $this->get_dummy_content('description'),$i);
178
+			$linkcat = new LinkCategory($i, $this->get_dummy_content('title'), $this->get_dummy_content('description'), $i);
179 179
 			$this->course->add_resource($linkcat);
180 180
 		}
181 181
 		// create links
182 182
 		$number_of_links = rand(5, 50);
183
-		$on_homepage = rand(0,20) == 0 ? 1 : 0;
183
+		$on_homepage = rand(0, 20) == 0 ? 1 : 0;
184 184
 		$property = $this->default_property;
185 185
 		$property['lastedit_type'] = 'LinkAdded';
186 186
 		$property['tool'] = TOOL_LINK;
187
-		for ($i = 0; $i < $number_of_links; $i ++)
187
+		for ($i = 0; $i < $number_of_links; $i++)
188 188
 		{
189
-			$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);
189
+			$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);
190 190
 			$link->item_properties[] = $property;
191 191
 			$this->course->add_resource($link);
192 192
 		}
@@ -200,18 +200,18 @@  discard block
 block discarded – undo
200 200
 		$number_of_forums = rand(5, 50);
201 201
 		$number_of_topics = rand(30, 100);
202 202
 		$number_of_posts = rand(100, 1000);
203
-		$last_forum_post = array ();
204
-		$last_topic_post = array ();
203
+		$last_forum_post = array();
204
+		$last_topic_post = array();
205 205
 		// create categorys
206 206
 		$order = 1;
207
-		for ($i = 1; $i <= $number_of_categories; $i ++)
207
+		for ($i = 1; $i <= $number_of_categories; $i++)
208 208
 		{
209 209
 			$forumcat = new ForumCategory($i, $this->get_dummy_content('title'), $this->get_dummy_content('description'), $order, 0, 0);
210 210
 			$this->course->add_resource($forumcat);
211 211
 			$order++;
212 212
 		}
213 213
 		// create posts
214
-		for ($post_id = 1; $post_id <= $number_of_posts; $post_id ++)
214
+		for ($post_id = 1; $post_id <= $number_of_posts; $post_id++)
215 215
 		{
216 216
 			$topic_id = rand(1, $number_of_topics);
217 217
 			$last_topic_post[$topic_id] = $post_id;
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 			$this->course->add_resource($post);
220 220
 		}
221 221
 		// create topics
222
-		for ($topic_id = 1; $topic_id <= $number_of_topics; $topic_id ++)
222
+		for ($topic_id = 1; $topic_id <= $number_of_topics; $topic_id++)
223 223
 		{
224 224
 			$forum_id = rand(1, $number_of_forums);
225 225
 			$last_forum_post[$forum_id] = $last_topic_post[$topic_id];
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
 			$this->course->add_resource($topic);
228 228
 		}
229 229
 		// create forums
230
-		for ($forum_id = 1; $forum_id <= $number_of_forums; $forum_id ++)
230
+		for ($forum_id = 1; $forum_id <= $number_of_forums; $forum_id++)
231 231
 		{
232
-			$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]);
232
+			$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]);
233 233
 			$this->course->add_resource($forum);
234 234
 		}
235 235
 	}
@@ -238,25 +238,25 @@  discard block
 block discarded – undo
238 238
 	 */
239 239
 	function create_dummy_learnpaths()
240 240
 	{
241
-		$number_of_learnpaths = rand(3,5);
241
+		$number_of_learnpaths = rand(3, 5);
242 242
 		$global_item_id = 1;
243
-		for($i=1; $i<=$number_of_learnpaths;$i++)
243
+		for ($i = 1; $i <= $number_of_learnpaths; $i++)
244 244
 		{
245 245
 		$chapters = array();
246
-		$number_of_chapters = rand(1,6);
247
-		for($chapter_id = 1; $chapter_id <= $number_of_chapters; $chapter_id++)
246
+		$number_of_chapters = rand(1, 6);
247
+		for ($chapter_id = 1; $chapter_id <= $number_of_chapters; $chapter_id++)
248 248
 		{
249 249
 			$chapter['name'] = $this->get_dummy_content('title');
250 250
 			$chapter['description'] = $this->get_dummy_content('description');
251 251
 			$chapter['display_order'] = $chapter_id;
252 252
 			$chapter['items'] = array();
253
-			$number_of_items = rand(5,20);
254
-			for( $item_id = 1; $item_id<$number_of_items; $item_id++)
253
+			$number_of_items = rand(5, 20);
254
+			for ($item_id = 1; $item_id < $number_of_items; $item_id++)
255 255
 			{
256
-				$types = array(RESOURCE_ANNOUNCEMENT, RESOURCE_EVENT, RESOURCE_DOCUMENT,RESOURCE_LINK,RESOURCE_FORUM,RESOURCE_FORUMPOST,RESOURCE_FORUMTOPIC);
257
-				$type = $types[rand(0,count($types)-1)];
256
+				$types = array(RESOURCE_ANNOUNCEMENT, RESOURCE_EVENT, RESOURCE_DOCUMENT, RESOURCE_LINK, RESOURCE_FORUM, RESOURCE_FORUMPOST, RESOURCE_FORUMTOPIC);
257
+				$type = $types[rand(0, count($types) - 1)];
258 258
 				$resources = $this->course->resources[$type];
259
-				$resource = $resources[rand(0,count($resources)-1)];
259
+				$resource = $resources[rand(0, count($resources) - 1)];
260 260
 				$item = array();
261 261
 				$item['type'] = $resource->type;
262 262
 				$item['id'] = $resource->source_id;
@@ -264,17 +264,17 @@  discard block
 block discarded – undo
264 264
 				$item['title'] = $this->get_dummy_content('title');
265 265
 				$item['description'] = $this->get_dummy_content('description');
266 266
 				$item['ref_id'] = $global_item_id;
267
-				if( rand(0,5) == 1 && $item_id > 1)
267
+				if (rand(0, 5) == 1 && $item_id > 1)
268 268
 				{
269 269
 					$item['prereq_type'] = 'i';
270
-					$item['prereq'] = rand($global_item_id - $item_id,$global_item_id-1);
270
+					$item['prereq'] = rand($global_item_id - $item_id, $global_item_id - 1);
271 271
 				}
272 272
 				$chapter['items'][] = $item;
273 273
 				$global_item_id++;
274 274
 			}
275 275
 			$chapters[] = $chapter;
276 276
 		}
277
-		$lp = new CourseCopyLearnpath($i,$this->get_dummy_content('title'),$this->get_dummy_content('description'),1,$chapters);
277
+		$lp = new CourseCopyLearnpath($i, $this->get_dummy_content('title'), $this->get_dummy_content('description'), 1, $chapters);
278 278
 		$this->course->add_resource($lp);
279 279
 		}
280 280
 	}
@@ -288,20 +288,20 @@  discard block
 block discarded – undo
288 288
 		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.
289 289
 		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.
290 290
 		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.';
291
-		switch($type)
291
+		switch ($type)
292 292
 		{
293 293
 		 case 'description':
294
-		 	$descriptions = explode(".",$dummy_text);
295
-		 	return $descriptions[rand(0,count($descriptions)-1)];
294
+		 	$descriptions = explode(".", $dummy_text);
295
+		 	return $descriptions[rand(0, count($descriptions) - 1)];
296 296
 		 	break;
297 297
 		 case 'title':
298
-		 	$dummy_text = str_replace(array("\n",'.',',',"\t"),array(' ','','',' '),$dummy_text);
299
-		 	$titles = explode(" ",$dummy_text);
300
-		 	return trim($titles[rand(0,count($titles)-1)]);
298
+		 	$dummy_text = str_replace(array("\n", '.', ',', "\t"), array(' ', '', '', ' '), $dummy_text);
299
+		 	$titles = explode(" ", $dummy_text);
300
+		 	return trim($titles[rand(0, count($titles) - 1)]);
301 301
 		 	break;
302 302
 		 case 'text':
303
-		 	$texts = explode("\n",$dummy_text);
304
-		 	return $texts[rand(0,count($texts)-1)];
303
+		 	$texts = explode("\n", $dummy_text);
304
+		 	return $texts[rand(0, count($texts) - 1)];
305 305
 		 	break;
306 306
 		}
307 307
 	}
Please login to merge, or discard this patch.
main/coursecopy/classes/CourseCopyLearnpath.class.php 1 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.
main/coursecopy/classes/CourseBuilder.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
         $table_doc = Database:: get_course_table(TABLE_DOCUMENT);
596 596
 
597 597
         if (!empty($courseId) && !empty($session_id)) {
598
-            $session_id  = intval($session_id);
598
+            $session_id = intval($session_id);
599 599
             if ($with_base_content) {
600 600
                 $session_condition = api_get_session_condition(
601 601
                     $session_id,
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
                 'title' => get_lang('OrphanQuestions', ''),
805 805
                 'type' => 2
806 806
             );
807
-            $newQuiz = new Quiz((object)$obj);
807
+            $newQuiz = new Quiz((object) $obj);
808 808
             if (!empty($orphanQuestionIds)) {
809 809
                 foreach ($orphanQuestionIds as $index => $orphanId) {
810 810
                     $order = $index + 1;
Please login to merge, or discard this patch.