Completed
Push — master ( 5da9ea...eef579 )
by Angel Fernando Quiroz
50:18 queued 17:36
created
main/inc/lib/table_sort.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 	 * @param string $direction The direction to sort (SORT_ASC (default) orSORT_DESC)
81 81
 	 * @param array $column_show The columns that we will show in the table i.e: $column_show = array('1','0','1') we will show the 1st and the 3th column.
82 82
 	 * @param array $column_order Changes how the columns will be sorted ie. $column_order = array('0','3','2','3') The column [1] will be sorted like the column [3]
83
-	 * @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE)
83
+	 * @param integer $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE)
84 84
 	 * @return array The sorted dataset
85 85
 	 * @author [email protected]
86 86
 	 */
Please login to merge, or discard this patch.
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
 class TableSort
16 16
 {
17 17
     /**
18
-    * Sorts 2-dimensional table.
19
-    * @param array $data The data to be sorted.
20
-    * @param int $column The column on which the data should be sorted (default = 0)
21
-    * @param int $direction The direction to sort (SORT_ASC (default) or SORT_DESC)
22
-    * @param int $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC,
23
-    * SORT_STRING,SORT_DATE,SORT_IMAGE)
24
-    * @return array The sorted dataset
25
-    * @author [email protected]
26
-    */
27
-	public static function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGULAR)
18
+     * Sorts 2-dimensional table.
19
+     * @param array $data The data to be sorted.
20
+     * @param int $column The column on which the data should be sorted (default = 0)
21
+     * @param int $direction The direction to sort (SORT_ASC (default) or SORT_DESC)
22
+     * @param int $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC,
23
+     * SORT_STRING,SORT_DATE,SORT_IMAGE)
24
+     * @return array The sorted dataset
25
+     * @author [email protected]
26
+     */
27
+    public static function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGULAR)
28 28
     {
29 29
         if (!is_array($data) || empty($data)) {
30 30
             return array();
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
         return $data;
74 74
     }
75 75
 
76
-	/**
77
-	 * Sorts 2-dimensional table. It is possile changing the columns that will be shown and the way that the columns are to be sorted.
78
-	 * @param array $data The data to be sorted.
79
-	 * @param int $column The column on which the data should be sorted (default = 0)
80
-	 * @param string $direction The direction to sort (SORT_ASC (default) orSORT_DESC)
81
-	 * @param array $column_show The columns that we will show in the table i.e: $column_show = array('1','0','1') we will show the 1st and the 3th column.
82
-	 * @param array $column_order Changes how the columns will be sorted ie. $column_order = array('0','3','2','3') The column [1] will be sorted like the column [3]
83
-	 * @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE)
84
-	 * @return array The sorted dataset
85
-	 * @author [email protected]
86
-	 */
87
-	public static function sort_table_config(
76
+    /**
77
+     * Sorts 2-dimensional table. It is possile changing the columns that will be shown and the way that the columns are to be sorted.
78
+     * @param array $data The data to be sorted.
79
+     * @param int $column The column on which the data should be sorted (default = 0)
80
+     * @param string $direction The direction to sort (SORT_ASC (default) orSORT_DESC)
81
+     * @param array $column_show The columns that we will show in the table i.e: $column_show = array('1','0','1') we will show the 1st and the 3th column.
82
+     * @param array $column_order Changes how the columns will be sorted ie. $column_order = array('0','3','2','3') The column [1] will be sorted like the column [3]
83
+     * @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE)
84
+     * @return array The sorted dataset
85
+     * @author [email protected]
86
+     */
87
+    public static function sort_table_config(
88 88
         $data,
89 89
         $column = 0,
90 90
         $direction = SORT_ASC,
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
             if (!empty($data)) {
133 133
                 foreach ($data as $document) {
134 134
                     if ($document['type'] == 'folder') {
135
-                      $docs_to_sort[$document['id']]   = api_strtolower($document['name']);
135
+                        $docs_to_sort[$document['id']]   = api_strtolower($document['name']);
136 136
                     } else {
137
-                      $folder_to_sort[$document['id']] = api_strtolower($document['name']);
137
+                        $folder_to_sort[$document['id']] = api_strtolower($document['name']);
138 138
                     }
139 139
                     $new_data[$document['id']] = $document;
140 140
                 }
@@ -196,91 +196,91 @@  discard block
 block discarded – undo
196 196
             usort($data, create_function('$a, $b', $compare_function));
197 197
         }
198 198
 
199
-		if (is_array($column_show) && !empty($column_show)) {
199
+        if (is_array($column_show) && !empty($column_show)) {
200 200
 
201
-			// We show only the columns data that were set up on the $column_show array
202
-			$new_order_data = array();
203
-			$count_data = count($data);
204
-			$count_column_show = count($column_show);
205
-			for ($j = 0; $j < $count_data; $j++) {
206
-				$k = 0;
207
-				for ($i = 0; $i < $count_column_show; $i++) {
208
-					if ($column_show[$i]) {
209
-						$new_order_data[$j][$k] = $data[$j][$i];
210
-					}
211
-					$k++;
212
-				}
213
-			}
214
-			// Replace the multi-arrays
215
-			$data = $new_order_data;
216
-		}
201
+            // We show only the columns data that were set up on the $column_show array
202
+            $new_order_data = array();
203
+            $count_data = count($data);
204
+            $count_column_show = count($column_show);
205
+            for ($j = 0; $j < $count_data; $j++) {
206
+                $k = 0;
207
+                for ($i = 0; $i < $count_column_show; $i++) {
208
+                    if ($column_show[$i]) {
209
+                        $new_order_data[$j][$k] = $data[$j][$i];
210
+                    }
211
+                    $k++;
212
+                }
213
+            }
214
+            // Replace the multi-arrays
215
+            $data = $new_order_data;
216
+        }
217 217
 
218
-		return $data;
219
-	}
218
+        return $data;
219
+    }
220 220
 
221
-	/**
222
-	 * Checks whether a column of a 2D-array contains only numeric values
223
-	 * @param array $data		The data-array
224
-	 * @param int $column		The index of the column to check
225
-	 * @return bool				TRUE if column contains only dates, FALSE otherwise
226
-	 * @todo Take locale into account (eg decimal point or comma ?)
227
-	 * @author [email protected]
228
-	 */
229
-	private static function is_numeric_column(& $data, $column)
221
+    /**
222
+     * Checks whether a column of a 2D-array contains only numeric values
223
+     * @param array $data		The data-array
224
+     * @param int $column		The index of the column to check
225
+     * @return bool				TRUE if column contains only dates, FALSE otherwise
226
+     * @todo Take locale into account (eg decimal point or comma ?)
227
+     * @author [email protected]
228
+     */
229
+    private static function is_numeric_column(& $data, $column)
230 230
     {
231
-		$is_numeric = true;
232
-		foreach ($data as $index => & $row) {
233
-			$is_numeric &= is_numeric(strip_tags($row[$column]));
234
-			if (!$is_numeric) {
235
-				break;
236
-			}
237
-		}
238
-		return $is_numeric;
239
-	}
231
+        $is_numeric = true;
232
+        foreach ($data as $index => & $row) {
233
+            $is_numeric &= is_numeric(strip_tags($row[$column]));
234
+            if (!$is_numeric) {
235
+                break;
236
+            }
237
+        }
238
+        return $is_numeric;
239
+    }
240 240
 
241
-	/**
242
-	 * Checks whether a column of a 2D-array contains only dates (GNU date syntax)
243
-	 * @param array $data		The data-array
244
-	 * @param int $column		The index of the column to check
245
-	 * @return bool				TRUE if column contains only dates, FALSE otherwise
246
-	 * @author [email protected]
247
-	 */
248
-	private static function is_date_column(& $data, $column)
241
+    /**
242
+     * Checks whether a column of a 2D-array contains only dates (GNU date syntax)
243
+     * @param array $data		The data-array
244
+     * @param int $column		The index of the column to check
245
+     * @return bool				TRUE if column contains only dates, FALSE otherwise
246
+     * @author [email protected]
247
+     */
248
+    private static function is_date_column(& $data, $column)
249 249
     {
250
-		$is_date = true;
251
-		foreach ($data as $index => & $row) {
252
-			if (strlen(strip_tags($row[$column])) != 0) {
253
-				$check_date = strtotime(strip_tags($row[$column]));
254
-				// strtotime Returns a timestamp on success, FALSE otherwise.
255
-				// Previous to PHP 5.1.0, this function would return -1 on failure.
256
-				$is_date &= ($check_date != -1 && $check_date);
257
-			} else {
258
-				$is_date &= false;
259
-			}
260
-			if (!$is_date) {
261
-				break;
262
-			}
263
-		}
264
-		return $is_date;
265
-	}
250
+        $is_date = true;
251
+        foreach ($data as $index => & $row) {
252
+            if (strlen(strip_tags($row[$column])) != 0) {
253
+                $check_date = strtotime(strip_tags($row[$column]));
254
+                // strtotime Returns a timestamp on success, FALSE otherwise.
255
+                // Previous to PHP 5.1.0, this function would return -1 on failure.
256
+                $is_date &= ($check_date != -1 && $check_date);
257
+            } else {
258
+                $is_date &= false;
259
+            }
260
+            if (!$is_date) {
261
+                break;
262
+            }
263
+        }
264
+        return $is_date;
265
+    }
266 266
 
