Completed
Push — 1.11.x ( 3ca1af...7f27ad )
by José
93:15 queued 54:45
created
main/group/member_settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 require_once '../inc/global.inc.php';
15 15
 $this_section = SECTION_COURSES;
16
-$current_course_tool  = TOOL_GROUP;
16
+$current_course_tool = TOOL_GROUP;
17 17
 
18 18
 // Notice for unauthorized people.
19 19
 api_protect_course_script(true);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 // Group members
163 163
 $group_member_list = GroupManager::get_subscribed_users($current_group['id']);
164 164
 
165
-$selected_users = array ();
165
+$selected_users = array();
166 166
 if (!empty($group_member_list)) {
167 167
     foreach ($group_member_list as $index => $user) {
168 168
         $selected_users[] = $user['user_id'];
Please login to merge, or discard this patch.
main/dropbox/dropbox_download.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 ON (post.file_id = file.id AND post.c_id = $course_id AND file.c_id = $course_id)
51 51
                 WHERE
52 52
                     post.cat_id = ".intval($_GET['cat_id'])." AND
53
-                    post.dest_user_id = $user_id" ;
53
+                    post.dest_user_id = $user_id";
54 54
     }
55 55
     $files_to_download = array();
56 56
     $result = Database::query($sql);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX][] = intval($_GET['id']);
97 97
 
98 98
     $work = new Dropbox_Work($_GET['id']);
99
-    $path = dropbox_cnf('sysPath') . '/' . $work -> filename; //path to file as stored on server
99
+    $path = dropbox_cnf('sysPath').'/'.$work -> filename; //path to file as stored on server
100 100
 
101 101
     if (!Security::check_abs_path($path, dropbox_cnf('sysPath').'/')) {
102 102
         exit;
Please login to merge, or discard this patch.
main/dropbox/dropbox_class.inc.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         $action = isset($_GET['action']) ? $_GET['action'] : null;
185 185
 
186 186
         // Do some sanity checks
187
-        $id	= intval($id);
187
+        $id = intval($id);
188 188
 
189 189
         // Get the data from DB
190 190
         $sql = "SELECT uploader_id, filename, filesize, title, description, author, upload_date, last_upload_date, cat_id
@@ -226,14 +226,14 @@  discard block
 block discarded – undo
226 226
                 $row_feedback['feedback'] = Security::remove_XSS($row_feedback['feedback']);
227 227
                 $feedback2[] = $row_feedback;
228 228
             }
229
-            $this->feedback2= $feedback2;
229
+            $this->feedback2 = $feedback2;
230 230
         }
231 231
 	}
232 232
 }
233 233
 
234 234
 class Dropbox_SentWork extends Dropbox_Work
