Completed
Push — 1.11.x ( 3ebade...c47d58 )
by José
213:48 queued 162:56
created
main/inc/lib/redirect.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             self::navigate($url);
35 35
         }
36 36
 
37
-        $url = self::www() . $url;
37
+        $url = self::www().$url;
38 38
         self::navigate($url);
39 39
     }
40 40
 
@@ -67,25 +67,25 @@  discard block
 block discarded – undo
67 67
                     case COURSEMANAGER:
68 68
                         $redir = api_get_setting('teacher_page_after_login');
69 69
                         if (!empty($redir)) {
70
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
70
+                            self::navigate(api_get_path(WEB_PATH).$redir);
71 71
                         }
72 72
                         break;
73 73
                     case STUDENT:
74 74
                         $redir = api_get_setting('student_page_after_login');
75 75
                         if (!empty($redir)) {
76
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
76
+                            self::navigate(api_get_path(WEB_PATH).$redir);
77 77
                         }
78 78
                         break;
79 79
                     case DRH:
80 80
                         $redir = api_get_setting('drh_page_after_login');
81 81
                         if (!empty($redir)) {
82
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
82
+                            self::navigate(api_get_path(WEB_PATH).$redir);
83 83
                         }
84 84
                         break;
85 85
                     case SESSIONADMIN:
86 86
                         $redir = api_get_setting('sessionadmin_page_after_login');
87 87
                         if (!empty($redir)) {
88
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
88
+                            self::navigate(api_get_path(WEB_PATH).$redir);
89 89
                         }
90 90
                         break;
91 91
                     default:
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             }
112 112
             $page_after_login = api_get_setting('page_after_login');
113 113
             if (!empty($page_after_login)) {
114
-                self::navigate(api_get_path(WEB_PATH) . $page_after_login);
114
+                self::navigate(api_get_path(WEB_PATH).$page_after_login);
115 115
             }
116 116
         }
117 117
     }
Please login to merge, or discard this patch.
main/inc/lib/diagnoser.lib.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -401,19 +401,19 @@
 block discarded – undo
401 401
 
402 402
     public function format_yes_no_optional($value)
403 403
     {
404
-    	$return = '';
405
-    	switch($value) {
406
-     		case 0:
407
-     			$return = get_lang('No');
408
-     			break;
409
-     		case 1:
410
-     			$return = get_lang('Yes');
411
-     			break;
412
-			case 2:
413
-				$return = get_lang('Optional');
414
-				break;
415
-    	}
416
-    	return $return;
404
+        $return = '';
405
+        switch($value) {
406
+                case 0:
407
+                 $return = get_lang('No');
408
+                    break;
409
+                case 1:
410
+                 $return = get_lang('Yes');
411
+                    break;
412
+            case 2:
413
+                $return = get_lang('Optional');
414
+                break;
415
+        }
416
+        return $return;
417 417
 
418 418
     }
419 419
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -9 removed lines patch added patch discarded remove patch
@@ -158,8 +158,9 @@  discard block
 block discarded – undo
158 158
         $array[] = $this->build_setting($status, '[INI]', 'display_errors', 'http://www.php.net/manual/en/ini.core.php#ini.display_errors', $setting, $req_setting, 'on_off', get_lang('DisplayErrorsInfo'));
159 159
 
160 160
         $setting = ini_get('default_charset');
161
-        if ($setting == '')
162
-            $setting = null;
161
+        if ($setting == '') {
162
+                    $setting = null;
163
+        }
163 164
         $req_setting = null;
164 165
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_ERROR;
165 166
         $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo'));
@@ -177,22 +178,25 @@  discard block
 block discarded – undo
177 178
         $setting = ini_get('memory_limit');
178 179
         $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M';
179 180
         $status = self :: STATUS_ERROR;
180
-        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT)
181
-            $status = self :: STATUS_OK;
181
+        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT) {
182
+                    $status = self :: STATUS_OK;
183
+        }
182 184
         $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo'));
183 185
 
184 186
         $setting = ini_get('post_max_size');
185 187
         $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M';
186 188
         $status = self :: STATUS_ERROR;
187
-        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE)
188
-            $status = self :: STATUS_OK;
189
+        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE) {
190
+                    $status = self :: STATUS_OK;
191
+        }
189 192
         $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo'));
190 193
 
191 194
         $setting = ini_get('upload_max_filesize');
192 195
         $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M';
193 196
         $status = self :: STATUS_ERROR;
194
-        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
195
-            $status = self :: STATUS_OK;
197
+        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) {
198
+                    $status = self :: STATUS_OK;
199
+        }
196 200
         $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo'));
197 201
 
198 202
         $setting = ini_get('variables_order');
@@ -205,7 +209,7 @@  discard block
 block discarded – undo
205 209
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
206 210
         $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo'));
207 211
 
208
-        if (api_check_browscap()){$setting = true;}else{$setting=false;}
212
+        if (api_check_browscap()){$setting = true;} else{$setting=false;}
209 213
         $req_setting = true;
210 214
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
211 215
         $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo'));
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     const STATUS_OK = 1;
17 17
     const STATUS_WARNING = 2;
18
-    const STATUS_ERROR 	= 3;
18
+    const STATUS_ERROR = 3;
19 19
     const STATUS_INFORMATION = 4;
20 20
 
21 21
     /**
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
                 $html .= '<li>';
43 43
             }
44 44
             $params['section'] = $section;
45
-            $html .='<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
45
+            $html .= '<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
46 46
         }
47 47
 
48 48
         $html .= '</ul><div class="tab-pane">';
49 49
 
50
-        $data = call_user_func(array($this, 'get_' . $currentSection . '_data'));
50
+        $data = call_user_func(array($this, 'get_'.$currentSection.'_data'));
51 51
         echo $html;
52 52
 
53 53
         if ($currentSection != 'paths') {
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $array = array();
116 116
         $writable_folders = array(
117
-            api_get_path(SYS_APP_PATH) .'cache',
117
+            api_get_path(SYS_APP_PATH).'cache',
118 118
             api_get_path(SYS_COURSE_PATH),
119
-            api_get_path(SYS_APP_PATH) .'home',
120
-            api_get_path(SYS_APP_PATH) .'upload/users/',
121
-            api_get_path(SYS_PATH) .'main/default_course_document/images/',
119
+            api_get_path(SYS_APP_PATH).'home',
120
+            api_get_path(SYS_APP_PATH).'upload/users/',
121
+            api_get_path(SYS_PATH).'main/default_course_document/images/',
122 122
         );
123 123
         foreach ($writable_folders as $index => $folder) {
124 124
             $writable = is_writable($folder);
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 
138 138
         $exists = file_exists(api_get_path(SYS_CODE_PATH).'install');
139 139
         $status = $exists ? self :: STATUS_WARNING : self :: STATUS_OK;
140
-        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists') . ': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
140
+        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists').': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
141 141
 
142 142
         $app_version = api_get_setting('chamilo_database_version');
143
-        $array[] = $this->build_setting(self :: STATUS_INFORMATION, '[DB]', 'chamilo_database_version', '#', $app_version, 0, null,  'Chamilo DB version');
143
+        $array[] = $this->build_setting(self :: STATUS_INFORMATION, '[DB]', 'chamilo_database_version', '#', $app_version, 0, null, 'Chamilo DB version');
144 144
 
145 145
         $access_url_id = api_get_current_access_url_id();
146 146
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                     $message2 .= get_lang('SpaceUsedOnSystemCannotBeMeasuredOnWindows');
153 153
                 } else {
154 154
                     $dir = api_get_path(SYS_PATH);
155
-                    $du = exec('du -sh ' . $dir, $err);
155
+                    $du = exec('du -sh '.$dir, $err);
156 156
                     list($size, $none) = explode("\t", $du);
157 157
                     $limit = $_configuration[$access_url_id]['hosting_limit_disk_space'];
158 158
                     $message2 .= sprintf(get_lang('TotalSpaceUsedByPortalXLimitIsYMB'), $size, $limit);
@@ -236,33 +236,33 @@  discard block
 block discarded – undo
236 236
         $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo'));
237 237
 
238 238
         $setting = ini_get('max_execution_time');
239
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
239
+        $req_setting = '300 ('.get_lang('Minimum').')';
240 240
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
241 241
         $array[] = $this->build_setting($status, '[INI]', 'max_execution_time', 'http://www.php.net/manual/en/ini.core.php#ini.max-execution-time', $setting, $req_setting, null, get_lang('MaxExecutionTimeInfo'));
242 242
 
243 243
         $setting = ini_get('max_input_time');
244
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
244
+        $req_setting = '300 ('.get_lang('Minimum').')';
245 245
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
246 246
         $array[] = $this->build_setting($status, '[INI]', 'max_input_time', 'http://www.php.net/manual/en/ini.core.php#ini.max-input-time', $setting, $req_setting, null, get_lang('MaxInputTimeInfo'));
247 247
 
248 248
         $setting = ini_get('memory_limit');
249 249
         $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M';
250 250
         $status = self :: STATUS_ERROR;
251
-        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT)
251
+        if ((float) $setting >= REQUIRED_MIN_MEMORY_LIMIT)
252 252
             $status = self :: STATUS_OK;
253 253
         $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo'));
254 254
 
255 255
         $setting = ini_get('post_max_size');
256 256
         $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M';
257 257
         $status = self :: STATUS_ERROR;
258
-        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE)
258
+        if ((float) $setting >= REQUIRED_MIN_POST_MAX_SIZE)
259 259
             $status = self :: STATUS_OK;
260 260
         $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo'));
261 261
 
262 262
         $setting = ini_get('upload_max_filesize');
263 263
         $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M';
264 264
         $status = self :: STATUS_ERROR;
265
-        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
265
+        if ((float) $setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
266 266
             $status = self :: STATUS_OK;
267 267
         $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo'));
268 268
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
277 277
         $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo'));
278 278
 
279
-        if (api_check_browscap()){$setting = true;}else{$setting=false;}
279
+        if (api_check_browscap()) {$setting = true; } else {$setting = false; }
280 280
         $req_setting = true;
281 281
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
282 282
         $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo'));
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
             $loaded = extension_loaded($extension);
334 334
             $status = $loaded ? self :: STATUS_OK : self :: STATUS_ERROR;
335
-            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension') . ': ' . $extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
335
+            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension').': '.$extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
336 336
         }
337 337
 
338 338
         return $array;
@@ -455,9 +455,9 @@  discard block
 block discarded – undo
455 455
         $formatted_expected_value = $expected_value;
456 456
 
457 457
         if ($formatter) {
458
-            if (method_exists($this, 'format_' . $formatter)) {
459
-                $formatted_current_value = call_user_func(array($this, 'format_' . $formatter), $current_value);
460
-                $formatted_expected_value = call_user_func(array($this, 'format_' . $formatter), $expected_value);
458
+            if (method_exists($this, 'format_'.$formatter)) {
459
+                $formatted_current_value = call_user_func(array($this, 'format_'.$formatter), $current_value);
460
+                $formatted_expected_value = call_user_func(array($this, 'format_'.$formatter), $expected_value);
461 461
             }
462 462
         }
463 463
 
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
      */
