Passed
Push — 1.10.x ( 751682...677ec8 )
by Yannick
50:57
created
main/inc/lib/diagnoser.lib.php 4 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -351,6 +351,12 @@
 block discarded – undo
351 351
 
352 352
     /**
353 353
      * Additional functions needed for fast integration
354
+     * @param integer $status
355
+     * @param string $section
356
+     * @param string $title
357
+     * @param string $url
358
+     * @param string|null $formatter
359
+     * @param string $comment
354 360
      */
355 361
     public function build_setting($status, $section, $title, $url, $current_value, $expected_value, $formatter, $comment, $img_path = null) {
356 362
         switch ($status) {
Please login to merge, or discard this patch.
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.
Spacing   +28 added lines, -28 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
     /**
@@ -44,21 +44,21 @@  discard block
 block discarded – undo
44 44
                 $html .= '<li>';
45 45
             }
46 46
             $params['section'] = $section;
47
-            $html .='<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
47
+            $html .= '<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
48 48
         }
49 49
 
50 50
         $html .= '</ul><div class="tab-pane">';
51 51
 
52
-        $data = call_user_func(array($this, 'get_' . $current_section . '_data'));
52
+        $data = call_user_func(array($this, 'get_'.$current_section.'_data'));
53 53
         echo $html;
54 54
         $table = new SortableTableFromArray($data, 1, 100);
55 55
 
56
-        $table->set_header(0,'', false);
57
-        $table->set_header(1,get_lang('Section'), false);
58
-        $table->set_header(2,get_lang('Setting'), false);
59
-        $table->set_header(3,get_lang('Current'), false);
60
-        $table->set_header(4,get_lang('Expected'), false);
61
-        $table->set_header(5,get_lang('Comment'), false);
56
+        $table->set_header(0, '', false);
57
+        $table->set_header(1, get_lang('Section'), false);
58
+        $table->set_header(2, get_lang('Setting'), false);
59
+        $table->set_header(3, get_lang('Current'), false);
60
+        $table->set_header(4, get_lang('Expected'), false);
61
+        $table->set_header(5, get_lang('Comment'), false);
62 62
 
63 63
         $table->display();
64 64
         echo '</div></div>';
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $array = array();
74 74
         $writable_folders = array(
75
-            api_get_path(SYS_APP_PATH) .'cache',
75
+            api_get_path(SYS_APP_PATH).'cache',
76 76
             api_get_path(SYS_COURSE_PATH),
77
-            api_get_path(SYS_APP_PATH) .'home',
78
-            api_get_path(SYS_APP_PATH) .'upload/users/',
79
-            api_get_path(SYS_PATH) .'main/default_course_document/images/',
77
+            api_get_path(SYS_APP_PATH).'home',
78
+            api_get_path(SYS_APP_PATH).'upload/users/',
79
+            api_get_path(SYS_PATH).'main/default_course_document/images/',
80 80
         );
81 81
         foreach ($writable_folders as $index => $folder) {
82 82
             $writable = is_writable($folder);
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
 
96 96
         $exists = file_exists(api_get_path(SYS_CODE_PATH).'install');
97 97
         $status = $exists ? self :: STATUS_WARNING : self :: STATUS_OK;
98
-        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists') . ': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
98
+        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists').': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
99 99
 
100 100
         $app_version = api_get_setting('chamilo_database_version');
101
-        $array[] = $this->build_setting(self :: STATUS_INFORMATION, '[DB]', 'chamilo_database_version', '#', $app_version, 0, null,  'Chamilo DB version');
101
+        $array[] = $this->build_setting(self :: STATUS_INFORMATION, '[DB]', 'chamilo_database_version', '#', $app_version, 0, null, 'Chamilo DB version');
102 102
 
103 103
         return $array;
104 104
     }
@@ -165,33 +165,33 @@  discard block
 block discarded – undo
165 165
         $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'));
166 166
 
167 167
         $setting = ini_get('max_execution_time');
168
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
168
+        $req_setting = '300 ('.get_lang('Minimum').')';
169 169
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
170 170
         $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'));
171 171
 
172 172
         $setting = ini_get('max_input_time');
173
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
173
+        $req_setting = '300 ('.get_lang('Minimum').')';
174 174
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
175 175
         $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'));
176 176
 
177 177
         $setting = ini_get('memory_limit');
178 178
         $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M';
179 179
         $status = self :: STATUS_ERROR;
180
-        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT)
180
+        if ((float) $setting >= REQUIRED_MIN_MEMORY_LIMIT)
181 181
             $status = self :: STATUS_OK;
182 182
         $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 183
 
184 184
         $setting = ini_get('post_max_size');
185 185
         $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M';
186 186
         $status = self :: STATUS_ERROR;
187
-        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE)
187
+        if ((float) $setting >= REQUIRED_MIN_POST_MAX_SIZE)
188 188
             $status = self :: STATUS_OK;
189 189
         $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 190
 
191 191
         $setting = ini_get('upload_max_filesize');
192 192
         $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M';
193 193
         $status = self :: STATUS_ERROR;
194
-        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
194
+        if ((float) $setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
195 195
             $status = self :: STATUS_OK;
196 196
         $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 197
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
206 206
         $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 207
 
208
-        if (api_check_browscap()){$setting = true;}else{$setting=false;}
208
+        if (api_check_browscap()) {$setting = true; } else {$setting = false; }
209 209
         $req_setting = true;
210 210
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
211 211
         $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'));
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
             $loaded = extension_loaded($extension);
263 263
             $status = $loaded ? self :: STATUS_OK : self :: STATUS_ERROR;
264
-            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension') . ': ' . $extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
264
+            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension').': '.$extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
265 265
         }
266 266
 
267 267
         return $array;
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                 break;
369 369
         }
370 370
 
371
-        if (! $img_path) {
371
+        if (!$img_path) {
372 372
             $img_path = api_get_path(WEB_IMG_PATH);
373 373
         }
374 374
         $image = Display::return_icon($img, $status);
@@ -379,9 +379,9 @@  discard block
 block discarded – undo
379 379
         $formatted_expected_value = $expected_value;
380 380
 
381 381
         if ($formatter) {
382
-            if (method_exists($this, 'format_' . $formatter)) {
383
-                $formatted_current_value = call_user_func(array($this, 'format_' . $formatter), $current_value);
384
-                $formatted_expected_value = call_user_func(array($this, 'format_' . $formatter), $expected_value);
382
+            if (method_exists($this, 'format_'.$formatter)) {
383
+                $formatted_current_value = call_user_func(array($this, 'format_'.$formatter), $current_value);
384
+                $formatted_expected_value = call_user_func(array($this, 'format_'.$formatter), $expected_value);
385 385
             }
386 386
         }
387 387
 
@@ -396,13 +396,13 @@  discard block
 block discarded – undo
396 396
      */
397 397
     public function get_link($title, $url)
398 398
     {
399
-        return '<a href="' . $url . '" target="about:bank">' . $title . '</a>';
399
+        return '<a href="'.$url.'" target="about:bank">'.$title.'</a>';
400 400
     }
401 401
 
402 402
     public function format_yes_no_optional($value)
403 403
     {
404 404
     	$return = '';
405
-    	switch($value) {
405
+    	switch ($value) {
406 406
      		case 0:
407 407
      			$return = get_lang('No');
408 408
      			break;
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.
main/inc/lib/display.lib.php 4 patches
Doc Comments   +26 added lines, -15 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     }
33 33
 
34 34
     /**
35
-     * @return array
35
+     * @return string[]
36 36
      */
37 37
     public static function toolList()
38 38
     {
@@ -290,7 +290,6 @@  discard block
 block discarded – undo
290 290
      * 					'page_nr' = The page to display
291 291
      * 					'hide_navigation' =  true to hide the navigation
292 292
      * @param array $query_vars Additional variables to add in the query-string
293
-     * @param array $form actions Additional variables to add in the query-string
294 293
      * @param mixed An array with bool values to know which columns show.
295 294
      * i.e: $visibility_options= array(true, false) we will only show the first column
296 295
      * 				Can be also only a bool value. TRUE: show all columns, FALSE: show nothing
@@ -331,7 +330,6 @@  discard block
 block discarded – undo
331 330
      * 					'page_nr' = The page to display
332 331
      * 					'hide_navigation' =  true to hide the navigation
333 332
      * @param array $query_vars Additional variables to add in the query-string
334
-     * @param array $form actions Additional variables to add in the query-string
335 333
      * @param mixed An array with bool values to know which columns show. i.e:
336 334
      *  $visibility_options= array(true, false) we will only show the first column
337 335
      * 	Can be also only a bool value. TRUE: show all columns, FALSE: show nothing
@@ -388,10 +386,11 @@  discard block
 block discarded – undo
388 386
      * 					'per_page' = number of items to show per page
389 387
      * 					'page_nr' = The page to display
390 388
      * @param array $query_vars Additional variables to add in the query-string
391
-     * @param array $column_show Array of binaries 1= show columns 0. hide a column
389
+     * @param integer[] $column_show Array of binaries 1= show columns 0. hide a column
392 390
      * @param array $column_order An array of integers that let us decide how the columns are going to be sort.
393 391
      * 						      i.e:  $column_order=array('1''4','3','4'); The 2nd column will be order like the 4th column
394 392
      * @param array $form_actions Set optional forms actions
393
+     * @param string $table_name
395 394
      *
396 395
      * @author Julio Montoya
397 396
      */
@@ -444,7 +443,7 @@  discard block
 block discarded – undo
444 443
      * @param bool	$filter (true) or not (false)
445 444
      * @param bool $returnValue
446 445
      *
447
-     * @return void
446
+     * @return string|null
448 447
      */
449 448
     public static function display_normal_message($message, $filter = true, $returnValue = false)
450 449
     {
@@ -474,7 +473,7 @@  discard block
 block discarded – undo
474 473
     /**
475 474
      * Displays an confirmation message. Use this if something has been done successfully
476 475
      * @param bool	Filter (true) or not (false)
477
-     * @return void
476
+     * @return string|null
478 477
      */
479 478
     public static function display_confirmation_message ($message, $filter = true, $returnValue = false)
480 479
     {
@@ -491,7 +490,7 @@  discard block
 block discarded – undo
491 490
      * @param string $message - include any additional html
492 491
      *                          tags if you need them
493 492
      * @param bool	Filter (true) or not (false)
494
-     * @return void
493
+     * @return string|null
495 494
      */
496 495
     public static function display_error_message ($message, $filter = true, $returnValue = false)
497 496
     {
@@ -681,6 +680,7 @@  discard block
 block discarded – undo
681 680
      * @param string   The alt text (probably a language variable)
682 681
      * @param array    additional attributes (for instance height, width, onclick, ...)
683 682
      * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
683
+     * @param string $image
684 684
      * @return void
685 685
     */
686 686
     public static function display_icon(
@@ -881,6 +881,7 @@  discard block
 block discarded – undo
881 881
     /**
882 882
      * Displays an HTML input tag
883 883
      *
884
+     * @param string $type
884 885
      */
885 886
     public static function input($type, $name, $value, $attributes = array())
886 887
     {
@@ -897,8 +898,8 @@  discard block
 block discarded – undo
897 898
     }
898 899
 
899 900
     /**
900
-     * @param $name
901
-     * @param $value
901
+     * @param string $name
902
+     * @param string $value
902 903
      * @param array $attributes
903 904
      * @return string
904 905
      */
@@ -913,6 +914,7 @@  discard block
 block discarded – undo
913 914
     /**
914 915
      * Displays an HTML select tag
915 916
      *
917
+     * @param string $blank_item_text
916 918
      */
917 919
     public static function select(
918 920
         $name,
@@ -983,6 +985,8 @@  discard block
 block discarded – undo
983 985
      * @param   array   content that will be showed
984 986
      * @param   string  the id of the container of the tab in the example "tabs"
985 987
      * @param   array   attributes for the ul
988
+     * @param string[] $header_list
989
+     * @param string[] $content_list
986 990
      *
987 991
      */
988 992
     public static function tabs($header_list, $content_list, $id = 'tabs', $attributes = array(), $ul_attributes = array())
@@ -1029,7 +1033,7 @@  discard block
 block discarded – undo
1029 1033
 
1030 1034
     /**
1031 1035
      * @param $headers
1032
-     * @param null $selected
1036
+     * @param integer $selected
1033 1037
      *
1034 1038
      * @return string
1035 1039
      */
@@ -1067,6 +1071,7 @@  discard block
 block discarded – undo
1067 1071
      * As you can see both function use the same "my_grid_name" this is very important otherwise nothing will work
1068 1072
      *
1069 1073
      * @param   string  the div id, this value must be the same with the first parameter of Display::grid_js()
1074
+     * @param string $div_id
1070 1075
      * @return  string  html
1071 1076
      *
1072 1077
      */
@@ -1622,6 +1627,8 @@  discard block
 block discarded – undo
1622 1627
      * @param  string  url that will be added (for jquery see hot_courses.tpl)
1623 1628
 	 * @param	string	point info array see function CourseManager::get_course_ranking()
1624 1629
 	 * @param	bool	add a div wrapper
1630
+	 * @param string $id
1631
+	 * @param string $url
1625 1632
 	 * @todo	use     templates
1626 1633
      **/
1627 1634
     public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true)
@@ -1717,6 +1724,9 @@  discard block
 block discarded – undo
1717 1724
         return '<'.$size.'>'.Security::remove_XSS($title).'</'.$size.'>';
1718 1725
     }
1719 1726
 
1727
+    /**
1728
+     * @param string $title
1729
+     */
1720 1730
     public static function page_subheader2($title, $second_title = null)
1721 1731
     {
1722 1732
         return self::page_header($title, $second_title, 'h4');
@@ -1947,6 +1957,7 @@  discard block
 block discarded – undo
1947 1957
 
1948 1958
     /**
1949 1959
      * @todo use twig
1960
+     * @param string $title
1950 1961
      */
1951 1962
     public static function group_button($title, $elements)
1952 1963
     {
@@ -2164,9 +2175,9 @@  discard block
 block discarded – undo
2164 2175
 
2165 2176
     /**
2166 2177
      * @param int $id
2167
-     * @param array $content
2178
+     * @param string[] $content
2168 2179
      * @param int $col
2169
-     * @param bool|true $right
2180
+     * @param boolean $right
2170 2181
      * @return string
2171 2182
      */
2172 2183
     public static function toolbarAction($id, $content = array(), $col = 2, $right = true)
@@ -2248,10 +2259,10 @@  discard block
 block discarded – undo
2248 2259
     /**
2249 2260
      * @param string $title
2250 2261
      * @param string $content
2251
-     * @param null $id
2262
+     * @param string $id
2252 2263
      * @param array $params
2253
-     * @param null $idAccordion
2254
-     * @param null $idCollapse
2264
+     * @param string $idAccordion
2265
+     * @param string $idCollapse
2255 2266
      * @param bool|true $open
2256 2267
      * @param bool|false $fullClickable
2257 2268
      * @return null|string
Please login to merge, or discard this patch.
Indentation   +69 added lines, -69 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 {
@@ -524,22 +524,22 @@  discard block
 block discarded – undo
524 524
     public static function return_message($message, $type = 'normal', $filter = true)
525 525
     {
526 526
         if ($filter) {
527
-        	$message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
527
+            $message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
528 528
         }
529 529
 
530 530
         $class = "";
531 531
         switch($type) {
532 532
             case 'warning':
533 533
                $class .= 'alert alert-warning';
534
-               break;
534
+                break;
535 535
             case 'error':
536 536
                $class .= 'alert alert-danger';
537
-               break;
537
+                break;
538 538
             case 'confirmation':
539 539
             case 'confirm':
540 540
             case 'success':
541 541
                 $class .= 'alert alert-success';
542
-               break;
542
+                break;
543 543
             case 'normal':
544 544
             default:
545 545
                 $class .= 'alert alert-info';
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
      * @param array    additional attributes (for instance height, width, onclick, ...)
683 683
      * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
684 684
      * @return void
685
-    */
685
+     */
686 686
     public static function display_icon(
687 687
         $image,
688 688
         $alt_text = '',
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
      * @author Julio Montoya 2010 Function improved, adding image constants
706 706
      * @author Yannick Warnier 2011 Added size handler
707 707
      * @version Feb 2011
708
-    */
708
+     */
709 709
     public static function return_icon(
710 710
         $image,
711 711
         $alt_text = '',
@@ -884,14 +884,14 @@  discard block
 block discarded – undo
884 884
      */
885 885
     public static function input($type, $name, $value, $attributes = array())
886 886
     {
887
-         if (isset($type)) {
888
-             $attributes['type']= $type;
889
-         }
890
-         if (isset($name)) {
891
-             $attributes['name']= $name;
892
-         }
893
-         if (isset($value)) {
894
-             $attributes['value']= $value;
887
+            if (isset($type)) {
888
+                $attributes['type']= $type;
889
+            }
890
+            if (isset($name)) {
891
+                $attributes['name']= $name;
892
+            }
893
+            if (isset($value)) {
894
+                $attributes['value']= $value;
895 895
         }
896 896
         return self::tag('input', '', $attributes);
897 897
     }
@@ -904,10 +904,10 @@  discard block
 block discarded – undo
904 904
      */
905 905
     public static function button($name, $value, $attributes = array())
906 906
     {
907
-    	if (!empty($name)) {
907
+        if (!empty($name)) {
908 908
             $attributes['name'] = $name;
909
-    	}
910
-    	return self::tag('button', $value, $attributes);
909
+        }
910
+        return self::tag('button', $value, $attributes);
911 911
     }
912 912
 
913 913
     /**
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
      * in the $htmlHeadXtra variable before the display_header
975 975
      * Add this script
976 976
      * @example
977
-             * <script>
977
+     * <script>
978 978
                     $(function() {
979 979
                         $( "#tabs" ).tabs();
980 980
                     });
@@ -1035,20 +1035,20 @@  discard block
 block discarded – undo
1035 1035
      */
1036 1036
     public static function tabsOnlyLink($headers, $selected = null)
1037 1037
     {
1038
-         $id = uniqid();
1039
-         $i = 1;
1040
-         $lis = null;
1041
-         foreach ($headers as $item) {
1038
+            $id = uniqid();
1039
+            $i = 1;
1040
+            $lis = null;
1041
+            foreach ($headers as $item) {
1042 1042
             $class = null;
1043 1043
             if ($i == $selected) {
1044 1044
                 $class = 'active';
1045 1045
             }
1046
-             $item = self::tag(
1047
-                 'a',
1048
-                 $item['content'],
1049
-                 array('id' => $id.'-'.$i, 'href' => $item['url'])
1050
-             );
1051
-             $lis .= self::tag('li', $item, array('class' => $class));
1046
+                $item = self::tag(
1047
+                    'a',
1048
+                    $item['content'],
1049
+                    array('id' => $id.'-'.$i, 'href' => $item['url'])
1050
+                );
1051
+                $lis .= self::tag('li', $item, array('class' => $class));
1052 1052
             $i++;
1053 1053
         }
1054 1054
         return self::tag('ul', $lis, array('class' => 'nav nav-tabs tabs-margin'));
@@ -1260,8 +1260,8 @@  discard block
 block discarded – undo
1260 1260
      */
1261 1261
     public static function table($headers, $rows, $attributes = array())
1262 1262
     {
1263
-    	if (empty($attributes)) {
1264
-    		$attributes['class'] = 'data_table';
1263
+        if (empty($attributes)) {
1264
+            $attributes['class'] = 'data_table';
1265 1265
         }
1266 1266
         $table = new HTML_Table($attributes);
1267 1267
         $row = 0;
@@ -1269,17 +1269,17 @@  discard block
 block discarded – undo
1269 1269
 
1270 1270
         // Course headers
1271 1271
         if (!empty($headers)) {
1272
-	        foreach ($headers as $item) {
1273
-	            $table->setHeaderContents($row, $column, $item);
1274
-	            $column++;
1275
-	        }
1276
-	        $row = 1;
1277
-	        $column = 0;
1272
+            foreach ($headers as $item) {
1273
+                $table->setHeaderContents($row, $column, $item);
1274
+                $column++;
1275
+            }
1276
+            $row = 1;
1277
+            $column = 0;
1278 1278
         }
1279 1279
 
1280 1280
         if (!empty($rows)) {
1281
-	        foreach($rows as $content) {
1282
-	            $table->setCellContents($row, $column, $content);
1281
+            foreach($rows as $content) {
1282
+                $table->setCellContents($row, $column, $content);
1283 1283
                 $row++;
1284 1284
             }
1285 1285
         }
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
                         //$item_property['tool'] != TOOL_DROPBOX &&
1386 1386
                         $item_property['tool'] != TOOL_NOTEBOOK &&
1387 1387
                         $item_property['tool'] != TOOL_CHAT)
1388
-                   )
1388
+                    )
1389 1389
                 )
1390 1390
                 // Take only what's visible or "invisible but where the user is a teacher" or where the visibility is unset.
1391 1391
                 && ($item_property['visibility'] == '1'
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
                         ($item_property['to_user_id'] != $user_id) &&
1402 1402
                         (!isset($item_property['to_group_id']) || !in_array($item_property['to_group_id'], $group_ids)))
1403 1403
                 ) {
1404
-                   continue;
1404
+                    continue;
1405 1405
                 }
1406 1406
 
1407 1407
                 // If it's a survey, make sure the user's invited. Otherwise drop it.
@@ -1620,21 +1620,21 @@  discard block
 block discarded – undo
1620 1620
      *
1621 1621
      * @param  string  id of the rating ul element
1622 1622
      * @param  string  url that will be added (for jquery see hot_courses.tpl)
1623
-	 * @param	string	point info array see function CourseManager::get_course_ranking()
1624
-	 * @param	bool	add a div wrapper
1625
-	 * @todo	use     templates
1623
+     * @param	string	point info array see function CourseManager::get_course_ranking()
1624
+     * @param	bool	add a div wrapper
1625
+     * @todo	use     templates
1626 1626
      **/
1627 1627
     public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true)
1628 1628
     {
1629
-		$number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1630
-		$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1629
+        $number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1630
+        $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1631 1631
 
1632
-		if (!empty($percentage)) {
1632
+        if (!empty($percentage)) {
1633 1633
             $percentage = $percentage*125/100;
1634 1634
         }
1635
-		$accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1635
+        $accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1636 1636
 
1637
-		$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1637
+        $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1638 1638
 
1639 1639
         $html = '<ul id="'.$id.'" class="star-rating">
1640 1640
 					<li class="current-rating" style="width:'.$percentage.'px;"></li>
@@ -1645,26 +1645,26 @@  discard block
 block discarded – undo
1645 1645
 					<li><a href="javascript:void(0);" data-link="'.$url.'&amp;star=5" title="'.$star_label.'" class="five-stars">5</a></li>
1646 1646
 				</ul>';
1647 1647
 
1648
-		$labels = array();
1648
+        $labels = array();
1649 1649
 
1650
-		$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1651
-		$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1652
-		if (!empty($number_of_users_who_voted)) {
1653
-			$labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1654
-		}
1650
+        $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1651
+        $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1652
+        if (!empty($number_of_users_who_voted)) {
1653
+            $labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1654
+        }
1655 1655
 
1656
-		$labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1656
+        $labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1657 1657
 
1658
-		if (!$add_div_wrapper && api_is_anonymous()) {
1659
-			$labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1660
-		}
1658
+        if (!$add_div_wrapper && api_is_anonymous()) {
1659
+            $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1660
+        }
1661 1661
 
1662 1662
         $html .= Display::div(implode(' | ', $labels) , array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1663 1663
         $html .= ' '.Display::span(' ', array('id' =>  'vote_label2_'.$id));
1664 1664
 
1665 1665
         if ($add_div_wrapper) {
1666
-			$html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1667
-		}
1666
+            $html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1667
+        }
1668 1668
 
1669 1669
         return $html;
1670 1670
     }
@@ -1702,8 +1702,8 @@  discard block
 block discarded – undo
1702 1702
         return self::page_header($title, $second_title);
1703 1703
     }
1704 1704
 
1705
-     public static function page_subheader_and_translate($title, $second_title = null)
1706
-     {
1705
+        public static function page_subheader_and_translate($title, $second_title = null)
1706
+        {
1707 1707
         $title = get_lang($title);
1708 1708
         return self::page_subheader($title, $second_title);
1709 1709
     }
Please login to merge, or discard this patch.
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @param string Optional help file name
56 56
      * @param string $page_header
57 57
      */
58
-    public static function display_header($tool_name ='', $help = null, $page_header = null)
58
+    public static function display_header($tool_name = '', $help = null, $page_header = null)
59 59
     {
60 60
         $origin = api_get_origin();
61 61
         $showHeader = true;
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         $grid_class = array(),
352 352
         $elementCount = 0
353 353
     ) {
354
-        $column =  0;
354
+        $column = 0;
355 355
         $default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20;
356 356
 
357 357
         $table = new SortableTableFromArray($content, $column, $default_items_per_page, $name);
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
      * @param bool	Filter (true) or not (false)
477 477
      * @return void
478 478
      */
479
-    public static function display_confirmation_message ($message, $filter = true, $returnValue = false)
479
+    public static function display_confirmation_message($message, $filter = true, $returnValue = false)
480 480
     {
481 481
         $message = self::return_message($message, 'confirm', $filter);
482 482
         if ($returnValue) {
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
      * @param bool	Filter (true) or not (false)
494 494
      * @return void
495 495
      */
496
-    public static function display_error_message ($message, $filter = true, $returnValue = false)
496
+    public static function display_error_message($message, $filter = true, $returnValue = false)
497 497
     {
498 498
         $message = self::return_message($message, 'error', $filter);
499 499
         if ($returnValue) {
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
      * @param string $type
509 509
      * @param bool $filter
510 510
      */
511
-    public static function return_message_and_translate($message, $type='normal', $filter = true)
511
+    public static function return_message_and_translate($message, $type = 'normal', $filter = true)
512 512
     {
513 513
         $message = get_lang($message);
514 514
         echo self::return_message($message, $type, $filter);
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
         }
529 529
 
530 530
         $class = "";
531
-        switch($type) {
531
+        switch ($type) {
532 532
             case 'warning':
533 533
                $class .= 'alert alert-warning';
534 534
                break;
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
      * @param string  optional, class from stylesheet
557 557
      * @return string encrypted mailto hyperlink
558 558
      */
559
-    public static function encrypted_mailto_link ($email, $clickable_text = null, $style_class = '')
559
+    public static function encrypted_mailto_link($email, $clickable_text = null, $style_class = '')
560 560
     {
561 561
         if (is_null($clickable_text)) {
562 562
             $clickable_text = $email;
@@ -571,14 +571,14 @@  discard block
 block discarded – undo
571 571
         }
572 572
         // Encrypt email
573 573
         $hmail = '';
574
-        for ($i = 0; $i < strlen($email); $i ++) {
574
+        for ($i = 0; $i < strlen($email); $i++) {
575 575
             $hmail .= '&#'.ord($email {
576 576
             $i }).';';
577 577
         }
578 578
         $hclickable_text = null;
579 579
         // Encrypt clickable text if @ is present
580 580
         if (strpos($clickable_text, '@')) {
581
-            for ($i = 0; $i < strlen($clickable_text); $i ++) {
581
+            for ($i = 0; $i < strlen($clickable_text); $i++) {
582 582
                 $hclickable_text .= '&#'.ord($clickable_text {
583 583
                 $i }).';';
584 584
             }
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
         }
611 611
         // Encrypt email
612 612
         $hmail = '';
613
-        for ($i = 0; $i < strlen($email); $i ++) {
613
+        for ($i = 0; $i < strlen($email); $i++) {
614 614
             $hmail .= '&#'.ord($email {
615 615
             $i }).';';
616 616
         }
@@ -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) {
@@ -720,12 +720,12 @@  discard block
 block discarded – undo
720 720
         $alternateWebCssPath = api_get_path(WEB_CSS_PATH);
721 721
 
722 722
         $image = trim($image);
723
-        $theme = 'themes/' . api_get_visual_theme() . '/icons/';
723
+        $theme = 'themes/'.api_get_visual_theme().'/icons/';
724 724
         $size_extra = '';
725 725
 
726 726
         if (isset($size)) {
727 727
             $size = intval($size);
728
-            $size_extra = $size . '/';
728
+            $size_extra = $size.'/';
729 729
         } else {
730 730
             $size = ICON_SIZE_SMALL;
731 731
         }
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
             $icon = $w_code_path.'img/icons/'.$size_extra.$image;
739 739
         } else {
740 740
             //Checking the img/ folder
741
-            $icon = $w_code_path . 'img/' . $image;
741
+            $icon = $w_code_path.'img/'.$image;
742 742
         }
743 743
 
744 744
         // Special code to enable SVG - refs #7359 - Needs more work
@@ -748,11 +748,11 @@  discard block
 block discarded – undo
748 748
         // ask for the SVG version directly
749 749
         $testServer = api_get_setting('server_type');
750 750
         if ($testServer == 'test' && $return_only_path == false) {
751
-            $svgImage = substr($image, 0, -3) . 'svg';
752
-            if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
753
-                $icon = $w_code_path . $theme . 'svg/' . $svgImage;
754
-            } elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) {
755
-                $icon = $w_code_path . 'img/icons/svg/' . $svgImage;
751
+            $svgImage = substr($image, 0, -3).'svg';
752
+            if (is_file($code_path.$theme.'svg/'.$svgImage)) {
753
+                $icon = $w_code_path.$theme.'svg/'.$svgImage;
754
+            } elseif (is_file($code_path.'img/icons/svg/'.$svgImage)) {
755
+                $icon = $w_code_path.'img/icons/svg/'.$svgImage;
756 756
             }
757 757
 
758 758
             if (empty($additional_attributes['height'])) {
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
             }
833 833
         }
834 834
         //some tags don't have this </XXX>
835
-        if (in_array($tag, array('img','input','br'))) {
835
+        if (in_array($tag, array('img', 'input', 'br'))) {
836 836
             $return_value = '<'.$tag.' '.$attribute_list.' />';
837 837
         } else {
838 838
             $return_value = '<'.$tag.' '.$attribute_list.' > '.$content.'</'.$tag.'>';
@@ -885,13 +885,13 @@  discard block
 block discarded – undo
885 885
     public static function input($type, $name, $value, $attributes = array())
886 886
     {
887 887
          if (isset($type)) {
888
-             $attributes['type']= $type;
888
+             $attributes['type'] = $type;
889 889
          }
890 890
          if (isset($name)) {
891
-             $attributes['name']= $name;
891
+             $attributes['name'] = $name;
892 892
          }
893 893
          if (isset($value)) {
894
-             $attributes['value']= $value;
894
+             $attributes['value'] = $value;
895 895
         }
896 896
         return self::tag('input', '', $attributes);
897 897
     }
@@ -924,14 +924,14 @@  discard block
 block discarded – undo
924 924
     ) {
925 925
         $html = '';
926 926
         $extra = '';
927
-        $default_id = 'id="' . $name . '" ';
927
+        $default_id = 'id="'.$name.'" ';
928 928
         foreach ($extra_attributes as $key => $parameter) {
929 929
             if ($key == 'id') {
930 930
                 $default_id = '';
931 931
             }
932
-            $extra .= $key . '="' . $parameter . '" ';
932
+            $extra .= $key.'="'.$parameter.'" ';
933 933
         }
934
-        $html .= '<select name="' . $name . '" ' . $default_id . ' ' . $extra . '>';
934
+        $html .= '<select name="'.$name.'" '.$default_id.' '.$extra.'>';
935 935
 
936 936
         if ($show_blank_item) {
937 937
             if (empty($blank_item_text)) {
@@ -939,14 +939,14 @@  discard block
 block discarded – undo
939 939
             } else {
940 940
                 $blank_item_text = Security::remove_XSS($blank_item_text);
941 941
             }
942
-            $html .= self::tag('option', '-- ' . $blank_item_text . ' --', array('value' => '-1'));
942
+            $html .= self::tag('option', '-- '.$blank_item_text.' --', array('value' => '-1'));
943 943
         }
944 944
         if ($values) {
945 945
             foreach ($values as $key => $value) {
946 946
                 if (is_array($value) && isset($value['name'])) {
947 947
                     $value = $value['name'];
948 948
                 }
949
-                $html .= '<option value="' . $key . '"';
949
+                $html .= '<option value="'.$key.'"';
950 950
 
951 951
                 if (is_array($default)) {
952 952
                     foreach ($default as $item) {
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
                     }
962 962
                 }
963 963
 
964
-                $html .= '>' . $value . '</option>';
964
+                $html .= '>'.$value.'</option>';
965 965
             }
966 966
         }
967 967
         $html .= '</select>';
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
      */
988 988
     public static function tabs($header_list, $content_list, $id = 'tabs', $attributes = array(), $ul_attributes = array())
989 989
     {
990
-        if (empty($header_list) || count($header_list) == 0 ) {
990
+        if (empty($header_list) || count($header_list) == 0) {
991 991
             return '';
992 992
         }
993 993
 
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 
1025 1025
         $main_div = self::tag('div', $ul.self::tag('div', $divs, ['class' => 'tab-content']), $attributes);
1026 1026
 
1027
-        return $main_div ;
1027
+        return $main_div;
1028 1028
     }
1029 1029
 
1030 1030
     /**
@@ -1072,8 +1072,8 @@  discard block
 block discarded – undo
1072 1072
      */
1073 1073
     public static function grid_html($div_id)
1074 1074
     {
1075
-        $table  = self::tag('table','', array('id' => $div_id));
1076
-        $table .= self::tag('div','', array('id' => $div_id.'_pager'));
1075
+        $table  = self::tag('table', '', array('id' => $div_id));
1076
+        $table .= self::tag('div', '', array('id' => $div_id.'_pager'));
1077 1077
         return $table;
1078 1078
     }
1079 1079
 
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
         $obj->colNames      = $column_names;
1135 1135
         $obj->colModel      = $column_model;
1136 1136
         $obj->pager         = '#'.$div_id.'_pager';
1137
-        $obj->datatype  = 'json';
1137
+        $obj->datatype = 'json';
1138 1138
         $obj->viewrecords = 'true';
1139 1139
 
1140 1140
         $all_value = 10000000;
@@ -1195,10 +1195,10 @@  discard block
 block discarded – undo
1195 1195
         // Adding static data.
1196 1196
         if (!empty($data)) {
1197 1197
             $data_var = $div_id.'_data';
1198
-            $json.=' var '.$data_var.' = '.json_encode($data).';';
1198
+            $json .= ' var '.$data_var.' = '.json_encode($data).';';
1199 1199
             $obj->data = $data_var;
1200 1200
             $obj->datatype = 'local';
1201
-            $json.="\n";
1201
+            $json .= "\n";
1202 1202
         }
1203 1203
 
1204 1204
         $obj->end = 'end';
@@ -1212,12 +1212,12 @@  discard block
 block discarded – undo
1212 1212
         }
1213 1213
 
1214 1214
         // Fixing true/false js values that doesn't need the ""
1215
-        $json_encode = str_replace(':"true"',':true',$json_encode);
1215
+        $json_encode = str_replace(':"true"', ':true', $json_encode);
1216 1216
         // wrap_cell is not a valid jqgrid attributes is a hack to wrap a text
1217 1217
         $json_encode = str_replace('"wrap_cell":true', 'cellattr : function(rowId, value, rowObject, colModel, arrData) { return \'class = "jqgrid_whitespace"\'; }', $json_encode);
1218
-        $json_encode = str_replace(':"false"',':false',$json_encode);
1218
+        $json_encode = str_replace(':"false"', ':false', $json_encode);
1219 1219
         $json_encode = str_replace('"formatter":"action_formatter"', 'formatter:action_formatter', $json_encode);
1220
-        $json_encode = str_replace(array('{"first":"first",','"end":"end"}'), '', $json_encode);
1220
+        $json_encode = str_replace(array('{"first":"first",', '"end":"end"}'), '', $json_encode);
1221 1221
 
1222 1222
         // Creating the jqgrid element.
1223 1223
         $json .= '$("#'.$div_id.'").jqGrid({';
@@ -1232,22 +1232,22 @@  discard block
 block discarded – undo
1232 1232
             $groups = '';
1233 1233
             foreach ($extra_params['groupHeaders'] as $group) {
1234 1234
                 //{ "startColumnName" : "courses", "numberOfColumns" : 1, "titleText" : "Order Info" },
1235
-                $groups .= '{ "startColumnName" : "' . $group['startColumnName'] . '", "numberOfColumns" : ' . $group['numberOfColumns'] . ', "titleText" : "' . $group['titleText']  . '" },';
1235
+                $groups .= '{ "startColumnName" : "'.$group['startColumnName'].'", "numberOfColumns" : '.$group['numberOfColumns'].', "titleText" : "'.$group['titleText'].'" },';
1236 1236
 
1237 1237
             }
1238 1238
             $json .= '$("#'.$div_id.'").jqGrid("setGroupHeaders", {
1239 1239
                 "useColSpanStyle" : false,
1240 1240
                 "groupHeaders"    : [
1241
-                    ' . $groups . '
1241
+                    ' . $groups.'
1242 1242
                 ]
1243 1243
             });';
1244 1244
         }
1245 1245
 
1246 1246
         $all_text = addslashes(get_lang('All'));
1247 1247
         $json .= '$("'.$obj->pager.' option[value='.$all_value.']").text("'.$all_text.'");';
1248
-        $json.= "\n";
1248
+        $json .= "\n";
1249 1249
         // Adding edit/delete icons.
1250
-        $json.= $formatter;
1250
+        $json .= $formatter;
1251 1251
 
1252 1252
         return $json;
1253 1253
     }
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
         }
1279 1279
 
1280 1280
         if (!empty($rows)) {
1281
-	        foreach($rows as $content) {
1281
+	        foreach ($rows as $content) {
1282 1282
 	            $table->setCellContents($row, $column, $content);
1283 1283
                 $row++;
1284 1284
             }
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
 
1441 1441
         // Show all tool icons where there is something new.
1442 1442
         $return = '&nbsp;';
1443
-        foreach($notifications as $notification) {
1443
+        foreach ($notifications as $notification) {
1444 1444
             $lastDate = date('d/m/Y H:i', convert_sql_date($notification['lastedit_date']));
1445 1445
             $type = $notification['lastedit_type'];
1446 1446
             $label = get_lang('TitleNotification').": ".get_lang($type)." ($lastDate)";
@@ -1483,9 +1483,9 @@  discard block
 block discarded – undo
1483 1483
             $tbl_session            = Database :: get_main_table(TABLE_MAIN_SESSION);
1484 1484
             $active = false;
1485 1485
             // Request for the name of the general coach
1486
-            $sql ='SELECT tu.lastname, tu.firstname, ts.*
1486
+            $sql = 'SELECT tu.lastname, tu.firstname, ts.*
1487 1487
                     FROM '.$tbl_session.' ts
1488
-                    LEFT JOIN '.$main_user_table .' tu
1488
+                    LEFT JOIN '.$main_user_table.' tu
1489 1489
                     ON ts.id_coach = tu.user_id
1490 1490
                     WHERE ts.id = '.intval($session_id);
1491 1491
             $rs = Database::query($sql);
@@ -1495,7 +1495,7 @@  discard block
 block discarded – undo
1495 1495
             $session = array();
1496 1496
             $session['title'] = $session_info['name'];
1497 1497
             $session['coach'] = '';
1498
-            $session['dates'] =  '';
1498
+            $session['dates'] = '';
1499 1499
 
1500 1500
             if (
1501 1501
                 (
@@ -1577,8 +1577,8 @@  discard block
 block discarded – undo
1577 1577
                     );
1578 1578
                 }
1579 1579
 
1580
-                if ( api_get_setting('show_session_coach') === 'true' ) {
1581
-                    $session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name(
1580
+                if (api_get_setting('show_session_coach') === 'true') {
1581
+                    $session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name(
1582 1582
                         $session_info['firstname'],
1583 1583
                         $session_info['lastname']
1584 1584
                     );
@@ -1630,9 +1630,9 @@  discard block
 block discarded – undo
1630 1630
 		$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1631 1631
 
1632 1632
 		if (!empty($percentage)) {
1633
-            $percentage = $percentage*125/100;
1633
+            $percentage = $percentage * 125 / 100;
1634 1634
         }
1635
-		$accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1635
+		$accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1636 1636
 
1637 1637
 		$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1638 1638
 
@@ -1647,19 +1647,19 @@  discard block
 block discarded – undo
1647 1647
 
1648 1648
 		$labels = array();
1649 1649
 
1650
-		$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1651
-		$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1650
+		$labels[] = $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1651
+		$labels[] = $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1652 1652
 		if (!empty($number_of_users_who_voted)) {
1653
-			$labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1653
+			$labels[] = get_lang('Average').' '.$point_info['point_average_star'].'/5';
1654 1654
 		}
1655 1655
 
1656
-		$labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1656
+		$labels[] = $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote').' [?] ';
1657 1657
 
1658 1658
 		if (!$add_div_wrapper && api_is_anonymous()) {
1659
-			$labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1659
+			$labels[] = Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1660 1660
 		}
1661 1661
 
1662
-        $html .= Display::div(implode(' | ', $labels) , array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1662
+        $html .= Display::div(implode(' | ', $labels), array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1663 1663
         $html .= ' '.Display::span(' ', array('id' =>  'vote_label2_'.$id));
1664 1664
 
1665 1665
         if ($add_div_wrapper) {
@@ -1737,8 +1737,8 @@  discard block
 block discarded – undo
1737 1737
         if (!empty($list)) {
1738 1738
             $html = '<dl class="dl-horizontal">';
1739 1739
             foreach ($list as $item) {
1740
-                $html .= '<dt>' . $item['title'] . '</dt>';
1741
-                $html .= '<dd>' . $item['content'] . '</dd>';
1740
+                $html .= '<dt>'.$item['title'].'</dt>';
1741
+                $html .= '<dd>'.$item['content'].'</dd>';
1742 1742
             }
1743 1743
             $html .= '</dl>';
1744 1744
         }
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
      * @param string $type
1781 1781
      * @return null|string
1782 1782
      */
1783
-    public static function badge($count, $type ="warning")
1783
+    public static function badge($count, $type = "warning")
1784 1784
     {
1785 1785
         $class = '';
1786 1786
 
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
         if (!empty($content)) {
1857 1857
             $html = '<span class="label '.$class.'">';
1858 1858
             $html .= $content;
1859
-            $html .='</span>';
1859
+            $html .= '</span>';
1860 1860
         }
1861 1861
 
1862 1862
         return $html;
@@ -1877,7 +1877,7 @@  discard block
 block discarded – undo
1877 1877
                     $class = 'class ="active"';
1878 1878
                 }
1879 1879
 
1880
-                if (basename($_SERVER['REQUEST_URI']) == basename($value['url']) ) {
1880
+                if (basename($_SERVER['REQUEST_URI']) == basename($value['url'])) {
1881 1881
                     $class = 'class ="active"';
1882 1882
                 }
1883 1883
                 $html .= "<li $class >";
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
      */
2094 2094
     public static function getVCardUserLink($userId)
2095 2095
     {
2096
-        $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId);;
2096
+        $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId); ;
2097 2097
 
2098 2098
         return $vCardUrl;
2099 2099
     }
@@ -2111,7 +2111,7 @@  discard block
 block discarded – undo
2111 2111
     {
2112 2112
         $title = !empty($title) ? '<div class="panel-heading"><h3 class="panel-title">'.$title.'</h3>'.$extra.'</div>' : '';
2113 2113
         $footer = !empty($footer) ? '<div class="panel-footer ">'.$footer.'</div>' : '';
2114
-        $styles = ['primary','success','info','warning','danger'];
2114
+        $styles = ['primary', 'success', 'info', 'warning', 'danger'];
2115 2115
         $style = !in_array($style, $styles) ? 'default' : $style;
2116 2116
 
2117 2117
         return '
@@ -2156,7 +2156,7 @@  discard block
 block discarded – undo
2156 2156
         $attributes['class'] = isset($attributes['class']) ? "$buttonClass {$attributes['class']}" : $buttonClass;
2157 2157
 
2158 2158
         if (!$includeText) {
2159
-            $text = '<span class="sr-only">' . $text . '</span>';
2159
+            $text = '<span class="sr-only">'.$text.'</span>';
2160 2160
         }
2161 2161
 
2162 2162
         return self::url("$icon $text", $url, $attributes);
@@ -2171,19 +2171,19 @@  discard block
 block discarded – undo
2171 2171
      */
2172 2172
     public static function toolbarAction($id, $content = array(), $col = 2, $right = true)
2173 2173
     {
2174
-        $columns = 12/$col;
2174
+        $columns = 12 / $col;
2175 2175
         $html = '';
2176
-        $html .= '<div id="' . $id . '" class="actions">';
2176
+        $html .= '<div id="'.$id.'" class="actions">';
2177 2177
         $html .= '<div class="row">';
2178 2178
         if ($col > 4) {
2179 2179
             $html = '<div class="alert alert-warning" role="alert">Action toolbar design does not work when exceeding four columns - check Display::toolbarAction()</div>';
2180 2180
         } else {
2181
-            for ( $i = 0; $i < $col; $i++ ) {
2182
-                $html .= '<div class="col-md-' . $columns . '">';
2183
-                if ( $col == 2 && $i == 1 ) {
2181
+            for ($i = 0; $i < $col; $i++) {
2182
+                $html .= '<div class="col-md-'.$columns.'">';
2183
+                if ($col == 2 && $i == 1) {
2184 2184
                     if ($right === true) {
2185 2185
                         $html .= '<div class="pull-right">';
2186
-                        $html .= (isset($content[$i])?$content[$i]:'');
2186
+                        $html .= (isset($content[$i]) ? $content[$i] : '');
2187 2187
                         $html .= '</div>';
2188 2188
                     } else {
2189 2189
                         $html .= $content[$i];
@@ -2295,9 +2295,9 @@  discard block
 block discarded – undo
2295 2295
             $params['class'] = 'panel panel-default';
2296 2296
             $html = null;
2297 2297
             if (!empty($title)) {
2298
-                $html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL;
2298
+                $html .= '<div class="panel-heading">'.$title.'</div>'.PHP_EOL;
2299 2299
             }
2300
-            $html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
2300
+            $html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL;
2301 2301
             $html = Display::div($html, $params);
2302 2302
         }
2303 2303
         return $html;
Please login to merge, or discard this patch.
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.
main/inc/lib/document.lib.php 2 patches
Doc Comments   +22 added lines, -18 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     /**
278 278
      *  @param string
279 279
      *  @param string
280
-     * 	@return true if the user is allowed to see the document, false otherwise
280
+     * 	@return boolean if the user is allowed to see the document, false otherwise
281 281
      * 	@author Sergio A Kessler, first version
282 282
      * 	@author Roan Embrechts, bugfix
283 283
      *  @todo not only check if a file is visible, but also check if the user is allowed to see the file??
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
      * Return true if the documentpath have visibility=1 as
1526 1526
      * item_property (you should use the is_visible_by_id)
1527 1527
      *
1528
-     * @param string $document_path the relative complete path of the document
1528
+     * @param string $doc_path the relative complete path of the document
1529 1529
      * @param array  $course the _course array info of the document's course
1530 1530
      * @param int
1531 1531
      * @param string
@@ -1610,6 +1610,8 @@  discard block
 block discarded – undo
1610 1610
      * @param   int
1611 1611
      * @param   int
1612 1612
      * @param bool
1613
+     * @param integer $session_id
1614
+     * @param integer $user_id
1613 1615
      * @return  bool
1614 1616
      */
1615 1617
     public static function is_visible_by_id(
@@ -2088,6 +2090,7 @@  discard block
 block discarded – undo
2088 2090
      * @param	bool  	is file or string html
2089 2091
      * @param	string	type (one of the app tools) - optional (otherwise takes the current item's type)
2090 2092
      * @param	int		level of recursivity we're in
2093
+     * @param string $source_html
2091 2094
      * @return	array	List of file paths. An additional field containing 'local' or 'remote' helps determine
2092 2095
      * if the file should be copied into the zip or just linked
2093 2096
      */
@@ -2908,6 +2911,7 @@  discard block
 block discarded – undo
2908 2911
 
2909 2912
     /**
2910 2913
      * Obtains the text inside the file with the right parser
2914
+     * @param string $doc_path
2911 2915
      */
2912 2916
     public static function get_text_content($doc_path, $doc_mime)
2913 2917
     {
@@ -3108,6 +3112,7 @@  discard block
 block discarded – undo
3108 3112
      * @author Bert Vanderkimpen
3109 3113
      * @param  int file_size size of the file in byte
3110 3114
      * @param  int max_dir_space maximum size
3115
+     * @param integer $max_dir_space
3111 3116
      * @return boolean true if there is enough space, false otherwise
3112 3117
      *
3113 3118
      * @see enough_space() uses  documents_total_space() function
@@ -3156,6 +3161,7 @@  discard block
 block discarded – undo
3156 3161
      * Shows a play icon next to the document title in the document list
3157 3162
      * @param int
3158 3163
      * @param string
3164
+     * @param integer|null $i
3159 3165
      * @return string	html content
3160 3166
      */
3161 3167
     static function generate_media_preview($i, $type = 'simple')
@@ -3550,7 +3556,7 @@  discard block
 block discarded – undo
3550 3556
      * @param bool $add_move_button
3551 3557
      * @param string $target
3552 3558
      * @param string $overwrite_url
3553
-     * @return null|string
3559
+     * @return string
3554 3560
      */
3555 3561
     private static function parseFile(
3556 3562
         $course_info,
@@ -4051,7 +4057,7 @@  discard block
 block discarded – undo
4051 4057
     }
4052 4058
 
4053 4059
     /**
4054
-     * @return array
4060
+     * @return string[]
4055 4061
      */
4056 4062
     public static function get_web_odf_extension_list()
4057 4063
     {
@@ -4060,10 +4066,10 @@  discard block
 block discarded – undo
4060 4066
 
4061 4067
     /**
4062 4068
      * Set of extension allowed to use Jodconverter
4063
-     * @param $mode 'from'
4069
+     * @param string $mode 'from'
4064 4070
      *              'to'
4065 4071
      *              'all'
4066
-     * @param $format   'text'
4072
+     * @param string $format   'text'
4067 4073
      *                  'spreadsheet'
4068 4074
      *                  'presentation'
4069 4075
      *                  'drawing'
@@ -4267,7 +4273,7 @@  discard block
 block discarded – undo
4267 4273
     }
4268 4274
 
4269 4275
     /**
4270
-     * @return array
4276
+     * @return string[]
4271 4277
      */
4272 4278
     public static function get_system_folders()
4273 4279
     {
@@ -4285,7 +4291,7 @@  discard block
 block discarded – undo
4285 4291
     }
4286 4292
 
4287 4293
     /**
4288
-     * @return array
4294
+     * @return string[]
4289 4295
      */
4290 4296
     public static function getProtectedFolderFromStudent()
4291 4297
     {
@@ -4441,7 +4447,7 @@  discard block
 block discarded – undo
4441 4447
      * Requires the ffmpeg lib. In ubuntu: sudo apt-get install ffmpeg
4442 4448
      * @param string $wavFile
4443 4449
      * @param bool $removeWavFileIfSuccess
4444
-     * @return bool
4450
+     * @return string|false
4445 4451
      */
4446 4452
     public static function convertWavToMp3($wavFile, $removeWavFileIfSuccess = false)
4447 4453
     {
@@ -5529,9 +5535,6 @@  discard block
 block discarded – undo
5529 5535
     /**
5530 5536
      * Creates the row of edit icons for a file/folder
5531 5537
      *
5532
-     * @param string $curdirpath current path (cfr open folder)
5533
-     * @param string $type (file/folder)
5534
-     * @param string $path dbase path of file/folder
5535 5538
      * @param int $visibility (1/0)
5536 5539
      * @param int $id dbase id of the document
5537 5540
      * @return string html img tags with hyperlinks
@@ -5860,7 +5863,7 @@  discard block
 block discarded – undo
5860 5863
     /**
5861 5864
      * Gets the path translated with title of docs and folders
5862 5865
      * @param string $path the real path
5863
-     * @return the path which should be displayed
5866
+     * @return string path which should be displayed
5864 5867
      */
5865 5868
     public static function get_titles_of_path($path)
5866 5869
     {
@@ -5915,7 +5918,8 @@  discard block
 block discarded – undo
5915 5918
 
5916 5919
     /**
5917 5920
      * Checks whether the user is in shared folder
5918
-     * @return return bool Return true when user is into shared folder
5921
+     * @param integer $current_session_id
5922
+     * @return boolean bool Return true when user is into shared folder
5919 5923
      */
5920 5924
     public static function is_shared_folder($curdirpath, $current_session_id)
5921 5925
     {
@@ -5931,7 +5935,7 @@  discard block
 block discarded – undo
5931 5935
 
5932 5936
     /**
5933 5937
      * Checks whether the user is into any user shared folder
5934
-     * @return return bool Return true when user is in any user shared folder
5938
+     * @return boolean bool Return true when user is in any user shared folder
5935 5939
      */
5936 5940
     public static function is_any_user_shared_folder($path, $current_session_id)
5937 5941
     {
@@ -6145,7 +6149,7 @@  discard block
 block discarded – undo
6145 6149
      * @param int $id
6146 6150
      * @param array $courseInfo
6147 6151
      * @param int $sessionId
6148
-     * @return bool
6152
+     * @return boolean|null
6149 6153
      */
6150 6154
     public static function downloadDeletedDocument($id, $courseInfo, $sessionId)
6151 6155
     {
@@ -6164,7 +6168,7 @@  discard block
 block discarded – undo
6164 6168
      * @param array $courseInfo
6165 6169
      * @param int $sessionId
6166 6170
      *
6167
-     * @return bool
6171
+     * @return false|null
6168 6172
      */
6169 6173
     public static function downloadAllDeletedDocument($courseInfo, $sessionId)
6170 6174
     {
@@ -6203,7 +6207,7 @@  discard block
 block discarded – undo
6203 6207
      * @param array $courseInfo
6204 6208
      * @param int $sessionId
6205 6209
      *
6206
-     * @return bool
6210
+     * @return false|null
6207 6211
      */
6208 6212
     public function deleteDocumentsFromSession($courseInfo, $sessionId)
6209 6213
     {
Please login to merge, or discard this patch.
Spacing   +339 added lines, -339 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
             return true;
291 291
         } else {
292 292
             $tbl_document = Database::get_course_table(TABLE_DOCUMENT);
293
-            $tbl_item_property = $this_course . 'item_property';
293
+            $tbl_item_property = $this_course.'item_property';
294 294
             $doc_url = Database::escape_string($doc_url);
295 295
             $query = "SELECT 1 FROM $tbl_document AS docs,$tbl_item_property AS props
296 296
                       WHERE
@@ -339,18 +339,18 @@  discard block
 block discarded – undo
339 339
             }
340 340
 
341 341
             header('Content-type: application/octet-stream');
342
-            header('Content-length: ' . $len);
342
+            header('Content-length: '.$len);
343 343
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
344
-                header('Content-Disposition: filename= ' . $filename);
344
+                header('Content-Disposition: filename= '.$filename);
345 345
             } else {
346
-                header('Content-Disposition: attachment; filename= ' . $filename);
346
+                header('Content-Disposition: attachment; filename= '.$filename);
347 347
             }
348 348
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
349 349
                 header('Pragma: ');
350 350
                 header('Cache-Control: ');
351 351
                 header('Cache-Control: public'); // IE cannot download from sessions without a cache
352 352
             }
353
-            header('Content-Description: ' . $filename);
353
+            header('Content-Description: '.$filename);
354 354
             header('Content-Transfer-Encoding: binary');
355 355
 
356 356
             $res = fopen($full_file_name, 'r');
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             $content_type = self::file_get_mime_type($filename);
364 364
 
365 365
             header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
366
-            header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
366
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
367 367
             // Commented to avoid double caching declaration when playing with IE and HTTPS
368 368
             //header('Cache-Control: no-cache, must-revalidate');
369 369
             //header('Pragma: no-cache');
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
                     } else {
375 375
                         $encoding = @api_detect_encoding_html(file_get_contents($full_file_name));
376 376
                         if (!empty($encoding)) {
377
-                            $content_type .= '; charset=' . $encoding;
377
+                            $content_type .= '; charset='.$encoding;
378 378
                         }
379 379
                     }
380 380
                     break;
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
                     } else {
385 385
                         $encoding = @api_detect_encoding(strip_tags(file_get_contents($full_file_name)));
386 386
                         if (!empty($encoding)) {
387
-                            $content_type .= '; charset=' . $encoding;
387
+                            $content_type .= '; charset='.$encoding;
388 388
                         }
389 389
                     }
390 390
                     break;
@@ -393,13 +393,13 @@  discard block
 block discarded – undo
393 393
                     header('Content-type: application/octet-stream');
394 394
                     break;
395 395
             }
396
-            header('Content-type: ' . $content_type);
397
-            header('Content-Length: ' . $len);
396
+            header('Content-type: '.$content_type);
397
+            header('Content-Length: '.$len);
398 398
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
399 399
             if (strpos($user_agent, 'msie')) {
400
-                header('Content-Disposition: ; filename= ' . $filename);
400
+                header('Content-Disposition: ; filename= '.$filename);
401 401
             } else {
402
-                header('Content-Disposition: inline; filename= ' . $filename);
402
+                header('Content-Disposition: inline; filename= '.$filename);
403 403
             }
404 404
 
405 405
             if ($fixLinksHttpToHttps) {
@@ -440,18 +440,18 @@  discard block
 block discarded – undo
440 440
 
441 441
             header('Content-type: application/octet-stream');
442 442
             //header('Content-Type: application/force-download');
443
-            header('Content-length: ' . $len);
443
+            header('Content-length: '.$len);
444 444
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
445
-                header('Content-Disposition: filename= ' . $filename);
445
+                header('Content-Disposition: filename= '.$filename);
446 446
             } else {
447
-                header('Content-Disposition: attachment; filename= ' . $filename);
447
+                header('Content-Disposition: attachment; filename= '.$filename);
448 448
             }
449 449
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
450 450
                 header('Pragma: ');
451 451
                 header('Cache-Control: ');
452 452
                 header('Cache-Control: public'); // IE cannot download from sessions without a cache
453 453
             }
454
-            header('Content-Description: ' . $filename);
454
+            header('Content-Description: '.$filename);
455 455
             header('Content-transfer-encoding: binary');
456 456
             echo $full_string;
457 457
 
@@ -464,30 +464,30 @@  discard block
 block discarded – undo
464 464
 
465 465
             $content_type = self::file_get_mime_type($filename);
466 466
             header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
467
-            header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
467
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
468 468
             header('Cache-Control: no-cache, must-revalidate');
469 469
             header('Pragma: no-cache');
470 470
             switch ($content_type) {
471 471
                 case 'text/html':
472 472
                     $encoding = @api_detect_encoding_html($full_string);
473 473
                     if (!empty($encoding)) {
474
-                        $content_type .= '; charset=' . $encoding;
474
+                        $content_type .= '; charset='.$encoding;
475 475
                     }
476 476
                     break;
477 477
                 case 'text/plain':
478 478
                     $encoding = @api_detect_encoding(strip_tags($full_string));
479 479
                     if (!empty($encoding)) {
480
-                        $content_type .= '; charset=' . $encoding;
480
+                        $content_type .= '; charset='.$encoding;
481 481
                     }
482 482
                     break;
483 483
             }
484
-            header('Content-type: ' . $content_type);
485
-            header('Content-Length: ' . $len);
484
+            header('Content-type: '.$content_type);
485
+            header('Content-Length: '.$len);
486 486
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
487 487
             if (strpos($user_agent, 'msie')) {
488
-                header('Content-Disposition: ; filename= ' . $filename);
488
+                header('Content-Disposition: ; filename= '.$filename);
489 489
             } else {
490
-                header('Content-Disposition: inline; filename= ' . $filename);
490
+                header('Content-Disposition: inline; filename= '.$filename);
491 491
             }
492 492
             echo($full_string);
493 493
             //You have to ensure that the calling script then stops processing (exit();)
@@ -580,9 +580,9 @@  discard block
 block discarded – undo
580 580
             if (!empty($students)) {
581 581
                 $conditionList = array();
582 582
                 foreach ($students as $studentId => $studentInfo) {
583
-                    $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
583
+                    $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
584 584
                 }
585
-                $sharedCondition .= ' AND docs.path IN ("' . implode('","', $conditionList) . '")';
585
+                $sharedCondition .= ' AND docs.path IN ("'.implode('","', $conditionList).'")';
586 586
             }
587 587
         }
588 588
 
@@ -608,8 +608,8 @@  discard block
 block discarded – undo
608 608
                     last.c_id = {$_course['real_id']}
609 609
                 )
610 610
                 WHERE
611
-                    docs.path LIKE '" . Database::escape_string($path . $added_slash.'%'). "' AND
612
-                    docs.path NOT LIKE '" . Database::escape_string($path . $added_slash.'%/%')."' AND
611
+                    docs.path LIKE '".Database::escape_string($path.$added_slash.'%')."' AND
612
+                    docs.path NOT LIKE '" . Database::escape_string($path.$added_slash.'%/%')."' AND
613 613
                     docs.path NOT LIKE '%_DELETED_%' AND
614 614
                     $userGroupFilter AND
615 615
                     last.visibility $visibility_bit
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
                     $table_template = Database::get_main_table(TABLE_MAIN_TEMPLATES);
651 651
                     $sql = "SELECT id FROM $table_template
652 652
                             WHERE
653
-                                course_code = '" . $_course['code'] . "' AND
653
+                                course_code = '".$_course['code']."' AND
654 654
                                 user_id = '".api_get_user_id()."' AND
655 655
                                 ref_doc = '".$row['id']."'";
656 656
                     $template_result = Database::query($sql);
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
         if (!empty($students)) {
761 761
             $conditionList = array();
762 762
             foreach ($students as $studentId => $studentInfo) {
763
-                $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
763
+                $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
764 764
             }
765 765
         }
766 766
 
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
                        INNER JOIN $TABLE_DOCUMENT  AS docs
785 785
                        ON (
786 786
                             docs.id = last.ref AND
787
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
787
+                            last.tool = '".TOOL_DOCUMENT."' AND
788 788
                             last.c_id = {$_course['real_id']} AND
789 789
                             docs.c_id = {$_course['real_id']}
790 790
                        )
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
                         INNER JOIN $TABLE_DOCUMENT  AS docs
802 802
                         ON (
803 803
                             docs.id = last.ref AND
804
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
804
+                            last.tool = '".TOOL_DOCUMENT."' AND
805 805
                             last.c_id = {$_course['real_id']} AND
806 806
                             docs.c_id = {$_course['real_id']}
807 807
                         )
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
                     WHERE
849 849
                         docs.id = last.ref AND
850 850
                         docs.filetype = 'folder' AND
851
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
851
+                        last.tool = '".TOOL_DOCUMENT."' AND
852 852
                         $groupCondition AND
853 853
                         last.visibility = 1
854 854
                         $condition_session AND
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
                     WHERE
870 870
                         docs.id = last.ref AND
871 871
                         docs.filetype = 'folder' AND
872
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
872
+                        last.tool = '".TOOL_DOCUMENT."' AND
873 873
                         $groupCondition AND
874 874
                         last.visibility = 0 $condition_session AND
875 875
                         last.c_id = {$_course['real_id']} AND
@@ -885,9 +885,9 @@  discard block
 block discarded – undo
885 885
                         FROM $TABLE_ITEMPROPERTY AS last, $TABLE_DOCUMENT AS docs
886 886
                         WHERE
887 887
                             docs.id = last.ref AND
888
-                            docs.path LIKE '" . Database::escape_string($row['path'].'/%') . "' AND
888
+                            docs.path LIKE '".Database::escape_string($row['path'].'/%')."' AND
889 889
                             docs.filetype = 'folder' AND
890
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
890
+                            last.tool = '" . TOOL_DOCUMENT."' AND
891 891
                             $groupCondition AND
892 892
                             last.visibility = 1 $condition_session AND
893 893
                             last.c_id = {$_course['real_id']} AND
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
                                 tp.c_id = $course_id AND
965 965
                                 td.session_id = $sessionId AND
966 966
                                 tp.ref= td.id AND
967
-                                (path='" . $path . "' OR path LIKE BINARY '" . $path . "/%' ) ";
967
+                                (path='".$path."' OR path LIKE BINARY '".$path."/%' ) ";
968 968
                     // Get all id's of documents that are deleted
969 969
                     $what_to_check_result = Database::query($sql);
970 970
 
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
             $res = Database::query($sql);
1307 1307
             if (Database::num_rows($res) > 0) {
1308 1308
                 $row2 = Database::fetch_array($res);
1309
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
1309
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
1310 1310
                 $di = new ChamiloIndexer();
1311 1311
                 $di->remove_document((int) $row2['search_did']);
1312 1312
             }
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
             Database::query($sql);
1316 1316
 
1317 1317
             // remove terms from db
1318
-            require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
1318
+            require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
1319 1319
             delete_all_values_for_item($course_id, TOOL_DOCUMENT, $document_id);
1320 1320
         }
1321 1321
     }
@@ -1404,12 +1404,12 @@  discard block
 block discarded – undo
1404 1404
             $path = str_replace('%2F', '/', $url_path);
1405 1405
             $pathinfo = pathinfo($row['path']);
1406 1406
 
1407
-            $row['url'] = api_get_path(WEB_CODE_PATH) . 'document/showinframes.php?cidReq=' . $course_code . '&id=' . $id;
1408
-            $row['document_url'] = api_get_path(WEB_CODE_PATH) . 'document/document.php?cidReq=' . $course_code . '&id=' . $id;
1409
-            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1410
-            $row['absolute_path_from_document'] = '/document' . $row['path'];
1411
-            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'] . '/';
1412
-            $row['direct_url'] = $www . $path;
1407
+            $row['url'] = api_get_path(WEB_CODE_PATH).'document/showinframes.php?cidReq='.$course_code.'&id='.$id;
1408
+            $row['document_url'] = api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course_code.'&id='.$id;
1409
+            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1410
+            $row['absolute_path_from_document'] = '/document'.$row['path'];
1411
+            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'].'/';
1412
+            $row['direct_url'] = $www.$path;
1413 1413
 
1414 1414
             if (dirname($row['path']) == '.') {
1415 1415
                 $row['parent_id'] = '0';
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
                 $real_dir = '';
1429 1429
 
1430 1430
                 for ($i = 1; $i < $array_len; $i++) {
1431
-                    $real_dir .= '/' . $dir_array[$i];
1431
+                    $real_dir .= '/'.$dir_array[$i];
1432 1432
                     $parent_id = self::get_document_id($course_info, $real_dir);
1433 1433
                     if ($session_id != 0 && empty($parent_id)) {
1434 1434
                         $parent_id = self::get_document_id($course_info, $real_dir, 0);
@@ -1502,21 +1502,21 @@  discard block
 block discarded – undo
1502 1502
         $user_id = intval($user_id);
1503 1503
         $document_id = intval($document_id);
1504 1504
 
1505
-        $sql = 'SELECT id FROM ' . $table_template . '
1505
+        $sql = 'SELECT id FROM '.$table_template.'
1506 1506
                 WHERE
1507
-                    course_code="' . $course_code . '" AND
1508
-                    user_id="' . $user_id . '" AND
1509
-                    ref_doc="' . $document_id . '"';
1507
+                    course_code="' . $course_code.'" AND
1508
+                    user_id="' . $user_id.'" AND
1509
+                    ref_doc="' . $document_id.'"';
1510 1510
         $result = Database::query($sql);
1511 1511
         $template_id = Database::result($result, 0, 0);
1512 1512
 
1513
-        my_delete(api_get_path(SYS_CODE_PATH) . 'upload/template_thumbnails/' . $template_id . '.jpg');
1513
+        my_delete(api_get_path(SYS_CODE_PATH).'upload/template_thumbnails/'.$template_id.'.jpg');
1514 1514
 
1515
-        $sql = 'DELETE FROM ' . $table_template . '
1515
+        $sql = 'DELETE FROM '.$table_template.'
1516 1516
                 WHERE
1517
-                    course_code="' . $course_code . '" AND
1518
-                    user_id="' . $user_id . '" AND
1519
-                    ref_doc="' . $document_id . '"';
1517
+                    course_code="' . $course_code.'" AND
1518
+                    user_id="' . $user_id.'" AND
1519
+                    ref_doc="' . $document_id.'"';
1520 1520
 
1521 1521
         Database::query($sql);
1522 1522
     }
@@ -1576,9 +1576,9 @@  discard block
 block discarded – undo
1576 1576
                 INNER JOIN $propTable ip
1577 1577
                 ON (d.id = ip.ref AND d.c_id  = $course_id AND ip.c_id = $course_id)
1578 1578
         		WHERE
1579
-        		    ip.tool = '" . TOOL_DOCUMENT . "' $condition AND
1579
+        		    ip.tool = '".TOOL_DOCUMENT."' $condition AND
1580 1580
         			filetype = '$file_type' AND
1581
-        			locate(concat(path,'/'), '" . Database::escape_string($doc_path.'/'). "')=1
1581
+        			locate(concat(path,'/'), '".Database::escape_string($doc_path.'/')."')=1
1582 1582
                 ";
1583 1583
 
1584 1584
         $result = Database::query($sql);
@@ -1741,12 +1741,12 @@  discard block
 block discarded – undo
1741 1741
         if (empty($session_id)) {
1742 1742
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1743 1743
         } elseif ($session_id > 0) {
1744
-            $sql_session = 'AND session_id=' . intval($session_id);
1744
+            $sql_session = 'AND session_id='.intval($session_id);
1745 1745
         } else {
1746 1746
             $sql_session = '';
1747 1747
         }
1748
-        $sql = 'UPDATE ' . $tbl_category . ' SET document_id="' . intval($document_id) . '"
1749
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1748
+        $sql = 'UPDATE '.$tbl_category.' SET document_id="'.intval($document_id).'"
1749
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1750 1750
         Database::query($sql);
1751 1751
     }
1752 1752
 
@@ -1768,12 +1768,12 @@  discard block
 block discarded – undo
1768 1768
         if (empty($session_id)) {
1769 1769
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1770 1770
         } elseif ($session_id > 0) {
1771
-            $sql_session = 'AND session_id=' . intval($session_id);
1771
+            $sql_session = 'AND session_id='.intval($session_id);
1772 1772
         } else {
1773 1773
             $sql_session = '';
1774 1774
         }
1775
-        $sql = 'SELECT document_id FROM ' . $tbl_category . '
1776
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1775
+        $sql = 'SELECT document_id FROM '.$tbl_category.'
1776
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1777 1777
 
1778 1778
         $rs = Database::query($sql);
1779 1779
         $num = Database::num_rows($rs);
@@ -1814,7 +1814,7 @@  discard block
 block discarded – undo
1814 1814
             $all_user_info = array();
1815 1815
             if (Database::num_rows($rs)) {
1816 1816
                 $row = Database::fetch_array($rs);
1817
-                $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1817
+                $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1818 1818
                 if (is_file($filepath)) {
1819 1819
                     $my_content_html = file_get_contents($filepath);
1820 1820
                 }
@@ -1897,7 +1897,7 @@  discard block
 block discarded – undo
1897 1897
             $date_no_time = api_convert_and_format_date(api_get_utc_datetime(), DATE_FORMAT_LONG_NO_DAY);
1898 1898
         }
1899 1899
 
1900
-        $url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $info_grade_certificate['id'];
1900
+        $url = api_get_path(WEB_PATH).'certificates/index.php?id='.$info_grade_certificate['id'];
1901 1901
 
1902 1902
         //replace content
1903 1903
         $info_to_replace_in_content_html = array(
@@ -1914,7 +1914,7 @@  discard block
 block discarded – undo
1914 1914
             $course_info['name'],
1915 1915
             $info_grade_certificate['grade'],
1916 1916
             $url,
1917
-            '<a href="' . $url . '" target="_blank">' . get_lang('CertificateOnlineLink') . '</a>',
1917
+            '<a href="'.$url.'" target="_blank">'.get_lang('CertificateOnlineLink').'</a>',
1918 1918
             '((certificate_barcode))',
1919 1919
         );
1920 1920
 
@@ -1938,7 +1938,7 @@  discard block
 block discarded – undo
1938 1938
         if (!empty($extraFields)) {
1939 1939
             foreach ($extraFields as $extraField) {
1940 1940
                 $valueExtra = isset($extra_user_info_data[$extraField['variable']]) ? $extra_user_info_data[$extraField['variable']] : '';
1941
-                $info_to_be_replaced_in_content_html[] = '((' . strtolower($extraField['variable']) . '))';
1941
+                $info_to_be_replaced_in_content_html[] = '(('.strtolower($extraField['variable']).'))';
1942 1942
                 $info_to_replace_in_content_html[] = $valueExtra;
1943 1943
             }
1944 1944
         }
@@ -1966,17 +1966,17 @@  discard block
 block discarded – undo
1966 1966
             $tbl_category = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
1967 1967
             $session_id = api_get_session_id();
1968 1968
             if ($session_id == 0 || is_null($session_id)) {
1969
-                $sql_session = 'AND (session_id=' . intval($session_id) . ' OR isnull(session_id)) ';
1969
+                $sql_session = 'AND (session_id='.intval($session_id).' OR isnull(session_id)) ';
1970 1970
             } elseif ($session_id > 0) {
1971
-                $sql_session = 'AND session_id=' . intval($session_id);
1971
+                $sql_session = 'AND session_id='.intval($session_id);
1972 1972
             } else {
1973 1973
                 $sql_session = '';
1974 1974
             }
1975 1975
 
1976
-            $sql = 'UPDATE ' . $tbl_category . ' SET document_id=null
1976
+            $sql = 'UPDATE '.$tbl_category.' SET document_id=null
1977 1977
                     WHERE
1978
-                        course_code = "' . Database::escape_string($course_id) . '" AND
1979
-                        document_id="' . $default_certificate_id . '" ' . $sql_session;
1978
+                        course_code = "' . Database::escape_string($course_id).'" AND
1979
+                        document_id="' . $default_certificate_id.'" '.$sql_session;
1980 1980
             Database::query($sql);
1981 1981
         }
1982 1982
     }
@@ -1992,10 +1992,10 @@  discard block
 block discarded – undo
1992 1992
         if (!empty($courseInfo)) {
1993 1993
             $to_group_id = 0;
1994 1994
             $to_user_id = null;
1995
-            $course_dir = $courseInfo['path'] . "/document/";
1995
+            $course_dir = $courseInfo['path']."/document/";
1996 1996
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
1997
-            $base_work_dir = $sys_course_path . $course_dir;
1998
-            $base_work_dir_test = $base_work_dir . 'certificates';
1997
+            $base_work_dir = $sys_course_path.$course_dir;
1998
+            $base_work_dir_test = $base_work_dir.'certificates';
1999 1999
             $dir_name = '/certificates';
2000 2000
             $post_dir_name = get_lang('CertificatesFiles');
2001 2001
             $visibility_command = 'invisible';
@@ -2222,9 +2222,9 @@  discard block
 block discarded – undo
2222 2222
                                             //$new_abs_path = realpath($dir.'/'.$second_part);
2223 2223
                                             $dir = '';
2224 2224
                                             if (!empty($abs_path)) {
2225
-                                                $dir = dirname($abs_path) . '/';
2225
+                                                $dir = dirname($abs_path).'/';
2226 2226
                                             }
2227
-                                            $new_abs_path = realpath($dir . $second_part);
2227
+                                            $new_abs_path = realpath($dir.$second_part);
2228 2228
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2229 2229
                                             if (count($in_files_list) > 0) {
2230 2230
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2237,9 +2237,9 @@  discard block
 block discarded – undo
2237 2237
                                             $files_list[] = array($second_part, 'local', 'rel');
2238 2238
                                             $dir = '';
2239 2239
                                             if (!empty($abs_path)) {
2240
-                                                $dir = dirname($abs_path) . '/';
2240
+                                                $dir = dirname($abs_path).'/';
2241 2241
                                             }
2242
-                                            $new_abs_path = realpath($dir . $second_part);
2242
+                                            $new_abs_path = realpath($dir.$second_part);
2243 2243
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2244 2244
                                             if (count($in_files_list) > 0) {
2245 2245
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2273,9 +2273,9 @@  discard block
 block discarded – undo
2273 2273
                                             $files_list[] = array($source, 'local', 'rel');
2274 2274
                                             $dir = '';
2275 2275
                                             if (!empty($abs_path)) {
2276
-                                                $dir = dirname($abs_path) . '/';
2276
+                                                $dir = dirname($abs_path).'/';
2277 2277
                                             }
2278
-                                            $new_abs_path = realpath($dir . $source);
2278
+                                            $new_abs_path = realpath($dir.$source);
2279 2279
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2280 2280
                                             if (count($in_files_list) > 0) {
2281 2281
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2288,9 +2288,9 @@  discard block
 block discarded – undo
2288 2288
                                             $files_list[] = array($source, 'local', 'rel');
2289 2289
                                             $dir = '';
2290 2290
                                             if (!empty($abs_path)) {
2291
-                                                $dir = dirname($abs_path) . '/';
2291
+                                                $dir = dirname($abs_path).'/';
2292 2292
                                             }
2293
-                                            $new_abs_path = realpath($dir . $source);
2293
+                                            $new_abs_path = realpath($dir.$source);
2294 2294
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2295 2295
                                             if (count($in_files_list) > 0) {
2296 2296
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2324,9 +2324,9 @@  discard block
 block discarded – undo
2324 2324
                                     $files_list[] = array($source, 'local', 'rel');
2325 2325
                                     $dir = '';
2326 2326
                                     if (!empty($abs_path)) {
2327
-                                        $dir = dirname($abs_path) . '/';
2327
+                                        $dir = dirname($abs_path).'/';
2328 2328
                                     }
2329
-                                    $new_abs_path = realpath($dir . $source);
2329
+                                    $new_abs_path = realpath($dir.$source);
2330 2330
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2331 2331
                                     if (count($in_files_list) > 0) {
2332 2332
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2339,9 +2339,9 @@  discard block
 block discarded – undo
2339 2339
                                     $files_list[] = array($source, 'local', 'rel');
2340 2340
                                     $dir = '';
2341 2341
                                     if (!empty($abs_path)) {
2342
-                                        $dir = dirname($abs_path) . '/';
2342
+                                        $dir = dirname($abs_path).'/';
2343 2343
                                     }
2344
-                                    $new_abs_path = realpath($dir . $source);
2344
+                                    $new_abs_path = realpath($dir.$source);
2345 2345
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2346 2346
                                     if (count($in_files_list) > 0) {
2347 2347
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2399,24 +2399,24 @@  discard block
 block discarded – undo
2399 2399
             // then possible closing brackets if we were in the opening bracket case
2400 2400
             // OR something like @import()
2401 2401
             $res = preg_match_all(
2402
-                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))' .
2402
+                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))'.
2403 2403
                 // '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]|[^\x00-\x7F])*)' . -> seems to be taking too much
2404 2404
                 // '/(((([A-Za-z_:])([^\x00-\x7F])*)' . -> takes only last letter of parameter name
2405
-                '([ \n\t\r]+)?(' .
2405
+                '([ \n\t\r]+)?('.
2406 2406
                 // '(=([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+))' . -> doesn't restrict close enough to the url itself
2407
-                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))' .
2408
-                '|' .
2407
+                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))'.
2408
+                '|'.
2409 2409
                 // '(\(([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)\))' . -> doesn't restrict close enough to the url itself
2410
-                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))' .
2411
-                '))' .
2412
-                '|' .
2410
+                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))'.
2411
+                '))'.
2412
+                '|'.
2413 2413
                 // '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))?/', -> takes a lot (like 100's of thousands of empty possibilities)
2414 2414
                 '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))/',
2415 2415
                 $attrString,
2416 2416
                 $regs
2417 2417
             );
2418 2418
         } catch (Exception $e) {
2419
-            error_log('Caught exception: ' . $e->getMessage(), 0);
2419
+            error_log('Caught exception: '.$e->getMessage(), 0);
2420 2420
         }
2421 2421
         if ($res) {
2422 2422
             for ($i = 0; $i < count($regs[1]); $i++) {
@@ -2494,14 +2494,14 @@  discard block
 block discarded – undo
2494 2494
                 $orig_course_info_path = $origin_course_info_path;
2495 2495
             }
2496 2496
         } else {
2497
-            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'] . '/';
2497
+            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'].'/';
2498 2498
             $orig_course_info_path = $orig_course_info['path'];
2499 2499
         }
2500 2500
 
2501 2501
         $destination_course_code = CourseManager::get_course_id_from_path($destination_course_directory);
2502 2502
         $destination_course_info = api_get_course_info($destination_course_code);
2503
-        $dest_course_path = api_get_path(SYS_COURSE_PATH) . $destination_course_directory . '/';
2504
-        $dest_course_path_rel = api_get_path(REL_COURSE_PATH) . $destination_course_directory . '/';
2503
+        $dest_course_path = api_get_path(SYS_COURSE_PATH).$destination_course_directory.'/';
2504
+        $dest_course_path_rel = api_get_path(REL_COURSE_PATH).$destination_course_directory.'/';
2505 2505
 
2506 2506
         $user_id = api_get_user_id();
2507 2507
 
@@ -2510,7 +2510,7 @@  discard block
 block discarded – undo
2510 2510
 
2511 2511
                 // Get information about source url
2512 2512
                 $real_orig_url = $source[0]; // url
2513
-                $scope_url = $source[1];   // scope (local, remote)
2513
+                $scope_url = $source[1]; // scope (local, remote)
2514 2514
                 $type_url = $source[2]; // type (rel, abs, url)
2515 2515
 
2516 2516
                 // Get path and query from origin url
@@ -2522,7 +2522,7 @@  discard block
 block discarded – undo
2522 2522
                 $dest_url_query = '';
2523 2523
 
2524 2524
                 if (!empty($real_orig_query)) {
2525
-                    $dest_url_query = '?' . $real_orig_query;
2525
+                    $dest_url_query = '?'.$real_orig_query;
2526 2526
                     if (strpos($dest_url_query, $origin_course_code) !== false) {
2527 2527
                         $dest_url_query = str_replace($origin_course_code, $destination_course_code, $dest_url_query);
2528 2528
                     }
@@ -2603,7 +2603,7 @@  discard block
 block discarded – undo
2603 2603
 
2604 2604
                                 //$destination_url = $url_course_path . $destination_course_directory . '/' . $document_file . $dest_url_query;
2605 2605
                                 // See BT#7780
2606
-                                $destination_url = $dest_course_path_rel . $document_file . $dest_url_query;
2606
+                                $destination_url = $dest_course_path_rel.$document_file.$dest_url_query;
2607 2607
 
2608 2608
                                 // If the course code doesn't exist in the path? what we do? Nothing! see BT#1985
2609 2609
                                 if (strpos($real_orig_path, $origin_course_code) === false) {
@@ -2638,14 +2638,14 @@  discard block
 block discarded – undo
2638 2638
     function replace_urls_inside_content_html_when_moving_file($file_name, $original_path, $destiny_path)
2639 2639
     {
2640 2640
         if (substr($original_path, strlen($original_path) - 1, strlen($original_path)) == '/') {
2641
-            $original = $original_path . $file_name;
2641
+            $original = $original_path.$file_name;
2642 2642
         } else {
2643
-            $original = $original_path . '/' . $file_name;
2643
+            $original = $original_path.'/'.$file_name;
2644 2644
         }
2645 2645
         if (substr($destiny_path, strlen($destiny_path) - 1, strlen($destiny_path)) == '/') {
2646
-            $destination = $destiny_path . $file_name;
2646
+            $destination = $destiny_path.$file_name;
2647 2647
         } else {
2648
-            $destination = $destiny_path . '/' . $file_name;
2648
+            $destination = $destiny_path.'/'.$file_name;
2649 2649
         }
2650 2650
         $original_count = count(explode('/', $original));
2651 2651
         $destination_count = count(explode('/', $destination));
@@ -2659,8 +2659,8 @@  discard block
 block discarded – undo
2659 2659
             $mode = 'inside';
2660 2660
         }
2661 2661
         //We do not select the $original_path becayse the file was already moved
2662
-        $content_html = file_get_contents($destiny_path . '/' . $file_name);
2663
-        $destination_file = $destiny_path . '/' . $file_name;
2662
+        $content_html = file_get_contents($destiny_path.'/'.$file_name);
2663
+        $destination_file = $destiny_path.'/'.$file_name;
2664 2664
 
2665 2665
         $pre_original = strstr($original_path, 'document');
2666 2666
         $pre_destin = strstr($destiny_path, 'document');
@@ -2682,11 +2682,11 @@  discard block
 block discarded – undo
2682 2682
         }
2683 2683
 
2684 2684
         if ($pre_original != '') {
2685
-            $pre_original = '..' . $pre_original . '/';
2685
+            $pre_original = '..'.$pre_original.'/';
2686 2686
         }
2687 2687
 
2688 2688
         if ($pre_destin != '') {
2689
-            $pre_destin = '..' . $pre_destin . '/';
2689
+            $pre_destin = '..'.$pre_destin.'/';
2690 2690
         }
2691 2691
 
2692 2692
         $levels = explode('/', $pre_original);
@@ -2704,7 +2704,7 @@  discard block
 block discarded – undo
2704 2704
         //echo '$count_pre_destination_levels '. $count_pre_destination_levels;
2705 2705
         $pre_remove = '';
2706 2706
         for ($i = 1; $i <= $count_pre_destination_levels; $i++) {
2707
-            $pre_remove .='..\/';
2707
+            $pre_remove .= '..\/';
2708 2708
         }
2709 2709
 
2710 2710
         $orig_source_html = DocumentManager::get_resources_from_source_html($content_html);
@@ -2712,9 +2712,9 @@  discard block
 block discarded – undo
2712 2712
         foreach ($orig_source_html as $source) {
2713 2713
 
2714 2714
             // get information about source url
2715
-            $real_orig_url = $source[0];   // url
2716
-            $scope_url = $source[1];   // scope (local, remote)
2717
-            $type_url = $source[2];   // tyle (rel, abs, url)
2715
+            $real_orig_url = $source[0]; // url
2716
+            $scope_url = $source[1]; // scope (local, remote)
2717
+            $type_url = $source[2]; // tyle (rel, abs, url)
2718 2718
             // Get path and query from origin url
2719 2719
             $orig_parse_url = parse_url($real_orig_url);
2720 2720
             $real_orig_path = $orig_parse_url['path'];
@@ -2741,11 +2741,11 @@  discard block
 block discarded – undo
2741 2741
                         $real_orig_url_temp = '';
2742 2742
                         if ($mode == 'inside') {
2743 2743
                             $real_orig_url_temp = str_replace('../', '', $real_orig_url);
2744
-                            $destination_url = $link_to_add . $real_orig_url_temp;
2744
+                            $destination_url = $link_to_add.$real_orig_url_temp;
2745 2745
                         } else {
2746 2746
                             $real_orig_url_temp = $real_orig_url;
2747 2747
 
2748
-                            $destination_url = preg_replace("/" . $pre_remove . "/", '', $real_orig_url, 1);
2748
+                            $destination_url = preg_replace("/".$pre_remove."/", '', $real_orig_url, 1);
2749 2749
                         }
2750 2750
                         if ($real_orig_url == $destination_url) {
2751 2751
                             //echo 'continue2';
@@ -2771,7 +2771,7 @@  discard block
 block discarded – undo
2771 2771
     {
2772 2772
         $course_data = api_get_course_info($course_code);
2773 2773
         $document_data = self::get_document_data_by_id($document_id, $course_code);
2774
-        $file_path = api_get_path(SYS_COURSE_PATH) . $course_data['path'] . '/document' . $document_data['path'];
2774
+        $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$document_data['path'];
2775 2775
         $pdf = new PDF('A4-L', 'L');
2776 2776
         $pdf->html_to_pdf($file_path, $document_data['title'], $course_code);
2777 2777
     }
@@ -2801,9 +2801,9 @@  discard block
 block discarded – undo
2801 2801
     ) {
2802 2802
         $course_info = api_get_course_info();
2803 2803
         $sessionId = api_get_session_id();
2804
-        $course_dir = $course_info['path'] . '/document';
2804
+        $course_dir = $course_info['path'].'/document';
2805 2805
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
2806
-        $base_work_dir = $sys_course_path . $course_dir;
2806
+        $base_work_dir = $sys_course_path.$course_dir;
2807 2807
 
2808 2808
         if (isset($files['file'])) {
2809 2809
             $upload_ok = process_uploaded_file($files['file'], $show_output);
@@ -2875,7 +2875,7 @@  discard block
 block discarded – undo
2875 2875
                     // Showing message when sending zip files
2876 2876
                     if ($new_path === true && $unzip == 1 && $show_output) {
2877 2877
                         Display::display_confirmation_message(
2878
-                            get_lang('UplUploadSucceeded') . '<br />',
2878
+                            get_lang('UplUploadSucceeded').'<br />',
2879 2879
                             false
2880 2880
                         );
2881 2881
                     }
@@ -2975,7 +2975,7 @@  discard block
 block discarded – undo
2975 2975
         }
2976 2976
         if (isset($output)) {
2977 2977
             foreach ($output as & $line) {
2978
-                $content .= $line . "\n";
2978
+                $content .= $line."\n";
2979 2979
             }
2980 2980
             return $content;
2981 2981
         } else {
@@ -3007,13 +3007,13 @@  discard block
 block discarded – undo
3007 3007
         $group_condition = null;
3008 3008
         if (isset($group_id)) {
3009 3009
             $group_id = intval($group_id);
3010
-            $group_condition = " AND props.to_group_id='" . $group_id . "' ";
3010
+            $group_condition = " AND props.to_group_id='".$group_id."' ";
3011 3011
         }
3012 3012
 
3013 3013
         $session_condition = null;
3014 3014
         if (isset($session_id)) {
3015 3015
             $session_id = intval($session_id);
3016
-            $session_condition = " AND props.session_id='" . $session_id . "' ";
3016
+            $session_condition = " AND props.session_id='".$session_id."' ";
3017 3017
         }
3018 3018
 
3019 3019
         $sql = "SELECT SUM(size)
@@ -3023,7 +3023,7 @@  discard block
 block discarded – undo
3023 3023
                 WHERE
3024 3024
                     props.c_id 	= $course_id AND
3025 3025
                     docs.c_id 	= $course_id AND
3026
-                    props.tool 	= '" . TOOL_DOCUMENT . "' AND
3026
+                    props.tool 	= '".TOOL_DOCUMENT."' AND
3027 3027
                     props.visibility <> 2
3028 3028
                     $group_condition
3029 3029
                     $session_condition
@@ -3046,8 +3046,8 @@  discard block
 block discarded – undo
3046 3046
         $course_quota_m = round($course_quota / 1048576);
3047 3047
         $already_consumed_space_m = round($already_consumed_space / 1048576);
3048 3048
 
3049
-        $message = get_lang('MaximumAllowedQuota') . ' <strong>' . $course_quota_m . ' megabyte</strong>.<br />';
3050
-        $message .= get_lang('CourseCurrentlyUses') . ' <strong>' . $already_consumed_space_m . ' megabyte</strong>.<br />';
3049
+        $message = get_lang('MaximumAllowedQuota').' <strong>'.$course_quota_m.' megabyte</strong>.<br />';
3050
+        $message .= get_lang('CourseCurrentlyUses').' <strong>'.$already_consumed_space_m.' megabyte</strong>.<br />';
3051 3051
 
3052 3052
         $percentage = round(($already_consumed_space / $course_quota * 100), 1);
3053 3053
 
@@ -3055,33 +3055,33 @@  discard block
 block discarded – undo
3055 3055
 
3056 3056
         // Decide where to place percentage in graph
3057 3057
         if ($percentage >= 50) {
3058
-            $text_in_filled = '&nbsp;' . $other_percentage . '%';
3058
+            $text_in_filled = '&nbsp;'.$other_percentage.'%';
3059 3059
             $text_in_unfilled = '';
3060 3060
         } else {
3061
-            $text_in_unfilled = '&nbsp;' . $other_percentage . '%';
3061
+            $text_in_unfilled = '&nbsp;'.$other_percentage.'%';
3062 3062
             $text_in_filled = '';
3063 3063
         }
3064 3064
 
3065 3065
         // Decide the background colour of the graph
3066 3066
         if ($percentage < 65) {
3067
-            $colour = '#00BB00';        // Safe - green
3067
+            $colour = '#00BB00'; // Safe - green
3068 3068
         } elseif ($percentage < 90) {
3069
-            $colour = '#ffd400';        // Filling up - yelloworange
3069
+            $colour = '#ffd400'; // Filling up - yelloworange
3070 3070
         } else {
3071
-            $colour = '#DD0000';        // Full - red
3071
+            $colour = '#DD0000'; // Full - red
3072 3072
         }
3073 3073
 
3074 3074
         // This is used for the table width: a table of only 100 pixels looks too small
3075 3075
         $visual_percentage = 4 * $percentage;
3076 3076
         $visual_other_percentage = 4 * $other_percentage;
3077 3077
 
3078
-        $message .= get_lang('PercentageQuotaInUse') . ': <strong>' . $percentage . '%</strong>.<br />' .
3079
-            get_lang('PercentageQuotaFree') . ': <strong>' . $other_percentage . '%</strong>.<br />';
3078
+        $message .= get_lang('PercentageQuotaInUse').': <strong>'.$percentage.'%</strong>.<br />'.
3079
+            get_lang('PercentageQuotaFree').': <strong>'.$other_percentage.'%</strong>.<br />';
3080 3080
 
3081
-        $show_percentage = '&nbsp;' . $percentage . '%';
3082
-        $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\'' . api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/bg-header4.png\');" class="document-quota-bar">' .
3083
-            '<div style="width:' . $percentage . '%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>' .
3084
-            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">' . $show_percentage . '</span></div>';
3081
+        $show_percentage = '&nbsp;'.$percentage.'%';
3082
+        $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\''.api_get_path(WEB_CODE_PATH).'css/'.api_get_visual_theme().'/images/bg-header4.png\');" class="document-quota-bar">'.
3083
+            '<div style="width:'.$percentage.'%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>'.
3084
+            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">'.$show_percentage.'</span></div>';
3085 3085
         echo $message;
3086 3086
     }
3087 3087
 
@@ -3097,7 +3097,7 @@  discard block
 block discarded – undo
3097 3097
         $percentage = $already_consumed_space / $course_quota * 100;
3098 3098
         $percentage = round($percentage, 1);
3099 3099
         $message = get_lang('YouAreCurrentlyUsingXOfYourX');
3100
-        $message = sprintf($message, $already_consumed_space_m, $percentage . '%', $course_quota_m . ' ');
3100
+        $message = sprintf($message, $already_consumed_space_m, $percentage.'%', $course_quota_m.' ');
3101 3101
         echo Display::div($message, array('id' => 'document_quota'));
3102 3102
     }
3103 3103
 
@@ -3128,12 +3128,12 @@  discard block
 block discarded – undo
3128 3128
      */
3129 3129
     static function generate_jplayer_jquery($params = array())
3130 3130
     {
3131
-        $js_path = api_get_path(WEB_LIBRARY_PATH) . 'javascript/';
3131
+        $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
3132 3132
 
3133
-        $js = ' $("#jquery_jplayer_' . $params['count'] . '").jPlayer({
3133
+        $js = ' $("#jquery_jplayer_'.$params['count'].'").jPlayer({
3134 3134
                     ready: function() {
3135 3135
                         $(this).jPlayer("setMedia", {
3136
-                            ' . $params['extension'] . ' : "' . $params['url'] . '"
3136
+                            ' . $params['extension'].' : "'.$params['url'].'"
3137 3137
                         });
3138 3138
                     },
3139 3139
                     play: function() { // To avoid both jPlayers playing together.
@@ -3141,12 +3141,12 @@  discard block
 block discarded – undo
3141 3141
                     },
3142 3142
                     //errorAlerts: true,
3143 3143
                     //warningAlerts: true,
3144
-                    swfPath: "' . $js_path . 'jquery-jplayer/jplayer/",
3144
+                    swfPath: "' . $js_path.'jquery-jplayer/jplayer/",
3145 3145
                     //supplied: "m4a, oga, mp3, ogg, wav",
3146
-                    supplied: "' . $params['extension'] . '",
3146
+                    supplied: "' . $params['extension'].'",
3147 3147
                     wmode: "window",
3148 3148
                     solution: "flash, html",  // Do not change this setting
3149
-                    cssSelectorAncestor: "#jp_container_' . $params['count'] . '",
3149
+                    cssSelectorAncestor: "#jp_container_' . $params['count'].'",
3150 3150
                 });  	 ' . "\n\n";
3151 3151
         return $js;
3152 3152
     }
@@ -3175,16 +3175,16 @@  discard block
 block discarded – undo
3175 3175
         }
3176 3176
 
3177 3177
         //Shows only the play button
3178
-        $html = '<div id="jquery_jplayer_' . $i . '" class="jp-jplayer"></div>
3179
-                <div id="jp_container_' . $i . '" class="jp-audio">
3178
+        $html = '<div id="jquery_jplayer_'.$i.'" class="jp-jplayer"></div>
3179
+                <div id="jp_container_' . $i.'" class="jp-audio">
3180 3180
                     <div class="jp-type-single">
3181 3181
                         <div class="jp-gui jp-interface">
3182 3182
                             <ul class="jp-controls">
3183 3183
                                 <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
3184 3184
                                 <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
3185
-                                ' . $extra_controls . '
3185
+                                ' . $extra_controls.'
3186 3186
                             </ul>
3187
-                            ' . $progress . '
3187
+                            ' . $progress.'
3188 3188
                         </div>
3189 3189
                     </div>
3190 3190
                 </div>';
@@ -3237,8 +3237,8 @@  discard block
 block discarded – undo
3237 3237
                     </div>
3238 3238
                 </div>
3239 3239
                 <div class="jp-no-solution">
3240
-                    <span>' . get_lang('UpdateRequire') . '</span>
3241
-                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile") . '
3240
+                    <span>' . get_lang('UpdateRequire').'</span>
3241
+                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile").'
3242 3242
                 </div>
3243 3243
             </div>
3244 3244
         </div>';
@@ -3319,7 +3319,7 @@  discard block
 block discarded – undo
3319 3319
 
3320 3320
         $add_folder_filter = null;
3321 3321
         if (!empty($filter_by_folder)) {
3322
-            $add_folder_filter = " AND docs.path LIKE '" . Database::escape_string($filter_by_folder) . "%'";
3322
+            $add_folder_filter = " AND docs.path LIKE '".Database::escape_string($filter_by_folder)."%'";
3323 3323
         }
3324 3324
 
3325 3325
         // If we are in LP display hidden folder https://support.chamilo.org/issues/6679
@@ -3354,7 +3354,7 @@  discard block
 block discarded – undo
3354 3354
 
3355 3355
                 $notLikeCondition = null;
3356 3356
                 for ($i = 1; $i <= $num; $i++) {
3357
-                    $repeat = str_repeat('/%', $i+1);
3357
+                    $repeat = str_repeat('/%', $i + 1);
3358 3358
                     $notLikeCondition .= " AND docs.path NOT LIKE '".Database::escape_string($cleanedPath.$repeat)."' ";
3359 3359
                 }
3360 3360
 
@@ -3379,7 +3379,7 @@  discard block
 block discarded – undo
3379 3379
                 ON (docs.id = last.ref AND docs.c_id = last.c_id)
3380 3380
                 WHERE
3381 3381
                     docs.path NOT LIKE '%_DELETED_%' AND
3382
-                    last.tool = '" . TOOL_DOCUMENT . "' $condition_session AND
3382
+                    last.tool = '".TOOL_DOCUMENT."' $condition_session AND
3383 3383
                     (last.visibility = '1' $lp_visibility_condition) AND
3384 3384
                     last.visibility <> 2 AND
3385 3385
                     docs.c_id = {$course_info['real_id']} AND
@@ -3409,7 +3409,7 @@  discard block
 block discarded – undo
3409 3409
                 Display::url(
3410 3410
                     Display::return_icon('close.png', get_lang('Close'), array(), ICON_SIZE_SMALL),
3411 3411
                     ' javascript:void(0);',
3412
-                    array('id' => 'close_div_' . $course_info['real_id'] . '_' . $session_id, 'class' => 'close_div')
3412
+                    array('id' => 'close_div_'.$course_info['real_id'].'_'.$session_id, 'class' => 'close_div')
3413 3413
                 ),
3414 3414
                 array('style' => 'position:absolute;right:10px')
3415 3415
             );
@@ -3509,12 +3509,12 @@  discard block
 block discarded – undo
3509 3509
 
3510 3510
                 if (image.hasClass('open')) {
3511 3511
                     image.removeClass('open');
3512
-                    image.attr('src', '" . $img_path . "nolines_plus.gif');
3512
+                    image.attr('src', '" . $img_path."nolines_plus.gif');
3513 3513
                     $('#'+id).show();
3514 3514
                     $('#'+tempId).hide();
3515 3515
                 } else {
3516 3516
                     image.addClass('open');
3517
-                    image.attr('src', '" . $img_path . "nolines_minus.gif');
3517
+                    image.attr('src', '" . $img_path."nolines_minus.gif');
3518 3518
                     $('#'+id).hide();
3519 3519
                     $('#'+tempId).show();
3520 3520
 
@@ -3562,7 +3562,7 @@  discard block
 block discarded – undo
3562 3562
         $overwrite_url
3563 3563
     ) {
3564 3564
         $img_path = api_get_path(WEB_IMG_PATH);
3565
-        $img_sys_path = api_get_path(SYS_CODE_PATH) . 'img/';
3565
+        $img_sys_path = api_get_path(SYS_CODE_PATH).'img/';
3566 3566
         $web_code_path = api_get_path(WEB_CODE_PATH);
3567 3567
 
3568 3568
         $documentId = $resource['id'];
@@ -3577,7 +3577,7 @@  discard block
 block discarded – undo
3577 3577
         // It's a file.
3578 3578
         $icon = choose_image($path);
3579 3579
         $position = strrpos($icon, '.');
3580
-        $icon = substr($icon, 0, $position) . '_small.gif';
3580
+        $icon = substr($icon, 0, $position).'_small.gif';
3581 3581
         $my_file_title = $resource['title'];
3582 3582
         $visibility = $resource['visibility'];
3583 3583
 
@@ -3589,25 +3589,25 @@  discard block
 block discarded – undo
3589 3589
         // Show the "image name" not the filename of the image.
3590 3590
         if ($lp_id) {
3591 3591
             //LP URL
3592
-            $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type=' . TOOL_DOCUMENT . '&amp;file=' . $documentId . '&amp;lp_id=' . $lp_id;
3592
+            $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type='.TOOL_DOCUMENT.'&amp;file='.$documentId.'&amp;lp_id='.$lp_id;
3593 3593
             if (!empty($overwrite_url)) {
3594
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId.'';
3594
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId.'';
3595 3595
             }
3596 3596
         } else {
3597 3597
             // Direct document URL
3598
-            $url = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3598
+            $url = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3599 3599
             if (!empty($overwrite_url)) {
3600
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId;
3600
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId;
3601 3601
             }
3602 3602
         }
3603 3603
 
3604
-        $img = $img_path . $icon;
3605
-        if (!file_exists($img_sys_path . $icon)) {
3606
-            $img = $img_path . 'icons/16/default_small.gif';
3604
+        $img = $img_path.$icon;
3605
+        if (!file_exists($img_sys_path.$icon)) {
3606
+            $img = $img_path.'icons/16/default_small.gif';
3607 3607
         }
3608 3608
 
3609 3609
         $link = Display::url(
3610
-            '<img alt="" src="' . $img . '" title="" />&nbsp;' . $my_file_title, $url,
3610
+            '<img alt="" src="'.$img.'" title="" />&nbsp;'.$my_file_title, $url,
3611 3611
             array('target' => $target)
3612 3612
         );
3613 3613
 
@@ -3618,12 +3618,12 @@  discard block
 block discarded – undo
3618 3618
         $return = null;
3619 3619
 
3620 3620
         if ($lp_id == false) {
3621
-            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3621
+            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3622 3622
         } else {
3623
-            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3623
+            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3624 3624
         }
3625 3625
 
3626
-        $return .= '<div class="item_data" style="margin-left:' . ($num  * 18) . 'px;margin-right:5px;">';
3626
+        $return .= '<div class="item_data" style="margin-left:'.($num * 18).'px;margin-right:5px;">';
3627 3627
 
3628 3628
         if ($add_move_button) {
3629 3629
             $return .= '<a class="moved" href="#">';
@@ -3690,7 +3690,7 @@  discard block
 block discarded – undo
3690 3690
             if (isset($resource['visible']) && $resource['visible'] == 0) {
3691 3691
                 $folder_class_hidden = "doc_folder_hidden"; // in base.css
3692 3692
             }
3693
-            $onclick = 'onclick="javascript: testResources(\'res_' . $resource['id'] . '\',\'img_' . $resource['id'] . '\')"';
3693
+            $onclick = 'onclick="javascript: testResources(\'res_'.$resource['id'].'\',\'img_'.$resource['id'].'\')"';
3694 3694
         }
3695 3695
         $return = null;
3696 3696
 
@@ -3698,23 +3698,23 @@  discard block
 block discarded – undo
3698 3698
             $return = '<ul class="lp_resource">';
3699 3699
         }
3700 3700
 
3701
-        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_' . $resource['id'] . '"  style="margin-left:' . ($num * 18) . 'px; ">';
3701
+        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_'.$resource['id'].'"  style="margin-left:'.($num * 18).'px; ">';
3702 3702
 
3703 3703
         $image = $img_path.'nolines_plus.gif';
3704 3704
         if (empty($path)) {
3705 3705
             $image = $img_path.'nolines_minus.gif';
3706 3706
         }
3707
-        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'] . '" '.$onclick.'>';
3707
+        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'].'" '.$onclick.'>';
3708 3708
 
3709
-        $return .= '<img alt="" src="' . $img_path . 'lp_folder.gif" title="" align="absmiddle" />&nbsp;';
3709
+        $return .= '<img alt="" src="'.$img_path.'lp_folder.gif" title="" align="absmiddle" />&nbsp;';
3710 3710
         $return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>';
3711 3711
         $return .= '</li>';
3712 3712
 
3713 3713
         if (empty($path)) {
3714 3714
             if ($folderId == false) {
3715
-                $return .= '<div id="res_' . $resource['id'] . '" >';
3715
+                $return .= '<div id="res_'.$resource['id'].'" >';
3716 3716
             } else {
3717
-                $return .= '<div id="res_' . $resource['id'] . '" style="display: none;" >';
3717
+                $return .= '<div id="res_'.$resource['id'].'" style="display: none;" >';
3718 3718
             }
3719 3719
         }
3720 3720
 
@@ -3876,9 +3876,9 @@  discard block
 block discarded – undo
3876 3876
             $session_id = api_get_session_id();
3877 3877
         }
3878 3878
         $course_info = api_get_course_info($course_code);
3879
-        $course_dir = $course_info['path'] . '/document';
3879
+        $course_dir = $course_info['path'].'/document';
3880 3880
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
3881
-        $base_work_dir = $sys_course_path . $course_dir;
3881
+        $base_work_dir = $sys_course_path.$course_dir;
3882 3882
 
3883 3883
         $course_id = $course_info['real_id'];
3884 3884
         $table_document = Database::get_course_table(TABLE_DOCUMENT);
@@ -3887,7 +3887,7 @@  discard block
 block discarded – undo
3887 3887
         $result = Database::query($qry);
3888 3888
         if (Database::num_rows($result) == 1) {
3889 3889
             $row = Database::fetch_array($result);
3890
-            $doc_path = api_get_path(SYS_COURSE_PATH) . $course_dir . $row['path'];
3890
+            $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
3891 3891
             //TODO: mime_content_type is deprecated, fileinfo php extension is enabled by default as of PHP 5.3.0
3892 3892
             // now versions of PHP on Debian testing(5.2.6-5) and Ubuntu(5.2.6-2ubuntu) are lower, so wait for a while
3893 3893
             $doc_mime = mime_content_type($doc_path);
@@ -3918,8 +3918,8 @@  discard block
 block discarded – undo
3918 3918
                 $file_content = self::get_text_content($doc_path, $doc_mime);
3919 3919
                 $course_code = Database::escape_string($course_code);
3920 3920
 
3921
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
3922
-                require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php';
3921
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
3922
+                require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php';
3923 3923
 
3924 3924
                 $ic_slide = new IndexableChunk();
3925 3925
                 $ic_slide->addValue('title', $file_title);
@@ -3936,7 +3936,7 @@  discard block
 block discarded – undo
3936 3936
                 $di = new ChamiloIndexer();
3937 3937
                 $return = $di->connectDb(null, null, $lang);
3938 3938
 
3939
-                require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
3939
+                require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
3940 3940
                 $specific_fields = get_specific_field_list();
3941 3941
 
3942 3942
                 // process different depending on what to do if file exists
@@ -3973,7 +3973,7 @@  discard block
 block discarded – undo
3973 3973
                             } else { //if the specific field is not defined, force an empty one
3974 3974
                                 $sterms = '';
3975 3975
                             }
3976
-                            $all_specific_terms .= ' ' . $sterms;
3976
+                            $all_specific_terms .= ' '.$sterms;
3977 3977
                             $sterms = explode(',', $sterms);
3978 3978
                             foreach ($sterms as $sterm) {
3979 3979
                                 $sterm = trim($sterm);
@@ -3987,7 +3987,7 @@  discard block
 block discarded – undo
3987 3987
                             }
3988 3988
                         }
3989 3989
                         // Add terms also to content to make terms findable by probabilistic search
3990
-                        $file_content = $all_specific_terms . ' ' . $file_content;
3990
+                        $file_content = $all_specific_terms.' '.$file_content;
3991 3991
 
3992 3992
                         if (!$simulation) {
3993 3993
                             $ic_slide->addValue('content', $file_content);
@@ -4013,7 +4013,7 @@  discard block
 block discarded – undo
4013 4013
                         } else { //if the specific field is not defined, force an empty one
4014 4014
                             $sterms = '';
4015 4015
                         }
4016
-                        $all_specific_terms .= ' ' . $sterms;
4016
+                        $all_specific_terms .= ' '.$sterms;
4017 4017
                         if (!empty($sterms)) {
4018 4018
                             $sterms = explode(',', $sterms);
4019 4019
                             foreach ($sterms as $sterm) {
@@ -4025,7 +4025,7 @@  discard block
 block discarded – undo
4025 4025
                         }
4026 4026
                     }
4027 4027
                     // Add terms also to content to make terms findable by probabilistic search
4028
-                    $file_content = $all_specific_terms . ' ' . $file_content;
4028
+                    $file_content = $all_specific_terms.' '.$file_content;
4029 4029
                     if (!$simulation) {
4030 4030
                         $ic_slide->addValue('content', $file_content);
4031 4031
                         $di->addChunk($ic_slide);
@@ -4309,7 +4309,7 @@  discard block
 block discarded – undo
4309 4309
         $defaultVisibility = 'visible';
4310 4310
 
4311 4311
         if (isset($settings['documents'])) {
4312
-            $portalDefaultVisibility =  'invisible';
4312
+            $portalDefaultVisibility = 'invisible';
4313 4313
             if ($settings['documents'] == 'true') {
4314 4314
                 $portalDefaultVisibility = 'visible';
4315 4315
             }
@@ -4547,7 +4547,7 @@  discard block
 block discarded – undo
4547 4547
         //make htaccess with allow from all, and file index.html into temp/audio
4548 4548
         $htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess';
4549 4549
         if (!file_exists($htaccess)) {
4550
-            $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
4550
+            $htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
4551 4551
             $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess', 'w');
4552 4552
             if ($fp) {
4553 4553
                 fwrite($fp, $htaccess_content);
@@ -4556,9 +4556,9 @@  discard block
 block discarded – undo
4556 4556
         }
4557 4557
 
4558 4558
         //encript temp name file
4559
-        $name_crip = sha1(uniqid());//encript
4560
-        $findext= explode(".", $file);
4561
-        $extension = $findext[count($findext)-1];
4559
+        $name_crip = sha1(uniqid()); //encript
4560
+        $findext = explode(".", $file);
4561
+        $extension = $findext[count($findext) - 1];
4562 4562
         $file_crip = $name_crip.'.'.$extension;
4563 4563
 
4564 4564
         //copy file to temp/audio directory
@@ -4662,7 +4662,7 @@  discard block
 block discarded – undo
4662 4662
         $comment = null;
4663 4663
 
4664 4664
         $fileName = api_replace_dangerous_char($title);
4665
-        $filePath = api_get_path(SYS_COURSE_PATH) . "{$courseData['path']}/document{$dir}";
4665
+        $filePath = api_get_path(SYS_COURSE_PATH)."{$courseData['path']}/document{$dir}";
4666 4666
         $fileFullPath = "{$filePath}/{$fileName}.html";
4667 4667
         $fileSize = 0;
4668 4668
         $fileType = 'file';
@@ -4714,7 +4714,7 @@  discard block
 block discarded – undo
4714 4714
             $fileSize,
4715 4715
             $title,
4716 4716
             $comment,
4717
-            0,//$readonly = 0,
4717
+            0, //$readonly = 0,
4718 4718
             true, //$save_visibility = true,
4719 4719
             null, //$group_id = null,
4720 4720
             $sessionId
@@ -4999,8 +4999,8 @@  discard block
 block discarded – undo
4999 4999
             $sessionId,
5000 5000
             $groupId
5001 5001
         )) {
5002
-            $uniqueName = self::addSuffixToFileName($name, '_' . $counter);
5003
-            $filePath = $path . $uniqueName;
5002
+            $uniqueName = self::addSuffixToFileName($name, '_'.$counter);
5003
+            $filePath = $path.$uniqueName;
5004 5004
             $counter++;
5005 5005
         }
5006 5006
 
@@ -5033,7 +5033,7 @@  discard block
 block discarded – undo
5033 5033
             $folder_sql = implode("','", $escaped_folders);
5034 5034
 
5035 5035
             $sql = "SELECT * FROM $doc_table
5036
-                WHERE filetype = 'folder' AND c_id = $course_id AND path IN ('" . $folder_sql . "')";
5036
+                WHERE filetype = 'folder' AND c_id = $course_id AND path IN ('".$folder_sql."')";
5037 5037
             $res = Database::query($sql);
5038 5038
             $folder_titles = array();
5039 5039
             while ($obj = Database::fetch_object($res)) {
@@ -5041,7 +5041,7 @@  discard block
 block discarded – undo
5041 5041
             }
5042 5042
         }
5043 5043
 
5044
-        $form = new FormValidator('selector', 'GET', api_get_self() . '?' . api_get_cidreq());
5044
+        $form = new FormValidator('selector', 'GET', api_get_self().'?'.api_get_cidreq());
5045 5045
         $form->addElement('hidden', 'cidReq', api_get_course_id());
5046 5046
         $parent_select = $form->addSelect('id', get_lang('CurrentDirectory'), '', array('onchange' => 'javascript: document.selector.submit();'));
5047 5047
 
@@ -5061,9 +5061,9 @@  discard block
 block discarded – undo
5061 5061
                     $folder_titles[$folder] = cut($folder_titles[$folder], 80);
5062 5062
                     $counter = count($path_parts) - 2;
5063 5063
                     if ($counter > 0) {
5064
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter) . ' &mdash; ' . $folder_titles[$folder];
5064
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter).' &mdash; '.$folder_titles[$folder];
5065 5065
                     } else {
5066
-                        $label = ' &mdash; ' . $folder_titles[$folder];
5066
+                        $label = ' &mdash; '.$folder_titles[$folder];
5067 5067
                     }
5068 5068
                     $parent_select->addOption($label, $folder_id);
5069 5069
                     if ($selected != '') {
@@ -5081,7 +5081,7 @@  discard block
 block discarded – undo
5081 5081
                     } else {
5082 5082
                         $path_parts = explode('/', str_replace($group_dir, '', $folder));
5083 5083
                         $label = cut($label, 80);
5084
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2) . ' &mdash; ' . $label;
5084
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2).' &mdash; '.$label;
5085 5085
                     }
5086 5086
                     $parent_select->addOption($label, $folder_id);
5087 5087
                     if ($selected != '') {
@@ -5113,7 +5113,7 @@  discard block
 block discarded – undo
5113 5113
     ) {
5114 5114
         global $dbl_click_id;
5115 5115
         $course_info = api_get_course_info();
5116
-        $www = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/document';
5116
+        $www = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document';
5117 5117
         $webOdflist = DocumentManager::get_web_odf_extension_list();
5118 5118
 
5119 5119
         // Get the title or the basename depending on what we're using
@@ -5137,11 +5137,11 @@  discard block
 block discarded – undo
5137 5137
 
5138 5138
         if (!$show_as_icon) {
5139 5139
             // Build download link (icon)
5140
-            $forcedownload_link = ($filetype == 'folder') ? api_get_self() . '?' . api_get_cidreq() . '&action=downloadfolder&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq() . '&amp;action=download&amp;id=' . $document_data['id'];
5140
+            $forcedownload_link = ($filetype == 'folder') ? api_get_self().'?'.api_get_cidreq().'&action=downloadfolder&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq().'&amp;action=download&amp;id='.$document_data['id'];
5141 5141
             // Folder download or file download?
5142 5142
             $forcedownload_icon = ($filetype == 'folder') ? 'save_pack.png' : 'save.png';
5143 5143
             // Prevent multiple clicks on zipped folder download
5144
-            $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_" . ($dbl_click_id++) . "=false;',10000); } else { return false; }\"" : '';
5144
+            $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_".($dbl_click_id++)."=false;',10000); } else { return false; }\"" : '';
5145 5145
         }
5146 5146
 
5147 5147
         $target = '_self';
@@ -5157,20 +5157,20 @@  discard block
 block discarded – undo
5157 5157
 
5158 5158
             if ($is_browser_viewable_file) {
5159 5159
                 if ($ext == 'pdf' || in_array($ext, $webOdflist)) {
5160
-                    $url = api_get_self() . '?' . api_get_cidreq() . '&amp;action=download&amp;id=' . $document_data['id'];
5160
+                    $url = api_get_self().'?'.api_get_cidreq().'&amp;action=download&amp;id='.$document_data['id'];
5161 5161
                 } else {
5162
-                    $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5162
+                    $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5163 5163
                 }
5164 5164
             } else {
5165 5165
                 // url-encode for problematic characters (we may not call them dangerous characters...)
5166
-                $path = str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq();
5167
-                $url = $www . $path;
5166
+                $path = str_replace('%2F', '/', $url_path).'?'.api_get_cidreq();
5167
+                $url = $www.$path;
5168 5168
             }
5169 5169
 
5170 5170
             /*$path = str_replace('%2F', '/', $url_path); //yox view hack otherwise the image can't be well read
5171 5171
             $url = $www . $path;*/
5172 5172
         } else {
5173
-            $url = api_get_self() . '?' . api_get_cidreq() . '&id=' . $document_data['id'];
5173
+            $url = api_get_self().'?'.api_get_cidreq().'&id='.$document_data['id'];
5174 5174
         }
5175 5175
 
5176 5176
         // The little download icon
@@ -5180,10 +5180,10 @@  discard block
 block discarded – undo
5180 5180
         if ($path == '/shared_folder') {
5181 5181
             $tooltip_title_alt = get_lang('UserFolders');
5182 5182
         } elseif (strstr($path, 'shared_folder_session_')) {
5183
-            $tooltip_title_alt = get_lang('UserFolders') . ' (' . api_get_session_name(api_get_session_id()) . ')';
5183
+            $tooltip_title_alt = get_lang('UserFolders').' ('.api_get_session_name(api_get_session_id()).')';
5184 5184
         } elseif (strstr($tooltip_title, 'sf_user_')) {
5185 5185
             $userinfo = api_get_user_info(substr($tooltip_title, 8));
5186
-            $tooltip_title_alt = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5186
+            $tooltip_title_alt = get_lang('UserFolder').' '.$userinfo['complete_name'];
5187 5187
         } elseif ($path == '/chat_files') {
5188 5188
             $tooltip_title_alt = get_lang('ChatFiles');
5189 5189
         } elseif ($path == '/learning_path') {
@@ -5216,24 +5216,24 @@  discard block
 block discarded – undo
5216 5216
                 ) {
5217 5217
                     //filter when I am into shared folder, I can show for donwload only my shared folder
5218 5218
                     if (DocumentManager::is_shared_folder($curdirpath, $current_session_id)) {
5219
-                        if (preg_match('/shared_folder\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5220
-                            preg_match('/shared_folder_session_' . $current_session_id . '\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5219
+                        if (preg_match('/shared_folder\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5220
+                            preg_match('/shared_folder_session_'.$current_session_id.'\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5221 5221
                             api_is_allowed_to_edit() || api_is_platform_admin()
5222 5222
                         ) {
5223
-                            $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5224
-                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5223
+                            $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5224
+                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5225 5225
                         }
5226 5226
                     } elseif (!preg_match('/shared_folder/', urldecode($forcedownload_link)) ||
5227 5227
                         api_is_allowed_to_edit() ||
5228 5228
                         api_is_platform_admin()
5229 5229
                     ) {
5230
-                        $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5231
-                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5230
+                        $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5231
+                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5232 5232
                     }
5233 5233
                 }
5234 5234
             } else {
5235
-                $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5236
-                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5235
+                $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5236
+                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5237 5237
             }
5238 5238
 
5239 5239
             // Copy files to users myfiles
@@ -5241,12 +5241,12 @@  discard block
 block discarded – undo
5241 5241
                 api_get_setting('users_copy_files') == 'true' &&
5242 5242
                 !api_is_anonymous()
5243 5243
             ) {
5244
-                $copy_myfiles_link = ($filetype == 'file') ? api_get_self() . '?' . api_get_cidreq() . '&action=copytomyfiles&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq();
5244
+                $copy_myfiles_link = ($filetype == 'file') ? api_get_self().'?'.api_get_cidreq().'&action=copytomyfiles&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq();
5245 5245
 
5246 5246
                 if ($filetype == 'file') {
5247 5247
 
5248
-                    $copy_to_myfiles = '<a href="' . $copy_myfiles_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5249
-                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5248
+                    $copy_to_myfiles = '<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5249
+                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5250 5250
 
5251 5251
                     if (api_get_setting('allow_my_files') === 'false') {
5252 5252
                         $copy_to_myfiles = '';
@@ -5265,13 +5265,13 @@  discard block
 block discarded – undo
5265 5265
                 $filetype == 'file' &&
5266 5266
                 in_array($extension, array('html', 'htm'))
5267 5267
             ) {
5268
-                $pdf_icon = ' <a style="float:right".' . $prevent_multiple_click . ' href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $document_data['id'] . '">' .
5269
-                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a> ';
5268
+                $pdf_icon = ' <a style="float:right".'.$prevent_multiple_click.' href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$document_data['id'].'">'.
5269
+                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a> ';
5270 5270
             }
5271 5271
 
5272 5272
             if ($is_browser_viewable_file) {
5273
-                $open_in_new_window_link = '<a href="' . $www . str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq() . '" style="float:right"' . $prevent_multiple_click . ' target="_blank">' .
5274
-                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5273
+                $open_in_new_window_link = '<a href="'.$www.str_replace('%2F', '/', $url_path).'?'.api_get_cidreq().'" style="float:right"'.$prevent_multiple_click.' target="_blank">'.
5274
+                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5275 5275
             }
5276 5276
 
5277 5277
             if ($filetype == 'file') {
@@ -5280,9 +5280,9 @@  discard block
 block discarded – undo
5280 5280
                     (preg_match('/wav$/i', urldecode($checkExtension)) && !preg_match('/_chnano_.wav$/i', urldecode($url))) ||
5281 5281
                     preg_match('/ogg$/i', urldecode($checkExtension))
5282 5282
                 ) {
5283
-                    return '<span style="float:left" ' . $visibility_class . '>' .
5284
-                    $title .
5285
-                    '</span>' . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5283
+                    return '<span style="float:left" '.$visibility_class.'>'.
5284
+                    $title.
5285
+                    '</span>'.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5286 5286
                 } elseif (
5287 5287
 
5288 5288
                     // Show preview
@@ -5300,7 +5300,7 @@  discard block
 block discarded – undo
5300 5300
                     )
5301 5301
                 ) {
5302 5302
                     // Simpler version of showinframesmin.php with no headers
5303
-                    $url = 'show_content.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5303
+                    $url = 'show_content.php?'.api_get_cidreq().'&id='.$document_data['id'];
5304 5304
                     $class = 'ajax';
5305 5305
                     if ($visibility == false) {
5306 5306
                         $class = "ajax invisible";
@@ -5315,34 +5315,34 @@  discard block
 block discarded – undo
5315 5315
                             'style' => 'float: left;'
5316 5316
                         ]
5317 5317
                     )
5318
-                        . $force_download_html . $send_to . $copy_to_myfiles
5319
-                        . $open_in_new_window_link . $pdf_icon;
5318
+                        . $force_download_html.$send_to.$copy_to_myfiles
5319
+                        . $open_in_new_window_link.$pdf_icon;
5320 5320
                 } else {
5321 5321
                     // For PDF Download the file.
5322 5322
                     $pdfPreview = null;
5323 5323
                     if ($ext != 'pdf' && !in_array($ext, $webOdflist)) {
5324
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5324
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5325 5325
                     } else {
5326 5326
                         $pdfPreview = Display::url(
5327 5327
                             Display::return_icon('preview.gif', get_lang('Preview')),
5328
-                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'],
5328
+                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'],
5329 5329
                             array('style' => 'float:right')
5330 5330
                         );
5331 5331
                     }
5332 5332
                     // No plugin just the old and good showinframes.php page
5333
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" style="float:left" ' . $visibility_class . ' >' . $title . '</a>' .
5334
-                    $pdfPreview.$force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5333
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" style="float:left" '.$visibility_class.' >'.$title.'</a>'.
5334
+                    $pdfPreview.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5335 5335
                 }
5336 5336
             } else {
5337
-                return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . $title . '</a>' .
5338
-                $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5337
+                return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.$title.'</a>'.
5338
+                $force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5339 5339
             }
5340 5340
             // end copy files to users myfiles
5341 5341
         } else {
5342 5342
             // Icon column
5343 5343
             if (preg_match('/shared_folder/', urldecode($checkExtension)) &&
5344 5344
                 preg_match('/shared_folder$/', urldecode($checkExtension)) == false &&
5345
-                preg_match('/shared_folder_session_' . $current_session_id . '$/', urldecode($url)) == false
5345
+                preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url)) == false
5346 5346
             ) {
5347 5347
                 if ($filetype == 'file') {
5348 5348
                     //Sound preview with jplayer
@@ -5367,19 +5367,19 @@  discard block
 block discarded – undo
5367 5367
                             api_get_setting('enable_nanogong') == 'true'
5368 5368
                         )
5369 5369
                     ) {
5370
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5371
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5372
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5373
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5370
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5371
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5372
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5373
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5374 5374
                     } else {
5375
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5376
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5377
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5375
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5376
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5377
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5378 5378
                     }
5379 5379
                 } else {
5380
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5381
-                    DocumentManager::build_document_icon_tag($filetype, $path) .
5382
-                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5380
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5381
+                    DocumentManager::build_document_icon_tag($filetype, $path).
5382
+                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5383 5383
                 }
5384 5384
             } else {
5385 5385
                 if ($filetype == 'file') {
@@ -5407,16 +5407,16 @@  discard block
 block discarded – undo
5407 5407
                             api_get_setting('enable_nanogong') == 'true'
5408 5408
                         )
5409 5409
                     ) {
5410
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id']; //without preview
5411
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5412
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5410
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id']; //without preview
5411
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5412
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5413 5413
                     } else {
5414
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5415
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5414
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5415
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5416 5416
                     }
5417 5417
                 } else {
5418
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5419
-                    DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5418
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5419
+                    DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5420 5420
                 }
5421 5421
             }
5422 5422
         }
@@ -5440,7 +5440,7 @@  discard block
 block discarded – undo
5440 5440
 
5441 5441
             if (preg_match('/_chnano_.wav$/i', $basename)) {
5442 5442
                 $icon = "jplayer_play.png";
5443
-                $basename = 'wav' . ' ' . '(Nanogong)';
5443
+                $basename = 'wav'.' '.'(Nanogong)';
5444 5444
             } else {
5445 5445
                 $basename = substr(strrchr($basename, '.'), 1);
5446 5446
             }
@@ -5456,13 +5456,13 @@  discard block
 block discarded – undo
5456 5456
                 $userinfo = api_get_user_info(substr($basename, 8));
5457 5457
                 $icon = $userinfo['avatar_small'];
5458 5458
 
5459
-                $basename = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5459
+                $basename = get_lang('UserFolder').' '.$userinfo['complete_name'];
5460 5460
                 $user_image = true;
5461 5461
             } elseif (strstr($path, 'shared_folder_session_')) {
5462 5462
                 if ($is_allowed_to_edit) {
5463
-                    $basename = '***(' . api_get_session_name($current_session_id) . ')*** ' . get_lang('HelpUsersFolder');
5463
+                    $basename = '***('.api_get_session_name($current_session_id).')*** '.get_lang('HelpUsersFolder');
5464 5464
                 } else {
5465
-                    $basename = get_lang('UserFolders') . ' (' . api_get_session_name($current_session_id) . ')';
5465
+                    $basename = get_lang('UserFolders').' ('.api_get_session_name($current_session_id).')';
5466 5466
                 }
5467 5467
                 $icon = 'folder_users.gif';
5468 5468
             } else {
@@ -5556,16 +5556,16 @@  discard block
 block discarded – undo
5556 5556
         // Build URL-parameters for table-sorting
5557 5557
         $sort_params = array();
5558 5558
         if (isset($_GET['column'])) {
5559
-            $sort_params[] = 'column=' . Security::remove_XSS($_GET['column']);
5559
+            $sort_params[] = 'column='.Security::remove_XSS($_GET['column']);
5560 5560
         }
5561 5561
         if (isset($_GET['page_nr'])) {
5562
-            $sort_params[] = 'page_nr=' . Security::remove_XSS($_GET['page_nr']);
5562
+            $sort_params[] = 'page_nr='.Security::remove_XSS($_GET['page_nr']);
5563 5563
         }
5564 5564
         if (isset($_GET['per_page'])) {
5565
-            $sort_params[] = 'per_page=' . Security::remove_XSS($_GET['per_page']);
5565
+            $sort_params[] = 'per_page='.Security::remove_XSS($_GET['per_page']);
5566 5566
         }
5567 5567
         if (isset($_GET['direction'])) {
5568
-            $sort_params[] = 'direction=' . Security::remove_XSS($_GET['direction']);
5568
+            $sort_params[] = 'direction='.Security::remove_XSS($_GET['direction']);
5569 5569
         }
5570 5570
         $sort_params = implode('&amp;', $sort_params);
5571 5571
         $visibility_icon = ($visibility == 0) ? 'invisible' : 'visible';
@@ -5578,89 +5578,89 @@  discard block
 block discarded – undo
5578 5578
         if ($is_read_only /* or ($session_id!=api_get_session_id()) */) {
5579 5579
             if (api_is_course_admin() || api_is_platform_admin()) {
5580 5580
                 if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5581
-                    $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5582
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5583
-                } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5584
-                    $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5585
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5581
+                    $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5582
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5583
+                } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5584
+                    $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5585
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5586 5586
                 } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5587
-                    $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5588
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5587
+                    $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5588
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5589 5589
                 } else {
5590
-                    $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id. '">' .
5591
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5590
+                    $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5591
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5592 5592
                 }
5593 5593
             } else {
5594 5594
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5595 5595
             }
5596
-            $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5596
+            $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5597 5597
             if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5598
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5598
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5599 5599
             }
5600
-            $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5600
+            $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5601 5601
         } else {
5602 5602
             //Edit button
5603 5603
             if (in_array($path, DocumentManager::get_system_folders())) {
5604 5604
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5605
-            } elseif ($is_certificate_mode ) {
5605
+            } elseif ($is_certificate_mode) {
5606 5606
                 // gradebook category doesn't seem to be taken into account
5607
-                $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id . '&curdirpath=/certificates">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5607
+                $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'&curdirpath=/certificates">'.Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5608 5608
             } else {
5609 5609
                 if (api_get_session_id()) {
5610 5610
                     if ($document_data['session_id'] == api_get_session_id()) {
5611 5611
                         if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5612
-                            $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5613
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5614
-                        } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5615
-                            $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5616
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5612
+                            $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5613
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5614
+                        } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5615
+                            $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5616
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5617 5617
                         } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5618
-                            $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5619
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5618
+                            $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5619
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5620 5620
                         } else {
5621
-                            $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5622
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5621
+                            $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5622
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5623 5623
                         }
5624 5624
                     } else {
5625
-                        $modify_icons .= '&nbsp;' . Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
5625
+                        $modify_icons .= '&nbsp;'.Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
5626 5626
                     }
5627 5627
                 } else {
5628 5628
                     if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5629
-                        $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5630
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5631
-                    } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5632
-                        $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5633
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5629
+                        $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5630
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5631
+                    } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5632
+                        $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5633
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5634 5634
                     } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5635
-                        $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&amp;id=' . $document_id . '">' .
5636
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5635
+                        $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5636
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5637 5637
                     } else {
5638
-                        $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5639
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5638
+                        $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5639
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5640 5640
                     }
5641 5641
                 }
5642 5642
             }
5643 5643
 
5644 5644
             // Move button.
5645 5645
             if ($is_certificate_mode || in_array($path, DocumentManager::get_system_folders())) {
5646
-                $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5646
+                $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5647 5647
             } else {
5648 5648
                 if (api_get_session_id()) {
5649 5649
                     if ($document_data['session_id'] == api_get_session_id()) {
5650
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5651
-                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5650
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5651
+                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5652 5652
                     } else {
5653
-                        $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5653
+                        $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5654 5654
                     }
5655 5655
                 } else {
5656
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5657
-                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5656
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5657
+                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5658 5658
                 }
5659 5659
             }
5660 5660
 
5661 5661
             //Visibility button
5662 5662
             if ($is_certificate_mode) {
5663
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL) . '</a>';
5663
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL).'</a>';
5664 5664
             } else {
5665 5665
                 if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5666 5666
                     if ($visibility_icon == 'invisible') {
@@ -5668,14 +5668,14 @@  discard block
 block discarded – undo
5668 5668
                     } else {
5669 5669
                         $tip_visibility = get_lang('Hide');
5670 5670
                     }
5671
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;' . $visibility_command . '=' . $id . '&amp;' . $sort_params . '">' .
5672
-                        Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
5671
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;'.$visibility_command.'='.$id.'&amp;'.$sort_params.'">'.
5672
+                        Display::return_icon($visibility_icon.'.png', $tip_visibility, '', ICON_SIZE_SMALL).'</a>';
5673 5673
                 }
5674 5674
             }
5675 5675
 
5676 5676
             // Delete button
5677 5677
             if (in_array($path, DocumentManager::get_system_folders())) {
5678
-                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5678
+                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5679 5679
             } else {
5680 5680
                 $titleToShow = addslashes(basename($document_data['title']));
5681 5681
 
@@ -5683,23 +5683,23 @@  discard block
 block discarded – undo
5683 5683
                     $_GET['curdirpath'] == '/certificates' &&
5684 5684
                     DocumentManager::get_default_certificate_id(api_get_course_id()) == $id
5685 5685
                 ) {
5686
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;' . $sort_params . 'delete_certificate_id=' . $id . '" onclick="return confirmation(\'' . $titleToShow . '\');">' .
5687
-                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5686
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'delete_certificate_id='.$id.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5687
+                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5688 5688
                 } else {
5689 5689
                     if ($is_certificate_mode) {
5690
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid=' . $document_id  . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">' .
5691
-                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5690
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5691
+                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5692 5692
                     } else {
5693 5693
                         if (api_get_session_id()) {
5694 5694
                             if ($document_data['session_id'] == api_get_session_id()) {
5695
-                                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id  . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">'.
5696
-                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5695
+                                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5696
+                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5697 5697
                             } else {
5698
-                                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5698
+                                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5699 5699
                             }
5700 5700
                         } else {
5701
-                            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow. '\');">' .
5702
-                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5701
+                            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5702
+                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5703 5703
                         }
5704 5704
                     }
5705 5705
                 }
@@ -5711,15 +5711,15 @@  discard block
 block discarded – undo
5711 5711
                 // nothing to do
5712 5712
             } else {
5713 5713
                 if ($usePpt2lp && $formatType) {
5714
-                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" ' .
5715
-                        'data-documentId = ' . $document_id .
5716
-                        ' data-formatType = ' . $formatType . '>' .
5714
+                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" '.
5715
+                        'data-documentId = '.$document_id.
5716
+                        ' data-formatType = '.$formatType.'>'.
5717 5717
                         Display::return_icon(
5718 5718
                             'convert.png',
5719 5719
                             get_lang('Convert'),
5720 5720
                             array(),
5721 5721
                             ICON_SIZE_SMALL
5722
-                        ) . '</a>';
5722
+                        ).'</a>';
5723 5723
                 }
5724 5724
             }
5725 5725
         }
