Completed
Push — 1.11.x ( 8330c8...fa802f )
by José
74:15 queued 40:10
created
main/admin/user_update_import.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
             // We are sure that the extra field exists.
216 216
             foreach ($extra_fields as $extras) {
217 217
                 if (isset($user[$extras[1]])) {
218
-                    $key 	= $extras[1];
219
-                    $value 	= $user[$extras[1]];
218
+                    $key = $extras[1];
219
+                    $value = $user[$extras[1]];
220 220
                     UserManager::update_extra_field_value($user_id, $key, $value);
221 221
                 }
222 222
             }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     global $current_tag;
254 254
     switch ($data) {
255 255
         case 'Contact':
256
-            $user = array ();
256
+            $user = array();
257 257
             break;
258 258
         default:
259 259
             $current_tag = $data;
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
     if (in_array($ext_import_file, $allowed_file_mimetype)) {
352 352
         if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) {
353
-            $users	= parse_csv_data($_FILES['import_file']['tmp_name']);
353
+            $users = parse_csv_data($_FILES['import_file']['tmp_name']);
354 354
             $errors = validate_data($users);
355 355
             $error_kind_file = false;
356 356
         } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) {
Please login to merge, or discard this patch.
main/social/groups.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -19,24 +19,24 @@  discard block
 block discarded – undo
19 19
 $join_url = '';
20 20
 
21 21
 $this_section = SECTION_SOCIAL;
22
-$allowed_views = array('mygroups','newest','pop');
22
+$allowed_views = array('mygroups', 'newest', 'pop');
23 23
 $content = null;
24 24
 
25 25
 if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) {
26 26
     if ($_GET['view'] == 'mygroups') {
27
-        $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
28
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MyGroups'));
29
-    } else if ( $_GET['view'] == 'newest') {
30
-        $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
31
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Newest'));
32
-    } else  {
33
-        $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
34
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Popular'));
27
+        $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
28
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('MyGroups'));
29
+    } else if ($_GET['view'] == 'newest') {
30
+        $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
31
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Newest'));
32
+    } else {
33
+        $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
34
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Popular'));
35 35
     }
36 36
 } else {
37
-    $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
37
+    $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
38 38
     if (!isset($_GET['id'])) {
39
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('GroupList'));
39
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('GroupList'));
40 40
     }
41 41
 }
42 42
 
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
         } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
74 74
             $name .= ' '.Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style'=>'vertical-align:middle'));
75 75
         }
76
-        $url  = '<a href="group_view.php?id='.$id.'">' . $name . '</a>';
76
+        $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>';
77 77
 
78
-        $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
79
-        if ($count_users_group == 1 ) {
78
+        $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000));
79
+        if ($count_users_group == 1) {
80 80
             $count_users_group = $count_users_group.' '.get_lang('Member');
81 81
         } else {
82 82
             $count_users_group = $count_users_group.' '.get_lang('Members');
83 83
         }
84 84
 
85
-        $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80);
85
+        $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80);
86 86
         $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />';
87 87
 
88 88
         $members = Display::returnFontAwesomeIcon('user').$count_users_group;
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
         $html .= '<div class="title-groups">';
95 95
         $html .= Display::tag('h5', $url);
96 96
         $html .= '</div>';
97
-        $html .= '<div class="members-groups">' . $members . '</div>';
97
+        $html .= '<div class="members-groups">'.$members.'</div>';
98 98
         if ($result['description'] != '') {
99
-            $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>';
99
+            $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>';
100 100
         } else {
101 101
             $html .= '';
102 102
         }
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
         $html .= '</div>';
105 105
 
106 106
         $grid_item_2 = $html;
107
-        $grid_my_groups[]= array($grid_item_2);
107
+        $grid_my_groups[] = array($grid_item_2);
108 108
     }
109 109
 }
110 110
 
111 111
 // Newest groups
112
-$results = $usergroup->get_groups_by_age(4,false);
112
+$results = $usergroup->get_groups_by_age(4, false);
113 113
 
114 114
 $grid_newest_groups = array();