267
-	/**
268
-	 * Checks whether a column of a 2D-array contains only images (<img src="path/file.ext" alt=".."/>)
269
-	 * @param array $data		The data-array
270
-	 * @param int $column		The index of the column to check
271
-	 * @return bool				TRUE if column contains only images, FALSE otherwise
272
-	 * @author [email protected]
273
-	 */
274
-	private static function is_image_column(& $data, $column)
267
+    /**
268
+     * Checks whether a column of a 2D-array contains only images (<img src="path/file.ext" alt=".."/>)
269
+     * @param array $data		The data-array
270
+     * @param int $column		The index of the column to check
271
+     * @return bool				TRUE if column contains only images, FALSE otherwise
272
+     * @author [email protected]
273
+     */
274
+    private static function is_image_column(& $data, $column)
275 275
     {
276
-		$is_image = true;
277
-		foreach ($data as $index => & $row) {
278
-			$is_image &= strlen(trim(strip_tags($row[$column], '<img>'))) > 0; // at least one img-tag
279
-			$is_image &= strlen(trim(strip_tags($row[$column]))) == 0; // and no text outside attribute-values
280
-			if (!$is_image) {
281
-				break;
282
-			}
283
-		}
284
-		return $is_image;
285
-	}
276
+        $is_image = true;
277
+        foreach ($data as $index => & $row) {
278
+            $is_image &= strlen(trim(strip_tags($row[$column], '<img>'))) > 0; // at least one img-tag
279
+            $is_image &= strlen(trim(strip_tags($row[$column]))) == 0; // and no text outside attribute-values
280
+            if (!$is_image) {
281
+                break;
282
+            }
283
+        }
284
+        return $is_image;
285
+    }
286 286
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     * @author [email protected]
26 26
     */
27 27
 	public static function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGULAR)