@@ -5727,8 +5727,8 @@  discard block
 block discarded – undo
5727 5727
         if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {
5728 5728
             if ($is_template == 0) {
5729 5729
                 if ((isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates') || !isset($_GET['curdirpath'])) {
5730
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;add_as_template=' . $id .  '&amp;' . $sort_params . '">' .
5731
-                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
5730
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;add_as_template='.$id.'&amp;'.$sort_params.'">'.
5731
+                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL).'</a>';
5732 5732
                 }
5733 5733
                 if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {//allow attach certificate to course
5734 5734
                     $visibility_icon_certificate = 'nocertificate';
@@ -5742,20 +5742,20 @@  discard block
 block discarded – undo
5742 5742
                         $certificate = get_lang('NoDefaultCertificate');
5743 5743
                     }
5744 5744
                     if (isset($_GET['selectcat'])) {
5745
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;selectcat=' . Security::remove_XSS($_GET['selectcat']) . '&amp;set_certificate=' . $id . '&amp;' . $sort_params . '">
5746
-                    <img src="../img/' . $visibility_icon_certificate . '.png" border="0" title="' . $certificate . '" alt="" /></a>';
5745
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;selectcat='.Security::remove_XSS($_GET['selectcat']).'&amp;set_certificate='.$id.'&amp;'.$sort_params.'">
5746
+                    <img src="../img/' . $visibility_icon_certificate.'.png" border="0" title="'.$certificate.'" alt="" /></a>';
5747 5747
                         if ($is_preview) {
5748
-                            $modify_icons .= '&nbsp;<a target="_blank"  href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;set_preview=' . $id . '&amp;' . $sort_params . '" >' .
5749
-                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
5748
+                            $modify_icons .= '&nbsp;<a target="_blank"  href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;set_preview='.$id.'&amp;'.$sort_params.'" >'.
5749
+                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL).'</a>';
5750 5750
                         }
5751 5751
                     }
5752 5752
                 }