115 115
 foreach ($results as $result) {
@@ -118,16 +118,16 @@  discard block
 block discarded – undo
118 118
     $id = $result['id'];
119 119
     $name = cut($result['name'], GROUP_TITLE_LENGTH, true);
120 120
 
121
-    $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
122
-    if ($count_users_group == 1 ) {
121
+    $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000));
122
+    if ($count_users_group == 1) {
123 123
         $count_users_group = $count_users_group.' '.get_lang('Member');
124 124
     } else {
125 125
         $count_users_group = $count_users_group.' '.get_lang('Members');
126 126
     }
127 127
 
128
-    $url  = '<a href="group_view.php?id='.$id.'">' . $name . '</a>';
128
+    $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>';
129 129
 
130
-    $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80);
130
+    $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80);
131 131
     $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />';
132 132
     $members = Display::returnFontAwesomeIcon('user').$count_users_group;
133 133
 
@@ -139,15 +139,15 @@  discard block
 block discarded – undo
139 139
     $html .= '<div class="title-groups">';
140 140
     $html .= Display::tag('h5', $url);
141 141
     $html .= '</div>';
142
-    $html .= '<div class="members-groups">' . $members . '</div>';
142
+    $html .= '<div class="members-groups">'.$members.'</div>';
143 143
     if ($result['description'] != '') {
144
-        $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>';
144
+        $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>';
145 145
     } else {
146 146
         $html .= '';
147 147
     }
148 148
     //Avoiding my groups
149 149
 
150
-    if (!in_array($id,$my_group_list)) {
150
+    if (!in_array($id, $my_group_list)) {
151 151
         $html .= '<a class="btn" href="group_view.php?id='.$id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a> ';
152 152
     }
153 153
 
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
 
158 158
     $grid_item_2 = $html;
159 159
 
160
-    $grid_newest_groups[]= array($grid_item_2);
160
+    $grid_newest_groups[] = array($grid_item_2);
161 161
 }
162 162
 
163 163
 // Pop groups
164
-$results = $usergroup->get_groups_by_popularity(4,false);
164
+$results = $usergroup->get_groups_by_popularity(4, false);
165 165
 $grid_pop_groups = array();
166 166
 
167 167
 if (is_array($results) && count($results) > 0) {
@@ -169,18 +169,18 @@  discard block
 block discarded – undo
169 169
         $result['name'] = Security::remove_XSS($result['name'], STUDENT, true);
170 170
         $result['description'] = Security::remove_XSS($result['description'], STUDENT, true);
171 171
         $id = $result['id'];
172
-        $name = cut($result['name'],GROUP_TITLE_LENGTH,true);
172
+        $name = cut($result['name'], GROUP_TITLE_LENGTH, true);
173 173
 
174
-        $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
175
-        if ($count_users_group == 1 ) {
174
+        $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000));
175
+        if ($count_users_group == 1) {
176 176
             $count_users_group = $count_users_group.' '.get_lang('Member');
177 177
         } else {
178 178
             $count_users_group = $count_users_group.' '.get_lang('Members');
179 179
         }
180 180
 
181
-        $url  = '<a href="group_view.php?id='.$id.'">' . $name . '</a>';
181
+        $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>';
182 182
 
183
-        $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80);
183
+        $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80);
184 184
         $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />';
185 185
 
186 186
         $html = '<div class="row">';
@@ -191,15 +191,15 @@  discard block
 block discarded – undo
191 191
         $html .= '<div class="title-groups">';
192 192
         $html .= Display::tag('h5', $url);
193 193
         $html .= '</div>';
194
-        $html .= '<div class="members-groups">' . $members . '</div>';
194
+        $html .= '<div class="members-groups">'.$members.'</div>';
195 195
         if ($result['description'] != '') {
196
-            $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>';
196
+            $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>';
197 197
         } else {
198 198
             $html .= '';
199 199
         }
200 200
         //Avoiding my groups
201 201
 
202
-        if (!in_array($id,$my_group_list)) {
202
+        if (!in_array($id, $my_group_list)) {
203 203
             $html .= '<a class="btn" href="group_view.php?id='.$id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a> ';
204 204
         }
205 205
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         $html .= '</div>';
209 209
 
210 210
         $grid_item_2 = $html;
211
-        $grid_pop_groups[]= array($grid_item_2);
211
+        $grid_pop_groups[] = array($grid_item_2);
212 212
     }