473 473
     public function get_link($title, $url)
474 474
     {
475
-        return '<a href="' . $url . '" target="about:bank">' . $title . '</a>';
475
+        return '<a href="'.$url.'" target="about:bank">'.$title.'</a>';
476 476
     }
477 477
 
478 478
     public function format_yes_no_optional($value)
479 479
     {
480 480
     	$return = '';
481
-    	switch($value) {
481
+    	switch ($value) {
482 482
      		case 0:
483 483
      			$return = get_lang('No');
484 484
      			break;
Please login to merge, or discard this patch.
main/inc/lib/skill.visualizer.lib.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $this->skills   = $skills;
29 29
         $this->type     = $type;
30
-        $this->center_x = intval($offset_x + $this->canvas_x/2 - $this->block_size/2);
30
+        $this->center_x = intval($offset_x + $this->canvas_x / 2 - $this->block_size / 2);
31 31
     }
32 32
 
33 33
     function prepare_skill_box($skill, $position, $class)
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
             $extra_class = 'second_window';
40 40
         }
41 41
 
42
-        $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.'  '.$class.'" style = "top:' . $position['y'] . 'px; left:' . $position['x'] . 'px;">';
42
+        $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.'  '.$class.'" style = "top:'.$position['y'].'px; left:'.$position['x'].'px;">';
43 43
 
44
-        $content =  $skill['name'];
44
+        $content = $skill['name'];
45 45
         $content .= '<div class="btn-group">';
46 46
         $content .= Display::url(get_lang('Edit'), '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn'));
47 47
         $content .= Display::url('+', '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn'));
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
         }
88 88
         //default_arrow_color
89 89
 
90
-        $this->js .= 'var e'.$block_id.' = prepare("block_' . $block_id.'",  '.$end_point.');'."\n";
91
-        $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_' . $skill['parent_id'].'",  '.$end_point.');'."\n";
92
-        $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n";;
90
+        $this->js .= 'var e'.$block_id.' = prepare("block_'.$block_id.'",  '.$end_point.');'."\n";
91
+        $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_'.$skill['parent_id'].'",  '.$end_point.');'."\n";
92
+        $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n"; ;
93 93
     }
94 94
 
95 95
     /**
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
         $brothers = array();
126 126
 
127 127
         foreach ($this->skills as &$skill) {
128
-            if (!in_array($skill['parent_id'], array(0,1))) {
128
+            if (!in_array($skill['parent_id'], array(0, 1))) {
129 129
                 continue;
130 130
             }
131
-            $childs = isset($skill['children']) ? count($skill['children']) : 0 ;
131
+            $childs = isset($skill['children']) ? count($skill['children']) : 0;
132 132
 
133 133
             //$x = round($this->offsetX * sin(deg2rad($corner * $count)));
134 134
             //$y = round($this->offsetY * cos(deg2rad($corner * $count)));
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
             if ($skill['parent_id'] == 0) {
145 145
                 //$x = 130*$childs/2;
146 146
                 //$x = $this->space_between_blocks_x*$childs/2;
147
-                $x = $this->canvas_x/2  - $this->block_size/2;
147
+                $x = $this->canvas_x / 2 - $this->block_size / 2;
148 148
             } else {
149 149
                 $max = isset($this->skills[$skill['parent_id']]['children']) ? count($this->skills[$skill['parent_id']]['children']) : 0;
150
-                foreach($this->skills[$skill['parent_id']]['children'] as  $id => $sk) {
150
+                foreach ($this->skills[$skill['parent_id']]['children'] as  $id => $sk) {
151 151
                     if ($skill['id'] == $sk['id']) {
152 152
                         break;
153 153
                     }
@@ -155,17 +155,17 @@  discard block
 block discarded – undo
155 155
                 }
156 156
                 $parent_x = isset($this->skills[$skill['parent_id']]['x']) ? $this->skills[$skill['parent_id']]['x'] : 0;
157 157
                 //$x = $my_count*$this->space_between_blocks_x + $parent_x  + $this->block_size - ($this->space_between_blocks_x*$max/2) ;
158
-                $x = $my_count*$this->space_between_blocks_x + $parent_x  + $this->block_size - ($this->canvas_x/2 ) ;
158
+                $x = $my_count * $this->space_between_blocks_x + $parent_x + $this->block_size - ($this->canvas_x / 2);
159 159
             }
160 160
 
161
-            $y = $skill['level']*$this->space_between_blocks_y;
161
+            $y = $skill['level'] * $this->space_between_blocks_y;
162 162
 
163 163
             $skill['x'] = $x;
164 164
             $skill['y'] = $y;
165 165
 
166 166
             //$skill['description']  = "{$brothers[$skill['parent_id']]} $x - $y";
167 167
             //$skill['name']  =  $skill['name']."  |  $x = $my_count * 150  +  $parent_x - (150* $max/2) - 10*$childs ";
168
-            $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y +$y));
168
+            $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y + $y));
169 169
         }
170 170
         return $this->get_html();
171 171
     }
Please login to merge, or discard this patch.
main/inc/lib/extra_field_value.lib.php 2 patches
Indentation   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -720,11 +720,11 @@  discard block
 block discarded – undo
720 720
         return false;
721 721
     }
722 722
 
723
-     /**
724
-     * @param int $itemId
725
-     * @param int $fieldId
726
-     * @return array
727
-     */
723
+        /**
724
+         * @param int $itemId
725
+         * @param int $fieldId
726
+         * @return array
727
+         */
728 728
     public function getAllValuesByItemAndField($itemId, $fieldId)
729 729
     {
730 730
         $fieldId = intval($fieldId);
@@ -847,7 +847,6 @@  discard block
 block discarded – undo
847 847
     /**
848 848
      * Deletes all values from an item
849 849
      * @param int $itemId (session id, course id, etc)
850
-
851 850
      * @assert (-1,-1) == null
852 851
      */
853 852
     public function deleteValuesByItem($itemId)
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                             break;
217 217
                     }
218 218
 
219
-                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png";
219
+                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png";
220 220
 