28
-    {
28
+	{
29 29
         if (!is_array($data) || empty($data)) {
30 30
             return array();
31 31
         }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 	 * @author [email protected]
228 228
 	 */
229 229
 	private static function is_numeric_column(& $data, $column)
230
-    {
230
+	{
231 231
 		$is_numeric = true;
232 232
 		foreach ($data as $index => & $row) {
233 233
 			$is_numeric &= is_numeric(strip_tags($row[$column]));
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 * @author [email protected]
247 247
 	 */
248 248
 	private static function is_date_column(& $data, $column)
249
-    {
249
+	{
250 250
 		$is_date = true;
251 251
 		foreach ($data as $index => & $row) {
252 252
 			if (strlen(strip_tags($row[$column])) != 0) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	 * @author [email protected]
273 273
 	 */
274 274
 	private static function is_image_column(& $data, $column)
275
-    {
275
+	{
276 276
 		$is_image = true;
277 277
 		foreach ($data as $index => & $row) {
278 278
 			$is_image &= strlen(trim(strip_tags($row[$column], '<img>'))) > 0; // at least one img-tag
Please login to merge, or discard this patch.
main/inc/lib/template.lib.php 4 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -330,6 +330,7 @@  discard block
 block discarded – undo
330 330
     /**
331 331
      * Sets the footer visibility
332 332
      * @param bool true if we show the footer
333
+     * @param boolean $status
333 334
      */
334 335
     public function set_footer($status)
335 336
     {
@@ -370,6 +371,7 @@  discard block
 block discarded – undo
370 371
     /**
371 372
      * Sets the header visibility
372 373
      * @param bool true if we show the header
374
+     * @param boolean $status
373 375
      */
374 376
     public function set_header($status)
375 377
     {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -615,7 +615,7 @@
 block discarded – undo
615 615
         return [
616 616
             '_p' => $_p,
617 617
             '_s' => $_s,
618
-     //       '_u' => $user_info,
618
+        //       '_u' => $user_info,
619 619
             'template' => 'default' // @todo setup template folder in config.yml;
620 620
         ];
621 621
     }
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                 $content = '<div class="help">';
316 316
                 $content .= Display::url(
317 317
                     Display::return_icon('help.large.png', get_lang('Help')),
318
-                    api_get_path(WEB_CODE_PATH) . 'help/help.php?open=' . $help,
318
+                    api_get_path(WEB_CODE_PATH).'help/help.php?open='.$help,
319 319
                     [
320 320
                         'class' => 'ajax',
321 321
                         'data-title' => get_lang('Help')
@@ -637,12 +637,12 @@  discard block
 block discarded – undo
637 637
         foreach ($bowerCSSFiles as $file) {
638 638
             $css[] = api_get_path(WEB_PATH).'web/assets/'.$file;
639 639
         }
640
-        $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/bootstrap-select/css/bootstrap-select.min.css';
641
-        $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chosen/chosen.css';
642
-        $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/tag/style.css';
640
+        $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/bootstrap-select/css/bootstrap-select.min.css';
641
+        $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/chosen/chosen.css';
642
+        $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css';
643 643
 
644 644
         if (api_is_global_chat_enabled()) {
645
-            $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chat/css/chat.css';
645
+            $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/chat/css/chat.css';
646 646
         }
647 647
 
648 648
         //THEME CSS STYLE
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 
695 695
         if (is_file(api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/editor.css')) {
696 696
             $css[] = api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/editor.css';
697
-        }else{
697
+        } else {
698 698
             $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'editor.css');
699 699
         }
700 700
 
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 
730 730
             $style_print = '';
731 731
             if (is_readable(api_get_path(SYS_CSS_PATH).$this->theme.'/print.css')) {
732
-                $style_print = api_get_css(api_get_cdn_path(api_get_path(WEB_CSS_PATH) . $this->theme . '/print.css'),
732
+                $style_print = api_get_css(api_get_cdn_path(api_get_path(WEB_CSS_PATH).$this->theme.'/print.css'),
733 733
                     'print');
734 734
             }
735 735
             $this->assign('css_style_print', $style_print);
@@ -752,10 +752,10 @@  discard block
 block discarded – undo
752 752
 
753 753
         $isoCode = api_get_language_isocode();
754 754
 
755
-        $selectLink = 'bootstrap-select/js/i18n/defaults-' . $isoCode . '_' . strtoupper($isoCode) . '.min.js';
755
+        $selectLink = 'bootstrap-select/js/i18n/defaults-'.$isoCode.'_'.strtoupper($isoCode).'.min.js';
756 756
 
757 757
         if ($isoCode == 'en') {
758
-            $selectLink = 'bootstrap-select/js/i18n/defaults-' . $isoCode . '_US.min.js';
758
+            $selectLink = 'bootstrap-select/js/i18n/defaults-'.$isoCode.'_US.min.js';
759 759
         }
760 760
         // JS files
761 761
         $js_files = array(
@@ -808,8 +808,8 @@  discard block
 block discarded – undo
808 808
         }
809 809
 
810 810
         if ($isoCode != 'en') {
811
-            $bowerJsFiles[] = 'jqueryui-timepicker-addon/dist/i18n/jquery-ui-timepicker-' . $isoCode . '.js';
812
-            $bowerJsFiles[] = 'jquery-ui/ui/minified/i18n/datepicker-' . $isoCode . '.min.js';
811
+            $bowerJsFiles[] = 'jqueryui-timepicker-addon/dist/i18n/jquery-ui-timepicker-'.$isoCode.'.js';
812
+            $bowerJsFiles[] = 'jquery-ui/ui/minified/i18n/datepicker-'.$isoCode.'.min.js';
813 813
         }
814 814
 
815 815
         foreach ($bowerJsFiles as $file) {
@@ -958,14 +958,14 @@  discard block
 block discarded – undo
958 958
         $this->assign('section_name', 'section-'.$this_section);
959 959
 
960 960
         //Defaul root chamilo favicon
961
-        $favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_PATH) . 'favicon.ico" type="image/x-icon" />';
961
+        $favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_PATH).'favicon.ico" type="image/x-icon" />';
962 962
 
963 963
         //Added to verify if in the current Chamilo Theme exist a favicon
964
-        $favicoThemeUrl = api_get_path(SYS_CSS_PATH) . 'themes/' . $this->theme . '/images/';
964
+        $favicoThemeUrl = api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/images/';
965 965
 
966 966
         //If exist pick the current chamilo theme favicon
967
-        if (is_file($favicoThemeUrl . 'favicon.ico')) {
968
-            $favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_CSS_PATH). 'themes/' . $this->theme . '/images/favicon.ico" type="image/x-icon" />';
967
+        if (is_file($favicoThemeUrl.'favicon.ico')) {
968
+            $favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/images/favicon.ico" type="image/x-icon" />';
969 969
         }
970 970
 
971 971
         if (api_is_multiple_url_enabled()) {
@@ -995,7 +995,7 @@  discard block
 block discarded – undo
995 995
         if (api_get_setting('show_link_bug_notification') == 'true' && $this->user_is_logged_in) {
996 996
             $rightFloatMenu = '<div class="report">
997 997
 		<a href="https://github.com/chamilo/chamilo-lms/wiki/How-to-report-issues" target="_blank">
998
-                    '. $iconBug . '
998
+                    '. $iconBug.'
999 999
                 </a>
1000 1000
 		</div>';
1001 1001
         }
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
             $url = api_get_path(WEB_CODE_PATH).'ticket/tickets.php?project_id=1&'.$courseParams;
1012 1012
             $rightFloatMenu .= '<div class="report">
1013 1013
 		        <a href="'.$url.'" target="_blank">
1014
-                    '. $iconTicket . '
1014
+                    '. $iconTicket.'
1015 1015
                 </a>
1016 1016
 		    </div>';
1017 1017
         }
@@ -1118,7 +1118,7 @@  discard block
 block discarded – undo
1118 1118
 
1119 1119
         // Block Breadcrumb
1120 1120
         //$breadcrumb = return_breadcrumb($interbreadcrumb, $language_file, $nameTools);
1121
-        $breadcrumb  = '';
1121
+        $breadcrumb = '';
1122 1122
         $this->assign('breadcrumb', $breadcrumb);
1123 1123
 
1124 1124
         //Extra content
@@ -1138,13 +1138,13 @@  discard block
 block discarded – undo
1138 1138
         $socialMeta = '';
1139 1139
         $metaTitle = api_get_setting('meta_title');
1140 1140
         if (!empty($metaTitle)) {
1141
-            $socialMeta .= '<meta name="twitter:card" content="summary" />' . "\n";
1141
+            $socialMeta .= '<meta name="twitter:card" content="summary" />'."\n";
1142 1142
             $metaSite = api_get_setting('meta_twitter_site');
1143 1143
             if (!empty($metaSite)) {
1144
-                $socialMeta .= '<meta name="twitter:site" content="' . $metaSite . '" />' . "\n";
1144
+                $socialMeta .= '<meta name="twitter:site" content="'.$metaSite.'" />'."\n";
1145 1145
                 $metaCreator = api_get_setting('meta_twitter_creator');
1146 1146
                 if (!empty($metaCreator)) {
1147
-                    $socialMeta .= '<meta name="twitter:creator" content="' . $metaCreator . '" />' . "\n";
1147
+                    $socialMeta .= '<meta name="twitter:creator" content="'.$metaCreator.'" />'."\n";
1148 1148
                 }
1149 1149
             }
1150 1150
 
@@ -1156,19 +1156,19 @@  discard block
 block discarded – undo
1156 1156
             if (!$userId && !$skillId) {
1157 1157
                 // no combination of user and skill ID has been defined,
1158 1158
                 // so print the normal OpenGraph meta tags
1159
-                $socialMeta .= '<meta property="og:title" content="' . $metaTitle . '" />' . "\n";
1160
-                $socialMeta .= '<meta property="og:url" content="' . api_get_path(WEB_PATH) . '" />' . "\n";
1159
+                $socialMeta .= '<meta property="og:title" content="'.$metaTitle.'" />'."\n";
1160
+                $socialMeta .= '<meta property="og:url" content="'.api_get_path(WEB_PATH).'" />'."\n";
1161 1161
 
1162 1162
                 $metaDescription = api_get_setting('meta_description');
1163 1163
                 if (!empty($metaDescription)) {
1164
-                    $socialMeta .= '<meta property="og:description" content="' . $metaDescription . '" />' . "\n";
1164
+                    $socialMeta .= '<meta property="og:description" content="'.$metaDescription.'" />'."\n";
1165 1165
                 }
1166 1166
 
1167 1167
                 $metaImage = api_get_setting('meta_image_path');
1168 1168
                 if (!empty($metaImage)) {
1169
-                    if (is_file(api_get_path(SYS_PATH) . $metaImage)) {
1170
-                        $path = api_get_path(WEB_PATH) . $metaImage;
1171
-                        $socialMeta .= '<meta property="og:image" content="' . $path . '" />' . "\n";
1169
+                    if (is_file(api_get_path(SYS_PATH).$metaImage)) {
1170
+                        $path = api_get_path(WEB_PATH).$metaImage;
1171
+                        $socialMeta .= '<meta property="og:image" content="'.$path.'" />'."\n";
1172 1172
                     }
1173 1173
                 }
1174 1174
             }
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
         // Tutor name
1203 1203
         if (api_get_setting('show_tutor_data') == 'true') {
1204 1204
             // Course manager
1205
-            $courseId  = api_get_course_int_id();
1205
+            $courseId = api_get_course_int_id();
1206 1206
             $id_session = api_get_session_id();
1207 1207
             if (!empty($courseId)) {
1208 1208
                 $tutor_data = '';
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
             $courseId = api_get_course_int_id();
1235 1235
             if (!empty($courseId)) {
1236 1236
                 $teacher_data = '';
1237
-                $mail= CourseManager::get_emails_of_tutors_to_course($courseId);
1237
+                $mail = CourseManager::get_emails_of_tutors_to_course($courseId);
1238 1238
                 if (!empty($mail)) {
1239 1239
                     $teachers_parsed = array();
1240 1240
                     foreach ($mail as $value) {
@@ -1468,7 +1468,7 @@  discard block
 block discarded – undo
1468 1468
                     'sessionVar'   => basename(__FILE__, '.php'),
1469 1469
                     'imageOptions' => array(
1470 1470
                         'font_size' => 20,
1471
-                        'font_path' => api_get_path(SYS_FONTS_PATH) . 'opensans/',
1471
+                        'font_path' => api_get_path(SYS_FONTS_PATH).'opensans/',
1472 1472
                         'font_file' => 'OpenSans-Regular.ttf',
1473 1473
                         //'output' => 'gif'
1474 1474
                     )
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -607,7 +607,7 @@
 block discarded – undo
607 607
 
608 608
         if (is_file(api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/editor.css')) {
609 609
             $css[] = api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/editor.css';
610
-        }else{
610
+        } else {
611 611
             $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'editor.css');
612 612
         }
613 613
 
Please login to merge, or discard this patch.
main/inc/lib/VideoChat.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      * Create a video chat
44 44
      * @param int $fromUser The sender user
45 45
      * @param int $toUser The receiver user
46
-     * @return int The created video chat id. Otherwise return false
46
+     * @return false|string The created video chat id. Otherwise return false
47 47
      */
48 48
     public static function createRoom($fromUser, $toUser)
49 49
     {
Please login to merge, or discard this patch.
main/inc/lib/zombie/zombie_report.class.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -121,6 +121,9 @@
 block discarded – undo
121 121
         return $form->isSubmitted() == false || $form->validate();
122 122
     }
123 123
 
124
+    /**
125
+     * @param string $format
126
+     */
124 127
     function get_ceiling($format = null)
125 128
     {
126 129
         $result = Request::get('ceiling');
Please login to merge, or discard this patch.
main/install/install.lib.php 5 patches
Doc Comments   +14 added lines, -5 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  * This function return the value of a php.ini setting if not "" or if exists,
98 98
  * otherwise return false
99 99
  * @param   string  $phpSetting The name of a PHP setting
100
- * @return  mixed   The value of the setting, or false if not found
100
+ * @return  string|false   The value of the setting, or false if not found
101 101
  */
102 102
 function checkPhpSettingExists($phpSetting)
103 103
 {
@@ -1268,6 +1268,10 @@  discard block
 block discarded – undo
1268 1268
  * @param   string  Extra notice (to show on the right side)
1269 1269
  * @param   boolean Whether to display in update mode
1270 1270
  * @param   string  Additional attribute for the <tr> element
1271
+ * @param string $installType
1272
+ * @param string $parameterName
1273
+ * @param string $formFieldName
1274
+ * @param string $extra_notice
1271 1275
  * @return  void    Direct output
1272 1276
  */
1273 1277
 function displayDatabaseParameter(
@@ -1481,6 +1485,11 @@  discard block
 block discarded – undo
1481 1485
 
1482 1486
     <?php
1483 1487
 }
1488
+/**
1489
+ * @param string $content
1490
+ * @param string $title
1491
+ * @param string $id
1492
+ */
1484 1493
 function panel($content = null, $title = null, $id = null, $style = null) {
1485 1494
     $html = '';
1486 1495
     if (empty($style)) {
@@ -1837,8 +1846,8 @@  discard block
 block discarded – undo
1837 1846
 }
1838 1847
 
1839 1848
 /**
1840
- * @param $current_value
1841
- * @param $wanted_value
1849
+ * @param string $current_value
1850
+ * @param string $wanted_value
1842 1851
  * @return string
1843 1852
  */
1844 1853
 function compare_setting_values($current_value, $wanted_value)
@@ -1855,8 +1864,8 @@  discard block
 block discarded – undo
1855 1864
 }
1856 1865
 
1857 1866
 /**
1858
- * @param $course_dir
1859
- * @param $course_attempt_name
1867
+ * @param string $course_dir
1868
+ * @param string $course_attempt_name
1860 1869
  * @param string $file
1861 1870
  * @return bool
1862 1871
  */
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1745,7 +1745,7 @@  discard block
 block discarded – undo
1745 1745
         $html .= '<label class="checkbox-inline">
1746 1746
                         <input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
1747 1747
                     </label>';
1748
-         $html .= '<label class="checkbox-inline">
1748
+            $html .= '<label class="checkbox-inline">
1749 1749
                     <input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ') .' /> '. get_lang('AfterApproval') .'
1750 1750
                 </label>';
1751 1751
         $html .= '</div>';
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
     </div>';
1780 1780
 
1781 1781
     echo panel($html, get_lang('Platform'), 'platform');
1782
- ?>
1782
+    ?>
1783 1783
     <div class='form-group'>
1784 1784
         <div class="col-sm-6">
1785 1785
             <button type="submit" class="btn btn-default pull-right" name="step3" value="&lt; <?php echo get_lang('Previous'); ?>" ><em class="fa fa-backward"> </em> <?php echo get_lang('Previous'); ?></button>
Please login to merge, or discard this patch.
Braces   +32 added lines, -17 removed lines patch added patch discarded remove patch
@@ -650,7 +650,8 @@  discard block
 block discarded – undo
650 650
  * can be done in the language of the user
651 651
  */
652 652
 function display_language_selection()
653
-{ ?>
653
+{
654
+?>
654 655
     <h2><?php get_lang('WelcomeToTheChamiloInstaller'); ?></h2>
655 656
     <div class="RequirementHeading">
656 657
         <h2><?php echo display_step_sequence(); ?>
@@ -696,7 +697,8 @@  discard block
 block discarded – undo
696 697
     $badUpdatePath,
697 698
     $updatePath = '',
698 699
     $update_from_version_8 = array()
699
-) {
700
+)
701
+{
700 702
     global $_setting;
701 703
     echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('Requirements')."</h2></div>";
702 704
     echo '<div class="RequirementText">';
@@ -1012,8 +1014,7 @@  discard block
 block discarded – undo
1012 1014
                 <?php echo get_lang('Error'); ?>!<br />
1013 1015
                 Chamilo <?php echo implode('|', $update_from_version_8).' '.get_lang('HasNotBeenFoundInThatDir'); ?>.
1014 1016
             </div>
1015
-        <?php }
1016
-        else {
1017
+        <?php } else {
1017 1018
             echo '<br />';
1018 1019
         }
1019 1020
         ?>
@@ -1133,7 +1134,10 @@  discard block
 block discarded – undo
1133 1134
         <button type="submit" name="step1" class="btn btn-default" onclick="javascript: window.location='index.php'; return false;" value="<?php echo get_lang('Previous'); ?>" >
1134 1135
             <em class="fa fa-backward"> </em> <?php echo get_lang('Previous'); ?>
1135 1136
         </button>
1136
-        <button type="submit" name="step2_install" class="btn btn-success" value="<?php echo get_lang("NewInstallation"); ?>" <?php if ($error) echo 'disabled="disabled"'; ?> >
1137
+        <button type="submit" name="step2_install" class="btn btn-success" value="<?php echo get_lang("NewInstallation"); ?>" <?php if ($error) {
1138
+    echo 'disabled="disabled"';
1139
+}
1140
+?> >
1137 1141
             <em class="fa fa-forward"> </em> <?php echo get_lang('NewInstallation'); ?>
1138 1142
         </button>
1139 1143
         <input type="hidden" name="is_executable" id="is_executable" value="-" />
@@ -1350,7 +1354,8 @@  discard block
 block discarded – undo
1350 1354
     $extra_notice,
1351 1355
     $displayWhenUpdate = true,
1352 1356
     $tr_attribute = ''
1353
-) {
1357
+)
1358
+{
1354 1359
     //echo "<tr ".$tr_attribute.">";
1355 1360
     echo "<label class='col-sm-4'>$parameterName</label>";
1356 1361
 
@@ -1391,7 +1396,8 @@  discard block
 block discarded – undo
1391 1396
     $dbNameForm,
1392 1397
     $dbPortForm = 3306,
1393 1398
     $installationProfile = ''
1394
-) {
1399
+)
1400
+{
1395 1401
     if ($installType == 'update') {
1396 1402
         global $_configuration;
1397 1403
         $dbHostForm = $_configuration['db_host'];
@@ -1420,7 +1426,7 @@  discard block
 block discarded – undo
1420 1426
                 <input type="hidden" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" /><?php echo $dbHostForm; ?>
1421 1427
             </div>
1422 1428
             <div class="col-sm-3"></div>
1423
-            <?php }else{ ?>
1429
+            <?php } else{ ?>
1424 1430
             <div class="col-sm-5">
1425 1431
                 <input type="text" class="form-control" size="25" maxlength="50" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" />
1426 1432
             </div>
@@ -1434,7 +1440,7 @@  discard block
 block discarded – undo
1434 1440
                 <input type="hidden" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" /><?php echo $dbPortForm; ?>
1435 1441
             </div>
1436 1442
             <div class="col-sm-3"></div>
1437
-            <?php }else{ ?>
1443
+            <?php } else{ ?>
1438 1444
             <div class="col-sm-5">
1439 1445
                 <input type="text" class="form-control" size="25" maxlength="50" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" />
1440 1446
             </div>
@@ -1516,9 +1522,12 @@  discard block
 block discarded – undo
1516 1522
             Database port: <strong><?php echo $manager->getConnection()->getPort(); ?></strong><br/>
1517 1523
             Database driver: <strong><?php echo $manager->getConnection()->getDriver()->getName(); ?></strong><br/>
1518 1524
         </div>
1519
-    <?php else: ?>
1525
+    <?php else {
1526
+    : ?>
1520 1527
         <div id="db_status" class="alert alert-danger">
1521
-            <p><?php echo get_lang('FailedConectionDatabase'); ?></strong></p>
1528
+            <p><?php echo get_lang('FailedConectionDatabase');
1529
+}
1530
+?></strong></p>
1522 1531
             <code><?php echo $database_exists_text ?></code>
1523 1532
         </div>
1524 1533
     <?php endif; ?>
@@ -1545,7 +1554,8 @@  discard block
 block discarded – undo
1545 1554
     <?php
1546 1555
 }
1547 1556
 
1548
-function panel($content = null, $title = null, $id = null, $style = null) {
1557
+function panel($content = null, $title = null, $id = null, $style = null)
1558
+{
1549 1559
     $html = '';
1550 1560
     if (empty($style)) {
1551 1561
         $style = 'default';
@@ -1577,7 +1587,8 @@  discard block
 block discarded – undo
1577 1587
     $formFieldName,
1578 1588
     $parameterValue,
1579 1589
     $displayWhenUpdate = 'true'
1580
-) {
1590
+)
1591
+{
1581 1592
     $html = '<div class="form-group">';
1582 1593
     $html .= '<label class="col-sm-6 control-label">' . $parameterName . '</label>';
1583 1594
     if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) {
@@ -1624,7 +1635,8 @@  discard block
 block discarded – undo
1624 1635
     $allowSelfRegProf,
1625 1636
     $loginForm,
1626 1637
     $passForm
1627
-) {
1638
+)
1639
+{
1628 1640
     if ($installType != 'update' && empty($languageForm)) {
1629 1641
         $languageForm = $_SESSION['install_language'];
1630 1642
     }
@@ -1668,7 +1680,8 @@  discard block
 block discarded – undo
1668 1680
     if ($installType == 'update') {
1669 1681
         $html .= '<input type="hidden" name="languageForm" value="'.api_htmlentities($languageForm, ENT_QUOTES).'" />'.$languageForm;
1670 1682
 
1671
-    } else { // new installation
1683
+    } else {
1684
+// new installation
1672 1685
         $html .= '<div class="col-sm-6">';
1673 1686
         $html .= display_language_selection_box('languageForm', $languageForm);
1674 1687
         $html .= '</div>';
@@ -2036,7 +2049,8 @@  discard block
 block discarded – undo
2036 2049
     $allowRegistration,
2037 2050
     $allowTeacherSelfRegistration,
2038 2051
     $installationProfile = ''
2039
-) {
2052
+)
2053
+{
2040 2054
     $allowTeacherSelfRegistration = $allowTeacherSelfRegistration ? 'true' : 'false';
2041 2055
 
2042 2056
     // Use PHP 5.3 to avoid issue with weird peripherical auto-installers like travis-ci
@@ -2734,7 +2748,8 @@  discard block
 block discarded – undo
2734 2748
     $allowSelfReg,
2735 2749
     $allowSelfRegProf,
2736 2750
     $installationProfile = ''
2737
-) {
2751
+)
2752
+{
2738 2753
     $sysPath = !empty($sysPath) ? $sysPath : api_get_path(SYS_PATH);
2739 2754
 
2740 2755
     $connection = $manager->getConnection();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1872,7 +1872,7 @@  discard block
 block discarded – undo
1872 1872
     $access_url_locked_settings = api_get_locked_settings();
1873 1873
     $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
1874 1874
     foreach ($access_url_locked_settings as $setting) {
1875
-        $sql = "UPDATE $table SET access_url_locked = 1 WHERE variable  = '$setting'";
1875
+        $sql = "update $table SET access_url_locked = 1 WHERE variable  = '$setting'";
1876 1876
         Database::query($sql);
1877 1877
     }
1878 1878
 }
@@ -1886,11 +1886,11 @@  discard block
 block discarded – undo
1886 1886
     $permissions_for_new_directories = isset($_SESSION['permissions_for_new_directories']) ? $_SESSION['permissions_for_new_directories'] : 0770;
1887 1887
     $permissions_for_new_files = isset($_SESSION['permissions_for_new_files']) ? $_SESSION['permissions_for_new_files'] : 0660;
1888 1888
     // use decoct() to store as string
1889
-    $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_directories) . "'
1889
+    $sql = "update $table SET selected_value = '0" . decoct($permissions_for_new_directories) . "'
1890 1890
               WHERE variable  = 'permissions_for_new_directories'";
1891 1891
     Database::query($sql);
1892 1892
 
1893
-    $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_files) . "' WHERE variable  = 'permissions_for_new_files'";
1893
+    $sql = "update $table SET selected_value = '0" . decoct($permissions_for_new_files) . "' WHERE variable  = 'permissions_for_new_files'";
1894 1894
     Database::query($sql);
1895 1895
 
1896 1896
     if (isset($_SESSION['permissions_for_new_directories'])) {
@@ -1968,7 +1968,7 @@  discard block
 block discarded – undo
1968 1968
                 //Check fsockopen (not sure it works with https). If that is your case, you might want to try the
1969 1969
                 // suggestion at https://support.chamilo.org/issues/8260#note-3 (although it ignores SSL peer checks)
1970 1970
                 if ($fp = @fsockopen(str_replace('http://', $scheme, $url), $port, $sock_errno, $sock_errmsg, 60)) {
1971
-                    $out  = "GET $path HTTP/1.1\r\n";
1971
+                    $out  = "get $path HTTP/1.1\r\n";
1972 1972
                     $out .= "Host: $host\r\n";
1973 1973
                     $out .= "Connection: Close\r\n\r\n";
1974 1974
 
@@ -2276,7 +2276,7 @@  discard block
 block discarded – undo
2276 2276
                 $data = $connection->fetchAssoc($sql);
2277 2277
                 if (!empty($data)) {
2278 2278
                     $newGroupId = $data['iid'];
2279
-                    $sql = "UPDATE $table SET group_id = $newGroupId
2279
+                    $sql = "update $table SET group_id = $newGroupId
2280 2280
                             WHERE iid = $iid";
2281 2281
                     $connection->executeQuery($sql);
2282 2282
                 } else {
@@ -2472,7 +2472,7 @@  discard block
 block discarded – undo
2472 2472
                     $path['dir']
2473 2473
                 );
2474 2474
                 $command = "mv {$path['dir']} $newPath ";
2475
-                error_log("Executing $command");
2475
+                error_log("executing $command");
2476 2476
                 system($command);
2477 2477
             }
2478 2478
         }
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
     if (!is_array($result)) {
412 412
         $result = array();
413 413
         $exceptions = array('.', '..', 'CVS', '.svn');
414
-        $search       = array('_latin',   '_unicode',   '_corporate',   '_org'  , '_KM',   '_');
414
+        $search       = array('_latin', '_unicode', '_corporate', '_org', '_KM', '_');
415 415
         $replace_with = array(' (Latin)', ' (unicode)', ' (corporate)', ' (org)', ' (KM)', ' ');
416 416
         $dirname = api_get_path(SYS_LANG_PATH);
417 417
         $handle = opendir($dirname);
@@ -446,9 +446,9 @@  discard block
 block discarded – undo
446 446
     if ($handle = opendir($directory)) {
447 447
         while (false !== ($file = readdir($handle))) {
448 448
             if ($file != "." && $file != "..") {
449
-                if (is_dir($directory. "/" . $file)) {
450
-                    $array_items = array_merge($array_items, my_directory_to_array($directory. '/' . $file));
451
-                    $file = $directory . "/" . $file;
449
+                if (is_dir($directory."/".$file)) {
450
+                    $array_items = array_merge($array_items, my_directory_to_array($directory.'/'.$file));
451
+                    $file = $directory."/".$file;
452 452
                     $array_items[] = preg_replace("/\/\//si", '/', $file);
453 453
                 }
454 454
             }
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         // try to recover config file from Chamilo 1.9.x
494 494
         if (file_exists($updatePath.'main/inc/conf/configuration.php')) {
495 495
             $updateFromConfigFile = 'main/inc/conf/configuration.php';
496
-        } elseif (file_exists($updatePath . 'app/config/configuration.php')) {
496
+        } elseif (file_exists($updatePath.'app/config/configuration.php')) {
497 497
             $updateFromConfigFile = 'app/config/configuration.php';
498 498
         } else {
499 499
             // Give up recovering.
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
     <h2><?php get_lang('WelcomeToTheChamiloInstaller'); ?></h2>
655 655
     <div class="RequirementHeading">
656 656
         <h2><?php echo display_step_sequence(); ?>
657
-            <?php echo get_lang('InstallationLanguage');?>
657
+            <?php echo get_lang('InstallationLanguage'); ?>
658 658
         </h2>
659 659
         <p><?php echo get_lang('PleaseSelectInstallationProcessLanguage'); ?>:</p>
660 660
         <form id="lang_form" method="post" action="<?php echo api_get_self(); ?>">
@@ -708,14 +708,14 @@  discard block
 block discarded – undo
708 708
     }
709 709
     echo '</div>';
710 710
 
711
-    $properlyAccessUrl =  checkAccessUrl();
711
+    $properlyAccessUrl = checkAccessUrl();
712 712
 
713 713
     if (!$properlyAccessUrl) {
714 714
         echo '
715 715
             <div class="alert alert-danger">
716
-                ' . Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_MEDIUM, true, false, true) .
717
-            ' ' .
718
-            sprintf(get_lang('InstallMultiURLDetectedNotMainURL'), api_get_configuration_value('root_web')) . '
716
+                ' . Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_MEDIUM, true, false, true).
717
+            ' '.
718
+            sprintf(get_lang('InstallMultiURLDetectedNotMainURL'), api_get_configuration_value('root_web')).'
719 719
             </div>
720 720
         ';
721 721
     }
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
     if (phpversion() < REQUIRED_PHP_VERSION) {
748 748
         echo '<strong><font color="red">'.get_lang('PHPVersionError').'</font></strong>';
749 749
     } else {
750
-        echo '<strong><font color="green">'.get_lang('PHPVersionOK'). ' '.phpversion().'</font></strong>';
750
+        echo '<strong><font color="green">'.get_lang('PHPVersionOK').' '.phpversion().'</font></strong>';
751 751
     }
752 752
     echo '</td>
753 753
             </tr>
@@ -1105,9 +1105,9 @@  discard block
 block discarded – undo
1105 1105
         }
1106 1106
 
1107 1107
         $deprecated = [
1108
-            api_get_path(SYS_CODE_PATH) . 'exercice/',
1109
-            api_get_path(SYS_CODE_PATH) . 'newscorm/',
1110
-            api_get_path(SYS_PLUGIN_PATH) . 'ticket/'
1108
+            api_get_path(SYS_CODE_PATH).'exercice/',
1109
+            api_get_path(SYS_CODE_PATH).'newscorm/',
1110
+            api_get_path(SYS_PLUGIN_PATH).'ticket/'
1111 1111
         ];
1112 1112
         $deprecatedToRemove = [];
1113 1113
 
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
 function get_contact_registration_form()
1218 1218
 {
1219 1219
 
1220
-    $html ='
1220
+    $html = '
1221 1221
    <div class="form-horizontal">
1222 1222
     <div class="panel panel-default">
1223 1223
     <div class="panel-body">
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
         <div class="col-sm-9">
1315 1315
             <div class="radio">
1316 1316
                 <label>
1317
-                    <input type="radio" name="financial_decision" id="financial_decision1" value="1" checked /> ' . get_lang('Yes') . '
1317
+                    <input type="radio" name="financial_decision" id="financial_decision1" value="1" checked /> ' . get_lang('Yes').'
1318 1318
                 </label>
1319 1319
             </div>
1320 1320
             <div class="radio">
@@ -1373,8 +1373,8 @@  discard block
 block discarded – undo
1373 1373
             echo '<input type="hidden" name="'.$formFieldName.'" id="'.$formFieldName.'" value="'.api_htmlentities($parameterValue).'" />';
1374 1374
             echo api_htmlentities($parameterValue);
1375 1375
         } else {
1376
-            echo '<div class="col-sm-5"><input type="' . $inputType . '" class="form-control" size="' . DATABASE_FORM_FIELD_DISPLAY_LENGTH . '" maxlength="' . $maxLength . '" name="' . $formFieldName . '" id="' . $formFieldName . '" value="' . api_htmlentities($parameterValue) . '" />' . "</div>";
1377
-            echo '<div class="col-sm-3">' . $extra_notice . '</div>';
1376
+            echo '<div class="col-sm-5"><input type="'.$inputType.'" class="form-control" size="'.DATABASE_FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.$maxLength.'" name="'.$formFieldName.'" id="'.$formFieldName.'" value="'.api_htmlentities($parameterValue).'" />'."</div>";
1377
+            echo '<div class="col-sm-3">'.$extra_notice.'</div>';
1378 1378
         }
1379 1379
     }
1380 1380
 }
@@ -1408,12 +1408,12 @@  discard block
 block discarded – undo
1408 1408
         $dbNameForm = $_configuration['main_database'];
1409 1409
         $dbPortForm = isset($_configuration['db_port']) ? $_configuration['db_port'] : '';
1410 1410
 
1411
-        echo '<div class="RequirementHeading"><h2>' . display_step_sequence() .get_lang('DBSetting') . '</h2></div>';
1411
+        echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('DBSetting').'</h2></div>';
1412 1412
         echo '<div class="RequirementContent">';
1413 1413
         echo get_lang('DBSettingUpgradeIntro');
1414 1414
         echo '</div>';
1415 1415
     } else {
1416
-        echo '<div class="RequirementHeading"><h2>' . display_step_sequence() .get_lang('DBSetting') . '</h2></div>';
1416
+        echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('DBSetting').'</h2></div>';
1417 1417
         echo '<div class="RequirementContent">';
1418 1418
         echo get_lang('DBSettingIntro');
1419 1419
         echo '</div>';
@@ -1423,12 +1423,12 @@  discard block
 block discarded – undo
1423 1423
         <div class="panel-body">
1424 1424
         <div class="form-group">
1425 1425
             <label class="col-sm-4"><?php echo get_lang('DBHost'); ?> </label>
1426
-            <?php if ($installType == 'update'){ ?>
1426
+            <?php if ($installType == 'update') { ?>
1427 1427
             <div class="col-sm-5">
1428 1428
                 <input type="hidden" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" /><?php echo $dbHostForm; ?>
1429 1429
             </div>
1430 1430
             <div class="col-sm-3"></div>
1431
-            <?php }else{ ?>
1431
+            <?php } else { ?>
1432 1432
             <div class="col-sm-5">
1433 1433
                 <input type="text" class="form-control" size="25" maxlength="50" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" />
1434 1434
             </div>
@@ -1437,12 +1437,12 @@  discard block
 block discarded – undo
1437 1437
         </div>
1438 1438
         <div class="form-group">
1439 1439
             <label class="col-sm-4"><?php echo get_lang('DBPort'); ?> </label>
1440
-            <?php if ($installType == 'update'){ ?>
1440
+            <?php if ($installType == 'update') { ?>
1441 1441
             <div class="col-sm-5">
1442 1442
                 <input type="hidden" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" /><?php echo $dbPortForm; ?>
1443 1443
             </div>
1444 1444
             <div class="col-sm-3"></div>
1445
-            <?php }else{ ?>
1445
+            <?php } else { ?>
1446 1446
             <div class="col-sm-5">
1447 1447
                 <input type="text" class="form-control" size="25" maxlength="50" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" />
1448 1448
             </div>
@@ -1468,7 +1468,7 @@  discard block
 block discarded – undo
1468 1468
             <?php
1469 1469
             //Database Name fix replace weird chars
1470 1470
             if ($installType != INSTALL_TYPE_UPDATE) {
1471
-                $dbNameForm = str_replace(array('-','*', '$', ' ', '.'), '', $dbNameForm);
1471
+                $dbNameForm = str_replace(array('-', '*', '$', ' ', '.'), '', $dbNameForm);
1472 1472
             }
1473 1473
 
1474 1474
             displayDatabaseParameter(
@@ -1561,7 +1561,7 @@  discard block
 block discarded – undo
1561 1561
     if (!empty($title)) {
1562 1562
         $panelTitle = Display::div($title, array('class' => 'panel-heading'));
1563 1563
         $panelBody = Display::div($content, array('class' => 'panel-body'));
1564
-        $panelParent = Display::div($panelTitle . $panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
1564
+        $panelParent = Display::div($panelTitle.$panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
1565 1565
     } else {
1566 1566
         $panelBody = Display::div($html, array('class' => 'panel-body'));
1567 1567
         $panelParent = Display::div($panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
@@ -1587,9 +1587,9 @@  discard block
 block discarded – undo
1587 1587
     $displayWhenUpdate = 'true'
1588 1588
 ) {
1589 1589
     $html = '<div class="form-group">';
1590
-    $html .= '<label class="col-sm-6 control-label">' . $parameterName . '</label>';
1590
+    $html .= '<label class="col-sm-6 control-label">'.$parameterName.'</label>';
1591 1591
     if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) {
1592
-        $html .= '<input type="hidden" name="' . $formFieldName . '" value="'. api_htmlentities($parameterValue, ENT_QUOTES). '" />' . $parameterValue;
1592
+        $html .= '<input type="hidden" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'.$parameterValue;
1593 1593
     } else {
1594 1594
         $html .= '<div class="col-sm-6"><input class="form-control" type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</div>";
1595 1595
     }
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
         $languageForm = $_SESSION['install_language'];
1638 1638
     }
1639 1639
     echo '<div class="RequirementHeading">';
1640
-    echo "<h2>" . display_step_sequence() . get_lang("CfgSetting") . "</h2>";
1640
+    echo "<h2>".display_step_sequence().get_lang("CfgSetting")."</h2>";
1641 1641
     echo '</div>';
1642 1642
 
1643 1643
     echo '<p>'.get_lang('ConfigSettingsInfo').' <strong>app/config/configuration.php</strong></p>';
@@ -1655,14 +1655,14 @@  discard block
 block discarded – undo
1655 1655
 
1656 1656
     // Parameters 3 and 4: administrator's names
1657 1657
 
1658
-    $html .=  display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName);
1659
-    $html .=  display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName);
1658
+    $html .= display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName);
1659
+    $html .= display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName);
1660 1660
 
1661 1661
     //Parameter 3: administrator's email
1662
-    $html .=  display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm);
1662
+    $html .= display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm);
1663 1663
 
1664 1664
     //Parameter 6: administrator's telephone
1665
-    $html .=  display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm);
1665
+    $html .= display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm);
1666 1666
 
1667 1667
 
1668 1668
     echo panel($html, get_lang('Administrator'), 'administrator');
@@ -1681,12 +1681,12 @@  discard block
 block discarded – undo
1681 1681
         $html .= display_language_selection_box('languageForm', $languageForm);
1682 1682
         $html .= '</div>';
1683 1683
     }
1684
-    $html.= "</div>";
1684
+    $html .= "</div>";
1685 1685
 
1686 1686
 
1687 1687
     //Second parameter: Chamilo URL
1688 1688
     $html .= '<div class="form-group">';
1689
-    $html .= '<label class="col-sm-6 control-label">'.get_lang('ChamiloURL') .get_lang('ThisFieldIsRequired').'</label>';
1689
+    $html .= '<label class="col-sm-6 control-label">'.get_lang('ChamiloURL').get_lang('ThisFieldIsRequired').'</label>';
1690 1690
 
1691 1691
 
1692 1692
 
@@ -1710,34 +1710,34 @@  discard block
 block discarded – undo
1710 1710
 
1711 1711
 
1712 1712
     $html .= '<div class="form-group">
1713
-            <label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass") . '</label>
1713
+            <label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass").'</label>
1714 1714
         <div class="col-sm-6">';
1715 1715
     if ($installType == 'update') {
1716
-        $html .= '<input type="hidden" name="encryptPassForm" value="'. $encryptPassForm .'" />'. $encryptPassForm;
1716
+        $html .= '<input type="hidden" name="encryptPassForm" value="'.$encryptPassForm.'" />'.$encryptPassForm;
1717 1717
     } else {
1718 1718
 
1719 1719
         $html .= '<div class="checkbox">
1720 1720
                     <label>
1721
-                        <input  type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ':'') .'/> bcrypt
1721
+                        <input  type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ' : '').'/> bcrypt
1722 1722
                     </label>';
1723 1723
 
1724 1724
         $html .= '<label>
1725
-                        <input  type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ':'') .'/> sha1
1725
+                        <input  type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ' : '').'/> sha1
1726 1726
                     </label>';
1727 1727
 
1728 1728
         $html .= '<label>
1729
-                        <input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ':'') .'/> md5
1729
+                        <input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ' : '').'/> md5
1730 1730
                     </label>';
1731 1731
 
1732 1732
         $html .= '<label>
1733
-                        <input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ':'') .'/>'. get_lang('None').'
1733
+                        <input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ' : '').'/>'.get_lang('None').'
1734 1734
                     </label>';
1735 1735
         $html .= '</div>';
1736 1736
     }
1737 1737
     $html .= '</div></div>';
1738 1738
 
1739 1739
     $html .= '<div class="form-group">
1740
-            <label class="col-sm-6 control-label">' . get_lang('AllowSelfReg') . '</label>
1740
+            <label class="col-sm-6 control-label">' . get_lang('AllowSelfReg').'</label>
1741 1741
             <div class="col-sm-6">';
1742 1742
     if ($installType == 'update') {
1743 1743
         if ($allowSelfReg == 'true') {
@@ -1747,17 +1747,17 @@  discard block
 block discarded – undo
1747 1747
         } else {
1748 1748
             $label = get_lang('AfterApproval');
1749 1749
         }
1750
-        $html .= '<input type="hidden" name="allowSelfReg" value="'. $allowSelfReg .'" />'. $label;
1750
+        $html .= '<input type="hidden" name="allowSelfReg" value="'.$allowSelfReg.'" />'.$label;
1751 1751
     } else {
1752 1752
         $html .= '<div class="control-group">';
1753 1753
         $html .= '<label class="checkbox-inline">
1754
-                        <input type="radio" name="allowSelfReg" value="true" id="allowSelfReg1" '. ($allowSelfReg == 'true' ? 'checked="checked" ' : '') . ' /> '. get_lang('Yes') .'
1754
+                        <input type="radio" name="allowSelfReg" value="true" id="allowSelfReg1" '. ($allowSelfReg == 'true' ? 'checked="checked" ' : '').' /> '.get_lang('Yes').'
1755 1755
                     </label>';
1756 1756
         $html .= '<label class="checkbox-inline">
1757
-                        <input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
1757
+                        <input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ').' /> '.get_lang('No').'
1758 1758
                     </label>';
1759 1759
          $html .= '<label class="checkbox-inline">
1760
-                    <input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ') .' /> '. get_lang('AfterApproval') .'
1760
+                    <input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ').' /> '.get_lang('AfterApproval').'
1761 1761
                 </label>';
1762 1762
         $html .= '</div>';
1763 1763
     }
@@ -1765,7 +1765,7 @@  discard block
 block discarded – undo
1765 1765
     $html .= '</div>';
1766 1766
 
1767 1767
     $html .= '<div class="form-group">';
1768
-    $html .= '<label class="col-sm-6 control-label">'. get_lang('AllowSelfRegProf') .'</label>
1768
+    $html .= '<label class="col-sm-6 control-label">'.get_lang('AllowSelfRegProf').'</label>
1769 1769
         <div class="col-sm-6">';
1770 1770
     if ($installType == 'update') {
1771 1771
         if ($allowSelfRegProf == 'true') {
@@ -1773,16 +1773,16 @@  discard block
 block discarded – undo
1773 1773
         } else {
1774 1774
             $label = get_lang('No');
1775 1775
         }
1776
-        $html .= '<input type="hidden" name="allowSelfRegProf" value="'. $allowSelfRegProf.'" />'. $label;
1776
+        $html .= '<input type="hidden" name="allowSelfRegProf" value="'.$allowSelfRegProf.'" />'.$label;
1777 1777
     } else {
1778 1778
         $html .= '<div class="control-group">
1779 1779
                 <label class="checkbox-inline">
1780
-                    <input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '') .'/>
1781
-                ' . get_lang('Yes') .'
1780
+                    <input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '').'/>
1781
+                ' . get_lang('Yes').'
1782 1782
                 </label>';
1783 1783
         $html .= '<label class="checkbox-inline">
1784
-                    <input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ') .' />
1785
-                   '. get_lang('No') .'
1784
+                    <input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ').' />
1785
+                   '. get_lang('No').'
1786 1786
                 </label>';
1787 1787
         $html .= '</div>';
1788 1788
     }
@@ -1847,7 +1847,7 @@  discard block
 block discarded – undo
1847 1847
         "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar",
1848 1848
         "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway",
1849 1849
         "Oman",
1850
-        "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland","Portugal",
1850
+        "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal",
1851 1851
         "Qatar",
1852 1852
         "Romania", "Russia", "Rwanda",
1853 1853
         "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria",
@@ -1894,11 +1894,11 @@  discard block
 block discarded – undo
1894 1894
     $permissions_for_new_directories = isset($_SESSION['permissions_for_new_directories']) ? $_SESSION['permissions_for_new_directories'] : 0770;
1895 1895
     $permissions_for_new_files = isset($_SESSION['permissions_for_new_files']) ? $_SESSION['permissions_for_new_files'] : 0660;
1896 1896
     // use decoct() to store as string
1897
-    $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_directories) . "'
1897
+    $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_directories)."'
1898 1898
               WHERE variable  = 'permissions_for_new_directories'";
1899 1899
     Database::query($sql);
1900 1900
 
1901
-    $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_files) . "' WHERE variable  = 'permissions_for_new_files'";
1901
+    $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_files)."' WHERE variable  = 'permissions_for_new_files'";
1902 1902
     Database::query($sql);
1903 1903
 
1904 1904
     if (isset($_SESSION['permissions_for_new_directories'])) {
@@ -1918,8 +1918,8 @@  discard block
 block discarded – undo
1918 1918
 function compare_setting_values($current_value, $wanted_value)
1919 1919
 {
1920 1920
     $current_value_string = $current_value;
1921
-    $current_value = (float)$current_value;
1922
-    $wanted_value = (float)$wanted_value;
1921
+    $current_value = (float) $current_value;
1922
+    $wanted_value = (float) $wanted_value;
1923 1923
 
1924 1924
     if ($current_value >= $wanted_value) {
1925 1925
         return Display::label($current_value_string, 'success');
@@ -1983,7 +1983,7 @@  discard block
 block discarded – undo
1983 1983
 
1984 1984
                     fwrite($fp, $out);
1985 1985
                     while (!feof($fp)) {
1986
-                        $result = str_replace("\r\n", '',fgets($fp, 128));
1986
+                        $result = str_replace("\r\n", '', fgets($fp, 128));
1987 1987
                         if (!empty($result) && $result == '123') {
1988 1988
                             $output = true;
1989 1989
                         }
@@ -2006,7 +2006,7 @@  discard block
 block discarded – undo
2006 2006
                     curl_setopt($ch, CURLOPT_URL, $url);
2007 2007
                     //curl_setopt($ch, CURLOPT_TIMEOUT, 30);
2008 2008
                     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
2009
-                    $result = curl_exec ($ch);
2009
+                    $result = curl_exec($ch);
2010 2010
                     if (!empty($result) && $result == '123') {
2011 2011
                         $output = true;
2012 2012
                     }
@@ -2860,12 +2860,12 @@  discard block
 block discarded – undo
2860 2860
         $adminPhoneForm,
2861 2861
         '', //$picture_uri = '',
2862 2862
         PLATFORM_AUTH_SOURCE,
2863
-        '',//$expirationDate,
2863
+        '', //$expirationDate,
2864 2864
         1,
2865 2865
         0,
2866 2866
         null,
2867 2867
         '',
2868
-        false,  //$send_mail = false,
2868
+        false, //$send_mail = false,
2869 2869
         true //$isAdmin = false
2870 2870
     );
2871 2871
 
@@ -2887,7 +2887,7 @@  discard block
 block discarded – undo
2887 2887
         0,
2888 2888
         null,
2889 2889
         '',
2890
-        false,  //$send_mail = false,
2890
+        false, //$send_mail = false,
2891 2891
         false //$isAdmin = false
2892 2892
     );
2893 2893
 
@@ -2922,7 +2922,7 @@  discard block
 block discarded – undo
2922 2922
     Database::query($sql);
2923 2923
 
2924 2924
     foreach ($files as $version) {
2925
-        $version = str_replace(['Version',  '.php' ], '', $version->getFilename());
2925
+        $version = str_replace(['Version', '.php'], '', $version->getFilename());
2926 2926
         $sql = "INSERT INTO version (version) VALUES ('$version')";
2927 2927
         Database::query($sql);
2928 2928
     }
@@ -2968,7 +2968,7 @@  discard block
 block discarded – undo
2968 2968
                 SET selected_value = '".$param->selected_value."'
2969 2969
                 WHERE variable = '".$param->variable."'";
2970 2970
         if (!empty($param->subkey)) {
2971
-            $sql .= " AND subkey='" . $param->subkey . "'";
2971
+            $sql .= " AND subkey='".$param->subkey."'";
2972 2972
         }
2973 2973
         Database::query($sql);
2974 2974
     }
Please login to merge, or discard this patch.
main/permissions/permissions_functions.inc.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 /**
120 120
 * This function retrieves the existing permissions of a user, group or role.
121
-* @param $content are we retrieving the rights of a user, a group or a role (the database depends on it)
121
+* @param string $content are we retrieving the rights of a user, a group or a role (the database depends on it)
122 122
 * @param $id the id of the user, group or role
123 123
 * @author Patrick Cool <[email protected]>, Ghent University
124 124
 * @version 1.0
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 
527 527
 /**
528 528
 * This function gets all the roles that are defined
529
-* @param $content are we finding the roles for a user or a group (the database depends on it)
529
+* @param string $content are we finding the roles for a user or a group (the database depends on it)
530 530
 * @param $id the id of the user or group
531 531
 * @param string	Deprecated parameter allowing use of 'platform' scope - the corresponding tables don't exist anymore so the scope is always set to 'course'
532 532
 * @return array that contains the name of the roles the user has
Please login to merge, or discard this patch.
Braces   +10 added lines, -17 removed lines patch added patch discarded remove patch
@@ -206,8 +206,7 @@  discard block
 block discarded – undo
206 206
 function display_checkbox_matrix($permission_array, $tool, $permission, $inherited_permissions = array())
207 207
 {
208 208
     $checked = "";
209
-    if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool]))
210
-    {
209
+    if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool])) {
211 210
         $checked = "checked";
212 211
     }
213 212
     echo "\t\t\t<input type=\"checkbox\" name=\"permission*$tool*$permission\" $checked>\n";
@@ -254,8 +253,7 @@  discard block
 block discarded – undo
254 253
                     echo "</a>";
255 254
                 }
256 255
             } else {
257
-                if ($editable)
258
-                {
256
+                if ($editable) {
259 257
                     $url = api_get_self();
260 258
                     $urlparameters = '';
261 259
                     foreach ($_GET as $key => $value) {
@@ -273,8 +271,7 @@  discard block
 block discarded – undo
273 271
                     echo "\t\t\t <a href=\"".$url."\">";
274 272
                 }
275 273
                 echo "<img src=\"../img/wrong.gif\" border=\"0\"/>";
276
-                if ($editable)
277
-                {
274
+                if ($editable) {
278 275
                     echo "</a>";
279 276
                 }
280 277
             }
@@ -306,8 +303,7 @@  discard block
 block discarded – undo
306 303
                 if ($editable) {
307 304
                     $url = api_get_self();
308 305
                     $urlparameters = '';
309
-                    foreach ($_GET as $key => $value)
310
-                    {
306
+                    foreach ($_GET as $key => $value) {
311 307
                         $parameter[$key] = $value;
312 308
                     }
313 309
                     $parameter['action'] = 'manage_rights';
@@ -315,8 +311,7 @@  discard block
 block discarded – undo
315 311
                     $parameter['permission'] = $permission;
316 312
                     $parameter['tool'] = $tool;
317 313
                     $parameter['user_id'] = $user_id;
318
-                    foreach ($parameter as $key=>$value)
319
-                    {
314
+                    foreach ($parameter as $key=>$value) {
320 315
                         $urlparameters .= $key.'='.$value.'&amp;';
321 316
                     }
322 317
                     $url = $url.'?'.$urlparameters;
@@ -433,16 +428,15 @@  discard block
 block discarded – undo
433 428
 * @author Patrick Cool <[email protected]>, Ghent University
434 429
 * @version 1.0
435 430
 */
436
-function get_all_roles($content = 'course') {
431
+function get_all_roles($content = 'course')
432
+{
437 433
     $course_id = api_get_course_int_id();
438 434
     $course_id_condition = " WHERE c_id = $course_id ";
439 435
 
440
-    if ($content == 'course')
441
-    {
436
+    if ($content == 'course') {
442 437
         $table_role = Database::get_course_table(TABLE_ROLE);
443 438
     }
444
-    if ($content == 'platform')
445
-    {
439
+    if ($content == 'platform') {
446 440
         $table_role = Database::get_main_table(TABLE_ROLE);
447 441
         $course_id_condition = '';
448 442
     }
@@ -450,8 +444,7 @@  discard block
 block discarded – undo
450 444
     $current_roles = array();
451 445
     $sql = "SELECT * FROM $table_role $course_id_condition ";
452 446
     $result = Database::query($sql);
453
-    while ($row = Database::fetch_array($result))
454
-    {
447
+    while ($row = Database::fetch_array($result)) {
455 448
         $roles[] = $row;
456 449
     }
457 450
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                 if ($value == 'View') {
176 176
                     unset($current_permissions[$tool][$key]);
177 177
                 }
178
-                if ($value == 'Visibility' OR $value == 'Move') {
178
+                if ($value == 'Visibility' or $value == 'Move') {
179 179
                     if (!in_array('Edit', $current_permissions[$tool])) {
180 180
                         $current_permissions[$tool][] = 'Edit';
181 181
                     }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 function display_checkbox_matrix($permission_array, $tool, $permission, $inherited_permissions = array())
207 207
 {
208 208
     $checked = "";
209
-    if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool]))
209
+    if (is_array($permission_array[$tool]) and in_array($permission, $permission_array[$tool]))
210 210
     {
211 211
         $checked = "checked";
212 212
     }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         if (in_array($permission, $inherited_permissions[$tool])) {
233 233
             echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">";
234 234
         } else {
235
-            if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool])) {
235
+            if (is_array($permission_array[$tool]) and in_array($permission, $permission_array[$tool])) {
236 236
                 if ($editable) {
237 237
                     $url = api_get_self();
238 238
                     $urlparameters = '';
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         if (!empty($inherited_permissions) and in_array($permission, $inherited_permissions[$tool])) {
303 303
             echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">";
304 304
         } else {
305
-            if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool])) {
305
+            if (is_array($permission_array[$tool]) and in_array($permission, $permission_array[$tool])) {
306 306
                 if ($editable) {
307 307
                     $url = api_get_self();
308 308
                     $urlparameters = '';
Please login to merge, or discard this patch.
main/webservices/additional_webservices.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 }
85 85
 
86 86
 /**
87
- * @param $directoryPath
87
+ * @param string $directoryPath
88 88
  * @return bool
89 89
  */
90 90
 function deleteDirectory($directoryPath)
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     }
29 29
     $fileData = $pptData['file_data'];
30 30
     $dataInfo = pathinfo($pptData['file_name']);
31
-    $fileName =  basename($pptData['file_name'], '.' . $dataInfo['extension']);
31
+    $fileName = basename($pptData['file_name'], '.'.$dataInfo['extension']);
32 32
     $fullFileName = $pptData['file_name'];
33 33
     $size = $pptData['service_ppt2lp_size'];
34 34
     $w = '800';
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
     }
39 39
 
40 40
     $tempArchivePath = api_get_path(SYS_ARCHIVE_PATH);
41
-    $tempPath = $tempArchivePath . 'wsConvert/' . $fileName . '/';
42
-    $tempPathNewFiles = $tempArchivePath . 'wsConvert/' . $fileName . '-n/';
41
+    $tempPath = $tempArchivePath.'wsConvert/'.$fileName.'/';
42
+    $tempPathNewFiles = $tempArchivePath.'wsConvert/'.$fileName.'-n/';
43 43
 
44 44
     $oldumask = umask(0);
45 45
     //$perms = api_get_permissions_for_new_directories();
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
     pptConverterDirectoriesCreate($tempPath, $tempPathNewFiles, $fileName, $perms);
50 50
 
51 51
     $file = base64_decode($fileData);
52
-    file_put_contents($tempPath . $fullFileName, $file);
52
+    file_put_contents($tempPath.$fullFileName, $file);
53 53
 
54 54
     $cmd = pptConverterGetCommandBaseParams();
55
-    $cmd .= ' -w ' . $w . ' -h ' . $h . ' -d oogie "' . $tempPath . $fullFileName.'"  "' . $tempPathNewFiles . $fileName . '.html"';
55
+    $cmd .= ' -w '.$w.' -h '.$h.' -d oogie "'.$tempPath.$fullFileName.'"  "'.$tempPathNewFiles.$fileName.'.html"';
56 56
 
57 57
     //$perms = api_get_permissions_for_new_files();
58
-    chmod($tempPathNewFiles . $fileName, $perms);
58
+    chmod($tempPathNewFiles.$fileName, $perms);
59 59
 
60 60
     $files = array();
61 61
     $return = 0;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         if (is_array($files) && !empty($files)) {
68 68
             foreach ($files as $file) {
69 69
                 $imageData = explode('||', $file);
70
-                $images[$imageData[1]] = base64_encode(file_get_contents($tempPathNewFiles . $fileName . '/' . $imageData[1]));
70
+                $images[$imageData[1]] = base64_encode(file_get_contents($tempPathNewFiles.$fileName.'/'.$imageData[1]));
71 71
             }
72 72
         }
73 73
         $data = array(
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
  */
94 94
 function deleteDirectory($directoryPath)
95 95
 {
96
-    $files = array_diff(scandir($directoryPath), array('.','..'));
96
+    $files = array_diff(scandir($directoryPath), array('.', '..'));
97 97
     foreach ($files as $file) {
98 98
         if (is_dir("$directoryPath/$file")) {
99 99
             deleteDirectory("$directoryPath/$file");
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
     if (!is_dir($tempPathNewFiles)) {
122 122
         mkdir($tempPathNewFiles, $perms, true);
123 123
     }
124
-    if (!is_dir($tempPathNewFiles . $fileName)) {
125
-        mkdir($tempPathNewFiles . $fileName, $perms, true);
124
+    if (!is_dir($tempPathNewFiles.$fileName)) {
125
+        mkdir($tempPathNewFiles.$fileName, $perms, true);
126 126
     }
127 127
 }
128 128
 
@@ -133,16 +133,16 @@  discard block
 block discarded – undo
133 133
 function pptConverterGetCommandBaseParams()
134 134
 {
135 135
     if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php
136
-        $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png');
137
-        $classPath = $converterPath . ';' . $converterPath . '/jodconverter-2.2.2.jar;' . $converterPath . '/jodconverter-cli-2.2.2.jar';
138
-        $cmd = 'java -Dfile.encoding=UTF-8 -cp "' . $classPath . '" DokeosConverter';
136
+        $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png');
137
+        $classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar';
138
+        $cmd = 'java -Dfile.encoding=UTF-8 -cp "'.$classPath.'" DokeosConverter';
139 139
     } else {
140
-        $converterPath = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png';
140
+        $converterPath = api_get_path(SYS_PATH).'main/inc/lib/ppt2png';
141 141
         $classPath = ' -Dfile.encoding=UTF-8 -cp .:jodconverter-2.2.2.jar:jodconverter-cli-2.2.2.jar';
142
-        $cmd = 'cd ' . $converterPath . ' && java ' . $classPath . ' DokeosConverter';
142
+        $cmd = 'cd '.$converterPath.' && java '.$classPath.' DokeosConverter';
143 143
     }
144 144
 
145
-    $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port');
145
+    $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port');
146 146
     return $cmd;
147 147
 }
148 148
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 $webCodePath = api_get_path(WEB_CODE_PATH);
152 152
 $options = array(
153 153
     'uri' => $webPath,
154
-    'location' => $webCodePath . 'webservices/additional_webservices.php'
154
+    'location' => $webCodePath.'webservices/additional_webservices.php'
155 155
 );
156 156
 
157 157
 $soapServer = new SoapServer(NULL, $options);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,8 @@
 block discarded – undo
132 132
  */
133 133
 function pptConverterGetCommandBaseParams()
134 134
 {
135
-    if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php
135
+    if (IS_WINDOWS_OS) {
136
+// IS_WINDOWS_OS has been defined in main_api.lib.php
136 137
         $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png');
137 138
         $classPath = $converterPath . ';' . $converterPath . '/jodconverter-2.2.2.jar;' . $converterPath . '/jodconverter-cli-2.2.2.jar';
138 139
         $cmd = 'java -Dfile.encoding=UTF-8 -cp "' . $classPath . '" DokeosConverter';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -154,6 +154,6 @@
 block discarded – undo
154 154
     'location' => $webCodePath . 'webservices/additional_webservices.php'
155 155
 );
156 156
 
157
-$soapServer = new SoapServer(NULL, $options);
157
+$soapServer = new SoapServer(null, $options);
158 158
 $soapServer->addFunction('wsConvertPpt');
159 159
 $soapServer->handle();
Please login to merge, or discard this patch.
main/webservices/cm_webservice_user.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
     /**
138 138
     * Get a list of users of which the given conditions match with a LIKE '%cond%'
139 139
     * @param array $conditions a list of condition (exemple : status=>STUDENT)
140
-    * @param array $order_by a list of fields on which sort
140
+    * @param string[] $order_by a list of fields on which sort
141 141
     * @return array An array with all users of the platform.
142 142
     * @todo optional course code parameter, optional sorting parameters...
143 143
      *@todo Use the UserManager class
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     {
103 103
         global $charset;
104 104
         if ($this->verifyUserPass($username, $password) == "valid") {
105
-		    $user_id = UserManager::get_user_id_from_username($username);
105
+            $user_id = UserManager::get_user_id_from_username($username);
106 106
             $message_title = get_lang('Invitation');
107 107
             $count_is_true = SocialManager::send_invitation_friend($user_id,$userfriend_id, $message_title, $content_message);
108 108
 
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
 
143 143
 
144 144
     /**
145
-    * Get a list of users of which the given conditions match with a LIKE '%cond%'
146
-    * @param array $conditions a list of condition (exemple : status=>STUDENT)
147
-    * @param array $order_by a list of fields on which sort
148
-    * @return array An array with all users of the platform.
149
-    * @todo optional course code parameter, optional sorting parameters...
145
+     * Get a list of users of which the given conditions match with a LIKE '%cond%'
146
+     * @param array $conditions a list of condition (exemple : status=>STUDENT)
147
+     * @param array $order_by a list of fields on which sort
148
+     * @return array An array with all users of the platform.
149
+     * @todo optional course code parameter, optional sorting parameters...
150 150
      *@todo Use the UserManager class
151 151
      * @todo security filter order by
152
-    */
152
+     */
153 153
     private static function get_user_list_like_start($conditions = [], $order_by = [])
154 154
     {
155 155
         $user_table = Database::get_main_table(TABLE_MAIN_USER);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
         if ($this->verifyUserPass($username, $password) == "valid") {
105 105
 		    $user_id = UserManager::get_user_id_from_username($username);
106 106
             $message_title = get_lang('Invitation');
107
-            $count_is_true = SocialManager::send_invitation_friend($user_id,$userfriend_id, $message_title, $content_message);
107
+            $count_is_true = SocialManager::send_invitation_friend($user_id, $userfriend_id, $message_title, $content_message);
108 108
 
109 109
             if ($count_is_true) {
110 110
                 return Display::return_message(api_htmlentities(get_lang('InvitationHasBeenSent'), ENT_QUOTES, $charset), 'normal', false);
Please login to merge, or discard this patch.
plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php 1 patch
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
      * Register a user into a queue for a session
371 371
      * @param $userId
372 372
      * @param $sessionId
373
-     * @return bool|int
373
+     * @return false|string
374 374
      */
375 375
     public function addToQueue($userId, $sessionId)
376 376
     {
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
      * Register message with type and status
397 397
      * @param $mailId
398 398
      * @param $userId
399
-     * @param $sessionId
399
+     * @param integer $sessionId
400 400
      * @return bool|int
401 401
      */
402 402
     public function saveLastMessage($mailId, $userId, $sessionId)
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 
510 510
     /**
511 511
      * Check if session is open for subscription
512
-     * @param $sessionId
512
+     * @param integer $sessionId
513 513
      * @param string $fieldVariable
514 514
      * @return bool
515 515
      */
@@ -531,8 +531,8 @@  discard block
 block discarded – undo
531 531
 
532 532
     /**
533 533
      * Check if user is in the session's target group based on its area
534
-     * @param $userId
535
-     * @param $sessionId
534
+     * @param integer $userId
535
+     * @param integer $sessionId
536 536
      * @param string $userFieldVariable
537 537
      * @param string $sessionFieldVariable
538 538
      * @return bool
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
     /**
1003 1003
      * Return the session details data from a session ID (including the extra
1004 1004
      * fields used for the advanced subscription mechanism)
1005
-     * @param $sessionId
1005
+     * @param integer $sessionId
1006 1006
      * @return bool|mixed
1007 1007
      */
1008 1008
     public function getSessionDetails($sessionId)
@@ -1102,7 +1102,7 @@  discard block
 block discarded – undo
1102 1102
 
1103 1103
     /**
1104 1104
      * Return the url to go to session
1105
-     * @param $sessionId
1105
+     * @param integer $sessionId
1106 1106
      *
1107 1107
      * @return string
1108 1108
      */
Please login to merge, or discard this patch.