213 213
 }
214 214
 
@@ -222,36 +222,36 @@  discard block
 block discarded – undo
222 222
     switch ($view_group) {
223 223
         case 'mygroups':
224 224
             if (count($grid_my_groups) > 0) {
225
-                $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false));
225
+                $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true, false));
226 226
             }
227 227
             if (api_get_setting(
228 228
                     'social.allow_students_to_create_groups_in_social'
229 229
                 ) == 'true'
230 230
             ) {
231
-                $create_group_item =  '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
231
+                $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
232 232
                     get_lang('CreateASocialGroup').'</a>';
233 233
             } else {
234
-                if (api_is_allowed_to_edit(null,true)) {
235
-                    $create_group_item =  '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
234
+                if (api_is_allowed_to_edit(null, true)) {
235
+                    $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
236 236
                         get_lang('CreateASocialGroup').'</a>';
237 237
                 }
238 238
             }
239 239
             break;
240 240
         case 'newest':
241 241
             if (count($grid_newest_groups) > 0) {
242
-                $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
242
+                $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false));
243 243
             }
244 244
             break;
245 245
         default:
246 246
             if (count($grid_pop_groups) > 0) {
247
-                $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true));
247
+                $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true));
248 248
             }
249 249
             break;
250 250
     }
251 251
 } else {
252 252
     $my_group_content = null;
253 253
     if (count($grid_my_groups) > 0) {
254
-        $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false));
254
+        $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true, false));
255 255
     } else {
256 256
         $my_group_content = '<span class="muted">'.get_lang('GroupNone').'</span>';
257 257
     }
@@ -259,30 +259,30 @@  discard block
 block discarded – undo
259 259
             'social.allow_students_to_create_groups_in_social'
260 260
         ) == 'true'
261 261
     ) {
262
-        $create_group_item =  '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
262
+        $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
263 263
             get_lang('CreateASocialGroup').'</a>';
264 264
     } else {
265
-        if (api_is_allowed_to_edit(null,true)) {
266
-            $create_group_item =  '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.get_lang('CreateASocialGroup').'</a>';
265
+        if (api_is_allowed_to_edit(null, true)) {
266
+            $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.get_lang('CreateASocialGroup').'</a>';
267 267
         }
268 268
     }
269 269
     if (count($grid_newest_groups) > 0) {
270
-        $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
270
+        $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false));
271 271
     } else {
272 272
         $newest_content = '<span class="muted">'.get_lang('GroupNone').'</span>';
273 273
     }
274 274
     if (count($grid_pop_groups) > 0) {
275
-        $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true));
275
+        $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true));
276 276
     } else {
277 277
         $popular_content = '<span class="muted">'.get_lang('GroupNone').'</span>';
278 278
     }
279 279
 }
280 280
 
281 281
 if (!empty($create_group_item)) {
282
-    $social_right_content .=  Display::page_subheader($create_group_item);
282
+    $social_right_content .= Display::page_subheader($create_group_item);
283 283
 }
284 284
 $headers = array(get_lang('Newest'), get_lang('Popular'), get_lang('MyGroups'));
285
-$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content),'tab_browse');
285
+$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content), 'tab_browse');
286 286
 