221 221
                     if (!file_exists($fileDir)) {
222 222
                         mkdir($fileDir, $dirPermissions, true);
@@ -226,15 +226,15 @@  discard block
 block discarded – undo
226 226
 
227 227
                         //Crop the image to adjust 16:9 ratio
228 228
                         $crop = new Image($value['tmp_name']);
229
-                        $crop->crop($params['extra_' . $field_variable . '_crop_result']);
229
+                        $crop->crop($params['extra_'.$field_variable.'_crop_result']);
230 230
 
231 231
                         $imageExtraField = new Image($value['tmp_name']);
232 232
                         $imageExtraField->resize(400);
233
-                        $imageExtraField->send_image($fileDir . $fileName, -1, 'png');
233
+                        $imageExtraField->send_image($fileDir.$fileName, -1, 'png');
234 234
                         $newParams = array(
235 235
                             'item_id' => $params['item_id'],
236 236
                             'field_id' => $extraFieldInfo['id'],
237
-                            'value' => $fileDirStored . $fileName,
237
+                            'value' => $fileDirStored.$fileName,
238 238
                             'comment' => $comment
239 239
                         );
240 240
 
@@ -260,18 +260,18 @@  discard block
 block discarded – undo
260 260
                     }
261 261
 
262 262
                     $cleanedName = api_replace_dangerous_char($value['name']);
263
-                    $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName";
263
+                    $fileName = ExtraField::FIELD_TYPE_FILE."_{$params['item_id']}_$cleanedName";
264 264
                     if (!file_exists($fileDir)) {
265 265
                         mkdir($fileDir, $dirPermissions, true);
266 266
                     }
267 267
 