235 235
 {
236
-	public $recipients;	//array of ['id']['name'] arrays
236
+	public $recipients; //array of ['id']['name'] arrays
237 237
 
238 238
 	/**
239 239
 	 * Constructor calls private functions to create a new work or retreive an existing work from DB
@@ -290,15 +290,15 @@  discard block
 block discarded – undo
290 290
 		settype($uploader_id, 'integer') or die(get_lang('GeneralError').' (code 208)'); // Set $uploader_id to correct type
291 291
 
292 292
 		$justSubmit = false;
293
-		if ( is_int($recipient_ids)) {
293
+		if (is_int($recipient_ids)) {
294 294
 			$justSubmit = true;
295 295
 			$recipient_ids = array($recipient_ids + $this->id);
296
-		} elseif ( count($recipient_ids) == 0) {
296
+		} elseif (count($recipient_ids) == 0) {
297 297
 			$justSubmit = true;
298 298
 			$recipient_ids = array($uploader_id);
299 299
 		}
300 300
 
301
-		if (! is_array($recipient_ids) || count($recipient_ids) == 0) {
301
+		if (!is_array($recipient_ids) || count($recipient_ids) == 0) {
302 302
 			die(get_lang('GeneralError').' (code 209)');
303 303
 		}
304 304
 
@@ -313,11 +313,11 @@  discard block
 block discarded – undo
313 313
         $table_person = $dropbox_cnf['tbl_person'];
314 314
         $session_id = api_get_session_id();
315 315
         $uploader_id = $this->uploader_id;
316
-        $user  = api_get_user_id();
316
+        $user = api_get_user_id();
317 317
 		// Insert data in dropbox_post and dropbox_person table for each recipient
318 318
 		foreach ($this->recipients as $rec) {
319
-            $file_id = (int)$this->id;
320
-            $user_id = (int)$rec['id'];
319
+            $file_id = (int) $this->id;
320
+            $user_id = (int) $rec['id'];
321 321
 			$sql = "INSERT INTO $table_post (c_id, file_id, dest_user_id, session_id)
322 322
                     VALUES ($course_id, $file_id, $user_id, $session_id)";
323 323
 	        Database::query($sql);
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
                 // Do not add recipient in person table if mailing zip or just upload.
335 335
                 if (!$justSubmit) {
336
-                    Database::query($sql);	// If work already exists no error is generated
336
+                    Database::query($sql); // If work already exists no error is generated
337 337
                 }
338 338
             }
339 339
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 			    $ownerid = getUserOwningThisMailing($ownerid);
343 343
 			}
344 344
 			if (($recipid = $rec["id"]) > $dropbox_cnf['mailingIdBase']) {
345
-			    $recipid = $ownerid;  // mailing file recipient = mailing id, not a person
345
+			    $recipid = $ownerid; // mailing file recipient = mailing id, not a person
346 346
 			}
347 347
             api_item_property_update(
348 348
                 $_course,
@@ -401,13 +401,13 @@  discard block
 block discarded – undo
401 401
 class Dropbox_Person
402 402
 {
403 403
 	// The receivedWork and the sentWork arrays are sorted.
404
-	public $receivedWork;	// an array of Dropbox_Work objects
405
-	public $sentWork;		// an array of Dropbox_SentWork objects
404
+	public $receivedWork; // an array of Dropbox_Work objects
405
+	public $sentWork; // an array of Dropbox_SentWork objects
406 406
 
407 407
 	public $userId = 0;
408 408
 	public $isCourseAdmin = false;
409 409
 	public $isCourseTutor = false;
410
-	public $_orderBy = '';	// private property that determines by which field
410
+	public $_orderBy = ''; // private property that determines by which field
411 411
 
412 412
 	/**
413 413
 	 * Constructor for recreating the Dropbox_Person object
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 	 */
507 507
 	function orderSentWork($sort)
508 508
     {
509
-		switch($sort) {
509
+		switch ($sort) {
510 510
 			case 'lastDate':
511 511
 				$this->_orderBy = 'last_upload_date';
512 512
 				break;
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 	 */
540 540
 	function orderReceivedWork($sort)
541 541
     {
542
-		switch($sort) {
542
+		switch ($sort) {
543 543
 			case 'lastDate':
544 544
 				$this->_orderBy = 'last_upload_date';
545 545
 				break;
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
         $sql = "DELETE FROM ".$dropbox_cnf['tbl_person']."
633 633
                 WHERE c_id = $course_id AND user_id = '".$this->userId."' AND file_id ='".$id."'";
634 634
 		Database::query($sql);
635
-		removeUnusedFiles();	// Check for unused files
635
+		removeUnusedFiles(); // Check for unused files
636 636
 	}
637 637
 
638 638
 	/**
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 			Database::query($sql);
650 650
 			removeMoreIfMailing($w->id);
651 651
 		}
652
-		removeUnusedFiles();	// Check for unused files
652
+		removeUnusedFiles(); // Check for unused files
653 653
 	}
654 654
 
655 655
 	/**
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
                 WHERE c_id = $course_id AND user_id='".$this->userId."' AND file_id='".$id."'";
684 684
 		Database::query($sql);
685 685
 		removeMoreIfMailing($id);
686
-		removeUnusedFiles();	// Check for unused files
686
+		removeUnusedFiles(); // Check for unused files
687 687
 	}
688 688
 
689 689
 	/**
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 		$wi = -1;
706 706
 		foreach ($this->receivedWork as $w) {
707 707
 			$wi++;
708
-			if ($w->id == $id){
708
+			if ($w->id == $id) {
709 709
 			   $found = true;
710 710
 			   break;
711 711
 			}  // foreach (... as $wi -> $w) gives error 221! (no idea why...)
Please login to merge, or discard this patch.
main/dropbox/dropbox_config.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
  */
19 19
 $dropbox_cnf['courseId'] = $_cid;
20 20
 //path to dropbox subdir in course containing the uploaded files
21
-$dropbox_cnf['sysPath'] = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox';
22
-$dropbox_cnf['webPath'] = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/dropbox';
21
+$dropbox_cnf['sysPath'] = api_get_path(SYS_COURSE_PATH).$_course['path'].'/dropbox';
22
+$dropbox_cnf['webPath'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/dropbox';
23 23
 
24 24
 //file size limit as imposed by the platform admin (see Chamilo Config Settings on the platform administration section)
25 25
 $dropbox_cnf['maxFilesize'] = api_get_setting('dropbox_max_filesize');
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  */
34 34
 // false = no mailing functionality
35 35
 $dropbox_cnf['allowMailing'] = api_string_2_boolean(api_get_setting('dropbox_allow_mailing'));
36
-$dropbox_cnf['mailingIdBase'] = 10000000;  // bigger than any user_id,
36
+$dropbox_cnf['mailingIdBase'] = 10000000; // bigger than any user_id,
37 37
 // allowing enough space for pseudo_ids as uploader_id, dest_user_id, user_id:
38 38
 // mailing pseudo_id = dropbox_cnf('mailingIdBase') + mailing id
39 39
 $dropbox_cnf['mailingZipRegexp'] = '/^(.*)(STUDENTID|USERID|LOGINNAME)(.*)\.ZIP$/i';
Please login to merge, or discard this patch.
main/course_progress/thematic_controller.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -201,20 +201,20 @@  discard block
 block discarded – undo
201 201
                         $plan_html = null;
202 202
                         if (!empty($data)) {
203 203
                             foreach ($data as $plan) {
204
-                                $plan_html .= '<strong>' . $plan['title'] . '</strong><br /> ' . $plan['description'] . '<br />';
204
+                                $plan_html .= '<strong>'.$plan['title'].'</strong><br /> '.$plan['description'].'<br />';
205 205
                             }
206 206
                         }
207 207
                         $data = $thematic->get_thematic_advance_by_thematic_id($theme['id']);
208 208
                         $advance_html = null;
209 209
                         if (!empty($data)) {
210 210
                             foreach ($data as $advance) {
211
-                                $advance_html .= api_convert_and_format_date($advance['start_date'], DATE_FORMAT_LONG) . ' ('.$advance['duration'].' '.get_lang('HourShort').')<br />'.$advance['content'].'<br />';
211
+                                $advance_html .= api_convert_and_format_date($advance['start_date'], DATE_FORMAT_LONG).' ('.$advance['duration'].' '.get_lang('HourShort').')<br />'.$advance['content'].'<br />';
212 212
                             }
213 213
                         }
214 214
                         $table[] = array($theme['title'], $plan_html, $advance_html);
215 215
                     }
216 216
                     $params = array(
217
-                        'filename' => get_lang('Thematic') . '-' . api_get_local_time(),
217
+                        'filename' => get_lang('Thematic').'-'.api_get_local_time(),
218 218
                         'pdf_title' => get_lang('Thematic'),
219 219
                         'add_signatures' => true,
220 220
                         'format' => 'A4-L',
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
                             unset($_SESSION['thematic_plan_token']);
312 312
                             $data['message'] = 'ok';
313 313
 
314
-                            $saveRedirect = api_get_path(WEB_PATH) . 'main/course_progress/index.php?';
315
-                            $saveRedirect.= api_get_cidreq() . '&';
316
-                            $saveRedirect.= 'thematic_plan_save_message=ok';
314
+                            $saveRedirect = api_get_path(WEB_PATH).'main/course_progress/index.php?';
315
+                            $saveRedirect .= api_get_cidreq().'&';
316
+                            $saveRedirect .= 'thematic_plan_save_message=ok';
317 317
 
318 318
                             header("Location: $saveRedirect");
319 319
                             exit;
Please login to merge, or discard this patch.
main/course_progress/thematic.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -23,25 +23,25 @@  discard block
 block discarded – undo
23 23
         case 'thematic_add' :
24 24
         case 'thematic_import_select' :
25 25
             echo '<a href="index.php?'.api_get_cidreq().'">'.
26
-                Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ThematicDetails'),'',ICON_SIZE_MEDIUM).'</a>';
26
+                Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ThematicDetails'), '', ICON_SIZE_MEDIUM).'</a>';
27 27
             break;
28 28
         case 'thematic_list' :
29 29
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'.
30
-                Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>';
30
+                Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
31 31
             break;
32 32
         case 'thematic_details' :
33 33
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'.
34
-                Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>';
34
+                Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
35 35
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_import_select'.$url_token.'">'.
36
-                Display::return_icon('import_csv.png',get_lang('ImportThematic'),'',ICON_SIZE_MEDIUM).'</a>';
36
+                Display::return_icon('import_csv.png', get_lang('ImportThematic'), '', ICON_SIZE_MEDIUM).'</a>';
37 37
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_export'.$url_token.'">'.
38
-                Display::return_icon('export_csv.png',get_lang('ExportThematic'),'', ICON_SIZE_MEDIUM).'</a>';
38
+                Display::return_icon('export_csv.png', get_lang('ExportThematic'), '', ICON_SIZE_MEDIUM).'</a>';
39 39
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_export_pdf'.$url_token.'">'.
40
-                Display::return_icon('pdf.png',get_lang('ExportToPDF'),'', ICON_SIZE_MEDIUM).'</a>';
40
+                Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>';
41 41
             break;
42 42
         default :
43 43
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'.
44
-                Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>';
44
+                Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
45 45
     }
46 46
     echo '</div>';
47 47
 }
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
     $parameters['action'] = $action;
58 58
     $table->set_additional_parameters($parameters);
59 59
     $table->set_header(0, '', false, array('style'=>'width:20px;'));
60
-    $table->set_header(1, get_lang('Title'), false );
60
+    $table->set_header(1, get_lang('Title'), false);
61 61
     if (api_is_allowed_to_edit(null, true)) {
62
-        $table->set_header(2, get_lang('Actions'), false,array('style'=>'text-align:center;width:40%;'));
63
-        $table->set_form_actions(array ('thematic_delete_select' => get_lang('DeleteAllThematics')));
62
+        $table->set_header(2, get_lang('Actions'), false, array('style'=>'text-align:center;width:40%;'));
63
+        $table->set_form_actions(array('thematic_delete_select' => get_lang('DeleteAllThematics')));
64 64
     }
65 65
     $table->display();
66 66
 
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
 
73 73
     if (isset($last_id) && $last_id) {
74 74
         $link_to_thematic_plan = '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$last_id.'">'.
75
-            Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style'=>'vertical-align:middle;float:none;'),ICON_SIZE_SMALL).'</a>';
75
+            Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style'=>'vertical-align:middle;float:none;'), ICON_SIZE_SMALL).'</a>';
76 76
         $link_to_thematic_advance = '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$last_id.'">'.
77
-            Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), array('style'=>'vertical-align:middle;float:none;'),ICON_SIZE_SMALL).'</a>';
77
+            Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), array('style'=>'vertical-align:middle;float:none;'), ICON_SIZE_SMALL).'</a>';
78 78
         Display::display_confirmation_message(
79
-            get_lang('ThematicSectionHasBeenCreatedSuccessfull').'<br />'.sprintf(get_lang('NowYouShouldAddThematicPlanXAndThematicAdvanceX'),$link_to_thematic_plan, $link_to_thematic_advance),
79
+            get_lang('ThematicSectionHasBeenCreatedSuccessfull').'<br />'.sprintf(get_lang('NowYouShouldAddThematicPlanXAndThematicAdvanceX'), $link_to_thematic_plan, $link_to_thematic_advance),
80 80
             false
81 81
         );
82 82
     }
@@ -113,27 +113,27 @@  discard block
 block discarded – undo
113 113
             $actions_first_col = '';
114 114
             if (api_is_allowed_to_edit(null, true)) {
115 115
                 // Thematic title
116
-                $actions_first_col  = Display::url(
116
+                $actions_first_col = Display::url(
117 117
                     Display::return_icon('cd.gif', get_lang('Copy')),
118 118
                     'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$my_thematic_id.$params.$url_token
119 119
                 );
120
-                if (api_get_session_id() == 0 ) {
120
+                if (api_get_session_id() == 0) {
121 121
 
122 122
                     if ($thematic['display_order'] > 1) {
123
-                        $actions_first_col .= ' <a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('up.png', get_lang('Up'),'',ICON_SIZE_SMALL).'</a>';
123
+                        $actions_first_col .= ' <a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('up.png', get_lang('Up'), '', ICON_SIZE_SMALL).'</a>';
124 124
                     } else {
125
-                        $actions_first_col .= ' '.Display::return_icon('up_na.png','&nbsp;','',ICON_SIZE_SMALL);
125
+                        $actions_first_col .= ' '.Display::return_icon('up_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
126 126
                     }
127 127
                     if (isset($thematic['max_thematic_item']) && $thematic['display_order'] < $thematic['max_thematic_item']) {
128
-                        $actions_first_col .= ' <a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('down.png',get_lang('Down'),'',ICON_SIZE_SMALL).'</a>';
128
+                        $actions_first_col .= ' <a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('down.png', get_lang('Down'), '', ICON_SIZE_SMALL).'</a>';
129 129
                     } else {
130
-                        $actions_first_col .= ' '.Display::return_icon('down_na.png','&nbsp;','',ICON_SIZE_SMALL);
130
+                        $actions_first_col .= ' '.Display::return_icon('down_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
131 131
                     }
132 132
 
133 133
                 }
134 134
                 if (api_get_session_id() == $thematic['session_id']) {
135
-                    $actions_first_col .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>';
136
-                    $actions_first_col .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
135
+                    $actions_first_col .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
136
+                    $actions_first_col .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
137 137
                 }
138 138
 
139 139
                 $actions_first_col = Display::div($actions_first_col, array('id'=>'thematic_id_content_'.$thematic['id'], 'class'=>'thematic_tools'));
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             //if (api_is_allowed_to_edit(null, true) &&  api_get_session_id() == $thematic['session_id']) {
150 150
             if (api_is_allowed_to_edit(null, true)) {
151 151
                 echo '<div style="text-align:right"><a href="index.php?'.api_get_cidreq().'&origin=thematic_details&action=thematic_plan_list&thematic_id='.$thematic['id'].'&width=700&height=500">'.
152
-                    Display::return_icon('edit.png', get_lang('EditThematicPlan'), array('style'=>'vertical-align:middle'),ICON_SIZE_MEDIUM).'</a></div><br />';
152
+                    Display::return_icon('edit.png', get_lang('EditThematicPlan'), array('style'=>'vertical-align:middle'), ICON_SIZE_MEDIUM).'</a></div><br />';
153 153
             }
154 154
 
155 155
             if (empty($thematic_plan_div[$thematic['id']])) {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             //if (api_is_allowed_to_edit(null, true) &&  api_get_session_id() == $thematic['session_id']) {
166 166
             if (api_is_allowed_to_edit(null, true)) {
167 167
                 echo '<div style="text-align:right"><a href="index.php?'.api_get_cidreq().'&action=thematic_advance_add&thematic_id='.$thematic['id'].'">'.
168
-                    Display::return_icon('add.png',get_lang('NewThematicAdvance'),'',ICON_SIZE_MEDIUM).'</a></div>';
168
+                    Display::return_icon('add.png', get_lang('NewThematicAdvance'), '', ICON_SIZE_MEDIUM).'</a></div>';
169 169
             }
170 170
 
171 171
             //if (api_is_allowed_to_edit(null, true) &&  api_get_session_id() == $thematic['session_id']) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                                 [],
188 188
                                 ICON_SIZE_SMALL
189 189
                             ),
190
-                            'index.php?' . api_get_cidreq() . '&' . http_build_query([
190
+                            'index.php?'.api_get_cidreq().'&'.http_build_query([
191 191
                                 'action' => 'thematic_advance_edit',
192 192
                                 'thematic_id' => $thematic['id'],
193 193
                                 'thematic_advance_id' => $thematic_advance['id'],
@@ -198,17 +198,17 @@  discard block
 block discarded – undo
198 198
                                 'data-title' => get_lang('EditThematicAdvance')
199 199
                             ]
200 200
                         );
201
-                        $edit_link  .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'.
202
-                            Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a></center>';
201
+                        $edit_link .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'.
202
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a></center>';
203 203
 
204 204
                         //Links
205 205
                         $edit_link = Display::div(
206
-                            Display::div($edit_link , array('id'=>'thematic_advance_tools_'.$thematic_advance['id'], 'class'=>'thematic_advance_actions')),
206
+                            Display::div($edit_link, array('id'=>'thematic_advance_tools_'.$thematic_advance['id'], 'class'=>'thematic_advance_actions')),
207 207
                             array('style'=>'height:20px;')
208 208
                         );
209 209
                     }
210 210
 
211
-                    $thematic_advance_item =  isset($thematic_advance_div[$thematic['id']][$thematic_advance['id']]) ? $thematic_advance_div[$thematic['id']][$thematic_advance['id']] : null;
211
+                    $thematic_advance_item = isset($thematic_advance_div[$thematic['id']][$thematic_advance['id']]) ? $thematic_advance_div[$thematic['id']][$thematic_advance['id']] : null;
212 212
                     echo Display::div($thematic_advance_item, array('id'=>'thematic_advance_'.$thematic_advance['id']));
213 213
                     echo $edit_link;
214 214
                     echo '</td>';
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 } elseif ($action == 'thematic_add' || $action == 'thematic_edit') {
254 254
 
255 255
     // Display form
256
-    $form = new FormValidator('thematic_add','POST','index.php?action=thematic_add&'.api_get_cidreq());
256
+    $form = new FormValidator('thematic_add', 'POST', 'index.php?action=thematic_add&'.api_get_cidreq());
257 257
 
258 258
     if ($action == 'thematic_edit') {
259 259
         $form->addElement('header', '', get_lang('EditThematicSection'));
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
     $form->addElement('hidden', 'action', $action);
264 264
 
265 265
     if (!empty($thematic_id)) {
266
-        $form->addElement('hidden', 'thematic_id',$thematic_id);
266
+        $form->addElement('hidden', 'thematic_id', $thematic_id);
267 267
     }
268 268
 
269 269
     $form->addText('title', get_lang('Title'), true, array('size'=>'50'));
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
     if (!empty($thematic_data)) {
276 276
         if (api_get_session_id()) {
277 277
             if ($thematic_data['session_id'] != api_get_session_id()) {
278
-                $show_form  = false;
279
-                Display::display_error_message(get_lang('NotAllowedClickBack'),false);
278
+                $show_form = false;
279
+                Display::display_error_message(get_lang('NotAllowedClickBack'), false);
280 280
             }
281 281
         }
282 282
         // set default values
@@ -287,14 +287,14 @@  discard block
 block discarded – undo
287 287
 
288 288
     // error messages
289 289
     if (isset($error)) {
290
-        Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
290
+        Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
291 291
     }
292 292
     if ($show_form) {
293 293
         $form->display();
294 294
     }
295 295
 } elseif ($action == 'thematic_import_select') {
296 296
     // Create form to upload csv file.
297
-    $form = new FormValidator('thematic_import','POST','index.php?action=thematic_import&'.api_get_cidreq().$url_token);
297
+    $form = new FormValidator('thematic_import', 'POST', 'index.php?action=thematic_import&'.api_get_cidreq().$url_token);
298 298
     $form->addElement('header', get_lang('ImportThematic'));
299 299
     $form->addElement('file', 'file');
300 300
     $form->addElement('checkbox', 'replace', null, get_lang('DeleteAllThematic'));
Please login to merge, or discard this patch.
main/cron/cleanup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 $a_dir = realpath($dir.'/../../archive/');
16 16
 $list = scandir($a_dir);
17 17
 // calculate 7 days
18
-$t = time()-(86400*7);
18
+$t = time() - (86400 * 7);
19 19
 foreach ($list as $item) {
20
-    if (substr($item,0,1) == '.') {
20
+    if (substr($item, 0, 1) == '.') {
21 21
         continue;
22 22
     }
23 23
     $stat = @stat($a_dir.'/'.$item);
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
  * Delete a file or recursively delete a directory
35 35
  * @param string $str Path to file or directory
36 36
  */
37
-function recursive_delete($str){
37
+function recursive_delete($str) {
38 38
     if (is_file($str)) {
39 39
         return @unlink($str);
40 40
     } elseif (is_dir($str)) {
41
-        $scan = glob(rtrim($str,'/').'/*');
41
+        $scan = glob(rtrim($str, '/').'/*');
42 42
         foreach ($scan as $index=>$path) {
43 43
             recursive_delete($path);
44 44
         }
Please login to merge, or discard this patch.
main/cron/remind_course_expiration.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * @package chamilo.cron
6 6
  * @author Imanol Losada <[email protected]>
7 7
  */
8
-require_once __DIR__ . '/../inc/global.inc.php';
8
+require_once __DIR__.'/../inc/global.inc.php';
9 9
 
10 10
 /**
11 11
  * Initialization
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 foreach ($sessions as $sessionId => $userIds) {
66 66
     $userId = 0;
67
-    $userIds = $userIds ? " AND sessionUser.user_id NOT IN (" . implode(", ", $userIds) . ")" : null;
67
+    $userIds = $userIds ? " AND sessionUser.user_id NOT IN (".implode(", ", $userIds).")" : null;
68 68
     $query = "
69 69
         SELECT sessionUser.session_id, sessionUser.user_id, session.name, session.access_end_date 
70 70
         FROM $sessionUserTable AS sessionUser
@@ -156,10 +156,10 @@  discard block
 block discarded – undo
156 156
                 $administrator['completeName'],
157 157
                 $administrator['email']
158 158
             );
159
-            echo "Email sent to $userCompleteName (" . $user['email'] . ")\n";
160
-            echo "Session: " . $session['name'] . "\n";
161
-            echo "Date end: " . $session['access_end_date'] . "\n";
162
-            echo "Days remaining: " . $daysRemaining->format("%d") . "\n\n";
159
+            echo "Email sent to $userCompleteName (".$user['email'].")\n";
160
+            echo "Session: ".$session['name']."\n";
161
+            echo "Date end: ".$session['access_end_date']."\n";
162
+            echo "Days remaining: ".$daysRemaining->format("%d")."\n\n";
163 163
         }
164 164
         echo "======================================================================\n\n";
165 165
     }
Please login to merge, or discard this patch.
main/cron/course_finished.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @author Angel Fernando Quiroz Campos <[email protected]>
7 7
  * @package chamilo.cron
8 8
  */
9
-require_once __DIR__ . '/../inc/global.inc.php';
9
+require_once __DIR__.'/../inc/global.inc.php';
10 10
 
11 11
 if (php_sapi_name() != 'cli') {
12 12
     exit; //do not run from browser
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     ->getResult();
33 33
 
34 34
 if (empty($sessions)) {
35
-    echo "No sessions finishing today $endDate" . PHP_EOL;
35
+    echo "No sessions finishing today $endDate".PHP_EOL;
36 36
     exit;
37 37
 }
38 38
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $sessionUsers = $session->getUsers();
51 51
 
52 52
     if (empty($sessionUsers)) {
53
-        echo 'No users to send mail' . PHP_EOL;
53
+        echo 'No users to send mail'.PHP_EOL;
54 54
         exit;
55 55
     }
56 56
 
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
             $administrator['email']
82 82
         );
83 83
 
84
-        echo '============' . PHP_EOL;
85
-        echo "Email sent to: {$user->getCompleteName()} ({$user->getEmail()})" . PHP_EOL;
86
-        echo "Session: {$session->getName()}" . PHP_EOL;
87
-        echo "End date: {$session->getAccessEndDate()->format('Y-m-d h:i')}" . PHP_EOL;
84
+        echo '============'.PHP_EOL;
85
+        echo "Email sent to: {$user->getCompleteName()} ({$user->getEmail()})".PHP_EOL;
86
+        echo "Session: {$session->getName()}".PHP_EOL;
87
+        echo "End date: {$session->getAccessEndDate()->format('Y-m-d h:i')}".PHP_EOL;
88 88
     }
89 89
 }
Please login to merge, or discard this patch.