287 287
 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'show_message' && isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'topic_deleted') {
288 288
     Display::return_message(get_lang('Deleted'), 'success');
Please login to merge, or discard this patch.
main/work/view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 /* For licensing terms, see /license.txt */
3 3
 
4 4
 require_once '../inc/global.inc.php';
5
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
5
+$current_course_tool = TOOL_STUDENTPUBLICATION;
6 6
 
7 7
 require_once 'work.lib.php';
8 8
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     $userInfo = api_get_user_info($work['user_id']);
53 53
     $interbreadcrumb[] = array('url' => $url_dir, 'name' => $my_folder_data['title']);
54 54
     $interbreadcrumb[] = array('url' => '#', 'name' => $userInfo['complete_name']);
55
-    $interbreadcrumb[] = array('url' => '#','name' => $work['title']);
55
+    $interbreadcrumb[] = array('url' => '#', 'name' => $work['title']);
56 56
 
57 57
     if (($courseInfo['show_score'] == 0 &&
58 58
         $work['active'] == 1 &&
Please login to merge, or discard this patch.
main/work/edit.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 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
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 $token = Security::get_token();
51 51
 
52 52
 $student_can_edit_in_session = api_is_allowed_to_session_edit(false, true);
53
-$has_ended   = false;
53
+$has_ended = false;
54 54
 $is_author = false;
55 55
 $work_item = get_work_data_by_id($item_id);
56 56
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 $form->setDefaults($defaults);
221 221
 $error_message = null;
222 222
 $_course = api_get_course_info();
223
-$currentCourseRepositorySys = api_get_path(SYS_COURSE_PATH).$_course['path'] . '/';
223
+$currentCourseRepositorySys = api_get_path(SYS_COURSE_PATH).$_course['path'].'/';
224 224
 
225 225
 $succeed = false;
226 226
 if ($form->validate()) {
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
             $description = isset($_POST['description']) ? $_POST['description'] : $work_data['description'];
242 242
 
243 243
             $add_to_update = null;
244
-            if ($is_allowed_to_edit && ($_POST['qualification'] !='' )) {
244
+            if ($is_allowed_to_edit && ($_POST['qualification'] != '')) {
245 245
                 $add_to_update = ', qualificator_id ='."'".api_get_user_id()."', ";
246 246
                 $add_to_update .= ' qualification = '."'".Database::escape_string($_POST['qualification'])."',";
247 247
                 $add_to_update .= ' date_of_qualification = '."'".api_get_utc_datetime()."'";
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                     'error'
268 268
                 );
269 269
             } else {
270
-                $sql = "UPDATE  " . $work_table . "
270
+                $sql = "UPDATE  ".$work_table."
271 271
                         SET	title = '".Database::escape_string($title)."',
272 272
                             description = '".Database::escape_string($description)."'
273 273
                             ".$add_to_update."
Please login to merge, or discard this patch.
main/dropbox/recover_dropbox_files.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 $result = Database::query($sql);
34 34
 
35 35
 if (Database::num_rows($result)) {
36
-    $files  = Database::store_result($result);
36
+    $files = Database::store_result($result);
37 37
     $rows = array();
38 38
     foreach ($files as $file) {
39 39
         //Check if I have this file:
Please login to merge, or discard this patch.
main/dropbox/dropbox_init.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 $is_courseTutor = api_is_course_tutor();
127 127
 $is_courseAdmin = api_is_course_admin();
128 128
 
129
-$current_course_tool  = TOOL_DROPBOX;
129
+$current_course_tool = TOOL_DROPBOX;
130 130
 
131 131
 // the dropbox configuration parameters
132 132
 $dropbox_cnf = require_once 'dropbox_config.inc.php';
@@ -278,10 +278,10 @@  discard block
 block discarded – undo
278 278
 $javascript .= "
279 279
 	</script>";
280 280
 $htmlHeadXtra[] = $javascript;
281
-$htmlHeadXtra[] ="<script>
281
+$htmlHeadXtra[] = "<script>
282 282
 function confirmation (name)
283 283
 {
284
-	if (confirm(\" ". get_lang("AreYouSureToDeleteJS") ." \"+ name + \" ?\"))
284
+	if (confirm(\" ". get_lang("AreYouSureToDeleteJS")." \"+ name + \" ?\"))
285 285
 		{return true;}
286 286
 	else
287 287
 		{return false;}
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
 if ((!$is_allowed_in_course || !$is_course_member) && !api_is_allowed_to_edit(null, true)) {
323 323
     if ($origin != 'learnpath') {
324
-        api_not_allowed(true);//print headers/footers
324
+        api_not_allowed(true); //print headers/footers
325 325
     } else {
326 326
         api_not_allowed();
327 327
     }
Please login to merge, or discard this patch.
main/inc/lib/geometry.lib.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
  * @returns an array such as: for all i in [0..max[x][ : for all j in [0..max[y][ : array[i][j] = FALSE
14 14
  */
15 15
 function poly_init($max) {
16
-    return array_fill(0, $max["x"]-1,
17
-            array_fill(0, $max["y"]-1, FALSE));
16
+    return array_fill(0, $max["x"] - 1,
17
+            array_fill(0, $max["y"] - 1, FALSE));
18 18
 }
19 19
 
20 20
 
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
     	array_push($bords[$poly[0]['y']], $poly[0]['x']);
70 70
 
71 71
     $i = 1; // we re-use $i and $old_pente bellow the loop
72
-    $old_pente=0;
73
-    for (    ;    // for each points of the polygon but the first
74
-        $i<sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) {
72
+    $old_pente = 0;
73
+    for (;    // for each points of the polygon but the first
74
+        $i < sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) {
75 75
 
76 76
         /* special cases */
77
-        if ($poly[$i-1]['y'] == $poly[$i]['y']) {
78
-            if ($poly[$i-1]['x'] == $poly[$i]['x'])
77
+        if ($poly[$i - 1]['y'] == $poly[$i]['y']) {
78
+            if ($poly[$i - 1]['x'] == $poly[$i]['x'])
79 79
                 continue; // twice the same point
80 80
             else {    //  infinite elevation of the edge
81 81
             	if (is_array($bords[$poly[$i]['y']]))
82
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
83
-                $old_pente=0;
82
+                	array_push($bords[$poly[$i]['y']], $poly[$i]['x']);
83
+                $old_pente = 0;
84 84
                 continue;
85 85
             }
86 86
         }
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
 
94 94
         /* computing the elevation of the edge going */
95 95
         //        from $poly[$i-1] to $poly[$i]
96
-        $pente = ($poly[$i-1]['x']-$poly[$i]['x'])/
97
-                 ($poly[$i-1]['y']-$poly[$i]['y']);
96
+        $pente = ($poly[$i - 1]['x'] - $poly[$i]['x']) /
97
+                 ($poly[$i - 1]['y'] - $poly[$i]['y']);
98 98
 
99 99
         // if the sign of the elevation change from the one of the
100 100
         // previous edge, the point must be added a second time inside
101 101
         // $bords
102
-        if ($i>1)
103
-            if (($old_pente<0 && $pente>0)
104
-                    || ($old_pente>0 && $pente<0)) {
102
+        if ($i > 1)
103
+            if (($old_pente < 0 && $pente > 0)
104
+                    || ($old_pente > 0 && $pente < 0)) {
105 105
 				if (is_array($bords[$poly[$i]['y']])) //avoid warning
106
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
106
+                	array_push($bords[$poly[$i]['y']], $poly[$i]['x']);
107 107
 
108 108
                 if (DEBUG)
109 109
                     echo '*('.$poly[$i]['x'].
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
         	}
112 112
 
113 113
         /* detect the direction of the elevation in Y */
114
-        $dy_inc = ($poly[$i]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1;
115
-        $x = $poly[$i-1]['x'];
114
+        $dy_inc = ($poly[$i]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1;
115
+        $x = $poly[$i - 1]['x'];
116 116
 //        if (DEBUG) echo "init: ".$poly[$i-1]['y']."  dy_inc: ".$dy_inc.
117 117
 //            "   end: ".$poly[$i]['y']."   pente:".$pente;
118 118
 
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 
122 122
         // we iterate w/ $dy in ]$poly[$i-1]['y'],$poly[$i-1]['y'][
123 123
         //    w/ $dy_inc as increment
124
-        for ($dy = $poly[$i-1]['y']+$dy_inc;
124
+        for ($dy = $poly[$i - 1]['y'] + $dy_inc;
125 125
             $dy != $poly[$i]['y'];
126 126
             $dy += $dy_inc) {
127
-            $x += $pente*$dy_inc;
127
+            $x += $pente * $dy_inc;
128 128
             array_push($bords[$dy], $x);
129 129
 //            if (DEBUG) echo '/('.$x.';'.$dy.')   ';
130 130
         }
@@ -132,47 +132,47 @@  discard block
 block discarded – undo
132 132
     }
133 133
 
134 134
     // closing the polygone (the edge between $poly[$i-1] and $poly[0])
135
-    if ($poly[$i-1]['y']!=$poly[0]['y']) {// droite--> rien à faire
135
+    if ($poly[$i - 1]['y'] != $poly[0]['y']) {// droite--> rien à faire
136 136
 
137 137
         // elevation between $poly[0]['x'] and $poly[1]['x'])
138
-        $rest = $poly[0]['y']-$poly[1]['y'];
139
-        if ($rest!=0)
140
-        	$pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest);
138
+        $rest = $poly[0]['y'] - $poly[1]['y'];
139
+        if ($rest != 0)
140
+        	$pente1 = ($poly[0]['x'] - $poly[1]['x']) / ($rest);
141 141
         else
142 142
 			$pente1 = 0;
143 143
 
144 144
         // elevation between $poly[$i-1]['x'] and $poly[0]['x'])
145
-        $pente = ($poly[$i-1]['x']-$poly[0]['x'])/
146
-            ($poly[$i-1]['y']-$poly[0]['y']);
145
+        $pente = ($poly[$i - 1]['x'] - $poly[0]['x']) /
146
+            ($poly[$i - 1]['y'] - $poly[0]['y']);
147 147
 
148 148
 //        if (DEBUG) echo 'start('.$poly[$i-1]['x'].','.$poly[$i-1]['y'].
149 149
 //                ')-end('.$poly[0]['x'].','.$poly[0]['y'].
150 150
 //                ')-pente'.$pente;
151 151
 
152 152
         // doubling the first point if needed (see above)
153
-        if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) {
153
+        if (($pente1 < 0 && $pente > 0) || ($pente1 > 0 && $pente < 0)) {
154 154
         	if (is_array($bords[$poly[$i - 1]['y']]))
155
-            	array_push($bords[$poly[$i - 1]['y']],  round($poly[$i - 1]['x']));
155
+            	array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x']));
156 156
             //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
157 157
         }
158 158
         //  doubling the last point if neededd
159
-        if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) {
160
-        	if (is_array($bords[$poly[$i-1]['y']])) //avoid warning
161
-            	array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x']));
159
+        if (($old_pente < 0 && $pente > 0) || ($old_pente > 0 && $pente < 0)) {
160
+        	if (is_array($bords[$poly[$i - 1]['y']])) //avoid warning
161
+            	array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x']));
162 162
             //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
163 163
         }
164 164
 
165 165
 
166
-        $dy_inc = ($poly[0]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1;
167
-        $x = $poly[$i-1]['x'];
166
+        $dy_inc = ($poly[0]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1;
167
+        $x = $poly[$i - 1]['x'];
168 168
 //        if (DEBUG) echo "init: ".$poly[$i-1]['y']."  dy_inc: ".$dy_inc.
169 169
 //            "   end: ".$poly[0]['y'];
170 170
 
171
-        for ($dy = $poly[$i-1]['y']+$dy_inc;
171
+        for ($dy = $poly[$i - 1]['y'] + $dy_inc;
172 172
             $dy != $poly[0]['y'];
173 173
             $dy += $dy_inc)
174 174
         {
175
-            $x += $pente*$dy_inc;
175
+            $x += $pente * $dy_inc;
176 176
             array_push($bords[$dy], round($x));
177 177
 //            if (DEBUG) echo '/('.$x.';'.$dy.')   ';
178 178
         }
@@ -182,20 +182,20 @@  discard block
 block discarded – undo
182 182
     /* basic idea: we sort a column of edges.
183 183
         For each pair of point, we color the points in between */
184 184
     $n = count($bords);
185
-    for ($i = 0; $i<$n; $i++) {  // Y
185
+    for ($i = 0; $i < $n; $i++) {  // Y
186 186
         //error_log(__FILE__.' - Border Num '.$i,0);
187 187
         if (is_array($bords[$i])) {
188 188
        		sort($bords[$i]);
189 189
         }
190 190
 
191
-        for ($j = 0; $j<sizeof($bords[$i]);$j+=2) { // bords
191
+        for ($j = 0; $j < sizeof($bords[$i]); $j += 2) { // bords
192 192
             if (!isset($bords[$i][$j + 1])) {
193 193
                 break;
194 194
             }
195 195
 
196
-            for ($k = round($bords[$i][$j]); $k<=$bords[$i][$j+1];$k++) {
196
+            for ($k = round($bords[$i][$j]); $k <= $bords[$i][$j + 1]; $k++) {
197 197
                 $res[$k][$i] = true; //filling the array with trues
198
-                if ($test == 1)  {
198
+                if ($test == 1) {
199 199
                 	/*how to draw the polygon in a human way:
200 200
                 	In ubuntu : sudo apt-get install gnuplot
201 201
                 	Create an empty file with all points with the result of this echos (No commas, no point, no headers)
@@ -222,19 +222,19 @@  discard block
 block discarded – undo
222 222
  *
223 223
  * @return string     html code of the representation of the polygone image
224 224
  */
225
-function poly_dump(&$poly, $max, $format='raw') {
225
+function poly_dump(&$poly, $max, $format = 'raw') {
226 226
     if ($format == 'html') {
227 227
         $s = "<div style='font-size: 8px; line-height:3px'><pre>\n";
228 228
     }
229
-    for ($i=0; $i<$max['y']; $i++) {
230
-        for($j=0; $j<$max['x']; $j++)
231
-            if($poly[$j][$i] == TRUE)
232
-                $s .= ($format=='html'?"<b>1</b>":'1');
229
+    for ($i = 0; $i < $max['y']; $i++) {
230
+        for ($j = 0; $j < $max['x']; $j++)
231
+            if ($poly[$j][$i] == TRUE)
232
+                $s .= ($format == 'html' ? "<b>1</b>" : '1');
233 233
             else
234 234
                 $s .= "0";
235
-        $s .= ($format=='html'?"<br />\n":"\n");
235
+        $s .= ($format == 'html' ? "<br />\n" : "\n");
236 236
     }
237
-    $s .= ($format=='html'?"</pre></div>\n":"\n");
237
+    $s .= ($format == 'html' ? "</pre></div>\n" : "\n");
238 238
     return $s;
239 239
 }
240 240
 
@@ -252,8 +252,8 @@  discard block
 block discarded – undo
252 252
     $surfaceOf1 = 0;
253 253
     $surfaceOf2 = 0;
254 254
 
255
-    for ($i=0; $i<$max['x']; $i++)
256
-        for($j=0; $j<$max['y']; $j++) {
255
+    for ($i = 0; $i < $max['x']; $i++)
256
+        for ($j = 0; $j < $max['y']; $j++) {
257 257
             if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == TRUE)) {
258 258
                 $surfaceOf1++;
259 259
                 if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE))
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                 $surfaceOf2++;
264 264
         }
265 265
 
266
-    return array (
266
+    return array(
267 267
         "s1" => $surfaceOf1,
268 268
         "s2" => $surfaceOf2,
269 269
         "both" => $surfaceOf1 - $onlyIn1,
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
  */
283 283
 function poly_touch(&$poly1, &$poly2, $max) {
284 284
 
285
-    for ($i=0; $i<$max['x']; $i++) {
286
-        for($j=0; $j<$max['y']; $j++) {
285
+    for ($i = 0; $i < $max['x']; $i++) {
286
+        for ($j = 0; $j < $max['y']; $j++) {
287 287
             if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == true)
288 288
                 && isset($poly2[$i][$j]) && ($poly2[$i][$j] == true)) {
289 289
                     return true;
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
  * @return  array   An array of points in the right format to use with the
302 302
  *                  local functions
303 303
  */
304
-function convert_coordinates($coords,$sep='|') {
304
+function convert_coordinates($coords, $sep = '|') {
305 305
     $points = array();
306
-    $pairs = explode($sep,$coords);
306
+    $pairs = explode($sep, $coords);
307 307
     foreach ($pairs as $idx => $pcoord) {
308
-        list($x,$y) = explode(';',$pcoord);
309
-        $points[] = array('x'=>$x,'y'=>$y);
308
+        list($x, $y) = explode(';', $pcoord);
309
+        $points[] = array('x'=>$x, 'y'=>$y);
310 310
     }
311 311
 	return $points;
312 312
 }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
             $my = $coord['y'];
337 337
         }
338 338
     }
339
-    return array('x'=>$mx,'y'=>$my);
339
+    return array('x'=>$mx, 'y'=>$my);
340 340
 }
341 341
 
342 342
 /**
Please login to merge, or discard this patch.
main/admin/access_urls.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     exit;
20 20
 }
21 21
 
22
-$interbreadcrumb[] = array ("url" => 'index.php', 'name' => get_lang('PlatformAdmin'));
22
+$interbreadcrumb[] = array("url" => 'index.php', 'name' => get_lang('PlatformAdmin'));
23 23
 $tool_name = get_lang('MultipleAccessURLs');
24 24
 Display :: display_header($tool_name);
25 25
 
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
         case 'register':
56 56
             // we are going to register the admin
57 57
             if (api_is_platform_admin()) {
58
-                if ($current_access_url_id!=-1) {
58
+                if ($current_access_url_id != -1) {
59 59
                     $url_str = '';
60 60
                     foreach ($url_list as $my_url) {
61 61
                         if (!in_array($my_url['id'], $my_user_url_list)) {
62 62
                             UrlManager::add_user_to_url(api_get_user_id(), $my_url['id']);
63
-                            $url_str.=$my_url['url'].' <br />';
63
+                            $url_str .= $my_url['url'].' <br />';
64 64
                         }
65 65
                     }
66 66
                     Display:: display_normal_message(
@@ -84,16 +84,16 @@  discard block
 block discarded – undo
84 84
         $url_string .= $my_url['url'].' <br />';
85 85
     }
86 86
 }
87
-if(!empty($url_string)) {
88
-	Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false);
87
+if (!empty($url_string)) {
88
+	Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string, false);
89 89
 }
90 90
 
91 91
 // checking the current installation
92
-if ($current_access_url_id==-1) {
92
+if ($current_access_url_id == -1) {
93 93
 	Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH));
94
-} elseif(api_is_platform_admin()) {
95
-    $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id);
96
-    if ($quant==0) {
94
+} elseif (api_is_platform_admin()) {
95
+    $quant = UrlManager::relation_url_user_exist(api_get_user_id(), $current_access_url_id);
96
+    if ($quant == 0) {
97 97
         Display:: display_warning_message(
98 98
             '<a href="'.api_get_self().'?action=register&sec_token='.$parameters['sec_token'].'">'.get_lang('ClickToRegisterAdmin').'</a>',
99 99
             false
@@ -142,16 +142,16 @@  discard block
 block discarded – undo
142 142
 
143 143
     //Status
144 144
     $active = $row['active'];
145
-    if ($active=='1') {
146
-        $action='lock';
147
-        $image='right';
145
+    if ($active == '1') {
146
+        $action = 'lock';
147
+        $image = 'right';
148 148
     }
149
-    if ($active=='0') {
150
-        $action='unlock';
151
-        $image='wrong';
149
+    if ($active == '0') {
150
+        $action = 'unlock';
151
+        $image = 'wrong';
152 152
     }
153 153
     // you cannot lock the default
154
-    if ($row['id']=='1') {
154
+    if ($row['id'] == '1') {
155 155
         $status = Display::return_icon($image.'.gif', get_lang(ucfirst($action)));
156 156
     } else {
157 157
         $status = '<a href="access_urls.php?action='.$action.'&amp;url_id='.$row['id'].'">'.
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     $url_id = $row['id'];
162 162
     $actions = Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), "access_url_edit.php?url_id=$url_id");
163 163
     if ($url_id != '1') {
164
-        $actions .= '<a href="access_urls.php?action=delete_url&amp;url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.
164
+        $actions .= '<a href="access_urls.php?action=delete_url&amp;url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.
165 165
             Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
166 166
     }
167 167
     $urls[] = array($url, $description, $status, $actions);
Please login to merge, or discard this patch.
main/calendar/agenda.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@
 block discarded – undo
274 274
             }
275 275
             break;
276 276
         case "delete":
277
-            if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $eventId) )) {
277
+            if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $eventId))) {
278 278
                 // a coach can only delete an element belonging to his session
279 279
                 $content = $agenda->deleteEvent($eventId);
280 280
             }
Please login to merge, or discard this patch.