Completed
Push — 1.11.x ( ca7787...41c0f2 )
by José
31:51
created
main/admin/user_list.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
 function display_advanced_search_form () {
125 125
     if ($("#advanced_search_form").css("display") == "none") {
126 126
         $("#advanced_search_form").css("display","block");
127
-        $("#img_plus_and_minus").html(\' '. Display::returnFontAwesomeIcon('arrow-down') . ' '. get_lang('AdvancedSearch').'\');
127
+        $("#img_plus_and_minus").html(\' '. Display::returnFontAwesomeIcon('arrow-down').' '.get_lang('AdvancedSearch').'\');
128 128
     } else {
129 129
         $("#advanced_search_form").css("display","none");
130
-        $("#img_plus_and_minus").html(\' '. Display::returnFontAwesomeIcon('arrow-right') . ' '.get_lang('AdvancedSearch').'\');
130
+        $("#img_plus_and_minus").html(\' '. Display::returnFontAwesomeIcon('arrow-right').' '.get_lang('AdvancedSearch').'\');
131 131
     }
132 132
 }
133 133
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
     // adding the filter to see the user's only of the current access_url
205 205
     if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
206 206
         $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
207
-        $sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.id=url_rel_user.user_id)";
207
+        $sql .= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.id=url_rel_user.user_id)";
208 208
     }
209 209
 
210 210
     $keywordList = array(
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     */
244 244
 
245 245
     if (isset($_GET['keyword']) && !empty($_GET['keyword'])) {
246
-        $keywordFiltered = Database::escape_string("%". $_GET['keyword'] ."%");
246
+        $keywordFiltered = Database::escape_string("%".$_GET['keyword']."%");
247 247
         $sql .= " WHERE (
248 248
                     u.firstname LIKE '$keywordFiltered' OR
249 249
                     u.lastname LIKE '$keywordFiltered' OR
@@ -277,13 +277,13 @@  discard block
 block discarded – undo
277 277
         */
278 278
         $sql .= " $query_admin_table
279 279
             WHERE (
280
-                u.firstname LIKE '". Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND
280
+                u.firstname LIKE '".Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND
281 281
                 u.lastname LIKE '". Database::escape_string("%".$keywordListValues['keyword_lastname']."%")."' AND
282 282
                 u.username LIKE '". Database::escape_string("%".$keywordListValues['keyword_username']."%")."' AND
283 283
                 u.email LIKE '". Database::escape_string("%".$keywordListValues['keyword_email']."%")."' AND
284 284
                 u.status LIKE '".Database::escape_string($keywordListValues['keyword_status'])."' ";
285 285
         if (!empty($keywordListValues['keyword_officialcode'])) {
286
-            $sql .= " AND u.official_code LIKE '" . Database::escape_string("%" . $keywordListValues['keyword_officialcode'] . "%") . "' ";
286
+            $sql .= " AND u.official_code LIKE '".Database::escape_string("%".$keywordListValues['keyword_officialcode']."%")."' ";
287 287
         }
288 288
         $sql .= "
289 289
             $keyword_admin
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
     $lastname = $userInfo['lastname'];
374 374
 
375 375
 	if (api_is_western_name_order()) {
376
-		$message = sprintf(get_lang('AttemptingToLoginAs'),$firstname, $lastname, $userId);
376
+		$message = sprintf(get_lang('AttemptingToLoginAs'), $firstname, $lastname, $userId);
377 377
 	} else {
378 378
 		$message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId);
379 379
 	}
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 function get_user_data($from, $number_of_items, $column, $direction)
441 441
 {
442 442
     $sql = prepare_user_sql_query(false);
443
-    if (!in_array($direction, array('ASC','DESC'))) {
443
+    if (!in_array($direction, array('ASC', 'DESC'))) {
444 444
     	$direction = 'ASC';
445 445
     }
446 446
     $column = intval($column);
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 
458 458
 	$res = Database::query($sql);
459 459
 
460
-	$users = array ();
460
+	$users = array();
461 461
     $t = time();
462 462
 	while ($user = Database::fetch_row($res)) {
463 463
 		$userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL);
@@ -551,8 +551,8 @@  discard block
 block discarded – undo
551 551
 					<div class="blackboard_hide" id="div_s_'.$user_id.'">&nbsp;&nbsp;</div>
552 552
 					</a>';
553 553
 	} else {
554
-		$result .= Display::return_icon('course_na.png',get_lang('Courses')).'&nbsp;&nbsp;';
555
-		$result .= Display::return_icon('course_na.png',get_lang('Sessions')).'&nbsp;&nbsp;';
554
+		$result .= Display::return_icon('course_na.png', get_lang('Courses')).'&nbsp;&nbsp;';
555
+		$result .= Display::return_icon('course_na.png', get_lang('Sessions')).'&nbsp;&nbsp;';
556 556
 	}
557 557
 
558 558
     if (api_is_platform_admin()) {
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
     if (api_is_platform_admin(true)) {
588 588
         $editProfileUrl = Display::getProfileEditionLink($user_id, true);
589 589
         if (!$user_is_anonymous && api_global_admin_can_edit_admin($user_id, null, true)) {
590
-            $result .= '<a href="' . $editProfileUrl . '">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
590
+            $result .= '<a href="'.$editProfileUrl.'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
591 591
         } else {
592 592
             $result .= Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
593 593
         }
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
     if ($allowAssignSkill) {
599 599
         $result .= Display::url(
600 600
             Display::return_icon('skill-badges.png', get_lang('AssignSkill'), null, ICON_SIZE_SMALL),
601
-            api_get_path(WEB_CODE_PATH) . 'badge/assign.php?' . http_build_query(['user' => $user_id])
601
+            api_get_path(WEB_CODE_PATH).'badge/assign.php?'.http_build_query(['user' => $user_id])
602 602
         );
603 603
     }
604 604
 
@@ -738,10 +738,10 @@  discard block
 block discarded – undo
738 738
             case 'add_user_to_my_url':
739 739
                 $user_id = $_REQUEST["user_id"];
740 740
                 $result = UrlManager::add_user_to_url($user_id, $current_access_url_id);
741
-                if ($result ) {
741
+                if ($result) {
742 742
                     $user_info = api_get_user_info($user_id);
743 743
                     $message = get_lang('UserAdded').' '.$user_info['firstname'].' '.$user_info['lastname'].' ('.$user_info['username'].')';
744
-                    $message  = Display::return_message($message, 'confirmation');
744
+                    $message = Display::return_message($message, 'confirmation');
745 745
                 }
746 746
                 break;
747 747
 			case 'delete_user':
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 $searchAdvanced = '
801 801
 <a id="advanced_params" href="javascript://" class = "btn btn-default advanced_options" onclick="display_advanced_search_form();">
802 802
     <span id="img_plus_and_minus">&nbsp;
803
-    '. Display::returnFontAwesomeIcon('arrow-right') . ' '.get_lang('AdvancedSearch').'
803
+    '. Display::returnFontAwesomeIcon('arrow-right').' '.get_lang('AdvancedSearch').'
804 804
     </span>
805 805
 </a>';
806 806
 $actionsLeft = '';
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 $actionsRight  = '';
809 809
 if (api_is_platform_admin()) {
810 810
 	$actionsRight .= '<a class="pull-right" href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.
811
-         Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>';
811
+         Display::return_icon('new_user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>';
812 812
 }
813 813
 
814 814
 $actionsLeft .= $form->returnForm();
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 // Display Advanced search form.
835 835
 $form = new FormValidator('advanced_search', 'get', '', '', array(), FormValidator::LAYOUT_HORIZONTAL);
836 836
 
837
-$form->addElement('html','<div id="advanced_search_form" style="display:none;">');
837
+$form->addElement('html', '<div id="advanced_search_form" style="display:none;">');
838 838
 $form->addElement('header', get_lang('AdvancedSearch'));
839 839
 $form->addText('keyword_firstname', get_lang('FirstName'), false);
840 840
 $form->addText('keyword_lastname', get_lang('LastName'), false);
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
 $defaults['keyword_active'] = 1;
874 874
 $defaults['keyword_inactive'] = 1;
875 875
 $form->setDefaults($defaults);
876
-$form->addElement('html','</div>');
876
+$form->addElement('html', '</div>');
877 877
 
878 878
 $form = $form->returnForm();
879 879
 
@@ -954,10 +954,10 @@  discard block
 block discarded – undo
954 954
                 }
955 955
                 if ($add_user) {
956 956
                     $row_table = array();
957
-                    $row_table[] =  api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') ';
958
-                    $row_table[] =  $access_info_to_string;
957
+                    $row_table[] = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') ';
958
+                    $row_table[] = $access_info_to_string;
959 959
                     $url = api_get_self().'?action=add_user_to_my_url&user_id='.$user['id'].'&sec_token='.$_SESSION['sec_token'];
960
-                    $row_table[] =  Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn'));
960
+                    $row_table[] = Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn'));
961 961
 
962 962
                     foreach ($row_table as $cell) {
963 963
                         $table->setCellContents($row, $column, $cell);
Please login to merge, or discard this patch.
main/inc/lib/MoodleImport.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
             }
44 44
 
45 45
             $folder = api_get_unique_id();
46
-            $destinationDir = api_get_path(SYS_ARCHIVE_PATH) . $folder;
46
+            $destinationDir = api_get_path(SYS_ARCHIVE_PATH).$folder;
47 47
             $coursePath = api_get_course_path();
48 48
             $sessionId = api_get_session_id();
49 49
             $groupId = api_get_group_id();
50
-            $documentPath = api_get_path(SYS_COURSE_PATH) . $coursePath . '/document';
50
+            $documentPath = api_get_path(SYS_COURSE_PATH).$coursePath.'/document';
51 51
             $courseInfo = api_get_course_info();
52 52
 
53 53
             mkdir($destinationDir, api_get_permissions_for_new_directories(), true);
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
         if ($weighting > 0) {
818 818
             $questionWeighting += $weighting;
819 819
         }
820
-        $goodAnswer =  $correct ? true : false;
820
+        $goodAnswer = $correct ? true : false;
821 821
 
822 822
         $this->fixPathInText($importedFiles, $answer);
823 823
 
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
         if ($weighting > 0) {
855 855
             $questionWeighting += $weighting;
856 856
         }
857
-        $goodAnswer =  $correct ? true : false;
857
+        $goodAnswer = $correct ? true : false;
858 858
 
859 859
         $this->fixPathInText($importedFiles, $answer);
860 860
 
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
                         $answer['questiontext']
956 956
                     );
957 957
 
958
-                    $placeholder .= '<p> ' . strip_tags($answer['questiontext']).' '.$currentAnswers . ' </p>';
958
+                    $placeholder .= '<p> '.strip_tags($answer['questiontext']).' '.$currentAnswers.' </p>';
959 959
                 }
960 960
 
961 961
                 return $optionsValues;
Please login to merge, or discard this patch.
main/inc/lib/fileManage.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -193,9 +193,9 @@
 block discarded – undo
193 193
         /* File case */
194 194
         if (is_file($source)) {
195 195
             if ($forceMove && !$isWindowsOS && $canExec) {
196
-                exec('mv ' . $source . ' ' . $target . '/' . $file_name);
196
+                exec('mv '.$source.' '.$target.'/'.$file_name);
197 197
             } else {
198
-                copy($source, $target . '/' . $file_name);
198
+                copy($source, $target.'/'.$file_name);
199 199
                 unlink($source);
200 200
             }
201 201
             return true;
Please login to merge, or discard this patch.
main/exercise/exercise_history.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,41 +10,41 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 require_once __DIR__.'/../inc/global.inc.php';
13
-$this_section=SECTION_COURSES;
13
+$this_section = SECTION_COURSES;
14 14
 api_protect_course_script(true);
15 15
 
16 16
 // moved down to fix bug: http://www.dokeos.com/forum/viewtopic.php?p=18609#18609
17 17
 $show = (isset($_GET['show']) && $_GET['show'] == 'result') ? 'result' : 'test';
18 18
 
19 19
 /* 	Constants and variables */
20
-$is_allowedToEdit = api_is_allowed_to_edit(null,true);
20
+$is_allowedToEdit = api_is_allowed_to_edit(null, true);
21 21
 $is_tutor = api_is_allowed_to_edit(true);
22 22
 
23
-if (!$is_allowedToEdit){
24
-    header('Location: ' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise.php?' . api_get_cidreq());
23
+if (!$is_allowedToEdit) {
24
+    header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq());
25 25
     exit;
26 26
 }
27 27
 
28
-$interbreadcrumb[]= array ('url' => 'exercise_report.php?'.api_get_cidreq(),'name' => get_lang('Exercises'));
29
-$interbreadcrumb[]= array ('url' => 'exercise_report.php?filter=2&'.api_get_cidreq(),'name' => get_lang('StudentScore'));
30
-$interbreadcrumb[]= array ('url' => 'exercise_history.php?exe_id='.intval($_GET['exe_id']).'&'.api_get_cidreq(), 'name' => get_lang('Details'));
28
+$interbreadcrumb[] = array('url' => 'exercise_report.php?'.api_get_cidreq(), 'name' => get_lang('Exercises'));
29
+$interbreadcrumb[] = array('url' => 'exercise_report.php?filter=2&'.api_get_cidreq(), 'name' => get_lang('StudentScore'));
30
+$interbreadcrumb[] = array('url' => 'exercise_history.php?exe_id='.intval($_GET['exe_id']).'&'.api_get_cidreq(), 'name' => get_lang('Details'));
31 31
 
32 32
 $TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
33 33
 $TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
34 34
 $TBL_EXERCISES_QUESTION = Database::get_course_table(TABLE_QUIZ_QUESTION);
35
-$TBL_TRACK_ATTEMPT_RECORDING= Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
36
-Display::display_header($nameTools,get_lang('Exercise'));
35
+$TBL_TRACK_ATTEMPT_RECORDING = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
36
+Display::display_header($nameTools, get_lang('Exercise'));
37 37
 
38 38
 if (isset($_GET['message'])) {
39 39
     if (in_array($_GET['message'], array('ExerciseEdited'))) {
40
-        $my_message_history=Security::remove_XSS($_GET['message']);
40
+        $my_message_history = Security::remove_XSS($_GET['message']);
41 41
         Display::display_confirmation_message(get_lang($my_message_history));
42 42
     }
43 43
 }
44 44
 
45 45
 echo '<div class="actions">';
46
-echo '<a href="exercise_report.php?' . api_get_cidreq() . '&filter=2">' .
47
-    Display :: return_icon('back.png', get_lang('BackToResultList'),'',ICON_SIZE_MEDIUM).'</a>';
46
+echo '<a href="exercise_report.php?'.api_get_cidreq().'&filter=2">'.
47
+    Display :: return_icon('back.png', get_lang('BackToResultList'), '', ICON_SIZE_MEDIUM).'</a>';
48 48
 echo '</div>';
49 49
 
50 50
 ?>
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
         WHERE 
66 66
             quiz_question.id = question_id AND 
67 67
             user_id = author AND 
68
-            exe_id = '".(int)$_GET['exe_id']."' 
68
+            exe_id = '".(int) $_GET['exe_id']."' 
69 69
         ORDER BY position";
70 70
 $query = Database::query($sql);
71
-while($row = Database::fetch_array($query)){
71
+while ($row = Database::fetch_array($query)) {
72 72
     echo '<tr';
73 73
     if ($i % 2 == 0) {
74 74
         echo 'class="row_odd"';
Please login to merge, or discard this patch.
main/admin/user_edit.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 if ($geolocalization) {
75 75
 	$gmapsApiKey = $gMapsPlugin->get('api_key');
76
-	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
76
+	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
77 77
 }
78 78
 
79 79
 $htmlHeadXtra[] = api_get_css_asset('cropper/dist/cropper.min.css');
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 }
154 154
 
155 155
 if (api_get_setting('login_is_email') == 'true') {
156
-    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
156
+    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
157 157
     $form->addRule('email', get_lang('UserTaken'), 'username_available', $user_data['username']);
158 158
 }
159 159
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 if (api_get_setting('login_is_email') != 'true') {
188 188
 	$form->addElement('text', 'username', get_lang('LoginName'), array('maxlength' => USERNAME_MAX_LENGTH));
189 189
     $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
190
-    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
190
+    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
191 191
     $form->addRule('username', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
192 192
     $form->addRule('username', get_lang('UserTaken'), 'username_available', $user_data['username']);
193 193
 }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 }
225 225
 $form->addElement('radio', 'reset_password', null, get_lang('AutoGeneratePassword'), 1);
226 226
 $group = array();
227
-$group[] =$form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
227
+$group[] = $form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
228 228
 $group[] = $form->createElement(
229 229
     'password',
230 230
     'password',
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
 // Platform admin
259 259
 if (api_is_platform_admin()) {
260 260
 	$group = array();
261
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
261
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
263 263
 
264
-	$user_data['status'] == 1 ? $display = 'block':$display = 'none';
264
+	$user_data['status'] == 1 ? $display = 'block' : $display = 'none';
265 265
 
266 266
 	$form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">');
267 267
 	$form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 if (!$user_data['platform_admin']) {
286 286
 	// Expiration Date
287 287
 	$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
288
-	$group = array ();
288
+	$group = array();
289 289
 	$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
290 290
 	$group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();'));
291 291
 	$form->addGroup($group, 'max_member_group', null, null, false);
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 if ($studentBoss) {
304 304
     foreach ($studentBoss as $bossId => $userData) {
305 305
         $bossInfo = api_get_user_info($userData['user_id']);
306
-        $studentBossToSelect[$bossInfo['user_id']] =  $bossInfo['complete_name_with_username'];
306
+        $studentBossToSelect[$bossInfo['user_id']] = $bossInfo['complete_name_with_username'];
307 307
     }
308 308
 }
309 309
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 $jquery_ready_content = $returnParams['jquery_ready_content'];
321 321
 
322 322
 // the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
323
-$htmlHeadXtra[] ='<script>
323
+$htmlHeadXtra[] = '<script>
324 324
 $(document).ready(function(){
325 325
 	'.$jquery_ready_content.'
326 326
 });
Please login to merge, or discard this patch.
main/auth/profile.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 if ($geolocalization) {
35 35
     $gmapsApiKey = $gMapsPlugin->get('api_key');
36
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
36
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
37 37
 }
38 38
 
39 39
 $htmlHeadXtra[] = api_get_password_checker_js('#username', '#password1');
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 if (api_is_western_name_order()) {
120 120
     //    FIRST NAME and LAST NAME
121 121
     $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
122
-    $form->addElement('text', 'lastname',  get_lang('LastName'),  array('size' => 40));
122
+    $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40));
123 123
 } else {
124 124
     //    LAST NAME and FIRST NAME
125
-    $form->addElement('text', 'lastname',  get_lang('LastName'),  array('size' => 40));
125
+    $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40));
126 126
     $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
127 127
 }
128 128
 if (api_get_setting('profile', 'name') !== 'true') {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 $form->applyFilter(array('lastname', 'firstname'), 'stripslashes');
132 132
 $form->applyFilter(array('lastname', 'firstname'), 'trim');
133 133
 $form->applyFilter(array('lastname', 'firstname'), 'html_filter');
134
-$form->addRule('lastname' , get_lang('ThisFieldIsRequired'), 'required');
134
+$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
135 135
 $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
136 136
 
137 137
 //    USERNAME
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     $form->freeze('email');
177 177
 }
178 178
 
179
-if (api_get_setting('registration', 'email') == 'true' &&  api_get_setting('profile', 'email') == 'true') {
179
+if (api_get_setting('registration', 'email') == 'true' && api_get_setting('profile', 'email') == 'true') {
180 180
     $form->applyFilter('email', 'stripslashes');
181 181
     $form->applyFilter('email', 'trim');
182 182
     $form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 // the $jquery_ready_content variable collects all functions that
330 330
 // will be load in the $(document).ready javascript function
331
-$htmlHeadXtra[] ='<script>
331
+$htmlHeadXtra[] = '<script>
332 332
 $(document).ready(function(){
333 333
     '.$jquery_ready_content.'
334 334
 });
Please login to merge, or discard this patch.
plugin/google_maps/src/map_coordinates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
 if ($apiIsEnable) {
23 23
     $gmapsApiKey = $plugin->get('api_key');
24
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='. $gmapsApiKey . '" ></script>';
24
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='.$gmapsApiKey.'" ></script>';
25 25
 }
26 26
 
27 27
 $em = Database::getManager();
Please login to merge, or discard this patch.
main/install/update-files-1.9.0-1.10.0.inc.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * current configuration file.
15 15
  * @package chamilo.install
16 16
  */
17
-error_log("Starting " . basename(__FILE__));
17
+error_log("Starting ".basename(__FILE__));
18 18
 
19 19
 global $debug;
20 20
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 
144 144
     $list = scandir($langPath);
145 145
     foreach ($list as $entry) {
146
-        if (is_dir($langPath . $entry) &&
146
+        if (is_dir($langPath.$entry) &&
147 147
             in_array($entry, $officialLanguages)
148 148
         ) {
149 149
             foreach ($filesToDelete as $file) {
150
-                if (is_file($langPath . $entry . '/' . $file . '.inc.php')) {
151
-                    unlink($langPath . $entry . '/' . $file . '.inc.php');
150
+                if (is_file($langPath.$entry.'/'.$file.'.inc.php')) {
151
+                    unlink($langPath.$entry.'/'.$file.'.inc.php');
152 152
                 }
153 153
             }
154 154
         }
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
 
174 174
     // Move dirs into new structures.
175 175
     $movePathList = [
176
-        api_get_path(SYS_CODE_PATH).'upload/users/groups' => api_get_path(SYS_UPLOAD_PATH) . 'groups',
177
-        api_get_path(SYS_CODE_PATH).'upload/users' => api_get_path(SYS_UPLOAD_PATH) . 'users',
178
-        api_get_path(SYS_CODE_PATH).'upload/badges' => api_get_path(SYS_UPLOAD_PATH) . 'badges',
179
-        api_get_path(SYS_PATH).'courses' => api_get_path(SYS_APP_PATH) . 'courses',
176
+        api_get_path(SYS_CODE_PATH).'upload/users/groups' => api_get_path(SYS_UPLOAD_PATH).'groups',
177
+        api_get_path(SYS_CODE_PATH).'upload/users' => api_get_path(SYS_UPLOAD_PATH).'users',
178
+        api_get_path(SYS_CODE_PATH).'upload/badges' => api_get_path(SYS_UPLOAD_PATH).'badges',
179
+        api_get_path(SYS_PATH).'courses' => api_get_path(SYS_APP_PATH).'courses',
180 180
         api_get_path(SYS_PATH).'searchdb' => api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/',
181
-        api_get_path(SYS_PATH).'home' => api_get_path(SYS_APP_PATH) . 'home'
181
+        api_get_path(SYS_PATH).'home' => api_get_path(SYS_APP_PATH).'home'
182 182
     ];
183 183
 
184 184
     if ($debug) {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 $fs->remove($origin);
200 200
             } catch (IOException $e) {
201 201
                 // If removing the directory doesn't work, just log an error and continue
202
-                error_log('Could not move ' . $origin . ' to ' . $destination . '(' . $e->getMessage() . '). Please move it manually.');
202
+                error_log('Could not move '.$origin.' to '.$destination.'('.$e->getMessage().'). Please move it manually.');
203 203
             }
204 204
         }
205 205
     }
@@ -246,5 +246,5 @@  discard block
 block discarded – undo
246 246
     @rrmdir(api_get_path(SYS_PATH).'archive');
247 247
 
248 248
 } else {
249
-    echo 'You are not allowed here !'. __FILE__;
249
+    echo 'You are not allowed here !'.__FILE__;
250 250
 }
Please login to merge, or discard this patch.
main/inc/lib/fileUpload.lib.php 1 patch
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 if ($show_output) {
95 95
                     Display::addFlash(
96 96
                         Display::return_message(
97
-                            get_lang('UplExceedMaxPostSize'). format_file_size($max_file_size),
97
+                            get_lang('UplExceedMaxPostSize').format_file_size($max_file_size),
98 98
                             'error'
99 99
                         )
100 100
                     );
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                 if ($show_output) {
119 119
                     Display::addFlash(
120 120
                         Display::return_message(
121
-                            get_lang('UplNoFileUploaded').' '. get_lang('UplSelectFileFirst'),
121
+                            get_lang('UplNoFileUploaded').' '.get_lang('UplSelectFileFirst'),
122 122
                             'error'
123 123
                         )
124 124
                     );
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                             if ($output) {
473 473
                                 Display::addFlash(
474 474
                                     Display::return_message(
475
-                                        get_lang('UplUploadSucceeded') . '<br /> ' . $documentTitle . ' ' . get_lang('UplFileOverwritten'),
475
+                                        get_lang('UplUploadSucceeded').'<br /> '.$documentTitle.' '.get_lang('UplFileOverwritten'),
476 476
                                         'confirmation',
477 477
                                         false
478 478
                                     )
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
                         if ($output) {
610 610
                             Display::addFlash(
611 611
                                 Display::return_message(
612
-                                    get_lang('UplUploadSucceeded') . '<br />' . get_lang('UplFileSavedAs') . ' ' . $documentTitle,
612
+                                    get_lang('UplUploadSucceeded').'<br />'.get_lang('UplFileSavedAs').' '.$documentTitle,
613 613
                                     'success',
614 614
                                     false
615 615
                                 )
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
                             if ($output) {
687 687
                                 Display::addFlash(
688 688
                                     Display::display_confirmation_message(
689
-                                        get_lang('UplUploadSucceeded') . '<br /> ' . $documentTitle,
689
+                                        get_lang('UplUploadSucceeded').'<br /> '.$documentTitle,
690 690
                                         false,
691 691
                                         true
692 692
                                     )
@@ -772,12 +772,12 @@  discard block
 block discarded – undo
772 772
 function dir_total_space($dir_path)
773 773
 {
774 774
     $save_dir = getcwd();
775
-    chdir($dir_path) ;
775
+    chdir($dir_path);
776 776
     $handle = opendir($dir_path);
777 777
     $sumSize = 0;
778 778
     $dirList = array();
779 779
     while ($element = readdir($handle)) {
780
-        if ( $element == '.' || $element == '..') {
780
+        if ($element == '.' || $element == '..') {
781 781
             continue; // Skip the current and parent directories
782 782
         }
783 783
         if (is_file($element)) {
@@ -788,11 +788,11 @@  discard block
 block discarded – undo
788 788
         }
789 789
     }
790 790
 
791
-    closedir($handle) ;
791
+    closedir($handle);
792 792
 
793 793
     if (sizeof($dirList) > 0) {
794 794
         foreach ($dirList as $j) {
795
-            $sizeDir = dir_total_space($j);	// Recursivity
795
+            $sizeDir = dir_total_space($j); // Recursivity
796 796
             $sumSize += $sizeDir;
797 797
         }
798 798
     }
@@ -826,63 +826,63 @@  discard block
 block discarded – undo
826 826
 
827 827
         static $mime_type = array();
828 828
 
829
-        $mime_type[] = 'application/msword';             $extension[] = '.doc';
830
-        $mime_type[] = 'application/rtf';                $extension[] = '.rtf';
831
-        $mime_type[] = 'application/vnd.ms-powerpoint';  $extension[] = '.ppt';
832
-        $mime_type[] = 'application/vnd.ms-excel';       $extension[] = '.xls';
833
-        $mime_type[] = 'application/pdf';                $extension[] = '.pdf';
834
-        $mime_type[] = 'application/postscript';         $extension[] = '.ps';
835
-        $mime_type[] = 'application/mac-binhex40';       $extension[] = '.hqx';
836
-        $mime_type[] = 'application/x-gzip';             $extension[] = 'tar.gz';
837
-        $mime_type[] = 'application/x-shockwave-flash';  $extension[] = '.swf';
838
-        $mime_type[] = 'application/x-stuffit';          $extension[] = '.sit';
839
-        $mime_type[] = 'application/x-tar';              $extension[] = '.tar';
840
-        $mime_type[] = 'application/zip';                $extension[] = '.zip';
841
-        $mime_type[] = 'application/x-tar';              $extension[] = '.tar';
842
-        $mime_type[] = 'text/html';                      $extension[] = '.html';
843
-        $mime_type[] = 'text/plain';                     $extension[] = '.txt';
844
-        $mime_type[] = 'text/rtf';                       $extension[] = '.rtf';
845
-        $mime_type[] = 'img/gif';                        $extension[] = '.gif';
846
-        $mime_type[] = 'img/jpeg';                       $extension[] = '.jpg';
847
-        $mime_type[] = 'img/png';                        $extension[] = '.png';
848
-        $mime_type[] = 'audio/midi';                     $extension[] = '.mid';
849
-        $mime_type[] = 'audio/mpeg';                     $extension[] = '.mp3';
850
-        $mime_type[] = 'audio/x-aiff';                   $extension[] = '.aif';
851
-        $mime_type[] = 'audio/x-pn-realaudio';           $extension[] = '.rm';
852
-        $mime_type[] = 'audio/x-pn-realaudio-plugin';    $extension[] = '.rpm';
853
-        $mime_type[] = 'audio/x-wav';                    $extension[] = '.wav';
854
-        $mime_type[] = 'video/mpeg';                     $extension[] = '.mpg';
855
-        $mime_type[] = 'video/mpeg4-generic';            $extension[] = '.mp4';
856
-        $mime_type[] = 'video/quicktime';                $extension[] = '.mov';
857
-        $mime_type[] = 'video/x-msvideo';                $extension[] = '.avi';
858
-
859
-        $mime_type[] = 'video/x-ms-wmv';                 $extension[] = '.wmv';
860
-        $mime_type[] = 'video/x-flv';                    $extension[] = '.flv';
861
-        $mime_type[] = 'image/svg+xml';                  $extension[] = '.svg';
862
-        $mime_type[] = 'image/svg+xml';                  $extension[] = '.svgz';
863
-        $mime_type[] = 'video/ogg';                  	 $extension[] = '.ogv';
864
-        $mime_type[] = 'audio/ogg';                  	 $extension[] = '.oga';
865
-        $mime_type[] = 'application/ogg';                $extension[] = '.ogg';
866
-        $mime_type[] = 'application/ogg';                $extension[] = '.ogx';
867
-        $mime_type[] = 'application/x-freemind';         $extension[] = '.mm';
868
-
869
-        $mime_type[] = 'application/vnd.ms-word.document.macroEnabled.12';							$extension[] = '.docm';
870
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';	$extension[] = '.docx';
871
-        $mime_type[] = 'application/vnd.ms-word.template.macroEnabled.12';							$extension[] = '.dotm';
872
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template';	$extension[] = '.dotx';
873
-        $mime_type[] = 'application/vnd.ms-powerpoint.template.macroEnabled.12';					$extension[] = '.potm';
874
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.template';		$extension[] = '.potx';
875
-        $mime_type[] = 'application/vnd.ms-powerpoint.addin.macroEnabled.12';						$extension[] = '.ppam';
876
-        $mime_type[] = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12';					$extension[] = '.ppsm';
877
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow';	$extension[] = '.ppsx';
878
-        $mime_type[] = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12';				$extension[] = '.pptm';
879
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';	$extension[] = '.pptx';
880
-        $mime_type[] = 'application/vnd.ms-excel.addin.macroEnabled.12';							$extension[] = '.xlam';
881
-        $mime_type[] = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12';						$extension[] = '.xlsb';
882
-        $mime_type[] = 'application/vnd.ms-excel.sheet.macroEnabled.12';							$extension[] = '.xlsm';
883
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';			$extension[] = '.xlsx';
884
-        $mime_type[] = 'application/vnd.ms-excel.template.macroEnabled.12';							$extension[] = '.xltm';
885
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template';		$extension[] = '.xltx';
829
+        $mime_type[] = 'application/msword'; $extension[] = '.doc';
830
+        $mime_type[] = 'application/rtf'; $extension[] = '.rtf';
831
+        $mime_type[] = 'application/vnd.ms-powerpoint'; $extension[] = '.ppt';
832
+        $mime_type[] = 'application/vnd.ms-excel'; $extension[] = '.xls';
833
+        $mime_type[] = 'application/pdf'; $extension[] = '.pdf';
834
+        $mime_type[] = 'application/postscript'; $extension[] = '.ps';
835
+        $mime_type[] = 'application/mac-binhex40'; $extension[] = '.hqx';
836
+        $mime_type[] = 'application/x-gzip'; $extension[] = 'tar.gz';
837
+        $mime_type[] = 'application/x-shockwave-flash'; $extension[] = '.swf';
838
+        $mime_type[] = 'application/x-stuffit'; $extension[] = '.sit';
839
+        $mime_type[] = 'application/x-tar'; $extension[] = '.tar';
840
+        $mime_type[] = 'application/zip'; $extension[] = '.zip';
841
+        $mime_type[] = 'application/x-tar'; $extension[] = '.tar';
842
+        $mime_type[] = 'text/html'; $extension[] = '.html';
843
+        $mime_type[] = 'text/plain'; $extension[] = '.txt';
844
+        $mime_type[] = 'text/rtf'; $extension[] = '.rtf';
845
+        $mime_type[] = 'img/gif'; $extension[] = '.gif';
846
+        $mime_type[] = 'img/jpeg'; $extension[] = '.jpg';
847
+        $mime_type[] = 'img/png'; $extension[] = '.png';
848
+        $mime_type[] = 'audio/midi'; $extension[] = '.mid';
849
+        $mime_type[] = 'audio/mpeg'; $extension[] = '.mp3';
850
+        $mime_type[] = 'audio/x-aiff'; $extension[] = '.aif';
851
+        $mime_type[] = 'audio/x-pn-realaudio'; $extension[] = '.rm';
852
+        $mime_type[] = 'audio/x-pn-realaudio-plugin'; $extension[] = '.rpm';
853
+        $mime_type[] = 'audio/x-wav'; $extension[] = '.wav';
854
+        $mime_type[] = 'video/mpeg'; $extension[] = '.mpg';
855
+        $mime_type[] = 'video/mpeg4-generic'; $extension[] = '.mp4';
856
+        $mime_type[] = 'video/quicktime'; $extension[] = '.mov';
857
+        $mime_type[] = 'video/x-msvideo'; $extension[] = '.avi';
858
+
859
+        $mime_type[] = 'video/x-ms-wmv'; $extension[] = '.wmv';
860
+        $mime_type[] = 'video/x-flv'; $extension[] = '.flv';
861
+        $mime_type[] = 'image/svg+xml'; $extension[] = '.svg';
862
+        $mime_type[] = 'image/svg+xml'; $extension[] = '.svgz';
863
+        $mime_type[] = 'video/ogg'; $extension[] = '.ogv';
864
+        $mime_type[] = 'audio/ogg'; $extension[] = '.oga';
865
+        $mime_type[] = 'application/ogg'; $extension[] = '.ogg';
866
+        $mime_type[] = 'application/ogg'; $extension[] = '.ogx';
867
+        $mime_type[] = 'application/x-freemind'; $extension[] = '.mm';
868
+
869
+        $mime_type[] = 'application/vnd.ms-word.document.macroEnabled.12'; $extension[] = '.docm';
870
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; $extension[] = '.docx';
871
+        $mime_type[] = 'application/vnd.ms-word.template.macroEnabled.12'; $extension[] = '.dotm';
872
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'; $extension[] = '.dotx';
873
+        $mime_type[] = 'application/vnd.ms-powerpoint.template.macroEnabled.12'; $extension[] = '.potm';
874
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.template'; $extension[] = '.potx';
875
+        $mime_type[] = 'application/vnd.ms-powerpoint.addin.macroEnabled.12'; $extension[] = '.ppam';
876
+        $mime_type[] = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12'; $extension[] = '.ppsm';
877
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'; $extension[] = '.ppsx';
878
+        $mime_type[] = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12'; $extension[] = '.pptm';
879
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; $extension[] = '.pptx';
880
+        $mime_type[] = 'application/vnd.ms-excel.addin.macroEnabled.12'; $extension[] = '.xlam';
881
+        $mime_type[] = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12'; $extension[] = '.xlsb';
882
+        $mime_type[] = 'application/vnd.ms-excel.sheet.macroEnabled.12'; $extension[] = '.xlsm';
883
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; $extension[] = '.xlsx';
884
+        $mime_type[] = 'application/vnd.ms-excel.template.macroEnabled.12'; $extension[] = '.xltm';
885
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'; $extension[] = '.xltx';
886 886
 
887 887
         // Test on PC (files with no extension get application/octet-stream)
888 888
         //$mime_type[] = 'application/octet-stream';      $extension[] = '.ext';
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 
892 892
         foreach ($mime_type as $key => & $type) {
893 893
             if ($type == $file_type) {
894
-                $file_name .=  $extension[$key];
894
+                $file_name .= $extension[$key];
895 895
                 break;
896 896
             }
897 897
         }
@@ -967,12 +967,12 @@  discard block
 block discarded – undo
967 967
         }
968 968
 
969 969
         // It happens on Linux that $upload_path sometimes doesn't start with '/'
970
-        if ($upload_path[0] != '/' && substr($base_work_dir,-1,1) != '/') {
970
+        if ($upload_path[0] != '/' && substr($base_work_dir, -1, 1) != '/') {
971 971
             $upload_path = '/'.$upload_path;
972 972
         }
973 973
 
974 974
         if ($upload_path[strlen($upload_path) - 1] == '/') {
975
-            $upload_path=substr($upload_path, 0, -1);
975
+            $upload_path = substr($upload_path, 0, -1);
976 976
         }
977 977
 
978 978
         /*	Uncompressing phase */
@@ -984,15 +984,15 @@  discard block
 block discarded – undo
984 984
             - add it to the database
985 985
             - parse & change relative html links
986 986
         */
987
-        if (PHP_OS == 'Linux' && ! get_cfg_var('safe_mode') && false) { // *** UGent, changed by OC ***
987
+        if (PHP_OS == 'Linux' && !get_cfg_var('safe_mode') && false) { // *** UGent, changed by OC ***
988 988
             // Shell Method - if this is possible, it gains some speed
989
-            exec("unzip -d \"".$base_work_dir.$upload_path."/\"".$uploaded_file['name']." " .$uploaded_file['tmp_name']);
989
+            exec("unzip -d \"".$base_work_dir.$upload_path."/\"".$uploaded_file['name']." ".$uploaded_file['tmp_name']);
990 990
         } else {
991 991
             // PHP method - slower...
992 992
             $save_dir = getcwd();
993 993
             chdir($base_work_dir.$upload_path);
994 994
             $unzippingState = $zip_file->extract();
995
-            for ($j=0; $j < count($unzippingState); $j++) {
995
+            for ($j = 0; $j < count($unzippingState); $j++) {
996 996
                 $state = $unzippingState[$j];
997 997
 
998 998
                 // Fix relative links in html files
@@ -1006,8 +1006,8 @@  discard block
 block discarded – undo
1006 1006
                         if (is_dir($base_work_dir.$upload_path.'/'.$file)) $filetype = 'folder';
1007 1007
 
1008 1008
                         $safe_file = api_replace_dangerous_char($file);
1009
-                        @rename($base_work_dir.$upload_path.'/'.$file,$base_work_dir.$upload_path.'/'.$safe_file);
1010
-                        set_default_settings($upload_path, $safe_file,$filetype);
1009
+                        @rename($base_work_dir.$upload_path.'/'.$file, $base_work_dir.$upload_path.'/'.$safe_file);
1010
+                        set_default_settings($upload_path, $safe_file, $filetype);
1011 1011
                     }
1012 1012
                 }
1013 1013
 
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
     $zip = new PclZip($uploaded_file['tmp_name']);
1058 1058
 
1059 1059
     // Check the zip content (real size and file extension)
1060
-    $zip_content_array = (array)$zip->listContent();
1060
+    $zip_content_array = (array) $zip->listContent();
1061 1061
 
1062 1062
     $realSize = 0;
1063 1063
     foreach ($zip_content_array as & $this_content) {
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
 function filter_extension(&$filename)
1160 1160
 {
1161 1161
     if (substr($filename, -1) == '/') {
1162
-        return 1;  // Authorize directories
1162
+        return 1; // Authorize directories
1163 1163
     }
1164 1164
     $blacklist = api_get_setting('upload_extensions_list_type');
1165 1165
     if ($blacklist != 'whitelist') { // if = blacklist
@@ -1392,9 +1392,9 @@  discard block
 block discarded – undo
1392 1392
     $upload_path = str_replace('//', '/', $upload_path);
1393 1393
 
1394 1394
     if ($upload_path == '/') {
1395
-        $upload_path='';
1395
+        $upload_path = '';
1396 1396
     } elseif (!empty($upload_path) && $upload_path[0] != '/') {
1397
-        $upload_path="/$upload_path";
1397
+        $upload_path = "/$upload_path";
1398 1398
     }
1399 1399
 
1400 1400
     $endchar = substr($filename, strlen($filename) - 1, 1);
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
     $img_path_list = array();
1433 1433
 
1434 1434
     if (!$fp = fopen($html_file, 'r')) {
1435
-        return ;
1435
+        return;
1436 1436
     }
1437 1437
 
1438 1438
     // Aearch and store occurences of the <img> tag in an array
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
         $img_tag_list = $matches[0];
1453 1453
     }
1454 1454
 
1455
-    fclose ($fp);
1455
+    fclose($fp);
1456 1456
     unset($buffer);
1457 1457
 
1458 1458
     // Search the image file path from all the <IMG> tag detected
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 
1552 1552
     if (!is_dir($base_work_dir.$systemFolderName)) {
1553 1553
         $result = mkdir(
1554
-            $base_work_dir . $systemFolderName,
1554
+            $base_work_dir.$systemFolderName,
1555 1555
             api_get_permissions_for_new_directories(),
1556 1556
             true
1557 1557
         );
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
                     WHERE
1565 1565
                         c_id = $course_id AND
1566 1566
                         (
1567
-                            path = '" . Database::escape_string($systemFolderName). "'
1567
+                            path = '".Database::escape_string($systemFolderName)."'
1568 1568
                         )
1569 1569
             ";
1570 1570
 
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
 
1722 1722
     // Fix the image tags
1723 1723
 
1724
-    for ($i = 0, $fileNb = count($original_img_path); $i < $fileNb ; $i++) {
1724
+    for ($i = 0, $fileNb = count($original_img_path); $i < $fileNb; $i++) {
1725 1725
         $replace_what = $original_img_path[$i];
1726 1726
         // We only need the directory and the filename /path/to/file_html_files/missing_file.gif -> file_html_files/missing_file.gif
1727 1727
         $exploded_file_path = explode('/', $new_img_path[$i]);
@@ -1762,7 +1762,7 @@  discard block
 block discarded – undo
1762 1762
         .'</body>'
1763 1763
         .'</html>';
1764 1764
     if (file_exists($file_path)) {
1765
-        if (!($fp = fopen ($file_path, 'w'))) {
1765
+        if (!($fp = fopen($file_path, 'w'))) {
1766 1766
             return false;
1767 1767
         }
1768 1768
         return fwrite($fp, $file_content);
@@ -1799,7 +1799,7 @@  discard block
 block discarded – undo
1799 1799
 {
1800 1800
     // Do we need a / or not?
1801 1801
     $added_slash = ($upload_path == '/') ? '' : '/';
1802
-    $folder_id      = DocumentManager::get_document_id(api_get_course_info(), $upload_path);
1802
+    $folder_id = DocumentManager::get_document_id(api_get_course_info(), $upload_path);
1803 1803
     // Build the form
1804 1804
     $form = "<p><strong>".get_lang('MissingImagesDetected')."</strong></p>"
1805 1805
         ."<form method=\"post\" action=\"".api_get_self()."\" enctype=\"multipart/form-data\">"
Please login to merge, or discard this patch.