5753 5753
             } else {
5754
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&amp;remove_as_template=' . $id. '&amp;' . $sort_params . '">' .
5755
-                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
5754
+                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;remove_as_template='.$id.'&amp;'.$sort_params.'">'.
5755
+                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL).'</a>';
5756 5756
             }
5757
-            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' .
5758
-                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
5757
+            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$id.'">'.
5758
+                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a>';
5759 5759
         }
5760 5760
         return $modify_icons;
5761 5761
     }
@@ -5824,7 +5824,7 @@  discard block
 block discarded – undo
5824 5824
                     // 3. inside a subfolder of the folder you want to move
5825 5825
                     if (($curdirpath != $folder) &&
5826 5826
                         ($folder != $move_file) &&
5827
-                        (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5827
+                        (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5828 5828
                     ) {
5829 5829
                         $path_displayed = $folder;
5830 5830
                         // If document title is used, we have to display titles instead of real paths...
@@ -5841,7 +5841,7 @@  discard block
 block discarded – undo
5841 5841
             foreach ($folders as $folder) {
5842 5842
                 if (($curdirpath != $folder) &&
5843 5843
                     ($folder != $move_file) &&
5844
-                    (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5844
+                    (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5845 5845
                 ) {
5846 5846
                     // Cannot copy dir into his own subdir
5847 5847
                     $path_displayed = DocumentManager::get_titles_of_path($folder);
@@ -5883,10 +5883,10 @@  discard block
 block discarded – undo
5883 5883
                 // If this path has soon been stored here we don't need a new query
5884 5884
                 $path_displayed .= $tmp_folders_titles[$tmp_path];
5885 5885
             } else {
5886
-                $sql = 'SELECT title FROM ' . Database::get_course_table(TABLE_DOCUMENT) . '
5887
-                    WHERE c_id = ' . $course_id . ' AND path LIKE BINARY "' . $tmp_path . '"';
5886
+                $sql = 'SELECT title FROM '.Database::get_course_table(TABLE_DOCUMENT).'
5887
+                    WHERE c_id = ' . $course_id.' AND path LIKE BINARY "'.$tmp_path.'"';
5888 5888
                 $rs = Database::query($sql);
5889
-                $tmp_title = '/' . Database::result($rs, 0, 0);
5889
+                $tmp_title = '/'.Database::result($rs, 0, 0);
5890 5890
                 $path_displayed .= $tmp_title;
5891 5891
                 $tmp_folders_titles[$tmp_path] = $tmp_title;
5892 5892
             }
@@ -5922,7 +5922,7 @@  discard block
 block discarded – undo
5922 5922
         $clean_curdirpath = Security::remove_XSS($curdirpath);
5923 5923
         if ($clean_curdirpath == '/shared_folder') {
5924 5924
             return true;
5925
-        } elseif ($clean_curdirpath == '/shared_folder_session_' . $current_session_id) {
5925
+        } elseif ($clean_curdirpath == '/shared_folder_session_'.$current_session_id) {
5926 5926
             return true;
5927 5927
         } else {
5928 5928
             return false;
@@ -5938,7 +5938,7 @@  discard block
 block discarded – undo
5938 5938
         $clean_path = Security::remove_XSS($path);
5939 5939
         if (strpos($clean_path, 'shared_folder/sf_user_')) {
5940 5940
             return true;
5941
-        } elseif (strpos($clean_path, 'shared_folder_session_' . $current_session_id . '/sf_user_')) {
5941
+        } elseif (strpos($clean_path, 'shared_folder_session_'.$current_session_id.'/sf_user_')) {
5942 5942
             return true;
5943 5943
         } else {
5944 5944
             return false;
@@ -5951,11 +5951,11 @@  discard block
 block discarded – undo
5951 5951
      */
5952 5952
     public static function is_my_shared_folder($user_id, $path, $current_session_id)
5953 5953
     {
5954
-        $clean_path = Security::remove_XSS($path) . '/';
5954
+        $clean_path = Security::remove_XSS($path).'/';
5955 5955
         //for security does not remove the last slash
5956
-        $main_user_shared_folder = '/shared_folder\/sf_user_' . $user_id . '\//';
5956
+        $main_user_shared_folder = '/shared_folder\/sf_user_'.$user_id.'\//';
5957 5957
         //for security does not remove the last slash
5958
-        $main_user_shared_folder_session = '/shared_folder_session_' . $current_session_id . '\/sf_user_' . $user_id . '\//';
5958
+        $main_user_shared_folder_session = '/shared_folder_session_'.$current_session_id.'\/sf_user_'.$user_id.'\//';
5959 5959
 
5960 5960
         if (preg_match($main_user_shared_folder, $clean_path)) {
5961 5961
             return true;
@@ -6227,7 +6227,7 @@  discard block
 block discarded – undo
6227 6227
                 ON (i.c_id = d.c_id)
6228 6228
                 WHERE
6229 6229
                     d.id = i.ref AND
6230
-                    i.tool = '" . TOOL_DOCUMENT . "'
6230
+                    i.tool = '".TOOL_DOCUMENT."'
6231 6231
                     $conditionSession AND
6232 6232
                     i.c_id = {$courseInfo['real_id']} AND
6233 6233
                     d.c_id = {$courseInfo['real_id']} ";
@@ -6235,9 +6235,9 @@  discard block
 block discarded – undo
6235 6235
         $result = Database::query($sql);
6236 6236
         $documents = Database::store_result($result, 'ASSOC');
6237 6237
         if ($documents) {
6238
-            $course_dir = $courseInfo['directory'] . '/document';
6238
+            $course_dir = $courseInfo['directory'].'/document';
6239 6239
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
6240
-            $base_work_dir = $sys_course_path . $course_dir;
6240
+            $base_work_dir = $sys_course_path.$course_dir;
6241 6241
 
6242 6242
             foreach ($documents as $document) {
6243 6243
                 $documentId = $document['id'];
Please login to merge, or discard this patch.
main/inc/lib/events.lib.php 3 patches
Doc Comments   +18 added lines, -10 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     }
240 240
 
241 241
     /**
242
-     * @param doc_id id of document (id in mainDb.document table)
242
+     * @param doc_id string of document (id in mainDb.document table)
243 243
      * @author Sebastien Piraux <[email protected]>
244 244
      * @desc Record information for upload event
245 245
      * used in the works tool to record informations when
@@ -311,6 +311,8 @@  discard block
 block discarded – undo
311 311
      * @param   int     session_id
312 312
      * @param   int     learnpath_id (id of the learnpath)
313 313
      * @param   int     learnpath_item_id (id of the learnpath_item)
314
+     * @param integer $weighting
315
+     * @param integer $session_id
314 316
      *
315 317
      * @author Sebastien Piraux <[email protected]>
316 318
      * @author Julio Montoya Armas <[email protected]> Reworked 2010
@@ -412,7 +414,9 @@  discard block
 block discarded – undo
412 414
      * @param	integer	Session ID (from the session table). Default value of null means "get from context".
413 415
      * @param	integer	Learnpath ID (from c_lp table). Default value of null means "get from context".
414 416
      * @param	integer	Learnpath item ID (from the c_lp_item table). Default value of null means "get from context".
415
-     * @return	boolean	Result of the insert query
417
+     * @param integer $exe_id
418
+     * @param integer $position
419
+     * @return	false|string	Result of the insert query
416 420
      */
417 421
     public static function saveQuestionAttempt(
418 422
         $score,
@@ -582,6 +586,7 @@  discard block
 block discarded – undo
582 586
      * @param	int		Whether this answer is correct (1) or not (0)
583 587
      * @param	string	Coordinates of this point (e.g. 123;324)
584 588
      * @param	bool update results?
589
+     * @param integer $exe_id
585 590
      * @return	boolean	Result of the insert query
586 591
      * @uses Course code and user_id from global scope $_cid and $_user
587 592
      */
@@ -714,7 +719,6 @@  discard block
 block discarded – undo
714 719
     /**
715 720
      * Get every email stored in the database
716 721
      *
717
-     * @param int $etId
718 722
      * @return type
719 723
      * @assert () !== false
720 724
      */
@@ -782,11 +786,11 @@  discard block
 block discarded – undo
782 786
     /**
783 787
      * Save the new message for one event and for one language
784 788
      *
785
-     * @param string $eventName
789
+     * @param string $event_name
786 790
      * @param array $users
787 791
      * @param string $message
788 792
      * @param string $subject
789
-     * @param string $eventMessageLanguage
793
+     * @param string $event_message_language
790 794
      * @param int $activated
791 795
      */
792 796
     public static function save_event_type_message($event_name, $users, $message, $subject, $event_message_language, $activated)
@@ -920,10 +924,10 @@  discard block
 block discarded – undo
920 924
     }
921 925
 
922 926
     /**
923
-     * @param $user_id
927
+     * @param integer $user_id
924 928
      * @param $exerciseId
925
-     * @param $lp_id
926
-     * @param $lp_item_id
929
+     * @param integer $lp_id
930
+     * @param integer $lp_item_id
927 931
      * @return int
928 932
      */
929 933
     public static function get_attempt_count_not_finished($user_id, $exerciseId, $lp_id, $lp_item_id)
@@ -1100,6 +1104,7 @@  discard block
 block discarded – undo
1100 1104
      * @param   int     exercise id
1101 1105
      * @param   int $courseId
1102 1106
      * @param   int     session id
1107
+     * @param integer $user_id
1103 1108
      * @return  array   with the results
1104 1109
      *
1105 1110
      */
@@ -1195,6 +1200,7 @@  discard block
 block discarded – undo
1195 1200
      * @param   int     exercise id
1196 1201
      * @param   int  $courseId
1197 1202
      * @param   int     session id
1203
+     * @param integer $user_id
1198 1204
      * @return  array   with the results
1199 1205
      *
1200 1206
      */
@@ -1235,6 +1241,7 @@  discard block
 block discarded – undo
1235 1241
      * @param   int     exercise id
1236 1242
      * @param   string  course code
1237 1243
      * @param   int     session id
1244
+     * @param integer $exe_id
1238 1245
      * @return  array   with the results
1239 1246
      *
1240 1247
      */
@@ -1284,6 +1291,7 @@  discard block
 block discarded – undo
1284 1291
      * @param   int     lp id
1285 1292
      * @param   int     lp item id
1286 1293
      * @param   string 	order asc or desc
1294
+     * @param integer $courseId
1287 1295
      * @return  array   with the results
1288 1296
      *
1289 1297
      */
@@ -1343,7 +1351,7 @@  discard block
 block discarded – undo
1343 1351
      * @param   int     exercise id
1344 1352
      * @param   int     $courseId
1345 1353
      * @param   int     session id
1346
-     * @return  array   with the results
1354
+     * @return  string   with the results
1347 1355
      *
1348 1356
      */
1349 1357
     public static function count_exercise_attempts_by_user($user_id, $exercise_id, $courseId, $session_id = 0)
@@ -1519,7 +1527,7 @@  discard block
 block discarded – undo
1519 1527
      * @param   int     exercise id
1520 1528
      * @param   int   course id
1521 1529
      * @param   int     session id
1522
-     * @return  array   with the results
1530
+     * @return  integer   with the results
1523 1531
      *
1524 1532
      */
1525 1533
     public static function get_count_exercises_attempted_by_course($courseId, $session_id = 0)
Please login to merge, or discard this patch.
Spacing   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -78,9 +78,7 @@  discard block
 block discarded – undo
78 78
         Database::query($sql);
79 79
 
80 80
         // Auto subscribe
81
-        $user_status = $userInfo['status']  == SESSIONADMIN ? 'sessionadmin' :
82
-            $userInfo['status'] == COURSEMANAGER ? 'teacher' :
83
-                $userInfo['status'] == DRH ? 'DRH' : 'student';
81
+        $user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : $userInfo['status'] == COURSEMANAGER ? 'teacher' : $userInfo['status'] == DRH ? 'DRH' : 'student';
84 82
         $autoSubscribe = api_get_setting($user_status.'_autosubscribe');
85 83
         if ($autoSubscribe) {
86 84
             $autoSubscribe = explode('|', $autoSubscribe);
@@ -334,7 +332,7 @@  discard block
 block discarded – undo
334 332
         global $debug;
335 333
 
336 334
         if ($debug) error_log('Called to update_event_exercice');
337
-        if ($debug) error_log('duration:' . $duration);
335
+        if ($debug) error_log('duration:'.$duration);
338 336
 
339 337
         if ($exeid != '') {
340 338
             /*
@@ -382,7 +380,7 @@  discard block
 block discarded – undo
382 380
         		   status = '".$status."',
383 381
         		   questions_to_check = '".$remind_list."',
384 382
         		   data_tracking = '".implode(',', $question_list)."',
385
-                   user_ip = '" . Database::escape_string(api_get_real_ip()) . "'
383
+                   user_ip = '" . Database::escape_string(api_get_real_ip())."'
386 384
         		 WHERE exe_id = '".Database::escape_string($exeid)."'";
387 385
             $res = Database::query($sql);
388 386
 
@@ -1036,15 +1034,15 @@  discard block
 block discarded – undo
1036 1034
 
1037 1035
         if (!empty($exe_list) && is_array($exe_list) && count($exe_list) > 0) {
1038 1036
             $sql = "DELETE FROM $track_e_exercises
1039
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1037
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1040 1038
             Database::query($sql);
1041 1039
 
1042 1040
             $sql = "DELETE FROM $track_attempts
1043
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1041
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1044 1042
             Database::query($sql);
1045 1043
 
1046 1044
             $sql = "DELETE FROM $recording_table
1047
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1045
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1048 1046
             Database::query($sql);
1049 1047
         }
1050 1048
 
@@ -1086,7 +1084,7 @@  discard block
 block discarded – undo
1086 1084
             Event::addEvent(
1087 1085
                 LOG_EXERCISE_RESULT_DELETE,
1088 1086
                 LOG_EXERCISE_AND_USER_ID,
1089
-                $exercise_id . '-' . $user_id,
1087
+                $exercise_id.'-'.$user_id,
1090 1088
                 null,
1091 1089
                 null,
1092 1090
                 $course_id,
@@ -1458,7 +1456,7 @@  discard block
 block discarded – undo
1458 1456
         $res = Database::query($sql);
1459 1457
         $list = array();
1460 1458
         while ($row = Database::fetch_array($res, 'ASSOC')) {
1461
-            $list[$row['exe_id']] = $row;  /*
1459
+            $list[$row['exe_id']] = $row; /*
1462 1460
               $sql = "SELECT * FROM $table_track_attempt WHERE exe_id = {$row['exe_id']}";
1463 1461
               $res_question = Database::query($sql);
1464 1462
               while($row_q = Database::fetch_array($res_question,'ASSOC')) {
@@ -1684,7 +1682,7 @@  discard block
 block discarded – undo
1684 1682
         Event::addEvent(
1685 1683
             LOG_QUESTION_RESULT_DELETE,
1686 1684
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1687
-            $exe_id . '-' . $question_id,
1685
+            $exe_id.'-'.$question_id,
1688 1686
             null,
1689 1687
             null,
1690 1688
             $courseId,
@@ -1720,7 +1718,7 @@  discard block
 block discarded – undo
1720 1718
         Event::addEvent(
1721 1719
             LOG_QUESTION_RESULT_DELETE,
1722 1720
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1723
-            $exe_id . '-' . $question_id,
1721
+            $exe_id.'-'.$question_id,
1724 1722
             null,
1725 1723
             null,
1726 1724
             $courseId,
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -333,8 +333,12 @@  discard block
 block discarded – undo
333 333
     ) {
334 334
         global $debug;
335 335
 
336
-        if ($debug) error_log('Called to update_event_exercice');
337
-        if ($debug) error_log('duration:' . $duration);
336
+        if ($debug) {
337
+            error_log('Called to update_event_exercice');
338
+        }
339
+        if ($debug) {
340
+            error_log('duration:' . $duration);
341
+        }
338 342
 
339 343
         if ($exeid != '') {
340 344
             /*
@@ -386,8 +390,12 @@  discard block
 block discarded – undo
386 390
         		 WHERE exe_id = '".Database::escape_string($exeid)."'";
387 391
             $res = Database::query($sql);
388 392
 
389
-            if ($debug) error_log('update_event_exercice called');
390
-            if ($debug) error_log("$sql");
393
+            if ($debug) {
394
+                error_log('update_event_exercice called');
395
+            }
396
+            if ($debug) {
397
+                error_log("$sql");
398
+            }
391 399
 
392 400
             //Deleting control time session track
393 401
             //ExerciseLib::exercise_time_control_delete($exo_id);
Please login to merge, or discard this patch.
main/inc/lib/exercise.lib.php 3 patches
Doc Comments   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1255,6 +1255,7 @@  discard block
 block discarded – undo
1255 1255
 
1256 1256
     /**
1257 1257
      * Validates the time control key
1258
+     * @param integer $exercise_id
1258 1259
      */
1259 1260
     public static function exercise_time_control_is_valid(
1260 1261
         $exercise_id,
@@ -1388,7 +1389,7 @@  discard block
 block discarded – undo
1388 1389
      * @param int $in_direction
1389 1390
      * @param string $in_hotpot_path
1390 1391
      * @param bool $in_get_count
1391
-     * @param null $where_condition
1392
+     * @param string $where_condition
1392 1393
      * @return array|int
1393 1394
      */
1394 1395
     public static function get_exam_results_hotpotatoes_data(
@@ -2179,7 +2180,7 @@  discard block
 block discarded – undo
2179 2180
     /**
2180 2181
      * Return true if pass_pourcentage activated (we use the pass pourcentage feature
2181 2182
      * return false if pass_percentage = 0 (we don't use the pass pourcentage feature
2182
-     * @param $in_pass_pourcentage
2183
+     * @param string $in_pass_pourcentage
2183 2184
      * @return boolean
2184 2185
      * In this version, pass_percentage and show_success_message are disabled if
2185 2186
      * pass_percentage is set to 0
@@ -2192,7 +2193,7 @@  discard block
 block discarded – undo
2192 2193
     /**
2193 2194
      * Converts a numeric value in a percentage example 0.66666 to 66.67 %
2194 2195
      * @param $value
2195
-     * @return float Converted number
2196
+     * @return string Converted number
2196 2197
      */
2197 2198
     public static function convert_to_percentage($value)
2198 2199
     {
@@ -2208,7 +2209,7 @@  discard block
 block discarded – undo
2208 2209
      * @param   float $score
2209 2210
      * @param   float $weight
2210 2211
      * @deprecated seem not to be used
2211
-     * @return  float   the score rounded converted to the new range
2212
+     * @return  string|null   the score rounded converted to the new range
2212 2213
      */
2213 2214
     public static function convert_score($score, $weight)
2214 2215
     {
@@ -2759,6 +2760,7 @@  discard block
 block discarded – undo
2759 2760
      * @param    int        exercise id
2760 2761
      * @param    int    $courseId
2761 2762
      * @param    int        session id
2763
+     * @param integer $user_count
2762 2764
      * @return    float    Best average score
2763 2765
      */
2764 2766
     public static function get_best_average_score_by_exercise(
@@ -3198,8 +3200,9 @@  discard block
 block discarded – undo
3198 3200
     }
3199 3201
 
3200 3202
     /**
3201
-     * @param array $answer
3203
+     * @param string|null $answer
3202 3204
      * @param string $user_answer
3205
+     * @param string|null $current_answer
3203 3206
      * @return array
3204 3207
      */
3205 3208
     public static function check_fill_in_blanks($answer, $user_answer, $current_answer)
@@ -3805,7 +3808,7 @@  discard block
 block discarded – undo
3805 3808
 
3806 3809
     /**
3807 3810
      * @param int $countLetter
3808
-     * @return mixed
3811
+     * @return string
3809 3812
      */
3810 3813
     public static function detectInputAppropriateClass($countLetter)
3811 3814
     {
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 /* For licensing terms, see /license.txt */
3 3
 
4
-use ChamiloSession as Session;
5
-
6 4
 /**
7 5
  * Class ExerciseLib
8 6
  * shows a question and its answers
Please login to merge, or discard this patch.
Spacing   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                 if ($show_title) {
66 66
                     TestCategory::displayCategoryAndTitle($objQuestionTmp->id);
67 67
                     echo Display::div(
68
-                        $current_item . '. ' . $objQuestionTmp->selectTitle(),
68
+                        $current_item.'. '.$objQuestionTmp->selectTitle(),
69 69
                         array('class' => 'question_title')
70 70
                     );
71 71
                 }
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
                 $config = array(
162 162
                     'ToolbarSet' => 'TestFreeAnswer'
163 163
                 );
164
-                $form->addHtmlEditor("choice[" . $questionId . "]", null, false, false, $config);
165
-                $form->setDefaults(array("choice[" . $questionId . "]" => $fck_content));
164
+                $form->addHtmlEditor("choice[".$questionId."]", null, false, false, $config);
165
+                $form->setDefaults(array("choice[".$questionId."]" => $fck_content));
166 166
                 $s .= $form->returnForm();
167 167
             } elseif ($answerType == ORAL_EXPRESSION) {
168 168
                 // Add nanog
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                 $config = array(
192 192
                     'ToolbarSet' => 'TestFreeAnswer'
193 193
                 );
194
-                $form->addHtmlEditor("choice[" . $questionId . "]", null, false, false, $config);
194
+                $form->addHtmlEditor("choice[".$questionId."]", null, false, false, $config);
195 195
                 //$form->setDefaults(array("choice[" . $questionId . "]" => $fck_content));
196 196
                 $s .= $form->returnForm();
197 197
             }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
                 // Unique answer
274 274
                 if (in_array($answerType, [UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION, UNIQUE_ANSWER_IMAGE])) {
275
-                    $input_id = 'choice-' . $questionId . '-' . $answerId;
275
+                    $input_id = 'choice-'.$questionId.'-'.$answerId;
276 276
                     if (isset($user_choice[0]['answer']) && $user_choice[0]['answer'] == $numAnswer) {
277 277
                         $attributes = array(
278 278
                             'id' => $input_id,
@@ -297,14 +297,14 @@  discard block
 block discarded – undo
297 297
                     if ($answerType == UNIQUE_ANSWER_IMAGE) {
298 298
                         if ($show_comment) {
299 299
                             if (empty($comment)) {
300
-                                $s .= '<div id="answer' . $questionId . $numAnswer . '" '
300
+                                $s .= '<div id="answer'.$questionId.$numAnswer.'" '
301 301
                                     . 'class="exercise-unique-answer-image" style="text-align: center">';
302 302
                             } else {
303
-                                $s .= '<div id="answer' . $questionId . $numAnswer . '" '
303
+                                $s .= '<div id="answer'.$questionId.$numAnswer.'" '
304 304
                                     . 'class="exercise-unique-answer-image col-xs-6 col-sm-12" style="text-align: center">';
305 305
                             }
306 306
                         } else {
307
-                            $s .= '<div id="answer' . $questionId . $numAnswer . '" '
307
+                            $s .= '<div id="answer'.$questionId.$numAnswer.'" '
308 308
                                 . 'class="exercise-unique-answer-image col-xs-6 col-md-3" style="text-align: center">';
309 309
                         }
310 310
                     }
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
                     $answer = Security::remove_XSS($answer, STUDENT);
313 313
                     $s .= Display::input(
314 314
                         'hidden',
315
-                        'choice2[' . $questionId . ']',
315
+                        'choice2['.$questionId.']',
316 316
                         '0'
317 317
                     );
318 318
 
@@ -320,13 +320,13 @@  discard block
 block discarded – undo
320 320
 
321 321
                     if ($answerType == UNIQUE_ANSWER_IMAGE) {
322 322
                         $attributes['style'] = 'display: none;';
323
-                        $answer = '<div class="thumbnail">' . $answer . '</div>';
323
+                        $answer = '<div class="thumbnail">'.$answer.'</div>';
324 324
                     }
325 325
 
326 326
                     $answer_input .= '<label class="radio">';
327 327
                     $answer_input .= Display::input(
328 328
                         'radio',
329
-                        'choice[' . $questionId . ']',
329
+                        'choice['.$questionId.']',
330 330
                         $numAnswer,
331 331
                         $attributes
332 332
                     );
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
                     $answerType == MULTIPLE_ANSWER_TRUE_FALSE ||
354 354
                     $answerType == GLOBAL_MULTIPLE_ANSWER
355 355
                 ) {
356
-                    $input_id = 'choice-' . $questionId . '-' . $answerId;
356
+                    $input_id = 'choice-'.$questionId.'-'.$answerId;
357 357
                     $answer = Security::remove_XSS($answer, STUDENT);
358 358
 
359 359
                     if (in_array($numAnswer, $user_choice_array)) {
@@ -374,12 +374,12 @@  discard block
 block discarded – undo
374 374
                     }
375 375
 
376 376
                     if ($answerType == MULTIPLE_ANSWER || $answerType == GLOBAL_MULTIPLE_ANSWER) {
377
-                        $s .= '<input type="hidden" name="choice2[' . $questionId . ']" value="0" />';
377
+                        $s .= '<input type="hidden" name="choice2['.$questionId.']" value="0" />';
378 378
 
379 379
                         $answer_input = '<label class="checkbox">';
380 380
                         $answer_input .= Display::input(
381 381
                             'checkbox',
382
-                            'choice[' . $questionId . '][' . $numAnswer . ']',
382
+                            'choice['.$questionId.']['.$numAnswer.']',
383 383
                             $numAnswer,
384 384
                             $attributes
385 385
                         );
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                                     'td',
433 433
                                     Display::input(
434 434
                                         'radio',
435
-                                        'choice[' . $questionId . '][' . $numAnswer . ']',
435
+                                        'choice['.$questionId.']['.$numAnswer.']',
436 436
                                         $id,
437 437
                                         $attributes
438 438
                                     ),
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
                     }
451 451
                 } elseif ($answerType == MULTIPLE_ANSWER_COMBINATION) {
452 452
                     // multiple answers
453
-                    $input_id = 'choice-' . $questionId . '-' . $answerId;
453
+                    $input_id = 'choice-'.$questionId.'-'.$answerId;
454 454
 
455 455
                     if (in_array($numAnswer, $user_choice_array)) {
456 456
                         $attributes = array(
@@ -470,11 +470,11 @@  discard block
 block discarded – undo
470 470
                     }
471 471
 
472 472
                     $answer = Security::remove_XSS($answer, STUDENT);
473
-                    $answer_input = '<input type="hidden" name="choice2[' . $questionId . ']" value="0" />';
473
+                    $answer_input = '<input type="hidden" name="choice2['.$questionId.']" value="0" />';
474 474
                     $answer_input .= '<label class="checkbox">';
475 475
                     $answer_input .= Display::input(
476 476
                         'checkbox',
477
-                        'choice[' . $questionId . '][' . $numAnswer . ']',
477
+                        'choice['.$questionId.']['.$numAnswer.']',
478 478
                         1,
479 479
                         $attributes
480 480
                     );
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
                     }
496 496
 
497 497
                 } elseif ($answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE) {
498
-                    $s .= '<input type="hidden" name="choice2[' . $questionId . ']" value="0" />';
498
+                    $s .= '<input type="hidden" name="choice2['.$questionId.']" value="0" />';
499 499
 
500 500
                     $my_choice = array();
501 501
                     if (!empty($user_choice_array)) {
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
                             'td',
531 531
                             Display::input(
532 532
                                 'radio',
533
-                                'choice[' . $questionId . '][' . $numAnswer . ']',
533
+                                'choice['.$questionId.']['.$numAnswer.']',
534 534
                                 $key,
535 535
                                 $attributes
536 536
                             )
@@ -626,8 +626,8 @@  discard block
 block discarded – undo
626 626
                         $trackAttempts = Database::get_main_table(
627 627
                             TABLE_STATISTIC_TRACK_E_ATTEMPT
628 628
                         );
629
-                        $sql = 'SELECT answer FROM ' . $trackAttempts . '
630
-                                WHERE exe_id=' . $exe_id . ' AND question_id=' . $questionId;
629
+                        $sql = 'SELECT answer FROM '.$trackAttempts.'
630
+                                WHERE exe_id=' . $exe_id.' AND question_id='.$questionId;
631 631
                         $rsLastAttempt = Database::query($sql);
632 632
                         $rowLastAttempt = Database::fetch_array($rsLastAttempt);
633 633
                         $answer = $rowLastAttempt['answer'];
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
                                 '',
683 683
                                 $answerCorrected
684 684
                             );
685
-                            $answerCorrected = '[' . $answerCorrected . ']';
685
+                            $answerCorrected = '['.$answerCorrected.']';
686 686
                             $studentAnswerList[] = $answerCorrected;
687 687
                         }
688 688
                     }
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
                     */
702 702
                     $tabComments = api_preg_split(
703 703
                         '/\[[^]]+\]/',
704
-                        ' ' . $answer . ' '
704
+                        ' '.$answer.' '
705 705
                     );
706 706
                     if (!empty($correctAnswerList) && !empty($studentAnswerList)) {
707 707
                         $answer = "";
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
                                 $size
719 719
                             );
720 720
 
721
-                            $answer .= $tabComments[$i] .
721
+                            $answer .= $tabComments[$i].
722 722
                                 Display::input(
723 723
                                     'text',
724 724
                                     "choice[$questionId][]",
@@ -764,12 +764,12 @@  discard block
 block discarded – undo
764 764
                         $s .= '<tr><td width="45%" valign="top">';
765 765
                         $parsed_answer = $answer;
766 766
                         //left part questions
767
-                        $s .= '<p class="indent">' . $lines_count . '.&nbsp;' . $parsed_answer . '</p></td>';
767
+                        $s .= '<p class="indent">'.$lines_count.'.&nbsp;'.$parsed_answer.'</p></td>';
768 768
                         //middle part (matches selects)
769 769
 
770 770
                         $s .= '<td width="10%" valign="top" align="center" >
771 771
                                 <div class="select-matching">
772
-                                <select name="choice[' . $questionId . '][' . $numAnswer . ']">';
772
+                                <select name="choice[' . $questionId.']['.$numAnswer.']">';
773 773
 
774 774
                         // fills the list-box
775 775
                         foreach ($select_items as $key => $val) {
@@ -785,14 +785,14 @@  discard block
 block discarded – undo
785 785
                             if (isset($user_choice_array_position[$numAnswer]) && $val['id'] == $user_choice_array_position[$numAnswer]) {
786 786
                                 $selected = 'selected="selected"';
787 787
                             }
788
-                            $s .= '<option value="' . $val['id'] . '" ' . $selected . '>' . $val['letter'] . '</option>';
788
+                            $s .= '<option value="'.$val['id'].'" '.$selected.'>'.$val['letter'].'</option>';
789 789
 
790 790
                         }  // end foreach()
791 791
 
792 792
                         $s .= '</select></div></td><td width="5%" class="separate">&nbsp;</td>';
793 793
                         $s .= '<td width="40%" valign="top" >';
794 794
                         if (isset($select_items[$lines_count])) {
795
-                            $s .= '<div class="text-right"><p class="indent">' . $select_items[$lines_count]['letter'].'.&nbsp; '. $select_items[$lines_count]['answer'].'</p></div>';
795
+                            $s .= '<div class="text-right"><p class="indent">'.$select_items[$lines_count]['letter'].'.&nbsp; '.$select_items[$lines_count]['answer'].'</p></div>';
796 796
                         } else {
797 797
                             $s .= '&nbsp;';
798 798
                         }
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
                                 $s .= '<tr>
808 808
                                       <td colspan="2"></td>
809 809
                                       <td valign="top">';
810
-                                $s .= '<b>' . $select_items[$lines_count]['letter'] . '.</b> ' . $select_items[$lines_count]['answer'];
810
+                                $s .= '<b>'.$select_items[$lines_count]['letter'].'.</b> '.$select_items[$lines_count]['answer'];
811 811
                                 $s .= "</td>
812 812
                                 </tr>";
813 813
                                 $lines_count++;
@@ -823,9 +823,9 @@  discard block
 block discarded – undo
823 823
                         $data = $objAnswerTmp->getAnswerByAutoId($data['correct']);
824 824
                         $lines_count = $data['answer'];*/
825 825
 
826
-                        $windowId = $questionId . '_' . $lines_count;
826
+                        $windowId = $questionId.'_'.$lines_count;
827 827
 
828
-                        $s .= '<li class="touch-items" id="' . $windowId . '">';
828
+                        $s .= '<li class="touch-items" id="'.$windowId.'">';
829 829
                         $s .= Display::div(
830 830
                             $parsed_answer,
831 831
                             [
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
                                 Display::tag(
884 884
                                     'b',
885 885
                                     $select_items[$lines_count]['letter']
886
-                                ) . $select_items[$lines_count]['answer'],
886
+                                ).$select_items[$lines_count]['answer'],
887 887
                                 [
888 888
                                     'id' => "window_{$windowId}_answer",
889 889
                                     'style' => 'display: none;'
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 
1028 1028
             if ($show_comment) {
1029 1029
                 $s .= '</table>';
1030
-            } elseif(
1030
+            } elseif (
1031 1031
                 in_array(
1032 1032
                     $answerType,
1033 1033
                     [
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
 
1053 1053
                 for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
1054 1054
                     $answerCorrect = $objAnswerTmp->isCorrect($answerId);
1055
-                    $windowId = $questionId . '_' . $counterAnswer;
1055
+                    $windowId = $questionId.'_'.$counterAnswer;
1056 1056
 
1057 1057
                     if ($answerCorrect) {
1058 1058
                         $s .= Display::div(
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
                 $course = api_get_course_info();
1098 1098
                 $doc_id = DocumentManager::get_document_id(
1099 1099
                     $course,
1100
-                    '/images/' . $pictureName
1100
+                    '/images/'.$pictureName
1101 1101
                 );
1102 1102
                 if (is_numeric($doc_id)) {
1103 1103
                     $images_folder_visibility = api_get_item_visibility(
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
                 echo "
1123 1123
                     <script>
1124 1124
                         $(document).on('ready', function () {
1125
-                            new " . ($answerType == HOT_SPOT ?  "HotspotQuestion" : "DelineationQuestion" ) . "({
1125
+                            new " . ($answerType == HOT_SPOT ? "HotspotQuestion" : "DelineationQuestion")."({
1126 1126
                                 questionId: $questionId,
1127 1127
                                 exerciseId: $exerciseId,
1128 1128
                                 selector: '#hotspot-preview-$questionId',
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
             if ($answerType != HOT_SPOT_DELINEATION) {
1157 1157
                 $answerList = '
1158 1158
                     <div class="well well-sm">
1159
-                        <h5 class="page-header">' . get_lang('HotspotZones') . '</h5>
1159
+                        <h5 class="page-header">' . get_lang('HotspotZones').'</h5>
1160 1160
                         <ol>
1161 1161
                 ';
1162 1162
 
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
             if (!$only_questions) {
1182 1182
                 if ($show_title) {
1183 1183
                     TestCategory::displayCategoryAndTitle($objQuestionTmp->id);
1184
-                    echo '<div class="question_title">' . $current_item . '. ' . $questionName . '</div>';
1184
+                    echo '<div class="question_title">'.$current_item.'. '.$questionName.'</div>';
1185 1185
                 }
1186 1186
                 //@todo I need to the get the feedback type
1187 1187
                 echo <<<HOTSPOT
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
                                 <div class=\"hotspot-image\"></div>
1200 1200
                                 <script>
1201 1201
                                     $(document).on('ready', function () {
1202
-                                        new " . ($answerType == HOT_SPOT_DELINEATION ? 'DelineationQuestion' : 'HotspotQuestion') . "({
1202
+                                        new " . ($answerType == HOT_SPOT_DELINEATION ? 'DelineationQuestion' : 'HotspotQuestion')."({
1203 1203
                                             questionId: $questionId,
1204 1204
                                             exerciseId: $exe_id,
1205 1205
                                             selector: '#question_div_' + $questionId + ' .hotspot-image',
@@ -1318,11 +1318,11 @@  discard block
 block discarded – undo
1318 1318
         $lp_id = intval($lp_id);
1319 1319
         $lp_item_id = intval($lp_item_id);
1320 1320
         return
1321
-            api_get_course_int_id() . '_' .
1322
-            api_get_session_id() . '_' .
1323
-            $exercise_id . '_' .
1324
-            api_get_user_id() . '_' .
1325
-            $lp_id . '_' .
1321
+            api_get_course_int_id().'_'.
1322
+            api_get_session_id().'_'.
1323
+            $exercise_id.'_'.
1324
+            api_get_user_id().'_'.
1325
+            $lp_id.'_'.
1326 1326
             $lp_item_id;
1327 1327
     }
1328 1328
 
@@ -1434,14 +1434,14 @@  discard block
 block discarded – undo
1434 1434
         $res = Database::query($sql);
1435 1435
         $result = array();
1436 1436
         $apiIsAllowedToEdit = api_is_allowed_to_edit();
1437
-        $urlBase = api_get_path(WEB_CODE_PATH) .
1438
-            'exercice/hotpotatoes_exercise_report.php?action=delete&' .
1439
-            api_get_cidreq() . '&id=';
1437
+        $urlBase = api_get_path(WEB_CODE_PATH).
1438
+            'exercice/hotpotatoes_exercise_report.php?action=delete&'.
1439
+            api_get_cidreq().'&id=';
1440 1440
         while ($data = Database::fetch_array($res)) {
1441 1441
             $actions = null;
1442 1442
 
1443 1443
             if ($apiIsAllowedToEdit) {
1444
-                $url = $urlBase . $data['id'] . '&path=' . $data['exe_name'];
1444
+                $url = $urlBase.$data['id'].'&path='.$data['exe_name'];
1445 1445
                 $actions = Display::url(
1446 1446
                     Display::return_icon('delete.png', get_lang('Delete')),
1447 1447
                     $url
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
                     GroupManager::get_user_group_name($data['user_id'])
1458 1458
                 ),
1459 1459
                 'exe_date' => $data['exe_date'],
1460
-                'score' => $data['exe_result'] . ' / ' . $data['exe_weighting'],
1460
+                'score' => $data['exe_result'].' / '.$data['exe_weighting'],
1461 1461
                 'actions' => $actions,
1462 1462
             );
1463 1463
         }
@@ -1540,18 +1540,18 @@  discard block
 block discarded – undo
1540 1540
         $TBL_TRACK_HOTPOTATOES = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
1541 1541
         $TBL_TRACK_ATTEMPT_RECORDING = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
1542 1542
 
1543
-        $session_id_and = ' AND te.session_id = ' . $sessionId . ' ';
1543
+        $session_id_and = ' AND te.session_id = '.$sessionId.' ';
1544 1544
         $exercise_id = intval($exercise_id);
1545 1545
 
1546 1546
         $exercise_where = '';
1547 1547
         if (!empty($exercise_id)) {
1548
-            $exercise_where .= ' AND te.exe_exo_id = ' . $exercise_id . '  ';
1548
+            $exercise_where .= ' AND te.exe_exo_id = '.$exercise_id.'  ';
1549 1549
         }
1550 1550
 
1551 1551
         $hotpotatoe_where = '';
1552 1552
         if (!empty($_GET['path'])) {
1553 1553
             $hotpotatoe_path = Database::escape_string($_GET['path']);
1554
-            $hotpotatoe_where .= ' AND exe_name = "' . $hotpotatoe_path . '"  ';
1554
+            $hotpotatoe_where .= ' AND exe_name = "'.$hotpotatoe_path.'"  ';
1555 1555
         }
1556 1556
 
1557 1557
         // sql for chamilo-type tests for teacher / tutor view
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
             WHERE
1564 1564
                 c_id = $course_id AND
1565 1565
                 exe_exo_id = $exercise_id AND
1566
-                ttte.session_id = " . $sessionId . "
1566
+                ttte.session_id = ".$sessionId."
1567 1567
         )";
1568 1568
 
1569 1569
         if ($is_allowedToEdit) {
@@ -1586,9 +1586,9 @@  discard block
 block discarded – undo
1586 1586
                         g.id as group_id
1587 1587
                     FROM $TBL_USER u
1588 1588
                     INNER JOIN $TBL_GROUP_REL_USER gru
1589
-                    ON (gru.user_id = u.user_id AND gru.c_id=" . $course_id . ")
1589
+                    ON (gru.user_id = u.user_id AND gru.c_id=".$course_id.")
1590 1590
                     INNER JOIN $TBL_GROUP g
1591
-                    ON (gru.group_id = g.id AND g.c_id=" . $course_id . ")
1591
+                    ON (gru.group_id = g.id AND g.c_id=".$course_id.")
1592 1592
                 )";
1593 1593
             }
1594 1594
 
@@ -1650,9 +1650,9 @@  discard block
 block discarded – undo
1650 1650
                     g.id as group_id
1651 1651
                 FROM $TBL_USER u
1652 1652
                 LEFT OUTER JOIN $TBL_GROUP_REL_USER gru
1653
-                ON ( gru.user_id = u.user_id AND gru.c_id=" . $course_id . " )
1653
+                ON ( gru.user_id = u.user_id AND gru.c_id=".$course_id." )
1654 1654
                 LEFT OUTER JOIN $TBL_GROUP g
1655
-                ON (gru.group_id = g.id AND g.c_id = " . $course_id . ")
1655
+                ON (gru.group_id = g.id AND g.c_id = ".$course_id.")
1656 1656
             )";
1657 1657
             }
1658 1658
 
@@ -1665,12 +1665,12 @@  discard block
 block discarded – undo
1665 1665
             (
1666 1666
                 SELECT u.user_id, firstname, lastname, email, username, ' ' as group_name, '' as group_id, official_code
1667 1667
                 FROM $TBL_USER u
1668
-                WHERE u.status NOT IN(" . api_get_users_status_ignored_in_reports('string') . ")
1668
+                WHERE u.status NOT IN(".api_get_users_status_ignored_in_reports('string').")
1669 1669
             )";
1670 1670
             }
1671 1671
 
1672 1672
             $sqlFromOption = " , $TBL_GROUP_REL_USER AS gru ";
1673
-            $sqlWhereOption = "  AND gru.c_id = " . $course_id ." AND gru.user_id = user.user_id ";
1673
+            $sqlWhereOption = "  AND gru.c_id = ".$course_id." AND gru.user_id = user.user_id ";
1674 1674
             $first_and_last_name = api_is_western_name_order() ? "firstname, lastname" : "lastname, firstname";
1675 1675
 
1676 1676
             if ($get_count) {
@@ -1707,8 +1707,8 @@  discard block
 block discarded – undo
1707 1707
                 ON (user.user_id = exe_user_id)
1708 1708
                 WHERE
1709 1709
                     te.status != 'incomplete' AND
1710
-                    te.c_id = " . $course_id . " $session_id_and AND
1711
-                    ce.active <>-1 AND ce.c_id = " . $course_id . "
1710
+                    te.c_id = ".$course_id." $session_id_and AND
1711
+                    ce.active <>-1 AND ce.c_id = ".$course_id."
1712 1712
                     $exercise_where
1713 1713
                     $extra_where_conditions
1714 1714
                 ";
@@ -1735,12 +1735,12 @@  discard block
 block discarded – undo
1735 1735
                     $sqlFromOption
1736 1736
                 WHERE
1737 1737
                     user.user_id=tth.exe_user_id
1738
-                    AND tth.c_id = " . $course_id . "
1738
+                    AND tth.c_id = ".$course_id."
1739 1739
                     $hotpotatoe_where
1740 1740
                     $sqlWhereOption
1741
-                    AND user.status NOT IN(" . api_get_users_status_ignored_in_reports(
1741
+                    AND user.status NOT IN(".api_get_users_status_ignored_in_reports(
1742 1742
                     'string'
1743
-                ) . ")
1743
+                ).")
1744 1744
                 ORDER BY
1745 1745
                     tth.c_id ASC,
1746 1746
                     tth.exe_date DESC";
@@ -1813,12 +1813,12 @@  discard block
 block discarded – undo
1813 1813
 
1814 1814
                     if ($from_gradebook && ($is_allowedToEdit)) {
1815 1815
                         if (in_array(
1816
-                            $results[$i]['username'] . $results[$i]['firstname'] . $results[$i]['lastname'],
1816
+                            $results[$i]['username'].$results[$i]['firstname'].$results[$i]['lastname'],
1817 1817
                             $users_array_id
1818 1818
                         )) {
1819 1819
                             continue;
1820 1820
                         }
1821
-                        $users_array_id[] = $results[$i]['username'] . $results[$i]['firstname'] . $results[$i]['lastname'];
1821
+                        $users_array_id[] = $results[$i]['username'].$results[$i]['firstname'].$results[$i]['lastname'];
1822 1822
                     }
1823 1823
 
1824 1824
                     $lp_obj = isset($results[$i]['orig_lp_id']) && isset($lp_list[$results[$i]['orig_lp_id']]) ? $lp_list[$results[$i]['orig_lp_id']] : null;
@@ -1827,8 +1827,8 @@  discard block
 block discarded – undo
1827 1827
                     if ($lp_obj) {
1828 1828
                         $url = api_get_path(
1829 1829
                                 WEB_CODE_PATH
1830
-                            ) . 'newscorm/lp_controller.php?' . api_get_cidreq(
1831
-                            ) . '&action=view&lp_id=' . $results[$i]['orig_lp_id'];
1830
+                            ).'newscorm/lp_controller.php?'.api_get_cidreq(
1831
+                            ).'&action=view&lp_id='.$results[$i]['orig_lp_id'];
1832 1832
                         $lp_name = Display::url(
1833 1833
                             $lp_obj['lp_name'],
1834 1834
                             $url,
@@ -1846,7 +1846,7 @@  discard block
 block discarded – undo
1846 1846
                         );
1847 1847
 
1848 1848
                         foreach ($group_list as $id) {
1849
-                            $group_name_list .= $clean_group_list[$id] . '<br/>';
1849
+                            $group_name_list .= $clean_group_list[$id].'<br/>';
1850 1850
                         }
1851 1851
                         $results[$i]['group_name'] = $group_name_list;
1852 1852
                     }
@@ -1902,8 +1902,8 @@  discard block
 block discarded – undo
1902 1902
                                 }
1903 1903
                             }
1904 1904
                             if ($revised) {
1905
-                                $actions .= "<a href='exercise_show.php?" . api_get_cidreq(
1906
-                                    ) . "&action=edit&id=$id'>" .
1905
+                                $actions .= "<a href='exercise_show.php?".api_get_cidreq(
1906
+                                    )."&action=edit&id=$id'>".
1907 1907
                                     Display:: return_icon(
1908 1908
                                         'edit.png',
1909 1909
                                         get_lang('Edit'),
@@ -1912,8 +1912,8 @@  discard block
 block discarded – undo
1912 1912
                                     );
1913 1913
                                 $actions .= '&nbsp;';
1914 1914
                             } else {
1915
-                                $actions .= "<a href='exercise_show.php?" . api_get_cidreq(
1916
-                                    ) . "&action=qualify&id=$id'>" .
1915
+                                $actions .= "<a href='exercise_show.php?".api_get_cidreq(
1916
+                                    )."&action=qualify&id=$id'>".
1917 1917
                                     Display:: return_icon(
1918 1918
                                         'quiz.gif',
1919 1919
                                         get_lang('Qualify')
@@ -1923,12 +1923,12 @@  discard block
 block discarded – undo
1923 1923
                             $actions .= "</a>";
1924 1924
 
1925 1925
                             if ($filter == 2) {
1926
-                                $actions .= ' <a href="exercise_history.php?' . api_get_cidreq(
1927
-                                    ) . '&exe_id=' . $id . '">' .
1926
+                                $actions .= ' <a href="exercise_history.php?'.api_get_cidreq(
1927
+                                    ).'&exe_id='.$id.'">'.
1928 1928
                                     Display:: return_icon(
1929 1929
                                         'history.gif',
1930 1930
                                         get_lang('ViewHistoryChange')
1931
-                                    ) . '</a>';
1931
+                                    ).'</a>';
1932 1932
                             }
1933 1933
 
1934 1934
                             //Admin can always delete the attempt
@@ -1940,35 +1940,35 @@  discard block
 block discarded – undo
1940 1940
                                     date('Y-m-d h:i:s'),
1941 1941
                                     false
1942 1942
                                 );
1943
-                                $actions .= '<a href="http://www.whatsmyip.org/ip-geo-location/?ip=' . $ip . '" target="_blank"><img src="' . api_get_path(
1943
+                                $actions .= '<a href="http://www.whatsmyip.org/ip-geo-location/?ip='.$ip.'" target="_blank"><img src="'.api_get_path(
1944 1944
                                         WEB_CODE_PATH
1945
-                                    ) . 'img/icons/22/info.png" title="' . $ip . '" /></a>';
1945
+                                    ).'img/icons/22/info.png" title="'.$ip.'" /></a>';
1946 1946
 
1947
-                                $delete_link = '<a href="exercise_report.php?' . api_get_cidreq(
1948
-                                    ) . '&filter_by_user=' . intval(
1947
+                                $delete_link = '<a href="exercise_report.php?'.api_get_cidreq(
1948
+                                    ).'&filter_by_user='.intval(
1949 1949
                                         $_GET['filter_by_user']
1950
-                                    ) . '&filter=' . $filter . '&exerciseId=' . $exercise_id . '&delete=delete&did=' . $id . '"
1950
+                                    ).'&filter='.$filter.'&exerciseId='.$exercise_id.'&delete=delete&did='.$id.'"
1951 1951
                                 onclick="javascript:if(!confirm(\'' . sprintf(
1952 1952
                                         get_lang('DeleteAttempt'),
1953 1953
                                         $results[$i]['username'],
1954 1954
                                         $dt
1955
-                                    ) . '\')) return false;">' . Display:: return_icon(
1955
+                                    ).'\')) return false;">'.Display:: return_icon(
1956 1956
                                         'delete.png',
1957 1957
                                         get_lang('Delete')
1958
-                                    ) . '</a>';
1958
+                                    ).'</a>';
1959 1959
                                 $delete_link = utf8_encode($delete_link);
1960 1960
 
1961 1961
                                 if (api_is_drh() && !api_is_platform_admin()) {
1962 1962
                                     $delete_link = null;
1963 1963
                                 }
1964
-                                $actions .= $delete_link . '&nbsp;';
1964
+                                $actions .= $delete_link.'&nbsp;';
1965 1965
                             }
1966 1966
 
1967 1967
                         } else {
1968 1968
                             $attempt_url = api_get_path(
1969 1969
                                     WEB_CODE_PATH
1970
-                                ) . 'exercice/result.php?' . api_get_cidreq(
1971
-                                ) . '&id=' . $results[$i]['exe_id'] . '&id_session=' . $sessionId;
1970
+                                ).'exercice/result.php?'.api_get_cidreq(
1971
+                                ).'&id='.$results[$i]['exe_id'].'&id_session='.$sessionId;
1972 1972
                             $attempt_link = Display::url(
1973 1973
                                 get_lang('Show'),
1974 1974
                                 $attempt_url,
@@ -2025,7 +2025,7 @@  discard block
 block discarded – undo
2025 2025
                     $hp_result = round(
2026 2026
                             ($hpresults[$i][4] / ($hpresults[$i][5] != 0 ? $hpresults[$i][5] : 1)) * 100,
2027 2027
                             2
2028
-                        ) . '% (' . $hpresults[$i][4] . ' / ' . $hpresults[$i][5] . ')';
2028
+                        ).'% ('.$hpresults[$i][4].' / '.$hpresults[$i][5].')';
2029 2029
                     if ($is_allowedToEdit) {
2030 2030
                         $list_info[] = array(
2031 2031
                             $hpresults[$i][0],
@@ -2098,13 +2098,13 @@  discard block
 block discarded – undo
2098 2098
 
2099 2099
         $html = null;
2100 2100
         if ($show_percentage) {
2101
-            $parent = '(' . $score . ' / ' . $weight . ')';
2102
-            $html = $percentage . "%  $parent";
2101
+            $parent = '('.$score.' / '.$weight.')';
2102
+            $html = $percentage."%  $parent";
2103 2103
             if ($show_only_percentage) {
2104
-                $html = $percentage . "% ";
2104
+                $html = $percentage."% ";
2105 2105
             }
2106 2106
         } else {
2107
-            $html = $score . ' / ' . $weight;
2107
+            $html = $score.' / '.$weight;
2108 2108
         }
2109 2109
         $html = Display::span($html, array('class' => 'score_exercise'));
2110 2110
 
@@ -2198,7 +2198,7 @@  discard block
 block discarded – undo
2198 2198
     {
2199 2199
         $return = '-';
2200 2200
         if ($value != '') {
2201
-            $return = float_format($value * 100, 1) . ' %';
2201
+            $return = float_format($value * 100, 1).' %';
2202 2202
         }
2203 2203
         return $return;
2204 2204
     }
@@ -2276,7 +2276,7 @@  discard block
 block discarded – undo
2276 2276
         }
2277 2277
 
2278 2278
         $needle_where = !empty($search) ? " AND title LIKE '?' " : '';
2279
-        $needle = !empty($search) ? "%" . $search . "%" : '';
2279
+        $needle = !empty($search) ? "%".$search."%" : '';
2280 2280
 
2281 2281
         // Show courses by active status
2282 2282
         $active_sql = '';
@@ -2291,7 +2291,7 @@  discard block
 block discarded – undo
2291 2291
         if ($search_all_sessions == true) {
2292 2292
             $conditions = array(
2293 2293
                 'where' => array(
2294
-                    $active_sql . ' c_id = ? ' . $needle_where . $time_conditions => array(
2294
+                    $active_sql.' c_id = ? '.$needle_where.$time_conditions => array(
2295 2295
                         $course_id,
2296 2296
                         $needle
2297 2297
                     )
@@ -2302,7 +2302,7 @@  discard block
 block discarded – undo
2302 2302
             if ($session_id == 0) {
2303 2303
                 $conditions = array(
2304 2304
                     'where' => array(
2305
-                        $active_sql . ' session_id = ? AND c_id = ? ' . $needle_where . $time_conditions => array(
2305
+                        $active_sql.' session_id = ? AND c_id = ? '.$needle_where.$time_conditions => array(
2306 2306
                             $session_id,
2307 2307
                             $course_id,
2308 2308
                             $needle
@@ -2313,7 +2313,7 @@  discard block
 block discarded – undo
2313 2313
             } else {
2314 2314
                 $conditions = array(
2315 2315
                     'where' => array(
2316
-                        $active_sql . ' (session_id = 0 OR session_id = ? ) AND c_id = ? ' . $needle_where . $time_conditions => array(
2316
+                        $active_sql.' (session_id = 0 OR session_id = ? ) AND c_id = ? '.$needle_where.$time_conditions => array(
2317 2317
                             $session_id,
2318 2318
                             $course_id,
2319 2319
                             $needle
@@ -2492,7 +2492,7 @@  discard block
 block discarded – undo
2492 2492
 
2493 2493
             if ($return_string) {
2494 2494
                 if (!empty($position) && !empty($my_ranking)) {
2495
-                    $return_value = $position . '/' . count($my_ranking);
2495
+                    $return_value = $position.'/'.count($my_ranking);
2496 2496
                 } else {
2497 2497
                     $return_value = '-';
2498 2498
                 }
@@ -2572,7 +2572,7 @@  discard block
 block discarded – undo
2572 2572
 
2573 2573
             if ($return_string) {
2574 2574
                 if (!empty($position) && !empty($my_ranking)) {
2575
-                    return $position . '/' . count($my_ranking);
2575
+                    return $position.'/'.count($my_ranking);
2576 2576
                 }
2577 2577
             }
2578 2578
             return $return_value;
@@ -2972,7 +2972,7 @@  discard block
 block discarded – undo
2972 2972
             $courseCondition = "
2973 2973
             INNER JOIN $courseUser cu
2974 2974
             ON cu.c_id = c.id AND cu.user_id  = exe_user_id";
2975
-            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = " . STUDENT;
2975
+            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = ".STUDENT;
2976 2976
         } else {
2977 2977
             $courseCondition = "
2978 2978
             INNER JOIN $courseUserSession cu
@@ -3047,7 +3047,7 @@  discard block
 block discarded – undo
3047 3047
             $courseCondition = "
3048 3048
             INNER JOIN $courseUser cu
3049 3049
             ON cu.c_id = c.id AND cu.user_id  = exe_user_id";
3050
-            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = " . STUDENT;
3050
+            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = ".STUDENT;
3051 3051
         } else {
3052 3052
             $courseCondition = "
3053 3053
             INNER JOIN $courseUserSession cu
@@ -3139,7 +3139,7 @@  discard block
 block discarded – undo
3139 3139
             $courseCondition = "
3140 3140
             INNER JOIN $courseUser cu
3141 3141
             ON cu.c_id = c.id AND cu.user_id  = exe_user_id";
3142
-            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = " . STUDENT;
3142
+            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = ".STUDENT;
3143 3143
         } else {
3144 3144
             $courseCondition = "
3145 3145
             INNER JOIN $courseUserSession cu
@@ -3321,7 +3321,7 @@  discard block
 block discarded – undo
3321 3321
                 }
3322 3322
             }
3323 3323
             // adds the correct word, followed by ] to close the blank
3324
-            $answer .= ' / <font color="green"><b>' . $real_correct_tags[$i] . '</b></font>]';
3324
+            $answer .= ' / <font color="green"><b>'.$real_correct_tags[$i].'</b></font>]';
3325 3325
             if (isset ($real_text[$i + 1])) {
3326 3326
                 $answer .= $real_text[$i + 1];
3327 3327
             }
@@ -3380,13 +3380,13 @@  discard block
 block discarded – undo
3380 3380
         // check the default value of option
3381 3381
         $tabSelected = array($in_default => " selected='selected' ");
3382 3382
         $res = "";
3383
-        $res .= "<select name='$in_name' id='$in_name' onchange='" . $in_onchange . "' >";
3384
-        $res .= "<option value='-1'" . $tabSelected["-1"] . ">-- " . get_lang(
3383
+        $res .= "<select name='$in_name' id='$in_name' onchange='".$in_onchange."' >";
3384
+        $res .= "<option value='-1'".$tabSelected["-1"].">-- ".get_lang(
3385 3385
                 'AllGroups'
3386
-            ) . " --</option>";
3387
-        $res .= "<option value='0'" . $tabSelected["0"] . ">- " . get_lang(
3386
+            )." --</option>";
3387
+        $res .= "<option value='0'".$tabSelected["0"].">- ".get_lang(
3388 3388
                 'NotInAGroup'
3389
-            ) . " -</option>";
3389
+            )." -</option>";
3390 3390
         $tabGroups = GroupManager::get_group_list();
3391 3391
         $currentCatId = 0;
3392 3392
         for ($i = 0; $i < count($tabGroups); $i++) {
@@ -3394,10 +3394,10 @@  discard block
 block discarded – undo
3394 3394
                 $tabGroups[$i]["id"]
3395 3395
             );
3396 3396
             if ($tabCategory["id"] != $currentCatId) {
3397
-                $res .= "<option value='-1' disabled='disabled'>" . $tabCategory["title"] . "</option>";
3397
+                $res .= "<option value='-1' disabled='disabled'>".$tabCategory["title"]."</option>";
3398 3398
                 $currentCatId = $tabCategory["id"];
3399 3399
             }
3400
-            $res .= "<option " . $tabSelected[$tabGroups[$i]["id"]] . "style='margin-left:40px' value='" . $tabGroups[$i]["id"] . "'>" . $tabGroups[$i]["name"] . "</option>";
3400
+            $res .= "<option ".$tabSelected[$tabGroups[$i]["id"]]."style='margin-left:40px' value='".$tabGroups[$i]["id"]."'>".$tabGroups[$i]["name"]."</option>";
3401 3401
         }
3402 3402
         $res .= "</select>";
3403 3403
         return $res;
@@ -3602,14 +3602,14 @@  discard block
 block discarded – undo
3602 3602
                 if ($show_results) {
3603 3603
                     $comnt = Event::get_comments($exe_id, $questionId);
3604 3604
                     if (!empty($comnt)) {
3605
-                        echo '<b>' . get_lang('Feedback') . '</b>';
3606
-                        echo '<div id="question_feedback">' . $comnt . '</div>';
3605
+                        echo '<b>'.get_lang('Feedback').'</b>';
3606
+                        echo '<div id="question_feedback">'.$comnt.'</div>';
3607 3607
                     }
3608 3608
                 }
3609 3609
 
3610 3610
                 if ($show_results) {
3611 3611
                     $score = array(
3612
-                        'result' => get_lang('Score') . " : " . self::show_score(
3612
+                        'result' => get_lang('Score')." : ".self::show_score(
3613 3613
                                 $my_total_score,
3614 3614
                                 $my_total_weight,
3615 3615
                                 false,
@@ -3683,13 +3683,13 @@  discard block
 block discarded – undo
3683 3683
         }
3684 3684
 
3685 3685
         if ($show_all_but_expected_answer) {
3686
-            $exercise_content .= "<div class='normal-message'>" . get_lang(
3686
+            $exercise_content .= "<div class='normal-message'>".get_lang(
3687 3687
                     "ExerciseWithFeedbackWithoutCorrectionComment"
3688
-                ) . "</div>";
3688
+                )."</div>";
3689 3689
         }
3690 3690
         // Remove audio auto play from questions on results page - refs BT#7939
3691 3691
         $exercise_content = preg_replace(
3692
-            ['/autoplay[\=\".+\"]+/','/autostart[\=\".+\"]+/'],
3692
+            ['/autoplay[\=\".+\"]+/', '/autostart[\=\".+\"]+/'],
3693 3693
             '',
3694 3694
             $exercise_content
3695 3695
         );
@@ -3783,11 +3783,11 @@  discard block
 block discarded – undo
3783 3783
                     $ribbon_total_success_or_error = ' ribbon-total-error';
3784 3784
                 }
3785 3785
             }
3786
-            $ribbon .= '<div class="total ' . $ribbon_total_success_or_error . '">';
3786
+            $ribbon .= '<div class="total '.$ribbon_total_success_or_error.'">';
3787 3787
         } else {
3788 3788
             $ribbon .= '<div class="total">';
3789 3789
         }
3790
-        $ribbon .= '<h3>' . get_lang('YourTotalScore') . ":&nbsp;";
3790
+        $ribbon .= '<h3>'.get_lang('YourTotalScore').":&nbsp;";
3791 3791
         $ribbon .= self::show_score($score, $weight, false, true);
3792 3792
         $ribbon .= '</h3>';
3793 3793
         $ribbon .= '</div>';
Please login to merge, or discard this patch.
main/inc/lib/exercise_show_functions.lib.php 4 patches
Doc Comments   +38 added lines patch added patch discarded remove patch
@@ -24,6 +24,10 @@  discard block
 block discarded – undo
24 24
 	 * @param int       Question ID
25 25
      * @param int $resultsDisabled
26 26
      * @param string $originalStudentAnswer
27
+     * @param integer $feedbackType
28
+     * @param string $answer
29
+     * @param integer $id
30
+     * @param integer $questionId
27 31
 	 * @return void
28 32
 	 */
29 33
 	public static function display_fill_in_blanks_answer($feedbackType, $answer, $id, $questionId, $resultsDisabled, $originalStudentAnswer = '')
@@ -62,6 +66,10 @@  discard block
 block discarded – undo
62 66
      * @param string    Answer text
63 67
      * @param int       Exercise ID
64 68
      * @param int       Question ID
69
+     * @param integer $feedback_type
70
+     * @param string $answer
71
+     * @param integer $id
72
+     * @param integer $questionId
65 73
      * @return void
66 74
      */
67 75
     static function display_calculated_answer($feedback_type, $answer, $id, $questionId)
@@ -95,6 +103,9 @@  discard block
 block discarded – undo
95 103
 	 * @param string    Answer text
96 104
 	 * @param int       Exercise ID
97 105
 	 * @param int       Question ID
106
+	 * @param integer $feedback_type
107
+	 * @param integer $exe_id
108
+	 * @param integer $questionId
98 109
 	 * @return void
99 110
 	 */
100 111
 	static function display_free_answer($feedback_type, $answer, $exe_id, $questionId, $questionScore = null)
@@ -117,6 +128,12 @@  discard block
 block discarded – undo
117 128
         }
118 129
 	}
119 130
 
131
+	/**
132
+	 * @param integer $feedback_type
133
+	 * @param integer $id
134
+	 * @param integer $questionId
135
+	 * @param Nanogong $nano
136
+	 */
120 137
 	static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $nano = null)
121 138
     {
122 139
         if (isset($nano)) {
@@ -158,6 +175,7 @@  discard block
 block discarded – undo
158 175
 	 * @param string $answer
159 176
 	 * @param string $studentChoice
160 177
 	 * @param string $answerComment
178
+	 * @param integer $feedback_type
161 179
 	 */
162 180
 	static function display_hotspot_answer($feedback_type, $answerId, $answer, $studentChoice, $answerComment, $in_results_disabled)
163 181
 	 {
@@ -224,6 +242,12 @@  discard block
 block discarded – undo
224 242
 	 * @param integer Exercise ID
225 243
 	 * @param integer Question ID
226 244
 	 * @param boolean Whether to show the answer comment or not
245
+	 * @param integer $answerType
246
+	 * @param string $answer
247
+	 * @param string $answerComment
248
+	 * @param integer $answerCorrect
249
+	 * @param integer $id
250
+	 * @param integer $questionId
227 251
 	 * @return void
228 252
 	 */
229 253
 	static function display_unique_or_multiple_answer(
@@ -308,6 +332,13 @@  discard block
 block discarded – undo
308 332
      * @param integer Exercise ID
309 333
      * @param integer Question ID
310 334
      * @param boolean Whether to show the answer comment or not
335
+     * @param integer $feedback_type
336
+     * @param integer $answerType
337
+     * @param string $answer
338
+     * @param string $answerComment
339
+     * @param integer $answerCorrect
340
+     * @param integer $id
341
+     * @param integer $questionId
311 342
      * @return void
312 343
      */
313 344
     static function display_multiple_answer_true_false(
@@ -398,6 +429,13 @@  discard block
 block discarded – undo
398 429
      * @param integer Exercise ID
399 430
      * @param integer Question ID
400 431
      * @param boolean Whether to show the answer comment or not
432
+     * @param integer $feedback_type
433
+     * @param integer $answerType
434
+     * @param string $answer
435
+     * @param string $answerComment
436
+     * @param integer $answerCorrect
437
+     * @param integer $id
438
+     * @param integer $questionId
401 439
      * @return void
402 440
      */
403 441
     static function display_multiple_answer_combination_true_false(
Please login to merge, or discard this patch.
Indentation   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -12,21 +12,21 @@  discard block
 block discarded – undo
12 12
 * @todo convert queries to use Database API
13 13
 */
14 14
 /**
15
- * Class
16
- * @package chamilo.library
17
- */
15
+     * Class
16
+     * @package chamilo.library
17
+     */
18 18
 class ExerciseShowFunctions
19 19
 {
20
-	/**
21
-	 * Shows the answer to a fill-in-the-blanks question, as HTML
22
-	 * @param string    Answer text
23
-	 * @param int       Exercise ID
24
-	 * @param int       Question ID
20
+    /**
21
+     * Shows the answer to a fill-in-the-blanks question, as HTML
22
+     * @param string    Answer text
23
+     * @param int       Exercise ID
24
+     * @param int       Question ID
25 25
      * @param int $resultsDisabled
26 26
      * @param string $originalStudentAnswer
27
-	 * @return void
28
-	 */
29
-	public static function display_fill_in_blanks_answer($feedbackType, $answer, $id, $questionId, $resultsDisabled, $originalStudentAnswer = '')
27
+     * @return void
28
+     */
29
+    public static function display_fill_in_blanks_answer($feedbackType, $answer, $id, $questionId, $resultsDisabled, $originalStudentAnswer = '')
30 30
     {
31 31
         $answerHTML = FillBlanks::getHtmlDisplayForAnswer($answer, $resultsDisabled);
32 32
         if (strpos($originalStudentAnswer, 'font color') !== false) {
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             </tr>
56 56
         <?php
57 57
         }
58
-	}
58
+    }
59 59
 
60 60
     /**
61 61
      * Shows the answer to a calculated question, as HTML
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
         }
91 91
     }
92 92
 
93
-	/**
94
-	 * Shows the answer to a free-answer question, as HTML
95
-	 * @param string    Answer text
96
-	 * @param int       Exercise ID
97
-	 * @param int       Question ID
98
-	 * @return void
99
-	 */
100
-	static function display_free_answer($feedback_type, $answer, $exe_id, $questionId, $questionScore = null)
93
+    /**
94
+     * Shows the answer to a free-answer question, as HTML
95
+     * @param string    Answer text
96
+     * @param int       Exercise ID
97
+     * @param int       Question ID
98
+     * @return void
99
+     */
100
+    static function display_free_answer($feedback_type, $answer, $exe_id, $questionId, $questionScore = null)
101 101
     {
102 102
         $comments = Event::get_comments($exe_id, $questionId);
103 103
 
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
                 echo '</tr>';
116 116
             }
117 117
         }
118
-	}
118
+    }
119 119
 
120
-	static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $nano = null)
120
+    static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $nano = null)
121 121
     {
122 122
         if (isset($nano)) {
123 123
             echo $nano->show_audio_file();
@@ -151,22 +151,22 @@  discard block
 block discarded – undo
151 151
         }
152 152
     }
153 153
 
154
-	/**
155
-	 * Displays the answer to a hotspot question
156
-	 *
157
-	 * @param int $answerId
158
-	 * @param string $answer
159
-	 * @param string $studentChoice
160
-	 * @param string $answerComment
161
-	 */
162
-	static function display_hotspot_answer($feedback_type, $answerId, $answer, $studentChoice, $answerComment, $in_results_disabled)
163
-	 {
154
+    /**
155
+     * Displays the answer to a hotspot question
156
+     *
157
+     * @param int $answerId
158
+     * @param string $answer
159
+     * @param string $studentChoice
160
+     * @param string $answerComment
161
+     */
162
+    static function display_hotspot_answer($feedback_type, $answerId, $answer, $studentChoice, $answerComment, $in_results_disabled)
163
+        {
164 164
         $hide_expected_answer = false;
165 165
         if ($feedback_type == 0 && $in_results_disabled == 2) {
166 166
             $hide_expected_answer = true;
167 167
         }
168 168
 
169
-		$hotspot_colors = array(
169
+        $hotspot_colors = array(
170 170
             "", // $i starts from 1 on next loop (ugly fix)
171 171
             "#4271B5",
172 172
             "#FE8E16",
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             "#ED2024",
182 182
             "#3B3B3B",
183 183
             "#F7BDE2");
184
-		?>
184
+        ?>
185 185
 		<table class="data_table">
186 186
 		<tr>
187 187
             <td class="text-center" width="5%">
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
 			<td class="text-left" width="10%">
194 194
 				<?php
195 195
                 if (!$hide_expected_answer) {
196
-    				$my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault');
197
-    				echo $my_choice;
196
+                    $my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault');
197
+                    echo $my_choice;
198 198
                 }
199
-				?>
199
+                ?>
200 200
 			</td>
201 201
 			<?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
202 202
 			<td class="text-left" width="60%">
@@ -204,29 +204,29 @@  discard block
 block discarded – undo
204 204
                 if ($studentChoice) {
205 205
                     echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
206 206
                 }
207
-				?>
207
+                ?>
208 208
 			</td>
209 209
 			<?php } else { ?>
210 210
 				<td class="text-left" width="60%">&nbsp;</td>
211 211
 			<?php } ?>
212 212
 		</tr>
213 213
 		<?php
214
-	}
214
+    }
215 215
 
216
-	/**
217
-	 * Display the answers to a multiple choice question
218
-	 * @param int $feedback_type Feedback type
219
-	 * @param integer Answer type
220
-	 * @param integer Student choice
221
-	 * @param string  Textual answer
222
-	 * @param string  Comment on answer
223
-	 * @param string  Correct answer comment
224
-	 * @param integer Exercise ID
225
-	 * @param integer Question ID
226
-	 * @param boolean Whether to show the answer comment or not
227
-	 * @return void
228
-	 */
229
-	static function display_unique_or_multiple_answer(
216
+    /**
217
+     * Display the answers to a multiple choice question
218
+     * @param int $feedback_type Feedback type
219
+     * @param integer Answer type
220
+     * @param integer Student choice
221
+     * @param string  Textual answer
222
+     * @param string  Comment on answer
223
+     * @param string  Correct answer comment
224
+     * @param integer Exercise ID
225
+     * @param integer Question ID
226
+     * @param boolean Whether to show the answer comment or not
227
+     * @return void
228
+     */
229
+    static function display_unique_or_multiple_answer(
230 230
         $feedback_type,
231 231
         $answerType,
232 232
         $studentChoice,
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         if ($feedback_type == 0 && $in_results_disabled == 2) {
244 244
             $hide_expected_answer = true;
245 245
         }
246
-		?>
246
+        ?>
247 247
 		<tr>
248 248
 		<td width="5%">
249 249
 			<img src="../img/<?php echo (in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION))) ? 'radio':'checkbox'; echo $studentChoice?'_on':'_off'; ?>.gif"
@@ -259,43 +259,43 @@  discard block
 block discarded – undo
259 259
 		</td>
260 260
 		<td width="40%">
261 261
 			<?php
262
-			echo $answer;
263
-			?>
262
+            echo $answer;
263
+            ?>
264 264
 		</td>
265 265
 
266 266
 		<?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
267 267
 		<td width="20%">
268 268
 			<?php
269 269
             if ($studentChoice) {
270
-				if ($answerCorrect) {
270
+                if ($answerCorrect) {
271 271
                     $color = 'green';
272
-					//echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
273
-				} else {
272
+                    //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
273
+                } else {
274 274
                     $color = 'black';
275 275
                     //echo '<span style="font-weight: bold; color: #FF0000;">'.nl2br($answerComment).'</span>';
276
-				}
276
+                }
277 277
                 echo '<span style="font-weight: bold; color: '.$color.';">'.nl2br($answerComment).'</span>';
278 278
 
279
-			} else {
280
-				if ($answerCorrect) {
281
-					//echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
282
-				} else {
279
+            } else {
280
+                if ($answerCorrect) {
281
+                    //echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
282
+                } else {
283 283
                     //echo '<span style="font-weight: normal; color: #000;">'.nl2br($answerComment).'</span>';
284
-				}
285
-			}
286
-			?>
284
+                }
285
+            }
286
+            ?>
287 287
 		</td>
288 288
 			<?php
289
-		    if ($ans==1) {
290
-		        $comm = Event::get_comments($id,$questionId);
291
-			}
292
-		    ?>
289
+            if ($ans==1) {
290
+                $comm = Event::get_comments($id,$questionId);
291
+            }
292
+            ?>
293 293
 		 <?php } else { ?>
294 294
 			<td>&nbsp;</td>
295 295
 		<?php } ?>
296 296
 		</tr>
297 297
 		<?php
298
-	}
298
+    }
299 299
 
300 300
     /**
301 301
      * Display the answers to a multiple choice question
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         if (isset($new_options[$studentChoice])) {
340 340
             echo get_lang($new_options[$studentChoice]['name']);
341 341
         } else {
342
-        	echo '-';
342
+            echo '-';
343 343
         }
344 344
 
345 345
         ?>
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
         <td width="5%">
348 348
         <?php
349 349
 
350
-		//Expected choice
350
+        //Expected choice
351 351
         if (!$hide_expected_answer) {
352 352
             if (isset($new_options[$answerCorrect])) {
353 353
                 echo get_lang($new_options[$answerCorrect]['name']);
@@ -387,19 +387,19 @@  discard block
 block discarded – undo
387 387
         <?php
388 388
     }
389 389
 
390
-     /**
391
-     * Display the answers to a multiple choice question
392
-     *
393
-     * @param integer Answer type
394
-     * @param integer Student choice
395
-     * @param string  Textual answer
396
-     * @param string  Comment on answer
397
-     * @param string  Correct answer comment
398
-     * @param integer Exercise ID
399
-     * @param integer Question ID
400
-     * @param boolean Whether to show the answer comment or not
401
-     * @return void
402
-     */
390
+        /**
391
+         * Display the answers to a multiple choice question
392
+         *
393
+         * @param integer Answer type
394
+         * @param integer Student choice
395
+         * @param string  Textual answer
396
+         * @param string  Comment on answer
397
+         * @param string  Correct answer comment
398
+         * @param integer Exercise ID
399
+         * @param integer Question ID
400
+         * @param boolean Whether to show the answer comment or not
401
+         * @return void
402
+         */
403 403
     static function display_multiple_answer_combination_true_false(
404 404
         $feedback_type,
405 405
         $answerType,
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         <tr>
421 421
         <td width="5%">
422 422
         <?php
423
-		//Your choice
423
+        //Your choice
424 424
         $question = new MultipleAnswerCombinationTrueFalse();
425 425
         if (isset($question->options[$studentChoice])) {
426 426
             echo $question->options[$studentChoice];
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
         </td>
432 432
         <td width="5%">
433 433
         <?php
434
-		//Expected choice
434
+        //Expected choice
435 435
         if (!$hide_expected_answer) {
436 436
             if (isset($question->options[$answerCorrect])) {
437 437
                 echo $question->options[$answerCorrect];
@@ -456,20 +456,20 @@  discard block
 block discarded – undo
456 456
             <?php
457 457
             //@todo replace this harcoded value
458 458
             if ($studentChoice) {
459
-                 $color = "black";
459
+                    $color = "black";
460 460
                 if ($studentChoice == $answerCorrect) {
461 461
                     $color = "green";
462 462
                 }
463 463
                 echo '<span style="font-weight: bold; color: '.$color.';">'.nl2br($answerComment).'</span>';
464 464
             }
465 465
             if ($studentChoice == 2 || $studentChoice == '') {
466
-            	//echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
466
+                //echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
467 467
             } else {
468
-				if ($studentChoice == $answerCorrect) {
469
-	            	//echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
470
-				} else {
468
+                if ($studentChoice == $answerCorrect) {
469
+                    //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
470
+                } else {
471 471
                     //echo '<span style="font-weight: bold; color: #FF0000;">'.nl2br($answerComment).'</span>';
472
-				}
472
+                }
473 473
             }
474 474
             ?>
475 475
         </td>
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                 </td>
46 46
 
47 47
                 <?php
48
-                if (!api_is_allowed_to_edit(null,true) && $feedbackType != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
48
+                if (!api_is_allowed_to_edit(null, true) && $feedbackType != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
49 49
                     <td>
50 50
                         <?php
51 51
                         $comm = Event::get_comments($id, $questionId);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     static function display_calculated_answer($feedback_type, $answer, $id, $questionId)
68 68
     {
69 69
         if (empty($id)) {
70
-            echo '<tr><td>'. (Security::remove_XSS($answer)).'</td></tr>';
70
+            echo '<tr><td>'.(Security::remove_XSS($answer)).'</td></tr>';
71 71
         } else {
72 72
         ?>
73 73
             <tr>
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
                 </td>
79 79
 
80 80
             <?php
81
-            if (!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
81
+            if (!api_is_allowed_to_edit(null, true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
82 82
                 <td>
83 83
                     <?php
84
-                    $comm = Event::get_comments($id,$questionId);
84
+                    $comm = Event::get_comments($id, $questionId);
85 85
                     ?>
86 86
                 </td>
87 87
             <?php } ?>
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             echo '</tr>';
130 130
             if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
131 131
                 echo '<tr>';
132
-                echo Display::tag('td',get_lang('notCorrectedYet'), array('width'=>'45%'));
132
+                echo Display::tag('td', get_lang('notCorrectedYet'), array('width'=>'45%'));
133 133
                 echo '</tr>';
134 134
             } else {
135 135
                 echo '<tr><td>&nbsp;</td></tr>';
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
             }
143 143
             echo '</td>';
144 144
 
145
-            if (!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
145
+            if (!api_is_allowed_to_edit(null, true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
146 146
                 echo '<td>';
147
-                $comm = Event::get_comments($id,$questionId);
147
+                $comm = Event::get_comments($id, $questionId);
148 148
                 echo '</td>';
149 149
             }
150 150
             echo '</tr>';
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 			<td class="text-left" width="10%">
194 194
 				<?php
195 195
                 if (!$hide_expected_answer) {
196
-    				$my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault');
196
+    				$my_choice = ($studentChoice) ? get_lang('Correct') : get_lang('Fault');
197 197
     				echo $my_choice;
198 198
                 }
199 199
 				?>
@@ -246,12 +246,12 @@  discard block
 block discarded – undo
246 246
 		?>
247 247
 		<tr>
248 248
 		<td width="5%">
249
-			<img src="../img/<?php echo (in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION))) ? 'radio':'checkbox'; echo $studentChoice?'_on':'_off'; ?>.gif"
249
+			<img src="../img/<?php echo (in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION))) ? 'radio' : 'checkbox'; echo $studentChoice ? '_on' : '_off'; ?>.gif"
250 250
 			border="0" alt="" />
251 251
 		</td>
252 252
 		<td width="5%">
253 253
             <?php if (!$hide_expected_answer) { ?>
254
-			    <img src="../img/<?php echo (in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION))) ? 'radio':'checkbox'; echo $answerCorrect?'_on':'_off'; ?>.gif" border="0" alt=" " />
254
+			    <img src="../img/<?php echo (in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION))) ? 'radio' : 'checkbox'; echo $answerCorrect ? '_on' : '_off'; ?>.gif" border="0" alt=" " />
255 255
             <?php }
256 256
             else {
257 257
                 echo "-";
@@ -286,8 +286,8 @@  discard block
 block discarded – undo
286 286
 			?>
287 287
 		</td>
288 288
 			<?php
289
-		    if ($ans==1) {
290
-		        $comm = Event::get_comments($id,$questionId);
289
+		    if ($ans == 1) {
290
+		        $comm = Event::get_comments($id, $questionId);
291 291
 			}
292 292
 		    ?>
293 293
 		 <?php } else { ?>
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         <td width="5%">
332 332
         <?php
333 333
 
334
-        $question 	 = new MultipleAnswerTrueFalse();
334
+        $question = new MultipleAnswerTrueFalse();
335 335
         $course_id   = api_get_course_int_id();
336 336
         $new_options = Question::readQuestionOption($questionId, $course_id);
337 337
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             ?>
377 377
         </td>
378 378
             <?php
379
-            if ($ans==1) {
379
+            if ($ans == 1) {
380 380
                 $comm = Event::get_comments($id, $questionId);
381 381
             }
382 382
             ?>
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
             ?>
475 475
         </td>
476 476
             <?php
477
-            if ($ans==1) {
478
-                $comm = Event::get_comments($id,$questionId);
477
+            if ($ans == 1) {
478
+                $comm = Event::get_comments($id, $questionId);
479 479
             }
480 480
             ?>
481 481
          <?php } else { ?>
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -252,8 +252,7 @@  discard block
 block discarded – undo
252 252
 		<td width="5%">
253 253
             <?php if (!$hide_expected_answer) { ?>
254 254
 			    <img src="../img/<?php echo (in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION))) ? 'radio':'checkbox'; echo $answerCorrect?'_on':'_off'; ?>.gif" border="0" alt=" " />
255
-            <?php }
256
-            else {
255
+            <?php } else {
257 256
                 echo "-";
258 257
             }?>
259 258
 		</td>
@@ -438,8 +437,7 @@  discard block
 block discarded – undo
438 437
             } else {
439 438
                 echo $question->options[2];
440 439
             }
441
-        }
442
-        else {
440
+        } else {
443 441
             echo '-';
444 442
         }
445 443
         ?>
Please login to merge, or discard this patch.
main/inc/lib/export.lib.inc.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @param string Name of common tag to place each line in
158 158
      * @param string Name of the root element. A root element should always be given.
159 159
      * @param string Encoding in which the data is provided
160
-     * @return void  Prompts the user for a file download
160
+     * @return boolean  Prompts the user for a file download
161 161
      */
162 162
     public static function export_complex_table_xml(
163 163
         $data,
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      * @param string $name
284 284
      * @param string $format
285 285
      *
286
-     * @return bool
286
+     * @return false|null
287 287
      */
288 288
     public static function htmlToOdt($html, $name, $format = 'odt')
289 289
     {
Please login to merge, or discard this patch.
Unused Use Statements   -6 removed lines patch added patch discarded remove patch
@@ -3,14 +3,8 @@
 block discarded – undo
3 3
 
4 4
 use Ddeboer\DataImport\Writer\ExcelWriter;
5 5
 use Ddeboer\DataImport\Writer\CsvWriter;
6
-use Ddeboer\DataImport\Workflow;
7
-
8
-use Ddeboer\DataImport\Reader\CsvReader;
9
-use Ddeboer\DataImport\Reader\ArrayReader;
10
-use Ddeboer\DataImport\Writer\ArrayWriter;
11 6
 use Chamilo\CoreBundle\Component\Editor\Connector;
12 7
 use Chamilo\CoreBundle\Component\Filesystem\Data;
13
-use ChamiloSession as Session;
14 8
 use MediaAlchemyst\Alchemyst;
15 9
 use MediaAlchemyst\DriversContainer;
16 10
 use Neutron\TemporaryFilesystem\Manager;
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
         DocumentManager::file_send_for_download($filePath, true, $filename.'.csv');
58 58
         exit;
59
-	}
59
+    }
60 60
 
61 61
     /**
62 62
      * Export tabular data to XLS-file
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         DocumentManager::file_send_for_download($filePath, true, $filename.'.xlsx');
81 81
         exit;
82
-	}
82
+    }
83 83
 
84 84
     /**
85 85
      * Export tabular data to XLS-file (as html table)
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
     }
113 113
 
114 114
     /**
115
-    * Export tabular data to XML-file
116
-    * @param array  Simple array of data to put in XML
117
-    * @param string Name of file to be given to the user
118
-    * @param string Name of common tag to place each line in
119
-    * @param string Name of the root element. A root element should always be given.
120
-    * @param string Encoding in which the data is provided
121
-    */
115
+     * Export tabular data to XML-file
116
+     * @param array  Simple array of data to put in XML
117
+     * @param string Name of file to be given to the user
118
+     * @param string Name of common tag to place each line in
119
+     * @param string Name of the root element. A root element should always be given.
120
+     * @param string Encoding in which the data is provided
121
+     */
122 122
     public static function arrayToXml(
123 123
         $data,
124 124
         $filename = 'export',
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         fclose($handle);
149 149
         DocumentManager :: file_send_for_download($file, true, $filename.'.xml');
150 150
         exit;
151
-	}
151
+    }
152 152
 
153 153
     /**
154 154
      * Export hierarchical tabular data to XML-file
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         foreach ($data as $row) {
198 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";
200
+                $string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
201 201
                 $string .= str_repeat("\t",$level).'</'.$row['name'].'>';
202 202
             } else {
203 203
                 $string .= $row['value'];
Please login to merge, or discard this patch.
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.
main/inc/lib/extra_field.lib.php 3 patches
Doc Comments   +8 added lines, -9 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     }
124 124
 
125 125
     /**
126
-     * @return array
126
+     * @return string[]
127 127
      */
128 128
     public static function getValidExtraFieldTypes()
129 129
     {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
     /**
201 201
      * @param array $conditions
202
-     * @param null  $order_field_options_by
202
+     * @param string  $order_field_options_by
203 203
      *
204 204
      * @return array
205 205
      */
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     /**
238 238
      * @param string $variable
239 239
      *
240
-     * @return array|bool
240
+     * @return integer
241 241
      */
242 242
     public function get_handler_field_info_by_field_variable($variable)
243 243
     {
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     /**
320 320
      * @param string $handler
321 321
      *
322
-     * @return array
322
+     * @return string[]
323 323
      */
324 324
     public static function get_extra_fields_by_handler($handler)
325 325
     {
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
     }
497 497
 
498 498
     /**
499
-     * @return array
499
+     * @return string[]
500 500
      */
501 501
     public function get_field_types()
502 502
     {
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
     /**
507 507
      * @param int $id
508 508
      *
509
-     * @return null
509
+     * @return string|null
510 510
      */
511 511
     public function get_field_type_by_id($id)
512 512
     {
@@ -691,7 +691,6 @@  discard block
 block discarded – undo
691 691
      * @param FormValidator $form
692 692
      * @param array $extraData
693 693
      * @param bool $admin_permissions
694
-     * @param int $user_id
695 694
      * @param array $extra
696 695
      * @param int $itemId
697 696
      * @param array $exclude variables of extra field to exclude
@@ -1592,7 +1591,7 @@  discard block
 block discarded – undo
1592 1591
     }
1593 1592
 
1594 1593
     /**
1595
-     * @return array
1594
+     * @return string[]
1596 1595
      */
1597 1596
     public function getJqgridColumnNames()
1598 1597
     {
@@ -1832,7 +1831,7 @@  discard block
 block discarded – undo
1832 1831
     }
1833 1832
 
1834 1833
     /**
1835
-     * @param array $columns
1834
+     * @param string[] $columns
1836 1835
      * @param array  $column_model
1837 1836
      * @param array  $extraFields
1838 1837
      * @return array
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         'changeable',
20 20
         'filter',
21 21
         'extra_field_type',
22
-         /* Enable this when field_loggeable is introduced as a table field (2.0)
22
+            /* Enable this when field_loggeable is introduced as a table field (2.0)
23 23
         'field_loggeable',
24 24
          */
25 25
         'created_at'
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
      * France:Paris;Bretagne;Marseilles;Lyon|Belgique:Bruxelles;Namur;Liège;Bruges|Peru:Lima;Piura;
524 524
      * into
525 525
      * array(
526
- *      'France' =>
526
+     *      'France' =>
527 527
      *      array('Paris', 'Bregtane', 'Marseilles'),
528 528
      *  'Belgique' =>
529 529
      *      array('Namur', 'Liège')
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 
1185 1185
                         if ($this->type == 'user') {
1186 1186
 
1187
-                           /* //the magic should be here
1187
+                            /* //the magic should be here
1188 1188
                             $user_tags = UserManager::get_user_tags($user_id, $field_details[0]);
1189 1189
 
1190 1190
                             $tag_list = '';
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
     );
27 27
 
28 28
     public $ops = array(
29
-        'eq' => '=',        //equal
30
-        'ne' => '<>',       //not equal
31
-        'lt' => '<',        //less than
32
-        'le' => '<=',       //less than or equal
33
-        'gt' => '>',        //greater than
34
-        'ge' => '>=',       //greater than or equal
35
-        'bw' => 'LIKE',     //begins with
29
+        'eq' => '=', //equal
30
+        'ne' => '<>', //not equal
31
+        'lt' => '<', //less than
32
+        'le' => '<=', //less than or equal
33
+        'gt' => '>', //greater than
34
+        'ge' => '>=', //greater than or equal
35
+        'bw' => 'LIKE', //begins with
36 36
         'bn' => 'NOT LIKE', //doesn't begin with
37
-        'in' => 'LIKE',     //is in
37
+        'in' => 'LIKE', //is in
38 38
         'ni' => 'NOT LIKE', //is not in
39
-        'ew' => 'LIKE',     //ends with
39
+        'ew' => 'LIKE', //ends with
40 40
         'en' => 'NOT LIKE', //doesn't end with
41
-        'cn' => 'LIKE',     //contains
41
+        'cn' => 'LIKE', //contains
42 42
         'nc' => 'NOT LIKE'  //doesn't contain
43 43
     );
44 44
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
      */
324 324
     public static function get_extra_fields_by_handler($handler)
325 325
     {
326
-        $types= array();
326
+        $types = array();
327 327
         $types[self::FIELD_TYPE_TEXT] = get_lang('FieldTypeText');
328 328
         $types[self::FIELD_TYPE_TEXTAREA] = get_lang('FieldTypeTextarea');
329 329
         $types[self::FIELD_TYPE_RADIO] = get_lang('FieldTypeRadio');
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
                         // chzn-select doesn't work for sessions??
963 963
                         $form->addElement(
964 964
                             'select',
965
-                            'extra_' . $field_details['variable'],
965
+                            'extra_'.$field_details['variable'],
966 966
                             $field_details['display_text'],
967 967
                             $options,
968 968
                             array('id' => 'extra_'.$field_details['variable'])
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
 
1022 1022
                         if (!$admin_permissions) {
1023 1023
                             if ($field_details['visible'] == 0) {
1024
-                                $form->freeze('extra_' . $field_details['variable']);
1024
+                                $form->freeze('extra_'.$field_details['variable']);
1025 1025
                             }
1026 1026
                         }
1027 1027
                         break;
@@ -1369,9 +1369,9 @@  discard block
 block discarded – undo
1369 1369
 
1370 1370
                         if (is_array($extraData) && array_key_exists($fieldVariable, $extraData)) {
1371 1371
 
1372
-                            if (file_exists(api_get_path(SYS_UPLOAD_PATH) . $extraData[$fieldVariable])) {
1372
+                            if (file_exists(api_get_path(SYS_UPLOAD_PATH).$extraData[$fieldVariable])) {
1373 1373
                                 $fieldTexts[] = Display::img(
1374
-                                    api_get_path(WEB_UPLOAD_PATH) . $extraData[$fieldVariable],
1374
+                                    api_get_path(WEB_UPLOAD_PATH).$extraData[$fieldVariable],
1375 1375
                                     $field_details['display_text'],
1376 1376
                                     array('width' => '300')
1377 1377
                                 );
@@ -1388,10 +1388,10 @@  discard block
 block discarded – undo
1388 1388
                         $form->applyFilter('extra_'.$field_details['variable'], 'stripslashes');
1389 1389
                         $form->applyFilter('extra_'.$field_details['variable'], 'trim');
1390 1390
 
1391
-                        $allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif');
1391
+                        $allowed_picture_types = array('jpg', 'jpeg', 'png', 'gif');
1392 1392
                         $form->addRule(
1393 1393
                             'extra_'.$field_details['variable'],
1394
-                            get_lang('OnlyImagesAllowed') . ' ('.implode(',', $allowed_picture_types).')',
1394
+                            get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')',
1395 1395
                             'filetype',
1396 1396
                             $allowed_picture_types
1397 1397
                         );
@@ -1433,10 +1433,10 @@  discard block
 block discarded – undo
1433 1433
                         if (is_array($extraData) &&
1434 1434
                             array_key_exists($fieldVariable, $extraData)
1435 1435
                         ) {
1436
-                            if (file_exists(api_get_path(SYS_UPLOAD_PATH) . $extraData[$fieldVariable])) {
1436
+                            if (file_exists(api_get_path(SYS_UPLOAD_PATH).$extraData[$fieldVariable])) {
1437 1437
                                 $fieldTexts[] = Display::url(
1438
-                                    api_get_path(WEB_UPLOAD_PATH) . $extraData[$fieldVariable],
1439
-                                    api_get_path(WEB_UPLOAD_PATH) . $extraData[$fieldVariable],
1438
+                                    api_get_path(WEB_UPLOAD_PATH).$extraData[$fieldVariable],
1439
+                                    api_get_path(WEB_UPLOAD_PATH).$extraData[$fieldVariable],
1440 1440
                                     array(
1441 1441
                                         'title' => $field_details['display_text'],
1442 1442
                                         'target' => '_blank'
@@ -1486,12 +1486,12 @@  discard block
 block discarded – undo
1486 1486
                             "extra_{$field_details['variable']}",
1487 1487
                             $field_details['display_text']
1488 1488
                         );
1489
-                        $form->applyFilter('extra_' . $field_details['variable'], 'stripslashes');
1489
+                        $form->applyFilter('extra_'.$field_details['variable'], 'stripslashes');
1490 1490
 
1491 1491
                         if (!$admin_permissions) {
1492 1492
                             if ($field_details['visible'] == 0) {
1493 1493
                                 $form->freeze(
1494
-                                    'extra_' . $field_details['variable']
1494
+                                    'extra_'.$field_details['variable']
1495 1495
                                 );
1496 1496
                             }
1497 1497
                         }
@@ -1502,13 +1502,13 @@  discard block
 block discarded – undo
1502 1502
                             $field_details['display_text']
1503 1503
                         );
1504 1504
                         $form->applyFilter(
1505
-                            'extra_' . $field_details['variable'],
1505
+                            'extra_'.$field_details['variable'],
1506 1506
                             'stripslashes'
1507 1507
                         );
1508 1508
                         if (!$admin_permissions) {
1509 1509
                             if ($field_details['visible'] == 0) {
1510 1510
                                 $form->freeze(
1511
-                                    'extra_' . $field_details['variable']
1511
+                                    'extra_'.$field_details['variable']
1512 1512
                                 );
1513 1513
                             }
1514 1514
                         }
@@ -1518,12 +1518,12 @@  discard block
 block discarded – undo
1518 1518
                             "extra_{$field_details['variable']}",
1519 1519
                             $field_details['display_text']
1520 1520
                         );
1521
-                        $form->applyFilter('extra_' . $field_details['variable'], 'stripslashes');
1521
+                        $form->applyFilter('extra_'.$field_details['variable'], 'stripslashes');
1522 1522
 
1523 1523
                         if (!$admin_permissions) {
1524 1524
                             if ($field_details['visible'] == 0) {
1525 1525
                                 $form->freeze(
1526
-                                    'extra_' . $field_details['variable']
1526
+                                    'extra_'.$field_details['variable']
1527 1527
                                 );
1528 1528
                             }
1529 1529
                         }
@@ -1534,13 +1534,13 @@  discard block
 block discarded – undo
1534 1534
                             $field_details['display_text']
1535 1535
                         );
1536 1536
                         $form->applyFilter(
1537
-                            'extra_' . $field_details['variable'],
1537
+                            'extra_'.$field_details['variable'],
1538 1538
                             'stripslashes'
1539 1539
                         );
1540 1540
                         if (!$admin_permissions) {
1541 1541
                             if ($field_details['visible'] == 0) {
1542 1542
                                 $form->freeze(
1543
-                                    'extra_' . $field_details['variable']
1543
+                                    'extra_'.$field_details['variable']
1544 1544
                                 );
1545 1545
                             }
1546 1546
                         }
@@ -2221,19 +2221,19 @@  discard block
 block discarded – undo
2221 2221
                         break;
2222 2222
                     }
2223 2223
 
2224
-                    if (!file_exists(api_get_path(SYS_UPLOAD_PATH) . $valueData['value'])) {
2224
+                    if (!file_exists(api_get_path(SYS_UPLOAD_PATH).$valueData['value'])) {
2225 2225
                         break;
2226 2226
                     }
2227 2227
 
2228 2228
                     $image = Display::img(
2229
-                        api_get_path(WEB_UPLOAD_PATH) . $valueData['value'],
2229
+                        api_get_path(WEB_UPLOAD_PATH).$valueData['value'],
2230 2230
                         $field['display_text'],
2231 2231
                         array('width' => '300')
2232 2232
                     );
2233 2233
 
2234 2234
                     $displayedValue = Display::url(
2235 2235
                         $image,
2236
-                        api_get_path(WEB_UPLOAD_PATH) . $valueData['value'],
2236
+                        api_get_path(WEB_UPLOAD_PATH).$valueData['value'],
2237 2237
                         array('target' => '_blank')
2238 2238
                     );
2239 2239
                     break;
@@ -2242,13 +2242,13 @@  discard block
 block discarded – undo
2242 2242
                         break;
2243 2243
                     }
2244 2244
 
2245
-                    if (!file_exists(api_get_path(SYS_UPLOAD_PATH) . $valueData['value'])) {
2245
+                    if (!file_exists(api_get_path(SYS_UPLOAD_PATH).$valueData['value'])) {
2246 2246
                         break;
2247 2247
                     }
2248 2248
 
2249 2249
                     $displayedValue = Display::url(
2250 2250
                         get_lang('Download'),
2251
-                        api_get_path(WEB_UPLOAD_PATH) . $valueData['value'],
2251
+                        api_get_path(WEB_UPLOAD_PATH).$valueData['value'],
2252 2252
                         array(
2253 2253
                             'title' => $field['display_text'],
2254 2254
                             'target' => '_blank'
Please login to merge, or discard this patch.
main/inc/lib/extra_field_value.lib.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     }
44 44
 
45 45
     /**
46
-     * @return ExtraField
46
+     * @return string
47 47
      */
48 48
     public function getExtraField()
49 49
     {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * This function is used with $extraField->addElements()
73 73
      * @param array $params array for the insertion into the *_field_values table
74 74
      *
75
-     * @return mixed false on empty params, void otherwise
75
+     * @return false|null false on empty params, void otherwise
76 76
      * @assert (array()) === false
77 77
      */
78 78
     public function saveFieldValues($params)
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
      * @param int $item_id Item ID (It could be a session_id, course_id or user_id)
501 501
      * @param int $field_id Field ID (the ID from the *_field table)
502 502
      * @param bool $transform Whether to transform the result to a human readable strings
503
-     * @return mixed A structured array with the field_id and field_value, or false on error
503
+     * @return string A structured array with the field_id and field_value, or false on error
504 504
      * @assert (-1,-1) === false
505 505
      */
506 506
     public function get_values_by_handler_and_field_id($item_id, $field_id, $transform = false)
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
      * @param int $item_id Item ID from the original table
594 594
      * @param string $field_variable The name of the field we are looking for
595 595
      * @param bool $transform
596
-     * @param bool $allVisibility
596
+     * @param bool $visibility
597 597
      *
598 598
      * @return mixed Array of results, or false on error or not found
599 599
      * @assert (-1,'') === false
Please login to merge, or discard this patch.
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   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                             break;
210 210
                     }
211 211
 
212
-                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png";
212
+                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png";
213 213
 
214 214
                     if (!file_exists($fileDir)) {
215 215
                         mkdir($fileDir, $dirPermissions, true);
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 
218 218
                     if ($value['error'] == 0) {
219 219
                         $imageExtraField = new Image($value['tmp_name']);
220
-                        $imageExtraField->send_image($fileDir . $fileName, -1, 'png');
220
+                        $imageExtraField->send_image($fileDir.$fileName, -1, 'png');
221 221
                         $newParams = array(
222 222
                             'item_id' => $params['item_id'],
223 223
                             'field_id' => $extraFieldInfo['id'],
224
-                            'value' => $fileDirStored . $fileName,
224
+                            'value' => $fileDirStored.$fileName,
225 225
                             'comment' => $comment
226 226
                         );
227 227
 
@@ -247,18 +247,18 @@  discard block
 block discarded – undo
247 247
                     }
248 248
 
249 249
                     $cleanedName = api_replace_dangerous_char($value['name']);
250
-                    $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName";
250
+                    $fileName = ExtraField::FIELD_TYPE_FILE."_{$params['item_id']}_$cleanedName";
251 251
                     if (!file_exists($fileDir)) {
252 252
                         mkdir($fileDir, $dirPermissions, true);
253 253
                     }
254 254
 
255 255
                     if ($value['error'] == 0) {
256
-                        moveUploadedFile($value, $fileDir . $fileName);
256
+                        moveUploadedFile($value, $fileDir.$fileName);
257 257
 
258 258
                         $new_params = array(
259 259
                             'item_id' => $params['item_id'],
260 260
                             'field_id' => $extraFieldInfo['id'],
261
-                            'value' => $fileDirStored . $fileName
261
+                            'value' => $fileDirStored.$fileName
262 262
                         );
263 263
 
264 264
                         if ($this->type !== 'session' && $this->type !== 'course') {
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
                 */
381 381
                 if (false) {
382 382
                     global $app;
383
-                    switch($this->type) {
383
+                    switch ($this->type) {
384 384
                         case 'question':
385 385
                             $extraFieldValue = new ChamiloLMS\Entity\QuestionFieldValues();
386 386
                             $extraFieldValue->setUserId(api_get_user_id());
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
                 */
443 443
                 if (false) {
444 444
                     global $app;
445
-                    switch($this->type) {
445
+                    switch ($this->type) {
446 446
                         case 'question':
447 447
                             $extraFieldValue = $app['orm.ems']['db_write']->getRepository('ChamiloLMS\Entity\QuestionFieldValues')->find($field_values['id']);
448 448
                             $extraFieldValue->setUserId(api_get_user_id());
Please login to merge, or discard this patch.