268 268
                     if ($value['error'] == 0) {
269
-                        moveUploadedFile($value, $fileDir . $fileName);
269
+                        moveUploadedFile($value, $fileDir.$fileName);
270 270
 
271 271
                         $new_params = array(
272 272
                             'item_id' => $params['item_id'],
273 273
                             'field_id' => $extraFieldInfo['id'],
274
-                            'value' => $fileDirStored . $fileName
274
+                            'value' => $fileDirStored.$fileName
275 275
                         );
276 276
 
277 277
                         if ($this->type !== 'session' && $this->type !== 'course') {
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                 */
412 412
                 if (false) {
413 413
                     global $app;
414
-                    switch($this->type) {
414
+                    switch ($this->type) {
415 415
                         case 'question':
416 416
                             $extraFieldValue = new ChamiloLMS\Entity\QuestionFieldValues();
417 417
                             $extraFieldValue->setUserId(api_get_user_id());
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
                 */
474 474
                 if (false) {
475 475
                     global $app;
476
-                    switch($this->type) {
476
+                    switch ($this->type) {
477 477
                         case 'question':
478 478
                             $extraFieldValue = $app['orm.ems']['db_write']->getRepository('ChamiloLMS\Entity\QuestionFieldValues')->find($field_values['id']);
479 479
                             $extraFieldValue->setUserId(api_get_user_id());
Please login to merge, or discard this patch.
main/inc/lib/export.lib.inc.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         }
100 100
         foreach ($data as $row) {
101 101
             $string = implode("</td><td>", $row);
102
-            $string = '<tr><td>' . $string . '</td></tr>';
102
+            $string = '<tr><td>'.$string.'</td></tr>';
103 103
             if ($encoding != 'utf-8') {
104 104
                 $string = api_convert_encoding($string, $encoding, $systemEncoding);
105 105
             }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             fwrite($handle, '<'.$wrapper_tagname.'>');
174 174
         }
175 175
         $s = self::_export_complex_table_xml_helper($data);
176
-        fwrite($handle,$s);
176
+        fwrite($handle, $s);
177 177
         if (!is_null($wrapper_tagname)) {
178 178
             fwrite($handle, '</'.$wrapper_tagname.'>'."\n");
179 179
         }
@@ -195,10 +195,10 @@  discard block
 block discarded – undo
195 195
         }
196 196
         $string = '';
197 197
         foreach ($data as $row) {
198
-            $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>';
198
+            $string .= "\n".str_repeat("\t", $level).'<'.$row['name'].'>';
199 199
             if (is_array($row['value'])) {
200
-            	$string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
201
-                $string .= str_repeat("\t",$level).'</'.$row['name'].'>';
200
+            	$string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n";
201
+                $string .= str_repeat("\t", $level).'</'.$row['name'].'>';
202 202
             } else {
203 203
                 $string .= $row['value'];
204 204
                 $string .= '</'.$row['name'].'>';
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
     }
116 116
 
117 117
     /**
118
-    * Export tabular data to XML-file
119
-    * @param array  Simple array of data to put in XML
120
-    * @param string Name of file to be given to the user
121
-    * @param string Name of common tag to place each line in
122
-    * @param string Name of the root element. A root element should always be given.
123
-    * @param string Encoding in which the data is provided
124
-    */
118
+     * Export tabular data to XML-file
119
+     * @param array  Simple array of data to put in XML
120
+     * @param string Name of file to be given to the user
121
+     * @param string Name of common tag to place each line in
122
+     * @param string Name of the root element. A root element should always be given.
123
+     * @param string Encoding in which the data is provided
124
+     */
125 125
     public static function arrayToXml(
126 126
         $data,
127 127
         $filename = 'export',
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         foreach ($data as $row) {
201 201
             $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>';
202 202
             if (is_array($row['value'])) {
203
-            	$string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
203
+                $string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
204 204
                 $string .= str_repeat("\t",$level).'</'.$row['name'].'>';
205 205
             } else {
206 206
                 $string .= $row['value'];
Please login to merge, or discard this patch.
main/inc/lib/array.lib.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -108,24 +108,24 @@
 block discarded – undo
108 108
  */
109 109
 function utf8_sort($array)
110 110
 {
111
-	$old_locale = setlocale(LC_ALL, null);
112
-	$code = api_get_language_isocode();
113
-	$locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
114
-	$try_sort = false;
111
+    $old_locale = setlocale(LC_ALL, null);
112
+    $code = api_get_language_isocode();
113
+    $locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
114
+    $try_sort = false;
115 115
 
116
-	foreach($locale_list as $locale) {
117
-		$my_local = setlocale(LC_COLLATE, $locale);
118
-		if ($my_local) {
119
-			$try_sort = true;
120
-			break;
121
-		}
122
-	}
116
+    foreach($locale_list as $locale) {
117
+        $my_local = setlocale(LC_COLLATE, $locale);
118
+        if ($my_local) {
119
+            $try_sort = true;
120
+            break;
121
+        }
122
+    }
123 123
 
124
-	if ($try_sort) {
125
-		uasort($array, 'strcoll');
126
-	}
127
-	setlocale(LC_COLLATE, $old_locale);
128
-	return $array;
124
+    if ($try_sort) {
125
+        uasort($array, 'strcoll');
126
+    }
127
+    setlocale(LC_COLLATE, $old_locale);
128
+    return $array;
129 129
 }
130 130
 
131 131
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 {
111 111
 	$old_locale = setlocale(LC_ALL, null);
112 112
 	$code = api_get_language_isocode();
113
-	$locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
113
+	$locale_list = array($code.'.utf8', 'en.utf8', 'en_US.utf8', 'en_GB.utf8');
114 114
 	$try_sort = false;
115 115
 
116
-	foreach($locale_list as $locale) {
116
+	foreach ($locale_list as $locale) {
117 117
 		$my_local = setlocale(LC_COLLATE, $locale);
118 118
 		if ($my_local) {
119 119
 			$try_sort = true;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     $flatten = array();
152 152
     array_walk_recursive(
153 153
         $array,
154
-        function ($value) use (&$flatten) {
154
+        function($value) use (&$flatten) {
155 155
             $flatten[] = $value;
156 156
         }
157 157
     );
Please login to merge, or discard this patch.
main/inc/lib/notebook.lib.php 2 patches
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -219,10 +219,10 @@
 block discarded – undo
219 219
         // action links
220 220
         echo '<div class="actions">';
221 221
         if (!api_is_anonymous()) {
222
-            if (api_get_session_id() == 0)
223
-                echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
222
+            if (api_get_session_id() == 0) {
223
+                            echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
224 224
                     Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
225
-            elseif (api_is_allowed_to_session_edit(false, true)) {
225
+            } elseif (api_is_allowed_to_session_edit(false, true)) {
226 226
                 echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
227 227
                     Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
228 228
             }
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         return "<script>
30 30
 				function confirmation (name)
31 31
 				{
32
-					if (confirm(\" " . get_lang("NoteConfirmDelete") . " \"+ name + \" ?\"))
32
+					if (confirm(\" " . get_lang("NoteConfirmDelete")." \"+ name + \" ?\"))
33 33
 						{return true;}
34 34
 					else
35 35
 						{return false;}
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 description 		AS note_comment,
107 107
                 session_id			AS session_id
108 108
                FROM $t_notebook
109
-               WHERE c_id = $course_id AND notebook_id = '" . intval($notebook_id) . "' ";
109
+               WHERE c_id = $course_id AND notebook_id = '".intval($notebook_id)."' ";
110 110
         $result = Database::query($sql);
111 111
         if (Database::num_rows($result) != 1) {
112 112
             return array();
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
         $sql = "DELETE FROM $t_notebook
185 185
                 WHERE
186 186
                     c_id = $course_id AND
187
-                    notebook_id='" . intval($notebook_id) . "' AND
188
-                    user_id = '" . api_get_user_id() . "'";
187
+                    notebook_id='".intval($notebook_id)."' AND
188
+                    user_id = '" . api_get_user_id()."'";
189 189
         $result = Database::query($sql);
190 190
         $affected_rows = Database::affected_rows($result);
191 191
         if ($affected_rows != 1) {
@@ -223,22 +223,22 @@  discard block
 block discarded – undo
223 223
         echo '<div class="actions">';
224 224
         if (!api_is_anonymous()) {
225 225
             if (api_get_session_id() == 0)
226
-                echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
227
-                    Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
226
+                echo '<a href="index.php?'.api_get_cidreq().'&action=addnote">'.
227
+                    Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>';
228 228
             elseif (api_is_allowed_to_session_edit(false, true)) {
229
-                echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
230
-                    Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
229
+                echo '<a href="index.php?'.api_get_cidreq().'&action=addnote">'.
230
+                    Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>';
231 231
             }
232 232
         } else {
233
-            echo '<a href="javascript:void(0)">' . Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
233
+            echo '<a href="javascript:void(0)">'.Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>';
234 234
         }
235 235
 
236
-        echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=creation_date&direction=' . $link_sort_direction . '">' .
237
-            Display::return_icon('notes_order_by_date_new.png', get_lang('OrderByCreationDate'), '', '32') . '</a>';
238
-        echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=update_date&direction=' . $link_sort_direction . '">' .
239
-            Display::return_icon('notes_order_by_date_mod.png', get_lang('OrderByModificationDate'), '', '32') . '</a>';
240
-        echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=title&direction=' . $link_sort_direction . '">' .
241
-            Display::return_icon('notes_order_by_title.png', get_lang('OrderByTitle'), '', '32') . '</a>';
236
+        echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=creation_date&direction='.$link_sort_direction.'">'.
237
+            Display::return_icon('notes_order_by_date_new.png', get_lang('OrderByCreationDate'), '', '32').'</a>';
238
+        echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=update_date&direction='.$link_sort_direction.'">'.
239
+            Display::return_icon('notes_order_by_date_mod.png', get_lang('OrderByModificationDate'), '', '32').'</a>';
240
+        echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=title&direction='.$link_sort_direction.'">'.
241
+            Display::return_icon('notes_order_by_title.png', get_lang('OrderByTitle'), '', '32').'</a>';
242 242
         echo '</div>';
243 243
 
244 244
         if (!isset($_SESSION['notebook_view']) || !in_array($_SESSION['notebook_view'], array('creation_date', 'update_date', 'title'))) {
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
         // Database table definition
249 249
         $t_notebook = Database :: get_course_table(TABLE_NOTEBOOK);
250 250
         if ($_SESSION['notebook_view'] == 'creation_date' || $_SESSION['notebook_view'] == 'update_date') {
251
-            $order_by = " ORDER BY " . $_SESSION['notebook_view'] . " $sort_direction ";
251
+            $order_by = " ORDER BY ".$_SESSION['notebook_view']." $sort_direction ";
252 252
         } else {
253
-            $order_by = " ORDER BY " . $_SESSION['notebook_view'] . " $sort_direction ";
253
+            $order_by = " ORDER BY ".$_SESSION['notebook_view']." $sort_direction ";
254 254
         }
255 255
 
256 256
         //condition for the session
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
         $sql = "SELECT * FROM $t_notebook
264 264
                 WHERE
265 265
                     c_id = $course_id AND
266
-                    user_id = '" . api_get_user_id() . "'
266
+                    user_id = '".api_get_user_id()."'
267 267
                     $condition_session
268 268
                     $cond_extra $order_by
269 269
                 ";
@@ -273,18 +273,18 @@  discard block
 block discarded – undo
273 273
             $session_img = api_get_session_image($row['session_id'], $_user['status']);
274 274
             $updateValue = '';
275 275
             if ($row['update_date'] <> $row['creation_date']) {
276
-                $updateValue = ', ' . get_lang('UpdateDate') . ': ' . Display::dateToStringAgoAndLongDate($row['update_date']);
276
+                $updateValue = ', '.get_lang('UpdateDate').': '.Display::dateToStringAgoAndLongDate($row['update_date']);
277 277
             }
278 278
 
279
-            $actions = '<a href="' . api_get_self() . '?action=editnote&notebook_id=' . $row['notebook_id'] . '">' .
280
-                Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>';
281
-            $actions .= '<a href="' . api_get_self() . '?action=deletenote&notebook_id=' . $row['notebook_id'] . '" onclick="return confirmation(\'' . $row['title'] . '\');">' .
282
-                Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>';
279
+            $actions = '<a href="'.api_get_self().'?action=editnote&notebook_id='.$row['notebook_id'].'">'.
280
+                Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
281
+            $actions .= '<a href="'.api_get_self().'?action=deletenote&notebook_id='.$row['notebook_id'].'" onclick="return confirmation(\''.$row['title'].'\');">'.
282
+                Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
283 283
 
284 284
             echo Display::panel(
285 285
                 $row['description'],
286
-                $row['title'] . $session_img.' <div class="pull-right">'.$actions.'</div>',
287
-                get_lang('CreationDate') . ': ' . Display::dateToStringAgoAndLongDate($row['creation_date']). $updateValue
286
+                $row['title'].$session_img.' <div class="pull-right">'.$actions.'</div>',
287
+                get_lang('CreationDate').': '.Display::dateToStringAgoAndLongDate($row['creation_date']).$updateValue
288 288
             );
289 289
         }
290 290
     }
Please login to merge, or discard this patch.
main/inc/lib/display.lib.php 3 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -666,9 +666,10 @@
 block discarded – undo
666 666
         $result = '';
667 667
         for ($i = $min; $i <= $max; $i ++) {
668 668
             $result .= '<option value="'.$i.'"';
669
-            if (is_int($selected_num))
670
-                if ($selected_num == $i) {
669
+            if (is_int($selected_num)) {
670
+                            if ($selected_num == $i) {
671 671
                     $result .= ' selected="selected"';
672
+            }
672 673
                 }
673 674
             $result .= '>'.$i.'</option>';
674 675
         }
Please login to merge, or discard this patch.
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
         );
50 50
     }
51 51
 
52
-     /**
53
-     * Displays the page header
54
-     * @param string The name of the page (will be showed in the page title)
55
-     * @param string Optional help file name
56
-     * @param string $page_header
57
-     */
52
+        /**
53
+         * Displays the page header
54
+         * @param string The name of the page (will be showed in the page title)
55
+         * @param string Optional help file name
56
+         * @param string $page_header
57
+         */
58 58
     public static function display_header($tool_name ='', $help = null, $page_header = null)
59 59
     {
60 60
         $origin = api_get_origin();
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
      */
449 449
     public static function display_normal_message($message, $filter = true, $returnValue = false)
450 450
     {
451
-    	$message = self::return_message($message, 'normal', $filter);
451
+        $message = self::return_message($message, 'normal', $filter);
452 452
         if ($returnValue) {
453 453
             return $message;
454 454
         } else {
@@ -528,22 +528,22 @@  discard block
 block discarded – undo
528 528
         }
529 529
 
530 530
         if ($filter) {
531
-        	$message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
531
+            $message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
532 532
         }
533 533
 
534 534
         $class = "";
535 535
         switch($type) {
536 536
             case 'warning':
537 537
                $class .= 'alert alert-warning';
538
-               break;
538
+                break;
539 539
             case 'error':
540 540
                $class .= 'alert alert-danger';
541
-               break;
541
+                break;
542 542
             case 'confirmation':
543 543
             case 'confirm':
544 544
             case 'success':
545 545
                 $class .= 'alert alert-success';
546
-               break;
546
+                break;
547 547
             case 'normal':
548 548
             default:
549 549
                 $class .= 'alert alert-info';
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
      * @param array    additional attributes (for instance height, width, onclick, ...)
687 687
      * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
688 688
      * @return void
689
-    */
689
+     */
690 690
     public static function display_icon(
691 691
         $image,
692 692
         $alt_text = '',
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
      * @author Julio Montoya 2010 Function improved, adding image constants
723 723
      * @author Yannick Warnier 2011 Added size handler
724 724
      * @version Feb 2011
725
-    */
725
+     */
726 726
     public static function return_icon(
727 727
         $image,
728 728
         $alt_text = '',
@@ -911,14 +911,14 @@  discard block
 block discarded – undo
911 911
      */
912 912
     public static function input($type, $name, $value, $attributes = array())
913 913
     {
914
-         if (isset($type)) {
915
-             $attributes['type']= $type;
916
-         }
917
-         if (isset($name)) {
918
-             $attributes['name']= $name;
919
-         }
920
-         if (isset($value)) {
921
-             $attributes['value']= $value;
914
+            if (isset($type)) {
915
+                $attributes['type']= $type;
916
+            }
917
+            if (isset($name)) {
918
+                $attributes['name']= $name;
919
+            }
920
+            if (isset($value)) {
921
+                $attributes['value']= $value;
922 922
         }
923 923
         return self::tag('input', '', $attributes);
924 924
     }
@@ -931,10 +931,10 @@  discard block
 block discarded – undo
931 931
      */
932 932
     public static function button($name, $value, $attributes = array())
933 933
     {
934
-    	if (!empty($name)) {
934
+        if (!empty($name)) {
935 935
             $attributes['name'] = $name;
936
-    	}
937
-    	return self::tag('button', $value, $attributes);
936
+        }
937
+        return self::tag('button', $value, $attributes);
938 938
     }
939 939
 
940 940
     /**
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
      * in the $htmlHeadXtra variable before the display_header
1002 1002
      * Add this script
1003 1003
      * @example
1004
-             * <script>
1004
+     * <script>
1005 1005
                     $(function() {
1006 1006
                         $( "#tabs" ).tabs();
1007 1007
                     });
@@ -1067,20 +1067,20 @@  discard block
 block discarded – undo
1067 1067
      */
1068 1068
     public static function tabsOnlyLink($headers, $selected = null)
1069 1069
     {
1070
-         $id = uniqid();
1071
-         $i = 1;
1072
-         $lis = null;
1073
-         foreach ($headers as $item) {
1070
+            $id = uniqid();
1071
+            $i = 1;
1072
+            $lis = null;
1073
+            foreach ($headers as $item) {
1074 1074
             $class = null;
1075 1075
             if ($i == $selected) {
1076 1076
                 $class = 'active';
1077 1077
             }
1078
-             $item = self::tag(
1079
-                 'a',
1080
-                 $item['content'],
1081
-                 array('id' => $id.'-'.$i, 'href' => $item['url'])
1082
-             );
1083
-             $lis .= self::tag('li', $item, array('class' => $class));
1078
+                $item = self::tag(
1079
+                    'a',
1080
+                    $item['content'],
1081
+                    array('id' => $id.'-'.$i, 'href' => $item['url'])
1082
+                );
1083
+                $lis .= self::tag('li', $item, array('class' => $class));
1084 1084
             $i++;
1085 1085
         }
1086 1086
         return self::tag('ul', $lis, array('class' => 'nav nav-tabs tabs-margin'));
@@ -1292,8 +1292,8 @@  discard block
 block discarded – undo
1292 1292
      */
1293 1293
     public static function table($headers, $rows, $attributes = array())
1294 1294
     {
1295
-    	if (empty($attributes)) {
1296
-    		$attributes['class'] = 'data_table';
1295
+        if (empty($attributes)) {
1296
+            $attributes['class'] = 'data_table';
1297 1297
         }
1298 1298
         $table = new HTML_Table($attributes);
1299 1299
         $row = 0;
@@ -1301,17 +1301,17 @@  discard block
 block discarded – undo
1301 1301
 
1302 1302
         // Course headers
1303 1303
         if (!empty($headers)) {
1304
-	        foreach ($headers as $item) {
1305
-	            $table->setHeaderContents($row, $column, $item);
1306
-	            $column++;
1307
-	        }
1308
-	        $row = 1;
1309
-	        $column = 0;
1304
+            foreach ($headers as $item) {
1305
+                $table->setHeaderContents($row, $column, $item);
1306
+                $column++;
1307
+            }
1308
+            $row = 1;
1309
+            $column = 0;
1310 1310
         }
1311 1311
 
1312 1312
         if (!empty($rows)) {
1313
-	        foreach($rows as $content) {
1314
-	            $table->setCellContents($row, $column, $content);
1313
+            foreach($rows as $content) {
1314
+                $table->setCellContents($row, $column, $content);
1315 1315
                 $row++;
1316 1316
             }
1317 1317
         }
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
                         //$item_property['tool'] != TOOL_DROPBOX &&
1418 1418
                         $item_property['tool'] != TOOL_NOTEBOOK &&
1419 1419
                         $item_property['tool'] != TOOL_CHAT)
1420
-                   )
1420
+                    )
1421 1421
                 )
1422 1422
                 // Take only what's visible or "invisible but where the user is a teacher" or where the visibility is unset.
1423 1423
                 && ($item_property['visibility'] == '1'
@@ -1433,7 +1433,7 @@  discard block
 block discarded – undo
1433 1433
                         ($item_property['to_user_id'] != $user_id) &&
1434 1434
                         (!isset($item_property['to_group_id']) || !in_array($item_property['to_group_id'], $group_ids)))
1435 1435
                 ) {
1436
-                   continue;
1436
+                    continue;
1437 1437
                 }
1438 1438
 
1439 1439
                 // If it's a survey, make sure the user's invited. Otherwise drop it.
@@ -1651,21 +1651,21 @@  discard block
 block discarded – undo
1651 1651
      *
1652 1652
      * @param  string  id of the rating ul element
1653 1653
      * @param  string  url that will be added (for jquery see hot_courses.tpl)
1654
-	 * @param	string	point info array see function CourseManager::get_course_ranking()
1655
-	 * @param	bool	add a div wrapper
1656
-	 * @todo	use     templates
1654
+     * @param	string	point info array see function CourseManager::get_course_ranking()
1655
+     * @param	bool	add a div wrapper
1656
+     * @todo	use     templates
1657 1657
      **/
1658 1658
     public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true)
1659 1659
     {
1660
-		$number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1661
-		$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1660
+        $number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1661
+        $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1662 1662
 
1663
-		if (!empty($percentage)) {
1663
+        if (!empty($percentage)) {
1664 1664
             $percentage = $percentage*125/100;
1665 1665
         }
1666
-		$accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1666
+        $accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1667 1667
 
1668
-		$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1668
+        $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1669 1669
 
1670 1670
         $html = '<ul id="'.$id.'" class="star-rating">
1671 1671
 					<li class="current-rating" style="width:'.$percentage.'px;"></li>
@@ -1676,26 +1676,26 @@  discard block
 block discarded – undo
1676 1676
 					<li><a href="javascript:void(0);" data-link="'.$url.'&amp;star=5" title="'.$star_label.'" class="five-stars">5</a></li>
1677 1677
 				</ul>';
1678 1678
 
1679
-		$labels = array();
1679
+        $labels = array();
1680 1680
 
1681
-		$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1682
-		$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1683
-		/* if (!empty($number_of_users_who_voted)) {
1681
+        $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1682
+        $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1683
+        /* if (!empty($number_of_users_who_voted)) {
1684 1684
 			$labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1685 1685
 		} */
1686 1686
 
1687
-		$labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1687
+        $labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1688 1688
 
1689
-		if (!$add_div_wrapper && api_is_anonymous()) {
1690
-			$labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1691
-		}
1689
+        if (!$add_div_wrapper && api_is_anonymous()) {
1690
+            $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1691
+        }
1692 1692
 
1693 1693
         $html .= Display::div(implode(' | ', $labels) , array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1694 1694
         $html .= ' '.Display::span(' ', array('id' =>  'vote_label2_'.$id));
1695 1695
 
1696 1696
         if ($add_div_wrapper) {
1697
-			$html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1698
-		}
1697
+            $html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1698
+        }
1699 1699
 
1700 1700
         return $html;
1701 1701
     }
@@ -1733,8 +1733,8 @@  discard block
 block discarded – undo
1733 1733
         return self::page_header($title, $second_title);
1734 1734
     }
1735 1735
 
1736
-     public static function page_subheader_and_translate($title, $second_title = null)
1737
-     {
1736
+        public static function page_subheader_and_translate($title, $second_title = null)
1737
+        {
1738 1738
         $title = get_lang($title);
1739 1739
         return self::page_subheader($title, $second_title);
1740 1740
     }
Please login to merge, or discard this patch.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * @param string Optional help file name
57 57
      * @param string $page_header
58 58
      */
59
-    public static function display_header($tool_name ='', $help = null, $page_header = null)
59
+    public static function display_header($tool_name = '', $help = null, $page_header = null)
60 60
     {
61 61
         $origin = api_get_origin();
62 62
         $showHeader = true;
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         $grid_class = array(),
355 355
         $elementCount = 0
356 356
     ) {
357
-        $column =  0;
357
+        $column = 0;
358 358
         $default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20;
359 359
 
360 360
         $table = new SortableTableFromArray($content, $column, $default_items_per_page, $name);
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
      * @deprecated use Display::addFlash with Display::return_message
484 484
      * @return void
485 485
      */
486
-    public static function display_confirmation_message ($message, $filter = true, $returnValue = false)
486
+    public static function display_confirmation_message($message, $filter = true, $returnValue = false)
487 487
     {
488 488
         $message = self::return_message($message, 'confirm', $filter);
489 489
         if ($returnValue) {
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
      *
503 503
      * @return void
504 504
      */
505
-    public static function display_error_message ($message, $filter = true, $returnValue = false)
505
+    public static function display_error_message($message, $filter = true, $returnValue = false)
506 506
     {
507 507
         $message = self::return_message($message, 'error', $filter);
508 508
         if ($returnValue) {
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
      * @param string $type
518 518
      * @param bool $filter
519 519
      */
520
-    public static function return_message_and_translate($message, $type='normal', $filter = true)
520
+    public static function return_message_and_translate($message, $type = 'normal', $filter = true)
521 521
     {
522 522
         $message = get_lang($message);
523 523
         echo self::return_message($message, $type, $filter);
@@ -584,14 +584,14 @@  discard block
 block discarded – undo
584 584
         }
585 585
         // Encrypt email
586 586
         $hmail = '';
587
-        for ($i = 0; $i < strlen($email); $i ++) {
587
+        for ($i = 0; $i < strlen($email); $i++) {
588 588
             $hmail .= '&#'.ord($email {
589 589
             $i }).';';
590 590
         }
591 591
         $hclickable_text = null;
592 592
         // Encrypt clickable text if @ is present
593 593
         if (strpos($clickable_text, '@')) {
594
-            for ($i = 0; $i < strlen($clickable_text); $i ++) {
594
+            for ($i = 0; $i < strlen($clickable_text); $i++) {
595 595
                 $hclickable_text .= '&#'.ord($clickable_text {
596 596
                 $i }).';';
597 597
             }
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
         }
624 624
         // Encrypt email
625 625
         $hmail = '';
626
-        for ($i = 0; $i < strlen($email); $i ++) {
626
+        for ($i = 0; $i < strlen($email); $i++) {
627 627
             $hmail .= '&#'.ord($email {
628 628
             $i }).';';
629 629
         }
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
     public static function get_alphabet_options($selected_letter = '')
644 644
     {
645 645
         $result = '';
646
-        for ($i = 65; $i <= 90; $i ++) {
646
+        for ($i = 65; $i <= 90; $i++) {
647 647
             $letter = chr($i);
648 648
             $result .= '<option value="'.$letter.'"';
649 649
             if ($selected_letter == $letter) {
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
     public static function get_numeric_options($min, $max, $selected_num = 0)
665 665
     {
666 666
         $result = '';
667
-        for ($i = $min; $i <= $max; $i ++) {
667
+        for ($i = $min; $i <= $max; $i++) {
668 668
             $result .= '<option value="'.$i.'"';
669 669
             if (is_int($selected_num))
670 670
                 if ($selected_num == $i) {
@@ -734,8 +734,8 @@  discard block
 block discarded – undo
734 734
         // important to use the public path (i.e. web/css/) rather than the
735 735
         // internal path (/app/Resource/public/css/) because the path used
736 736
         // in the end must be the public path
737
-        $alternateCssPath = api_get_path(SYS_PUBLIC_PATH) . 'css/';
738
-        $alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH) . 'css/';
737
+        $alternateCssPath = api_get_path(SYS_PUBLIC_PATH).'css/';
738
+        $alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH).'css/';
739 739
 
740 740
         $image = trim($image);
741 741
 
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
             $size = ICON_SIZE_SMALL;
746 746
         }
747 747
 
748
-        $size_extra = $size . '/';
748
+        $size_extra = $size.'/';
749 749
 
750 750
         // Checking the img/ folder
751 751
         $icon = $w_code_path.'img/'.$image;
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
         $theme = 'themes/chamilo/icons/';
754 754
 
755 755
         if ($loadThemeIcon) {
756
-            $theme = 'themes/' . api_get_visual_theme() . '/icons/';
756
+            $theme = 'themes/'.api_get_visual_theme().'/icons/';
757 757
             // Checking the theme icons folder example: app/Resources/public/css/themes/chamilo/icons/XXX
758 758
             if (is_file($alternateCssPath.$theme.$size_extra.$image)) {
759 759
                 $icon = $alternateWebCssPath.$theme.$size_extra.$image;
@@ -775,11 +775,11 @@  discard block
 block discarded – undo
775 775
         // ask for the SVG version directly
776 776
         $svgIcons = api_get_setting('icons_mode_svg');
777 777
         if ($svgIcons == 'true' && $return_only_path == false) {
778
-            $svgImage = substr($image, 0, -3) . 'svg';
779
-            if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
780
-                $icon = $w_code_path . $theme . 'svg/' . $svgImage;
781
-            } elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) {
782
-                $icon = $w_code_path . 'img/icons/svg/' . $svgImage;
778
+            $svgImage = substr($image, 0, -3).'svg';
779
+            if (is_file($code_path.$theme.'svg/'.$svgImage)) {
780
+                $icon = $w_code_path.$theme.'svg/'.$svgImage;
781
+            } elseif (is_file($code_path.'img/icons/svg/'.$svgImage)) {
782
+                $icon = $w_code_path.'img/icons/svg/'.$svgImage;
783 783
             }
784 784
 
785 785
             if (empty($additional_attributes['height'])) {
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
             }
869 869
         }
870 870
         //some tags don't have this </XXX>
871
-        if (in_array($tag, array('img','input','br'))) {
871
+        if (in_array($tag, array('img', 'input', 'br'))) {
872 872
             $return_value = '<'.$tag.' '.$attribute_list.' />';
873 873
         } else {
874 874
             $return_value = '<'.$tag.' '.$attribute_list.' >'.$content.'</'.$tag.'>';
@@ -921,13 +921,13 @@  discard block
 block discarded – undo
921 921
     public static function input($type, $name, $value, $attributes = array())
922 922
     {
923 923
          if (isset($type)) {
924
-             $attributes['type']= $type;
924
+             $attributes['type'] = $type;
925 925
          }
926 926
          if (isset($name)) {
927
-             $attributes['name']= $name;
927
+             $attributes['name'] = $name;
928 928
          }
929 929
          if (isset($value)) {
930
-             $attributes['value']= $value;
930
+             $attributes['value'] = $value;
931 931
         }
932 932
         return self::tag('input', '', $attributes);
933 933
     }
@@ -960,14 +960,14 @@  discard block
 block discarded – undo
960 960
     ) {
961 961
         $html = '';
962 962
         $extra = '';
963
-        $default_id = 'id="' . $name . '" ';
963
+        $default_id = 'id="'.$name.'" ';
964 964
         foreach ($extra_attributes as $key => $parameter) {
965 965
             if ($key == 'id') {
966 966
                 $default_id = '';
967 967
             }
968
-            $extra .= $key . '="' . $parameter . '" ';
968
+            $extra .= $key.'="'.$parameter.'" ';
969 969
         }
970
-        $html .= '<select name="' . $name . '" ' . $default_id . ' ' . $extra . '>';
970
+        $html .= '<select name="'.$name.'" '.$default_id.' '.$extra.'>';
971 971
 
972 972
         if ($show_blank_item) {
973 973
             if (empty($blank_item_text)) {
@@ -975,14 +975,14 @@  discard block
 block discarded – undo
975 975
             } else {
976 976
                 $blank_item_text = Security::remove_XSS($blank_item_text);
977 977
             }
978
-            $html .= self::tag('option', '-- ' . $blank_item_text . ' --', array('value' => '-1'));
978
+            $html .= self::tag('option', '-- '.$blank_item_text.' --', array('value' => '-1'));
979 979
         }
980 980
         if ($values) {
981 981
             foreach ($values as $key => $value) {
982 982
                 if (is_array($value) && isset($value['name'])) {
983 983
                     $value = $value['name'];
984 984
                 }
985
-                $html .= '<option value="' . $key . '"';
985
+                $html .= '<option value="'.$key.'"';
986 986
 
987 987
                 if (is_array($default)) {
988 988
                     foreach ($default as $item) {
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
                     }
998 998
                 }
999 999
 
1000
-                $html .= '>' . $value . '</option>';
1000
+                $html .= '>'.$value.'</option>';
1001 1001
             }
1002 1002
         }
1003 1003
         $html .= '</select>';
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
      */
1026 1026
     public static function tabs($headers, $items, $id = 'tabs', $attributes = array(), $ul_attributes = array())
1027 1027
     {
1028
-        if (empty($headers) || count($headers) == 0 ) {
1028
+        if (empty($headers) || count($headers) == 0) {
1029 1029
             return '';
1030 1030
         }
1031 1031
 
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
             if ($i == 1) {
1037 1037
                 $active = ' active';
1038 1038
             }
1039
-            $item = self::tag('a', $item, array('href'=>'#'.$id.'-'.$i, 'role'=> 'tab', 'data-toggle' => 'tab', 'id' => $id . $i));
1039
+            $item = self::tag('a', $item, array('href'=>'#'.$id.'-'.$i, 'role'=> 'tab', 'data-toggle' => 'tab', 'id' => $id.$i));
1040 1040
             $ul_attributes['role'] = 'presentation';
1041 1041
             $ul_attributes['class'] = $active;
1042 1042
             $lis .= self::tag('li', $item, $ul_attributes);
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 
1066 1066
         $main_div = self::tag('div', $ul.self::tag('div', $divs, ['class' => 'tab-content']), $attributes);
1067 1067
 
1068
-        return $main_div ;
1068
+        return $main_div;
1069 1069
     }
1070 1070
 
1071 1071
     /**
@@ -1113,8 +1113,8 @@  discard block
 block discarded – undo
1113 1113
      */
1114 1114
     public static function grid_html($div_id)
1115 1115
     {
1116
-        $table = self::tag('table','', array('id' => $div_id));
1117
-        $table .= self::tag('div','', array('id' => $div_id.'_pager'));
1116
+        $table = self::tag('table', '', array('id' => $div_id));
1117
+        $table .= self::tag('div', '', array('id' => $div_id.'_pager'));
1118 1118
         return $table;
1119 1119
     }
1120 1120
 
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
         $obj->colNames      = $column_names;
1176 1176
         $obj->colModel      = $column_model;
1177 1177
         $obj->pager         = '#'.$div_id.'_pager';
1178
-        $obj->datatype  = 'json';
1178
+        $obj->datatype = 'json';
1179 1179
         $obj->viewrecords = 'true';
1180 1180
 
1181 1181
         $all_value = 10000000;
@@ -1236,10 +1236,10 @@  discard block
 block discarded – undo
1236 1236
         // Adding static data.
1237 1237
         if (!empty($data)) {
1238 1238
             $data_var = $div_id.'_data';
1239
-            $json.=' var '.$data_var.' = '.json_encode($data).';';
1239
+            $json .= ' var '.$data_var.' = '.json_encode($data).';';
1240 1240
             $obj->data = $data_var;
1241 1241
             $obj->datatype = 'local';
1242
-            $json.="\n";
1242
+            $json .= "\n";
1243 1243
         }
1244 1244
 
1245 1245
         $obj->end = 'end';
@@ -1253,12 +1253,12 @@  discard block
 block discarded – undo
1253 1253
         }
1254 1254
 
1255 1255
         // Fixing true/false js values that doesn't need the ""
1256
-        $json_encode = str_replace(':"true"',':true',$json_encode);
1256
+        $json_encode = str_replace(':"true"', ':true', $json_encode);
1257 1257
         // wrap_cell is not a valid jqgrid attributes is a hack to wrap a text
1258 1258
         $json_encode = str_replace('"wrap_cell":true', 'cellattr : function(rowId, value, rowObject, colModel, arrData) { return \'class = "jqgrid_whitespace"\'; }', $json_encode);
1259
-        $json_encode = str_replace(':"false"',':false',$json_encode);
1259
+        $json_encode = str_replace(':"false"', ':false', $json_encode);
1260 1260
         $json_encode = str_replace('"formatter":"action_formatter"', 'formatter:action_formatter', $json_encode);
1261
-        $json_encode = str_replace(array('{"first":"first",','"end":"end"}'), '', $json_encode);
1261
+        $json_encode = str_replace(array('{"first":"first",', '"end":"end"}'), '', $json_encode);
1262 1262
 
1263 1263
         // Creating the jqgrid element.
1264 1264
         $json .= '$("#'.$div_id.'").jqGrid({';
@@ -1273,22 +1273,22 @@  discard block
 block discarded – undo
1273 1273
             $groups = '';
1274 1274
             foreach ($extra_params['groupHeaders'] as $group) {
1275 1275
                 //{ "startColumnName" : "courses", "numberOfColumns" : 1, "titleText" : "Order Info" },
1276
-                $groups .= '{ "startColumnName" : "' . $group['startColumnName'] . '", "numberOfColumns" : ' . $group['numberOfColumns'] . ', "titleText" : "' . $group['titleText']  . '" },';
1276
+                $groups .= '{ "startColumnName" : "'.$group['startColumnName'].'", "numberOfColumns" : '.$group['numberOfColumns'].', "titleText" : "'.$group['titleText'].'" },';
1277 1277
 
1278 1278
             }
1279 1279
             $json .= '$("#'.$div_id.'").jqGrid("setGroupHeaders", {
1280 1280
                 "useColSpanStyle" : false,
1281 1281
                 "groupHeaders"    : [
1282
-                    ' . $groups . '
1282
+                    ' . $groups.'
1283 1283
                 ]
1284 1284
             });';
1285 1285
         }
1286 1286
 
1287 1287
         $all_text = addslashes(get_lang('All'));
1288 1288
         $json .= '$("'.$obj->pager.' option[value='.$all_value.']").text("'.$all_text.'");';
1289
-        $json.= "\n";
1289
+        $json .= "\n";
1290 1290
         // Adding edit/delete icons.
1291
-        $json.= $formatter;
1291
+        $json .= $formatter;
1292 1292
 
1293 1293
         return $json;
1294 1294
     }
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
         }
1320 1320
 
1321 1321
         if (!empty($rows)) {
1322
-	        foreach($rows as $content) {
1322
+	        foreach ($rows as $content) {
1323 1323
 	            $table->setCellContents($row, $column, $content);
1324 1324
                 $row++;
1325 1325
             }
@@ -1481,7 +1481,7 @@  discard block
 block discarded – undo
1481 1481
 
1482 1482
         // Show all tool icons where there is something new.
1483 1483
         $return = '&nbsp;';
1484
-        foreach($notifications as $notification) {
1484
+        foreach ($notifications as $notification) {
1485 1485
             $lastDate = date('d/m/Y H:i', convert_sql_date($notification['lastedit_date']));
1486 1486
             $type = $notification['lastedit_type'];
1487 1487
             $label = get_lang('TitleNotification').": ".get_lang($type)." ($lastDate)";
@@ -1524,9 +1524,9 @@  discard block
 block discarded – undo
1524 1524
             $main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
1525 1525
             $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
1526 1526
             // Request for the name of the general coach
1527
-            $sql ='SELECT tu.lastname, tu.firstname, ts.*
1527
+            $sql = 'SELECT tu.lastname, tu.firstname, ts.*
1528 1528
                     FROM '.$tbl_session.' ts
1529
-                    LEFT JOIN '.$main_user_table .' tu
1529
+                    LEFT JOIN '.$main_user_table.' tu
1530 1530
                     ON ts.id_coach = tu.user_id
1531 1531
                     WHERE ts.id = '.intval($session_id);
1532 1532
             $rs = Database::query($sql);
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
             $session['title'] = $session_info['name'];
1539 1539
             $session['id_coach'] = $session_info['id_coach'];
1540 1540
             $session['coach'] = '';
1541
-            $session['dates'] =  '';
1541
+            $session['dates'] = '';
1542 1542
 
1543 1543
             if (($session_info['access_end_date'] == '0000-00-00 00:00:00' && $session_info['access_start_date'] == '0000-00-00 00:00:00') ||
1544 1544
                 ($session_info['access_end_date'] == '0000-00-00 00:00:00' && $session_info['access_start_date'] == '0000-00-00 00:00:00') ||
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
                 $session['dates'] = $dates['access'];
1611 1611
 
1612 1612
 
1613
-                if (api_get_setting('show_session_coach') === 'true' ) {
1613
+                if (api_get_setting('show_session_coach') === 'true') {
1614 1614
                     $session['coach'] = api_get_person_name(
1615 1615
                         $session_info['firstname'],
1616 1616
                         $session_info['lastname']
@@ -1664,9 +1664,9 @@  discard block
 block discarded – undo
1664 1664
 		$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1665 1665
 
1666 1666
 		if (!empty($percentage)) {
1667
-            $percentage = $percentage*125/100;
1667
+            $percentage = $percentage * 125 / 100;
1668 1668
         }
1669
-		$accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1669
+		$accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1670 1670
 
1671 1671
 		$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1672 1672
 
@@ -1681,19 +1681,19 @@  discard block
 block discarded – undo
1681 1681
 
1682 1682
 		$labels = array();
1683 1683
 
1684
-		$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1685
-		$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1684
+		$labels[] = $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1685
+		$labels[] = $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1686 1686
 		/* if (!empty($number_of_users_who_voted)) {
1687 1687
 			$labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1688 1688
 		} */
1689 1689
 
1690
-		$labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1690
+		$labels[] = $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote').' [?] ';
1691 1691
 
1692 1692
 		if (!$add_div_wrapper && api_is_anonymous()) {
1693
-			$labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1693
+			$labels[] = Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1694 1694
 		}
1695 1695
 
1696
-        $html .= Display::div(implode(' | ', $labels) , array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1696
+        $html .= Display::div(implode(' | ', $labels), array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1697 1697
         $html .= ' '.Display::span(' ', array('id' =>  'vote_label2_'.$id));
1698 1698
 
1699 1699
         if ($add_div_wrapper) {
@@ -1766,8 +1766,8 @@  discard block
 block discarded – undo
1766 1766
         if (!empty($list)) {
1767 1767
             $html = '<dl class="dl-horizontal">';
1768 1768
             foreach ($list as $item) {
1769
-                $html .= '<dt>' . $item['title'] . '</dt>';
1770
-                $html .= '<dd>' . $item['content'] . '</dd>';
1769
+                $html .= '<dt>'.$item['title'].'</dt>';
1770
+                $html .= '<dd>'.$item['content'].'</dd>';
1771 1771
             }
1772 1772
             $html .= '</dl>';
1773 1773
         }
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
      * @param string $type
1810 1810
      * @return null|string
1811 1811
      */
1812
-    public static function badge($count, $type ="warning")
1812
+    public static function badge($count, $type = "warning")
1813 1813
     {
1814 1814
         $class = '';
1815 1815
 
@@ -1885,7 +1885,7 @@  discard block
 block discarded – undo
1885 1885
         if (!empty($content)) {
1886 1886
             $html = '<span class="label '.$class.'">';
1887 1887
             $html .= $content;
1888
-            $html .='</span>';
1888
+            $html .= '</span>';
1889 1889
         }
1890 1890
 
1891 1891
         return $html;
@@ -1906,7 +1906,7 @@  discard block
 block discarded – undo
1906 1906
                     $class = 'class ="active"';
1907 1907
                 }
1908 1908
 
1909
-                if (basename($_SERVER['REQUEST_URI']) == basename($value['url']) ) {
1909
+                if (basename($_SERVER['REQUEST_URI']) == basename($value['url'])) {
1910 1910
                     $class = 'class ="active"';
1911 1911
                 }
1912 1912
                 $html .= "<li $class >";
@@ -2160,7 +2160,7 @@  discard block
 block discarded – undo
2160 2160
         }
2161 2161
         $label = $nextValue + $localCounter + 1;
2162 2162
         if ($isMedia) {
2163
-            $label = ($fixedValue + 1) .' '.chr(97 + $localCounter);
2163
+            $label = ($fixedValue + 1).' '.chr(97 + $localCounter);
2164 2164
             $link_to_show = $link.$fixedValue.'#questionanchor'.$itemId;
2165 2165
         }
2166 2166
         $link = Display::url($label.' ', $link_to_show, $linkAttributes);
@@ -2341,7 +2341,7 @@  discard block
 block discarded – undo
2341 2341
         $attributes['title'] = isset($attributes['title']) ? $attributes['title'] : $text;
2342 2342
 
2343 2343
         if (!$includeText) {
2344
-            $text = '<span class="sr-only">' . $text . '</span>';
2344
+            $text = '<span class="sr-only">'.$text.'</span>';
2345 2345
         }
2346 2346
 
2347 2347
         return self::url("$icon $text", $url, $attributes);
@@ -2356,9 +2356,9 @@  discard block
 block discarded – undo
2356 2356
      */
2357 2357
     public static function toolbarAction($id, $content = array(), $col = 2, $right = true)
2358 2358
     {
2359
-        $columns = 12/$col;
2359
+        $columns = 12 / $col;
2360 2360
         $html = '';
2361
-        $html .= '<div id="' . $id . '" class="actions">';
2361
+        $html .= '<div id="'.$id.'" class="actions">';
2362 2362
         $html .= '<div class="row">';
2363 2363
         if ($col > 4) {
2364 2364
             $html = '<div class="alert alert-warning" role="alert">
@@ -2366,7 +2366,7 @@  discard block
 block discarded – undo
2366 2366
             </div>';
2367 2367
         } else {
2368 2368
             for ($i = 0; $i < $col; $i++) {
2369
-                $html .= '<div class="col-md-' . $columns . '">';
2369
+                $html .= '<div class="col-md-'.$columns.'">';
2370 2370
                 if ($col == 2 && $i == 1) {
2371 2371
                     if ($right === true) {
2372 2372
                         $html .= '<div class="pull-right">';
@@ -2482,9 +2482,9 @@  discard block
 block discarded – undo
2482 2482
             $params['class'] = 'panel panel-default';
2483 2483
             $html = null;
2484 2484
             if (!empty($title)) {
2485
-                $html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL;
2485
+                $html .= '<div class="panel-heading">'.$title.'</div>'.PHP_EOL;
2486 2486
             }
2487
-            $html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
2487
+            $html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL;
2488 2488
             $html = Display::div($html, $params);
2489 2489
         }
2490 2490
         return $html;
Please login to merge, or discard this patch.
main/inc/lib/plugin.class.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -591,13 +591,13 @@
 block discarded – undo
591 591
 
592 592
     }
593 593
 
594
-   /**
595
-    * Add a tab to platform
596
-    * @param string   $tabName
597
-    * @param string   $url
598
-    *
599
-    * @return boolean
600
-    */
594
+    /**
595
+     * Add a tab to platform
596
+     * @param string   $tabName
597
+     * @param string   $url
598
+     *
599
+     * @return boolean
600
+     */
601 601
     public function addTab($tabName, $url)
602 602
     {
603 603
         $sql = "SELECT * FROM settings_current
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $this->fields = $settings;
61 61
 
62 62
         global $language_files;
63
-        $language_files[] = 'plugin_' . $this->get_name();
63
+        $language_files[] = 'plugin_'.$this->get_name();
64 64
     }
65 65
 
66 66
     /**
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     {
269 269
         $settings = $this->get_settings();
270 270
         foreach ($settings as $setting) {
271
-            if ($setting['variable'] == $this->get_name() . '_' . $name) {
271
+            if ($setting['variable'] == $this->get_name().'_'.$name) {
272 272
 
273 273
                 return $setting['selected_value'];
274 274
             }
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         if (!empty($this->course_settings)) {
405 405
             foreach ($this->course_settings as $setting) {
406 406
                 $variable = $setting['name'];
407
-                $value ='';
407
+                $value = '';
408 408
                 if (isset($setting['init_value'])) {
409 409
                     $value = $setting['init_value'];
410 410
                 }
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 
619 619
         // Avoid Tab Name Spaces
620 620
         $tabNameNoSpaces = preg_replace('/\s+/', '', $tabName);
621
-        $subkeytext = "Tabs" . $tabNameNoSpaces;
621
+        $subkeytext = "Tabs".$tabNameNoSpaces;
622 622
 
623 623
         // Check if it is already added
624 624
         $checkCondition = array(
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
         }
638 638
 
639 639
         // End Check
640
-        $subkey = 'custom_tab_' . $tabNum;
640
+        $subkey = 'custom_tab_'.$tabNum;
641 641
         $attributes = array(
642 642
             'variable' => 'show_tabs',
643 643
             'subkey' => $subkey,
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 
656 656
         // Save the id
657 657
         $settings = $this->get_settings();
658
-        $setData = array (
658
+        $setData = array(
659 659
             'comment' => $subkey
660 660
         );
661 661
         $whereCondition = array(
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
                 $i = 1;
697 697
                 foreach ($tabs as $row) {
698 698
                     $attributes = array(
699
-                        'subkey' => 'custom_tab_' . $i
699
+                        'subkey' => 'custom_tab_'.$i
700 700
                     );
701 701
                     $this->updateTab($row['subkey'], $attributes);
702 702
                     $i++;
Please login to merge, or discard this patch.