Completed
Push — 1.11.x ( 253320...1d91e0 )
by José
124:55 queued 86:48
created
main/inc/lib/array.lib.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -108,24 +108,24 @@
 block discarded – undo
108 108
  */
109 109
 function utf8_sort($array)
110 110
 {
111
-	$old_locale = setlocale(LC_ALL, null);
112
-	$code = api_get_language_isocode();
113
-	$locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
114
-	$try_sort = false;
111
+    $old_locale = setlocale(LC_ALL, null);
112
+    $code = api_get_language_isocode();
113
+    $locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
114
+    $try_sort = false;
115 115
 
116
-	foreach($locale_list as $locale) {
117
-		$my_local = setlocale(LC_COLLATE, $locale);
118
-		if ($my_local) {
119
-			$try_sort = true;
120
-			break;
121
-		}
122
-	}
116
+    foreach($locale_list as $locale) {
117
+        $my_local = setlocale(LC_COLLATE, $locale);
118
+        if ($my_local) {
119
+            $try_sort = true;
120
+            break;
121
+        }
122
+    }
123 123
 
124
-	if ($try_sort) {
125
-		uasort($array, 'strcoll');
126
-	}
127
-	setlocale(LC_COLLATE, $old_locale);
128
-	return $array;
124
+    if ($try_sort) {
125
+        uasort($array, 'strcoll');
126
+    }
127
+    setlocale(LC_COLLATE, $old_locale);
128
+    return $array;
129 129
 }
130 130
 
131 131
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 {
111 111
 	$old_locale = setlocale(LC_ALL, null);
112 112
 	$code = api_get_language_isocode();
113
-	$locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
113
+	$locale_list = array($code.'.utf8', 'en.utf8', 'en_US.utf8', 'en_GB.utf8');
114 114
 	$try_sort = false;
115 115
 
116
-	foreach($locale_list as $locale) {
116
+	foreach ($locale_list as $locale) {
117 117
 		$my_local = setlocale(LC_COLLATE, $locale);
118 118
 		if ($my_local) {
119 119
 			$try_sort = true;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     $flatten = array();
152 152
     array_walk_recursive(
153 153
         $array,
154
-        function ($value) use (&$flatten) {
154
+        function($value) use (&$flatten) {
155 155
             $flatten[] = $value;
156 156
         }
157 157
     );
Please login to merge, or discard this patch.
main/inc/lib/notebook.lib.php 2 patches
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -219,10 +219,10 @@
 block discarded – undo
219 219
         // action links
220 220
         echo '<div class="actions">';
221 221
         if (!api_is_anonymous()) {
222
-            if (api_get_session_id() == 0)
223
-                echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
222
+            if (api_get_session_id() == 0) {
223
+                            echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
224 224
                     Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
225
-            elseif (api_is_allowed_to_session_edit(false, true)) {
225
+            } elseif (api_is_allowed_to_session_edit(false, true)) {
226 226
                 echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
227 227
                     Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
228 228
             }
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         return "<script>
30 30
 				function confirmation (name)
31 31
 				{
32
-					if (confirm(\" " . get_lang("NoteConfirmDelete") . " \"+ name + \" ?\"))
32
+					if (confirm(\" " . get_lang("NoteConfirmDelete")." \"+ name + \" ?\"))
33 33
 						{return true;}
34 34
 					else
35 35
 						{return false;}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                 description 		AS note_comment,
108 108
                 session_id			AS session_id
109 109
                FROM $t_notebook
110
-               WHERE c_id = $course_id AND notebook_id = '" . intval($notebook_id) . "' ";
110
+               WHERE c_id = $course_id AND notebook_id = '".intval($notebook_id)."' ";
111 111
         $result = Database::query($sql);
112 112
         if (Database::num_rows($result) != 1) {
113 113
             return array();
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
         $sql = "DELETE FROM $t_notebook
182 182
                 WHERE
183 183
                     c_id = $course_id AND
184
-                    notebook_id='" . intval($notebook_id) . "' AND
185
-                    user_id = '" . api_get_user_id() . "'";
184
+                    notebook_id='".intval($notebook_id)."' AND
185
+                    user_id = '" . api_get_user_id()."'";
186 186
         $result = Database::query($sql);
187 187
         $affected_rows = Database::affected_rows($result);
188 188
         if ($affected_rows != 1) {
@@ -220,22 +220,22 @@  discard block
 block discarded – undo
220 220
         echo '<div class="actions">';
221 221
         if (!api_is_anonymous()) {
222 222
             if (api_get_session_id() == 0)
223
-                echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
224
-                    Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
223
+                echo '<a href="index.php?'.api_get_cidreq().'&action=addnote">'.
224
+                    Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>';
225 225
             elseif (api_is_allowed_to_session_edit(false, true)) {
226
-                echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
227
-                    Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
226
+                echo '<a href="index.php?'.api_get_cidreq().'&action=addnote">'.
227
+                    Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>';
228 228
             }
229 229
         } else {
230
-            echo '<a href="javascript:void(0)">' . Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
230
+            echo '<a href="javascript:void(0)">'.Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>';
231 231
         }
232 232
 
233
-        echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=creation_date&direction=' . $link_sort_direction . '">' .
234
-            Display::return_icon('notes_order_by_date_new.png', get_lang('OrderByCreationDate'), '', '32') . '</a>';
235
-        echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=update_date&direction=' . $link_sort_direction . '">' .
236
-            Display::return_icon('notes_order_by_date_mod.png', get_lang('OrderByModificationDate'), '', '32') . '</a>';
237
-        echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=title&direction=' . $link_sort_direction . '">' .
238
-            Display::return_icon('notes_order_by_title.png', get_lang('OrderByTitle'), '', '32') . '</a>';
233
+        echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=creation_date&direction='.$link_sort_direction.'">'.
234
+            Display::return_icon('notes_order_by_date_new.png', get_lang('OrderByCreationDate'), '', '32').'</a>';
235
+        echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=update_date&direction='.$link_sort_direction.'">'.
236
+            Display::return_icon('notes_order_by_date_mod.png', get_lang('OrderByModificationDate'), '', '32').'</a>';
237
+        echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=title&direction='.$link_sort_direction.'">'.
238
+            Display::return_icon('notes_order_by_title.png', get_lang('OrderByTitle'), '', '32').'</a>';
239 239
         echo '</div>';
240 240
 
241 241
         if (!isset($_SESSION['notebook_view']) || !in_array($_SESSION['notebook_view'], array('creation_date', 'update_date', 'title'))) {
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
         $t_notebook = Database :: get_course_table(TABLE_NOTEBOOK);
247 247
         $order_by = "";
248 248
         if ($_SESSION['notebook_view'] == 'creation_date' || $_SESSION['notebook_view'] == 'update_date') {
249
-            $order_by = " ORDER BY " . $_SESSION['notebook_view'] . " $sort_direction ";
249
+            $order_by = " ORDER BY ".$_SESSION['notebook_view']." $sort_direction ";
250 250
         } else {
251
-            $order_by = " ORDER BY " . $_SESSION['notebook_view'] . " $sort_direction ";
251
+            $order_by = " ORDER BY ".$_SESSION['notebook_view']." $sort_direction ";
252 252
         }
253 253
 
254 254
         //condition for the session
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         $sql = "SELECT * FROM $t_notebook
262 262
                 WHERE
263 263
                     c_id = $course_id AND
264
-                    user_id = '" . api_get_user_id() . "'
264
+                    user_id = '".api_get_user_id()."'
265 265
                     $condition_session
266 266
                     $cond_extra $order_by
267 267
                 ";
@@ -274,18 +274,18 @@  discard block
 block discarded – undo
274 274
 
275 275
             $updateValue = '';
276 276
             if ($row['update_date'] <> $row['creation_date']) {
277
-                $updateValue = ', ' . get_lang('UpdateDate') . ': ' . date_to_str_ago($row['update_date']) . '&nbsp;&nbsp;<span class="dropbox_date">' . $update_date . '</span>';
277
+                $updateValue = ', '.get_lang('UpdateDate').': '.date_to_str_ago($row['update_date']).'&nbsp;&nbsp;<span class="dropbox_date">'.$update_date.'</span>';
278 278
             }
279 279
 
280
-            $actions = '<a href="' . api_get_self() . '?action=editnote&notebook_id=' . $row['notebook_id'] . '">' .
281
-                Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>';
282
-            $actions .= '<a href="' . api_get_self() . '?action=deletenote&notebook_id=' . $row['notebook_id'] . '" onclick="return confirmation(\'' . $row['title'] . '\');">' .
283
-                Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>';
280
+            $actions = '<a href="'.api_get_self().'?action=editnote&notebook_id='.$row['notebook_id'].'">'.
281
+                Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
282
+            $actions .= '<a href="'.api_get_self().'?action=deletenote&notebook_id='.$row['notebook_id'].'" onclick="return confirmation(\''.$row['title'].'\');">'.
283
+                Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
284 284
 
285 285
             echo Display::panel(
286 286
                 $row['description'],
287
-                $row['title'] . $session_img.' <div class="pull-right">'.$actions.'</div>',
288
-                get_lang('CreationDate') . ': ' . date_to_str_ago($row['creation_date']) . '&nbsp;&nbsp;<span class="dropbox_date">' . $creation_date . $updateValue."</span>"
287
+                $row['title'].$session_img.' <div class="pull-right">'.$actions.'</div>',
288
+                get_lang('CreationDate').': '.date_to_str_ago($row['creation_date']).'&nbsp;&nbsp;<span class="dropbox_date">'.$creation_date.$updateValue."</span>"
289 289
             );
290 290
         }
291 291
     }
Please login to merge, or discard this patch.
main/inc/lib/display.lib.php 4 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -666,9 +666,10 @@
 block discarded – undo
666 666
         $result = '';
667 667
         for ($i = $min; $i <= $max; $i ++) {
668 668
             $result .= '<option value="'.$i.'"';
669
-            if (is_int($selected_num))
670
-                if ($selected_num == $i) {
669
+            if (is_int($selected_num)) {
670
+                            if ($selected_num == $i) {
671 671
                     $result .= ' selected="selected"';
672
+            }
672 673
                 }
673 674
             $result .= '>'.$i.'</option>';
674 675
         }
Please login to merge, or discard this patch.
Doc Comments   +26 added lines, -17 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(
@@ -886,6 +886,7 @@  discard block
 block discarded – undo
886 886
     /**
887 887
      * Displays an HTML input tag
888 888
      *
889
+     * @param string $type
889 890
      */
890 891
     public static function input($type, $name, $value, $attributes = array())
891 892
     {
@@ -902,8 +903,8 @@  discard block
 block discarded – undo
902 903
     }
903 904
 
904 905
     /**
905
-     * @param $name
906
-     * @param $value
906
+     * @param string $name
907
+     * @param string $value
907 908
      * @param array $attributes
908 909
      * @return string
909 910
      */
@@ -918,6 +919,7 @@  discard block
 block discarded – undo
918 919
     /**
919 920
      * Displays an HTML select tag
920 921
      *
922
+     * @param string $blank_item_text
921 923
      */
922 924
     public static function select(
923 925
         $name,
@@ -984,8 +986,8 @@  discard block
 block discarded – undo
984 986
                         $( "#tabs" ).tabs();
985 987
                     });
986 988
                 </script>
987
-     * @param   array   $headers list of the tab titles
988
-     * @param   array   $items
989
+     * @param   string[]   $headers list of the tab titles
990
+     * @param   string[]   $items
989 991
      * @param   string  $id id of the container of the tab in the example "tabs"
990 992
      * @param   array   $attributes for the ul
991 993
      * @param array $ul_attributes
@@ -1039,7 +1041,7 @@  discard block
 block discarded – undo
1039 1041
 
1040 1042
     /**
1041 1043
      * @param $headers
1042
-     * @param null $selected
1044
+     * @param integer $selected
1043 1045
      *
1044 1046
      * @return string
1045 1047
      */
@@ -1077,6 +1079,7 @@  discard block
 block discarded – undo
1077 1079
      * As you can see both function use the same "my_grid_name" this is very important otherwise nothing will work
1078 1080
      *
1079 1081
      * @param   string  the div id, this value must be the same with the first parameter of Display::grid_js()
1082
+     * @param string $div_id
1080 1083
      * @return  string  html
1081 1084
      *
1082 1085
      */
@@ -1632,6 +1635,8 @@  discard block
 block discarded – undo
1632 1635
      * @param  string  url that will be added (for jquery see hot_courses.tpl)
1633 1636
 	 * @param	string	point info array see function CourseManager::get_course_ranking()
1634 1637
 	 * @param	bool	add a div wrapper
1638
+	 * @param string $id
1639
+	 * @param string $url
1635 1640
 	 * @todo	use     templates
1636 1641
      **/
1637 1642
     public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true)
@@ -1727,6 +1732,9 @@  discard block
 block discarded – undo
1727 1732
         return '<'.$size.'>'.Security::remove_XSS($title).'</'.$size.'>';
1728 1733
     }
1729 1734
 
1735
+    /**
1736
+     * @param string $title
1737
+     */
1730 1738
     public static function page_subheader2($title, $second_title = null)
1731 1739
     {
1732 1740
         return self::page_header($title, $second_title, 'h4');
@@ -1957,6 +1965,7 @@  discard block
 block discarded – undo
1957 1965
 
1958 1966
     /**
1959 1967
      * @todo use twig
1968
+     * @param string $title
1960 1969
      */
1961 1970
     public static function group_button($title, $elements)
1962 1971
     {
@@ -2174,9 +2183,9 @@  discard block
 block discarded – undo
2174 2183
 
2175 2184
     /**
2176 2185
      * @param int $id
2177
-     * @param array $content
2186
+     * @param string[] $content
2178 2187
      * @param int $col
2179
-     * @param bool|true $right
2188
+     * @param boolean $right
2180 2189
      * @return string
2181 2190
      */
2182 2191
     public static function toolbarAction($id, $content = array(), $col = 2, $right = true)
@@ -2258,10 +2267,10 @@  discard block
 block discarded – undo
2258 2267
     /**
2259 2268
      * @param string $title
2260 2269
      * @param string $content
2261
-     * @param null $id
2270
+     * @param string $id
2262 2271
      * @param array $params
2263
-     * @param null $idAccordion
2264
-     * @param null $idCollapse
2272
+     * @param string $idAccordion
2273
+     * @param string $idCollapse
2265 2274
      * @param bool|true $open
2266 2275
      * @param bool|false $fullClickable
2267 2276
      * @return null|string
Please login to merge, or discard this patch.
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
         );
50 50
     }
51 51
 
52
-     /**
53
-     * Displays the page header
54
-     * @param string The name of the page (will be showed in the page title)
55
-     * @param string Optional help file name
56
-     * @param string $page_header
57
-     */
52
+        /**
53
+         * Displays the page header
54
+         * @param string The name of the page (will be showed in the page title)
55
+         * @param string Optional help file name
56
+         * @param string $page_header
57
+         */
58 58
     public static function display_header($tool_name ='', $help = null, $page_header = null)
59 59
     {
60 60
         $origin = api_get_origin();
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
      */
449 449
     public static function display_normal_message($message, $filter = true, $returnValue = false)
450 450
     {
451
-    	$message = self::return_message($message, 'normal', $filter);
451
+        $message = self::return_message($message, 'normal', $filter);
452 452
         if ($returnValue) {
453 453
             return $message;
454 454
         } else {
@@ -528,22 +528,22 @@  discard block
 block discarded – undo
528 528
         }
529 529
 
530 530
         if ($filter) {
531
-        	$message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
531
+            $message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
532 532
         }
533 533
 
534 534
         $class = "";
535 535
         switch($type) {
536 536
             case 'warning':
537 537
                $class .= 'alert alert-warning';
538
-               break;
538
+                break;
539 539
             case 'error':
540 540
                $class .= 'alert alert-danger';
541
-               break;
541
+                break;
542 542
             case 'confirmation':
543 543
             case 'confirm':
544 544
             case 'success':
545 545
                 $class .= 'alert alert-success';
546
-               break;
546
+                break;
547 547
             case 'normal':
548 548
             default:
549 549
                 $class .= 'alert alert-info';
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
      * @param array    additional attributes (for instance height, width, onclick, ...)
687 687
      * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
688 688
      * @return void
689
-    */
689
+     */
690 690
     public static function display_icon(
691 691
         $image,
692 692
         $alt_text = '',
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
      * @author Julio Montoya 2010 Function improved, adding image constants
723 723
      * @author Yannick Warnier 2011 Added size handler
724 724
      * @version Feb 2011
725
-    */
725
+     */
726 726
     public static function return_icon(
727 727
         $image,
728 728
         $alt_text = '',
@@ -911,14 +911,14 @@  discard block
 block discarded – undo
911 911
      */
912 912
     public static function input($type, $name, $value, $attributes = array())
913 913
     {
914
-         if (isset($type)) {
915
-             $attributes['type']= $type;
916
-         }
917
-         if (isset($name)) {
918
-             $attributes['name']= $name;
919
-         }
920
-         if (isset($value)) {
921
-             $attributes['value']= $value;
914
+            if (isset($type)) {
915
+                $attributes['type']= $type;
916
+            }
917
+            if (isset($name)) {
918
+                $attributes['name']= $name;
919
+            }
920
+            if (isset($value)) {
921
+                $attributes['value']= $value;
922 922
         }
923 923
         return self::tag('input', '', $attributes);
924 924
     }
@@ -931,10 +931,10 @@  discard block
 block discarded – undo
931 931
      */
932 932
     public static function button($name, $value, $attributes = array())
933 933
     {
934
-    	if (!empty($name)) {
934
+        if (!empty($name)) {
935 935
             $attributes['name'] = $name;
936
-    	}
937
-    	return self::tag('button', $value, $attributes);
936
+        }
937
+        return self::tag('button', $value, $attributes);
938 938
     }
939 939
 
940 940
     /**
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
      * in the $htmlHeadXtra variable before the display_header
1002 1002
      * Add this script
1003 1003
      * @example
1004
-             * <script>
1004
+     * <script>
1005 1005
                     $(function() {
1006 1006
                         $( "#tabs" ).tabs();
1007 1007
                     });
@@ -1067,20 +1067,20 @@  discard block
 block discarded – undo
1067 1067
      */
1068 1068
     public static function tabsOnlyLink($headers, $selected = null)
1069 1069
     {
1070
-         $id = uniqid();
1071
-         $i = 1;
1072
-         $lis = null;
1073
-         foreach ($headers as $item) {
1070
+            $id = uniqid();
1071
+            $i = 1;
1072
+            $lis = null;
1073
+            foreach ($headers as $item) {
1074 1074
             $class = null;
1075 1075
             if ($i == $selected) {
1076 1076
                 $class = 'active';
1077 1077
             }
1078
-             $item = self::tag(
1079
-                 'a',
1080
-                 $item['content'],
1081
-                 array('id' => $id.'-'.$i, 'href' => $item['url'])
1082
-             );
1083
-             $lis .= self::tag('li', $item, array('class' => $class));
1078
+                $item = self::tag(
1079
+                    'a',
1080
+                    $item['content'],
1081
+                    array('id' => $id.'-'.$i, 'href' => $item['url'])
1082
+                );
1083
+                $lis .= self::tag('li', $item, array('class' => $class));
1084 1084
             $i++;
1085 1085
         }
1086 1086
         return self::tag('ul', $lis, array('class' => 'nav nav-tabs tabs-margin'));
@@ -1292,8 +1292,8 @@  discard block
 block discarded – undo
1292 1292
      */
1293 1293
     public static function table($headers, $rows, $attributes = array())
1294 1294
     {
1295
-    	if (empty($attributes)) {
1296
-    		$attributes['class'] = 'data_table';
1295
+        if (empty($attributes)) {
1296
+            $attributes['class'] = 'data_table';
1297 1297
         }
1298 1298
         $table = new HTML_Table($attributes);
1299 1299
         $row = 0;
@@ -1301,17 +1301,17 @@  discard block
 block discarded – undo
1301 1301
 
1302 1302
         // Course headers
1303 1303
         if (!empty($headers)) {
1304
-	        foreach ($headers as $item) {
1305
-	            $table->setHeaderContents($row, $column, $item);
1306
-	            $column++;
1307
-	        }
1308
-	        $row = 1;
1309
-	        $column = 0;
1304
+            foreach ($headers as $item) {
1305
+                $table->setHeaderContents($row, $column, $item);
1306
+                $column++;
1307
+            }
1308
+            $row = 1;
1309
+            $column = 0;
1310 1310
         }
1311 1311
 
1312 1312
         if (!empty($rows)) {
1313
-	        foreach($rows as $content) {
1314
-	            $table->setCellContents($row, $column, $content);
1313
+            foreach($rows as $content) {
1314
+                $table->setCellContents($row, $column, $content);
1315 1315
                 $row++;
1316 1316
             }
1317 1317
         }
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
                         //$item_property['tool'] != TOOL_DROPBOX &&
1418 1418
                         $item_property['tool'] != TOOL_NOTEBOOK &&
1419 1419
                         $item_property['tool'] != TOOL_CHAT)
1420
-                   )
1420
+                    )
1421 1421
                 )
1422 1422
                 // Take only what's visible or "invisible but where the user is a teacher" or where the visibility is unset.
1423 1423
                 && ($item_property['visibility'] == '1'
@@ -1433,7 +1433,7 @@  discard block
 block discarded – undo
1433 1433
                         ($item_property['to_user_id'] != $user_id) &&
1434 1434
                         (!isset($item_property['to_group_id']) || !in_array($item_property['to_group_id'], $group_ids)))
1435 1435
                 ) {
1436
-                   continue;
1436
+                    continue;
1437 1437
                 }
1438 1438
 
1439 1439
                 // If it's a survey, make sure the user's invited. Otherwise drop it.
@@ -1651,21 +1651,21 @@  discard block
 block discarded – undo
1651 1651
      *
1652 1652
      * @param  string  id of the rating ul element
1653 1653
      * @param  string  url that will be added (for jquery see hot_courses.tpl)
1654
-	 * @param	string	point info array see function CourseManager::get_course_ranking()
1655
-	 * @param	bool	add a div wrapper
1656
-	 * @todo	use     templates
1654
+     * @param	string	point info array see function CourseManager::get_course_ranking()
1655
+     * @param	bool	add a div wrapper
1656
+     * @todo	use     templates
1657 1657
      **/
1658 1658
     public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true)
1659 1659
     {
1660
-		$number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1661
-		$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1660
+        $number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1661
+        $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1662 1662
 
1663
-		if (!empty($percentage)) {
1663
+        if (!empty($percentage)) {
1664 1664
             $percentage = $percentage*125/100;
1665 1665
         }
1666
-		$accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1666
+        $accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1667 1667
 
1668
-		$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1668
+        $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1669 1669
 
1670 1670
         $html = '<ul id="'.$id.'" class="star-rating">
1671 1671
 					<li class="current-rating" style="width:'.$percentage.'px;"></li>
@@ -1676,26 +1676,26 @@  discard block
 block discarded – undo
1676 1676
 					<li><a href="javascript:void(0);" data-link="'.$url.'&amp;star=5" title="'.$star_label.'" class="five-stars">5</a></li>
1677 1677
 				</ul>';
1678 1678
 
1679
-		$labels = array();
1679
+        $labels = array();
1680 1680
 
1681
-		$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1682
-		$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1683
-		/* if (!empty($number_of_users_who_voted)) {
1681
+        $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1682
+        $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1683
+        /* if (!empty($number_of_users_who_voted)) {
1684 1684
 			$labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1685 1685
 		} */
1686 1686
 
1687
-		$labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1687
+        $labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1688 1688
 
1689
-		if (!$add_div_wrapper && api_is_anonymous()) {
1690
-			$labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1691
-		}
1689
+        if (!$add_div_wrapper && api_is_anonymous()) {
1690
+            $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1691
+        }
1692 1692
 
1693 1693
         $html .= Display::div(implode(' | ', $labels) , array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1694 1694
         $html .= ' '.Display::span(' ', array('id' =>  'vote_label2_'.$id));
1695 1695
 
1696 1696
         if ($add_div_wrapper) {
1697
-			$html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1698
-		}
1697
+            $html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1698
+        }
1699 1699
 
1700 1700
         return $html;
1701 1701
     }
@@ -1733,8 +1733,8 @@  discard block
 block discarded – undo
1733 1733
         return self::page_header($title, $second_title);
1734 1734
     }
1735 1735
 
1736
-     public static function page_subheader_and_translate($title, $second_title = null)
1737
-     {
1736
+        public static function page_subheader_and_translate($title, $second_title = null)
1737
+        {
1738 1738
         $title = get_lang($title);
1739 1739
         return self::page_subheader($title, $second_title);
1740 1740
     }
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 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);
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
         }
533 533
 
534 534
         $class = "";
535
-        switch($type) {
535
+        switch ($type) {
536 536
             case 'warning':
537 537
                $class .= 'alert alert-warning';
538 538
                break;
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
      * @param string  optional, class from stylesheet
561 561
      * @return string encrypted mailto hyperlink
562 562
      */
563
-    public static function encrypted_mailto_link ($email, $clickable_text = null, $style_class = '')
563
+    public static function encrypted_mailto_link($email, $clickable_text = null, $style_class = '')
564 564
     {
565 565
         if (is_null($clickable_text)) {
566 566
             $clickable_text = $email;
@@ -575,14 +575,14 @@  discard block
 block discarded – undo
575 575
         }
576 576
         // Encrypt email
577 577
         $hmail = '';
578
-        for ($i = 0; $i < strlen($email); $i ++) {
578
+        for ($i = 0; $i < strlen($email); $i++) {
579 579
             $hmail .= '&#'.ord($email {
580 580
             $i }).';';
581 581
         }
582 582
         $hclickable_text = null;
583 583
         // Encrypt clickable text if @ is present
584 584
         if (strpos($clickable_text, '@')) {
585
-            for ($i = 0; $i < strlen($clickable_text); $i ++) {
585
+            for ($i = 0; $i < strlen($clickable_text); $i++) {
586 586
                 $hclickable_text .= '&#'.ord($clickable_text {
587 587
                 $i }).';';
588 588
             }
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
         }
615 615
         // Encrypt email
616 616
         $hmail = '';
617
-        for ($i = 0; $i < strlen($email); $i ++) {
617
+        for ($i = 0; $i < strlen($email); $i++) {
618 618
             $hmail .= '&#'.ord($email {
619 619
             $i }).';';
620 620
         }
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
     public static function get_alphabet_options($selected_letter = '')
648 648
     {
649 649
         $result = '';
650
-        for ($i = 65; $i <= 90; $i ++) {
650
+        for ($i = 65; $i <= 90; $i++) {
651 651
             $letter = chr($i);
652 652
             $result .= '<option value="'.$letter.'"';
653 653
             if ($selected_letter == $letter) {
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
     public static function get_numeric_options($min, $max, $selected_num = 0)
669 669
     {
670 670
         $result = '';
671
-        for ($i = $min; $i <= $max; $i ++) {
671
+        for ($i = $min; $i <= $max; $i++) {
672 672
             $result .= '<option value="'.$i.'"';
673 673
             if (is_int($selected_num))
674 674
                 if ($selected_num == $i) {
@@ -738,8 +738,8 @@  discard block
 block discarded – undo
738 738
         // important to use the public path (i.e. web/css/) rather than the
739 739
         // internal path (/app/Resource/public/css/) because the path used
740 740
         // in the end must be the public path
741
-        $alternateCssPath = api_get_path(SYS_PUBLIC_PATH) . 'css/';
742
-        $alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH) . 'css/';
741
+        $alternateCssPath = api_get_path(SYS_PUBLIC_PATH).'css/';
742
+        $alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH).'css/';
743 743
 
744 744
         $image = trim($image);
745 745
 
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
             $size = ICON_SIZE_SMALL;
750 750
         }
751 751
 
752
-        $size_extra = $size . '/';
752
+        $size_extra = $size.'/';
753 753
 
754 754
         // Checking the img/ folder
755 755
         $icon = $w_code_path.'img/'.$image;
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
         $theme = 'themes/chamilo/icons/';
758 758
 
759 759
         if ($loadThemeIcon) {
760
-            $theme = 'themes/' . api_get_visual_theme() . '/icons/';
760
+            $theme = 'themes/'.api_get_visual_theme().'/icons/';
761 761
             // Checking the theme icons folder example: app/Resources/public/css/themes/chamilo/icons/XXX
762 762
             if (is_file($alternateCssPath.$theme.$size_extra.$image)) {
763 763
                 $icon = $alternateWebCssPath.$theme.$size_extra.$image;
@@ -779,11 +779,11 @@  discard block
 block discarded – undo
779 779
         // ask for the SVG version directly
780 780
         $testServer = api_get_setting('server_type');
781 781
         if ($testServer == 'test' && $return_only_path == false) {
782
-            $svgImage = substr($image, 0, -3) . 'svg';
783
-            if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
784
-                $icon = $w_code_path . $theme . 'svg/' . $svgImage;
785
-            } elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) {
786
-                $icon = $w_code_path . 'img/icons/svg/' . $svgImage;
782
+            $svgImage = substr($image, 0, -3).'svg';
783
+            if (is_file($code_path.$theme.'svg/'.$svgImage)) {
784
+                $icon = $w_code_path.$theme.'svg/'.$svgImage;
785
+            } elseif (is_file($code_path.'img/icons/svg/'.$svgImage)) {
786
+                $icon = $w_code_path.'img/icons/svg/'.$svgImage;
787 787
             }
788 788
 
789 789
             if (empty($additional_attributes['height'])) {
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
             }
873 873
         }
874 874
         //some tags don't have this </XXX>
875
-        if (in_array($tag, array('img','input','br'))) {
875
+        if (in_array($tag, array('img', 'input', 'br'))) {
876 876
             $return_value = '<'.$tag.' '.$attribute_list.' />';
877 877
         } else {
878 878
             $return_value = '<'.$tag.' '.$attribute_list.' > '.$content.'</'.$tag.'>';
@@ -925,13 +925,13 @@  discard block
 block discarded – undo
925 925
     public static function input($type, $name, $value, $attributes = array())
926 926
     {
927 927
          if (isset($type)) {
928
-             $attributes['type']= $type;
928
+             $attributes['type'] = $type;
929 929
          }
930 930
          if (isset($name)) {
931
-             $attributes['name']= $name;
931
+             $attributes['name'] = $name;
932 932
          }
933 933
          if (isset($value)) {
934
-             $attributes['value']= $value;
934
+             $attributes['value'] = $value;
935 935
         }
936 936
         return self::tag('input', '', $attributes);
937 937
     }
@@ -964,14 +964,14 @@  discard block
 block discarded – undo
964 964
     ) {
965 965
         $html = '';
966 966
         $extra = '';
967
-        $default_id = 'id="' . $name . '" ';
967
+        $default_id = 'id="'.$name.'" ';
968 968
         foreach ($extra_attributes as $key => $parameter) {
969 969
             if ($key == 'id') {
970 970
                 $default_id = '';
971 971
             }
972
-            $extra .= $key . '="' . $parameter . '" ';
972
+            $extra .= $key.'="'.$parameter.'" ';
973 973
         }
974
-        $html .= '<select name="' . $name . '" ' . $default_id . ' ' . $extra . '>';
974
+        $html .= '<select name="'.$name.'" '.$default_id.' '.$extra.'>';
975 975
 
976 976
         if ($show_blank_item) {
977 977
             if (empty($blank_item_text)) {
@@ -979,14 +979,14 @@  discard block
 block discarded – undo
979 979
             } else {
980 980
                 $blank_item_text = Security::remove_XSS($blank_item_text);
981 981
             }
982
-            $html .= self::tag('option', '-- ' . $blank_item_text . ' --', array('value' => '-1'));
982
+            $html .= self::tag('option', '-- '.$blank_item_text.' --', array('value' => '-1'));
983 983
         }
984 984
         if ($values) {
985 985
             foreach ($values as $key => $value) {
986 986
                 if (is_array($value) && isset($value['name'])) {
987 987
                     $value = $value['name'];
988 988
                 }
989
-                $html .= '<option value="' . $key . '"';
989
+                $html .= '<option value="'.$key.'"';
990 990
 
991 991
                 if (is_array($default)) {
992 992
                     foreach ($default as $item) {
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
                     }
1002 1002
                 }
1003 1003
 
1004
-                $html .= '>' . $value . '</option>';
1004
+                $html .= '>'.$value.'</option>';
1005 1005
             }
1006 1006
         }
1007 1007
         $html .= '</select>';
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
      */
1030 1030
     public static function tabs($headers, $items, $id = 'tabs', $attributes = array(), $ul_attributes = array())
1031 1031
     {
1032
-        if (empty($headers) || count($headers) == 0 ) {
1032
+        if (empty($headers) || count($headers) == 0) {
1033 1033
             return '';
1034 1034
         }
1035 1035
 
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
 
1070 1070
         $main_div = self::tag('div', $ul.self::tag('div', $divs, ['class' => 'tab-content']), $attributes);
1071 1071
 
1072
-        return $main_div ;
1072
+        return $main_div;
1073 1073
     }
1074 1074
 
1075 1075
     /**
@@ -1117,8 +1117,8 @@  discard block
 block discarded – undo
1117 1117
      */
1118 1118
     public static function grid_html($div_id)
1119 1119
     {
1120
-        $table  = self::tag('table','', array('id' => $div_id));
1121
-        $table .= self::tag('div','', array('id' => $div_id.'_pager'));
1120
+        $table  = self::tag('table', '', array('id' => $div_id));
1121
+        $table .= self::tag('div', '', array('id' => $div_id.'_pager'));
1122 1122
         return $table;
1123 1123
     }
1124 1124
 
@@ -1179,7 +1179,7 @@  discard block
 block discarded – undo
1179 1179
         $obj->colNames      = $column_names;
1180 1180
         $obj->colModel      = $column_model;
1181 1181
         $obj->pager         = '#'.$div_id.'_pager';
1182
-        $obj->datatype  = 'json';
1182
+        $obj->datatype = 'json';
1183 1183
         $obj->viewrecords = 'true';
1184 1184
 
1185 1185
         $all_value = 10000000;
@@ -1240,10 +1240,10 @@  discard block
 block discarded – undo
1240 1240
         // Adding static data.
1241 1241
         if (!empty($data)) {
1242 1242
             $data_var = $div_id.'_data';
1243
-            $json.=' var '.$data_var.' = '.json_encode($data).';';
1243
+            $json .= ' var '.$data_var.' = '.json_encode($data).';';
1244 1244
             $obj->data = $data_var;
1245 1245
             $obj->datatype = 'local';
1246
-            $json.="\n";
1246
+            $json .= "\n";
1247 1247
         }
1248 1248
 
1249 1249
         $obj->end = 'end';
@@ -1257,12 +1257,12 @@  discard block
 block discarded – undo
1257 1257
         }
1258 1258
 
1259 1259
         // Fixing true/false js values that doesn't need the ""
1260
-        $json_encode = str_replace(':"true"',':true',$json_encode);
1260
+        $json_encode = str_replace(':"true"', ':true', $json_encode);
1261 1261
         // wrap_cell is not a valid jqgrid attributes is a hack to wrap a text
1262 1262
         $json_encode = str_replace('"wrap_cell":true', 'cellattr : function(rowId, value, rowObject, colModel, arrData) { return \'class = "jqgrid_whitespace"\'; }', $json_encode);
1263
-        $json_encode = str_replace(':"false"',':false',$json_encode);
1263
+        $json_encode = str_replace(':"false"', ':false', $json_encode);
1264 1264
         $json_encode = str_replace('"formatter":"action_formatter"', 'formatter:action_formatter', $json_encode);
1265
-        $json_encode = str_replace(array('{"first":"first",','"end":"end"}'), '', $json_encode);
1265
+        $json_encode = str_replace(array('{"first":"first",', '"end":"end"}'), '', $json_encode);
1266 1266
 
1267 1267
         // Creating the jqgrid element.
1268 1268
         $json .= '$("#'.$div_id.'").jqGrid({';
@@ -1277,22 +1277,22 @@  discard block
 block discarded – undo
1277 1277
             $groups = '';
1278 1278
             foreach ($extra_params['groupHeaders'] as $group) {
1279 1279
                 //{ "startColumnName" : "courses", "numberOfColumns" : 1, "titleText" : "Order Info" },
1280
-                $groups .= '{ "startColumnName" : "' . $group['startColumnName'] . '", "numberOfColumns" : ' . $group['numberOfColumns'] . ', "titleText" : "' . $group['titleText']  . '" },';
1280
+                $groups .= '{ "startColumnName" : "'.$group['startColumnName'].'", "numberOfColumns" : '.$group['numberOfColumns'].', "titleText" : "'.$group['titleText'].'" },';
1281 1281
 
1282 1282
             }
1283 1283
             $json .= '$("#'.$div_id.'").jqGrid("setGroupHeaders", {
1284 1284
                 "useColSpanStyle" : false,
1285 1285
                 "groupHeaders"    : [
1286
-                    ' . $groups . '
1286
+                    ' . $groups.'
1287 1287
                 ]
1288 1288
             });';
1289 1289
         }
1290 1290
 
1291 1291
         $all_text = addslashes(get_lang('All'));
1292 1292
         $json .= '$("'.$obj->pager.' option[value='.$all_value.']").text("'.$all_text.'");';
1293
-        $json.= "\n";
1293
+        $json .= "\n";
1294 1294
         // Adding edit/delete icons.
1295
-        $json.= $formatter;
1295
+        $json .= $formatter;
1296 1296
 
1297 1297
         return $json;
1298 1298
     }
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
         }
1324 1324
 
1325 1325
         if (!empty($rows)) {
1326
-	        foreach($rows as $content) {
1326
+	        foreach ($rows as $content) {
1327 1327
 	            $table->setCellContents($row, $column, $content);
1328 1328
                 $row++;
1329 1329
             }
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 
1486 1486
         // Show all tool icons where there is something new.
1487 1487
         $return = '&nbsp;';
1488
-        foreach($notifications as $notification) {
1488
+        foreach ($notifications as $notification) {
1489 1489
             $lastDate = date('d/m/Y H:i', convert_sql_date($notification['lastedit_date']));
1490 1490
             $type = $notification['lastedit_type'];
1491 1491
             $label = get_lang('TitleNotification').": ".get_lang($type)." ($lastDate)";
@@ -1528,9 +1528,9 @@  discard block
 block discarded – undo
1528 1528
             $tbl_session            = Database :: get_main_table(TABLE_MAIN_SESSION);
1529 1529
             $active = false;
1530 1530
             // Request for the name of the general coach
1531
-            $sql ='SELECT tu.lastname, tu.firstname, ts.*
1531
+            $sql = 'SELECT tu.lastname, tu.firstname, ts.*
1532 1532
                     FROM '.$tbl_session.' ts
1533
-                    LEFT JOIN '.$main_user_table .' tu
1533
+                    LEFT JOIN '.$main_user_table.' tu
1534 1534
                     ON ts.id_coach = tu.user_id
1535 1535
                     WHERE ts.id = '.intval($session_id);
1536 1536
             $rs = Database::query($sql);
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
             $session['title'] = $session_info['name'];
1543 1543
             $session['id_coach'] = $session_info['id_coach'];
1544 1544
             $session['coach'] = '';
1545
-            $session['dates'] =  '';
1545
+            $session['dates'] = '';
1546 1546
 
1547 1547
             if (
1548 1548
                 (
@@ -1615,11 +1615,11 @@  discard block
 block discarded – undo
1615 1615
                         );
1616 1616
                     }
1617 1617
 
1618
-                    $session['dates'] = $start_buffer . " " . $stop_buffer;
1618
+                    $session['dates'] = $start_buffer." ".$stop_buffer;
1619 1619
                    
1620 1620
                 }
1621 1621
 
1622
-                if ( api_get_setting('show_session_coach') === 'true' ) {
1622
+                if (api_get_setting('show_session_coach') === 'true') {
1623 1623
                     $session['coach'] = api_get_person_name(
1624 1624
                         $session_info['firstname'],
1625 1625
                         $session_info['lastname']
@@ -1674,9 +1674,9 @@  discard block
 block discarded – undo
1674 1674
 		$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1675 1675
 
1676 1676
 		if (!empty($percentage)) {
1677
-            $percentage = $percentage*125/100;
1677
+            $percentage = $percentage * 125 / 100;
1678 1678
         }
1679
-		$accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1679
+		$accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1680 1680
 
1681 1681
 		$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1682 1682
 
@@ -1691,19 +1691,19 @@  discard block
 block discarded – undo
1691 1691
 
1692 1692
 		$labels = array();
1693 1693
 
1694
-		$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1695
-		$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1694
+		$labels[] = $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1695
+		$labels[] = $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1696 1696
 		/* if (!empty($number_of_users_who_voted)) {
1697 1697
 			$labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1698 1698
 		} */
1699 1699
 
1700
-		$labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1700
+		$labels[] = $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote').' [?] ';
1701 1701
 
1702 1702
 		if (!$add_div_wrapper && api_is_anonymous()) {
1703
-			$labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1703
+			$labels[] = Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1704 1704
 		}
1705 1705
 
1706
-        $html .= Display::div(implode(' | ', $labels) , array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1706
+        $html .= Display::div(implode(' | ', $labels), array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1707 1707
         $html .= ' '.Display::span(' ', array('id' =>  'vote_label2_'.$id));
1708 1708
 
1709 1709
         if ($add_div_wrapper) {
@@ -1781,8 +1781,8 @@  discard block
 block discarded – undo
1781 1781
         if (!empty($list)) {
1782 1782
             $html = '<dl class="dl-horizontal">';
1783 1783
             foreach ($list as $item) {
1784
-                $html .= '<dt>' . $item['title'] . '</dt>';
1785
-                $html .= '<dd>' . $item['content'] . '</dd>';
1784
+                $html .= '<dt>'.$item['title'].'</dt>';
1785
+                $html .= '<dd>'.$item['content'].'</dd>';
1786 1786
             }
1787 1787
             $html .= '</dl>';
1788 1788
         }
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
      * @param string $type
1825 1825
      * @return null|string
1826 1826
      */
1827
-    public static function badge($count, $type ="warning")
1827
+    public static function badge($count, $type = "warning")
1828 1828
     {
1829 1829
         $class = '';
1830 1830
 
@@ -1900,7 +1900,7 @@  discard block
 block discarded – undo
1900 1900
         if (!empty($content)) {
1901 1901
             $html = '<span class="label '.$class.'">';
1902 1902
             $html .= $content;
1903
-            $html .='</span>';
1903
+            $html .= '</span>';
1904 1904
         }
1905 1905
 
1906 1906
         return $html;
@@ -1921,7 +1921,7 @@  discard block
 block discarded – undo
1921 1921
                     $class = 'class ="active"';
1922 1922
                 }
1923 1923
 
1924
-                if (basename($_SERVER['REQUEST_URI']) == basename($value['url']) ) {
1924
+                if (basename($_SERVER['REQUEST_URI']) == basename($value['url'])) {
1925 1925
                     $class = 'class ="active"';
1926 1926
                 }
1927 1927
                 $html .= "<li $class >";
@@ -2041,7 +2041,7 @@  discard block
 block discarded – undo
2041 2041
             case 'wav':
2042 2042
                 //no break;
2043 2043
             case 'ogg':
2044
-                $html = '<audio src="' . $params['url'] . '" controls class="skip"></audio>';
2044
+                $html = '<audio src="'.$params['url'].'" controls class="skip"></audio>';
2045 2045
 
2046 2046
                 return $html;
2047 2047
                 break;
@@ -2175,7 +2175,7 @@  discard block
 block discarded – undo
2175 2175
         }
2176 2176
         $label = $nextValue + $localCounter + 1;
2177 2177
         if ($isMedia) {
2178
-            $label = ($fixedValue + 1) .' '.chr(97 + $localCounter);
2178
+            $label = ($fixedValue + 1).' '.chr(97 + $localCounter);
2179 2179
             $link_to_show = $link.$fixedValue.'#questionanchor'.$itemId;
2180 2180
         }
2181 2181
         $link = Display::url($label.' ', $link_to_show, $linkAttributes);
@@ -2287,7 +2287,7 @@  discard block
 block discarded – undo
2287 2287
      */
2288 2288
     public static function getVCardUserLink($userId)
2289 2289
     {
2290
-        $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId);;
2290
+        $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId); ;
2291 2291
 
2292 2292
         return $vCardUrl;
2293 2293
     }
@@ -2305,7 +2305,7 @@  discard block
 block discarded – undo
2305 2305
     {
2306 2306
         $title = !empty($title) ? '<div class="panel-heading"><h3 class="panel-title">'.$title.'</h3>'.$extra.'</div>' : '';
2307 2307
         $footer = !empty($footer) ? '<div class="panel-footer ">'.$footer.'</div>' : '';
2308
-        $styles = ['primary','success','info','warning','danger'];
2308
+        $styles = ['primary', 'success', 'info', 'warning', 'danger'];
2309 2309
         $style = !in_array($style, $styles) ? 'default' : $style;
2310 2310
 
2311 2311
         return '
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
         $attributes['class'] = isset($attributes['class']) ? "$buttonClass {$attributes['class']}" : $buttonClass;
2351 2351
 
2352 2352
         if (!$includeText) {
2353
-            $text = '<span class="sr-only">' . $text . '</span>';
2353
+            $text = '<span class="sr-only">'.$text.'</span>';
2354 2354
         }
2355 2355
 
2356 2356
         return self::url("$icon $text", $url, $attributes);
@@ -2365,16 +2365,16 @@  discard block
 block discarded – undo
2365 2365
      */
2366 2366
     public static function toolbarAction($id, $content = array(), $col = 2, $right = true)
2367 2367
     {
2368
-        $columns = 12/$col;
2368
+        $columns = 12 / $col;
2369 2369
         $html = '';
2370
-        $html .= '<div id="' . $id . '" class="actions">';
2370
+        $html .= '<div id="'.$id.'" class="actions">';
2371 2371
         $html .= '<div class="row">';
2372 2372
         if ($col > 4) {
2373 2373
             $html = '<div class="alert alert-warning" role="alert">Action toolbar design does not work when exceeding four columns - check Display::toolbarAction()</div>';
2374 2374
         } else {
2375
-            for ( $i = 0; $i < $col; $i++ ) {
2376
-                $html .= '<div class="col-md-' . $columns . '">';
2377
-                if ( $col == 2 && $i == 1 ) {
2375
+            for ($i = 0; $i < $col; $i++) {
2376
+                $html .= '<div class="col-md-'.$columns.'">';
2377
+                if ($col == 2 && $i == 1) {
2378 2378
                     if ($right === true) {
2379 2379
                         $html .= '<div class="pull-right">';
2380 2380
                         $html .= (isset($content[$i]) ? $content[$i] : '');
@@ -2489,9 +2489,9 @@  discard block
 block discarded – undo
2489 2489
             $params['class'] = 'panel panel-default';
2490 2490
             $html = null;
2491 2491
             if (!empty($title)) {
2492
-                $html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL;
2492
+                $html .= '<div class="panel-heading">'.$title.'</div>'.PHP_EOL;
2493 2493
             }
2494
-            $html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
2494
+            $html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL;
2495 2495
             $html = Display::div($html, $params);
2496 2496
         }
2497 2497
         return $html;
Please login to merge, or discard this patch.
main/inc/lib/events.lib.php 3 patches
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.
Doc Comments   +20 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
@@ -313,6 +313,9 @@  discard block
 block discarded – undo
313 313
      * @param   int     session_id
314 314
      * @param   int     learnpath_id (id of the learnpath)
315 315
      * @param   int     learnpath_item_id (id of the learnpath_item)
316
+     * @param integer $score
317
+     * @param integer $weighting
318
+     * @param integer $session_id
316 319
      *
317 320
      * @author Sebastien Piraux <[email protected]>
318 321
      * @author Julio Montoya Armas <[email protected]> Reworked 2010
@@ -414,7 +417,9 @@  discard block
 block discarded – undo
414 417
      * @param	integer	Session ID (from the session table). Default value of null means "get from context".
415 418
      * @param	integer	Learnpath ID (from c_lp table). Default value of null means "get from context".
416 419
      * @param	integer	Learnpath item ID (from the c_lp_item table). Default value of null means "get from context".
417
-     * @return	boolean	Result of the insert query
420
+     * @param integer $exe_id
421
+     * @param integer $position
422
+     * @return	false|string	Result of the insert query
418 423
      */
419 424
     public static function saveQuestionAttempt(
420 425
         $score,
@@ -581,6 +586,7 @@  discard block
 block discarded – undo
581 586
      * @param	int		Whether this answer is correct (1) or not (0)
582 587
      * @param	string	Coordinates of this point (e.g. 123;324)
583 588
      * @param	bool update results?
589
+     * @param integer $exe_id
584 590
      * @return	boolean	Result of the insert query
585 591
      * @uses Course code and user_id from global scope $_cid and $_user
586 592
      */
@@ -720,7 +726,6 @@  discard block
 block discarded – undo
720 726
     /**
721 727
      * Get every email stored in the database
722 728
      *
723
-     * @param int $etId
724 729
      * @return type
725 730
      * @assert () !== false
726 731
      */
@@ -788,11 +793,11 @@  discard block
 block discarded – undo
788 793
     /**
789 794
      * Save the new message for one event and for one language
790 795
      *
791
-     * @param string $eventName
796
+     * @param string $event_name
792 797
      * @param array $users
793 798
      * @param string $message
794 799
      * @param string $subject
795
-     * @param string $eventMessageLanguage
800
+     * @param string $event_message_language
796 801
      * @param int $activated
797 802
      */
798 803
     public static function save_event_type_message($event_name, $users, $message, $subject, $event_message_language, $activated)
@@ -926,10 +931,10 @@  discard block
 block discarded – undo
926 931
     }
927 932
 
928 933
     /**
929
-     * @param $user_id
934
+     * @param integer $user_id
930 935
      * @param $exerciseId
931
-     * @param $lp_id
932
-     * @param $lp_item_id
936
+     * @param integer $lp_id
937
+     * @param integer $lp_item_id
933 938
      * @return int
934 939
      */
935 940
     public static function get_attempt_count_not_finished($user_id, $exerciseId, $lp_id, $lp_item_id)
@@ -1106,6 +1111,7 @@  discard block
 block discarded – undo
1106 1111
      * @param   int     exercise id
1107 1112
      * @param   int $courseId
1108 1113
      * @param   int     session id
1114
+     * @param integer $user_id
1109 1115
      * @return  array   with the results
1110 1116
      *
1111 1117
      */
@@ -1201,6 +1207,7 @@  discard block
 block discarded – undo
1201 1207
      * @param   int     exercise id
1202 1208
      * @param   int  $courseId
1203 1209
      * @param   int     session id
1210
+     * @param integer $user_id
1204 1211
      * @return  array   with the results
1205 1212
      *
1206 1213
      */
@@ -1241,6 +1248,7 @@  discard block
 block discarded – undo
1241 1248
      * @param   int     exercise id
1242 1249
      * @param   string  course code
1243 1250
      * @param   int     session id
1251
+     * @param integer $exe_id
1244 1252
      * @return  array   with the results
1245 1253
      *
1246 1254
      */
@@ -1290,6 +1298,8 @@  discard block
 block discarded – undo
1290 1298
      * @param   int     lp id
1291 1299
      * @param   int     lp item id
1292 1300
      * @param   string 	order asc or desc
1301
+     * @param integer $courseId
1302
+     * @param string $order
1293 1303
      * @return  array   with the results
1294 1304
      *
1295 1305
      */
@@ -1349,7 +1359,7 @@  discard block
 block discarded – undo
1349 1359
      * @param   int     exercise id
1350 1360
      * @param   int     $courseId
1351 1361
      * @param   int     session id
1352
-     * @return  array   with the results
1362
+     * @return  string   with the results
1353 1363
      *
1354 1364
      */
1355 1365
     public static function count_exercise_attempts_by_user($user_id, $exercise_id, $courseId, $session_id = 0)
@@ -1525,7 +1535,7 @@  discard block
 block discarded – undo
1525 1535
      * @param   int     exercise id
1526 1536
      * @param   int   course id
1527 1537
      * @param   int     session id
1528
-     * @return  array   with the results
1538
+     * @return  integer   with the results
1529 1539
      *
1530 1540
      */
1531 1541
     public static function get_count_exercises_attempted_by_course($courseId, $session_id = 0)
Please login to merge, or discard this patch.
main/inc/lib/message.lib.php 4 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1532,7 +1532,7 @@
 block discarded – undo
1532 1532
 
1533 1533
         if (isset($_REQUEST['action'])) {
1534 1534
             switch ($_REQUEST['action']) {
1535
-                 case 'mark_as_unread' :
1535
+                    case 'mark_as_unread' :
1536 1536
                     $number_of_selected_messages = count($_POST['id']);
1537 1537
                     if (is_array($_POST['id'])) {
1538 1538
                         foreach ($_POST['id'] as $index => $message_id) {
Please login to merge, or discard this patch.
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -131,8 +131,9 @@  discard block
 block discarded – undo
131 131
             $direction = 'DESC';
132 132
         } else {
133 133
             $column = intval($column);
134
-            if (!in_array($direction, array('ASC', 'DESC')))
135
-                $direction = 'ASC';
134
+            if (!in_array($direction, array('ASC', 'DESC'))) {
135
+                            $direction = 'ASC';
136
+            }
136 137
         }
137 138
         $table_message = Database::get_main_table(TABLE_MESSAGE);
138 139
 
@@ -488,8 +489,9 @@  discard block
 block discarded – undo
488 489
     public static function delete_message_by_user_receiver($user_receiver_id, $id)
489 490
     {
490 491
         $table_message = Database::get_main_table(TABLE_MESSAGE);
491
-        if ($id != strval(intval($id)))
492
-            return false;
492
+        if ($id != strval(intval($id))) {
493
+                    return false;
494
+        }
493 495
         $user_receiver_id = intval($user_receiver_id);
494 496
         $id = intval($id);
495 497
         $sql = "SELECT * FROM $table_message
@@ -664,8 +666,9 @@  discard block
 block discarded – undo
664 666
      */
665 667
     public static function update_message($user_id, $message_id)
666 668
     {
667
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
668
-            return false;
669
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
670
+                    return false;
671
+        }
669 672
 
670 673
         $table_message = Database::get_main_table(TABLE_MESSAGE);
671 674
         $sql = "UPDATE $table_message SET msg_status = '0'
@@ -705,8 +708,9 @@  discard block
 block discarded – undo
705 708
      */
706 709
     public static function get_message_by_user($user_id, $message_id)
707 710
     {
708
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
709
-            return false;
711
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
712
+                    return false;
713
+        }
710 714
         $table_message = Database::get_main_table(TABLE_MESSAGE);
711 715
         $query = "SELECT * FROM $table_message
712 716
                   WHERE user_receiver_id=".intval($user_id)." AND id='".intval($message_id)."'";
@@ -721,8 +725,9 @@  discard block
 block discarded – undo
721 725
      */
722 726
     public static function get_messages_by_group($group_id)
723 727
     {
724
-        if ($group_id != strval(intval($group_id)))
725
-            return false;
728
+        if ($group_id != strval(intval($group_id))) {
729
+                    return false;
730
+        }
726 731
 
727 732
         $table_message = Database::get_main_table(TABLE_MESSAGE);
728 733
         $group_id = intval($group_id);
@@ -749,8 +754,9 @@  discard block
 block discarded – undo
749 754
      */
750 755
     public static function get_messages_by_group_by_message($group_id, $message_id)
751 756
     {
752
-        if ($group_id != strval(intval($group_id)))
753
-            return false;
757
+        if ($group_id != strval(intval($group_id))) {
758
+                    return false;
759
+        }
754 760
         $table_message = Database::get_main_table(TABLE_MESSAGE);
755 761
         $group_id = intval($group_id);
756 762
         $sql = "SELECT * FROM $table_message
@@ -828,8 +834,9 @@  discard block
 block discarded – undo
828 834
      */
829 835
     public static function exist_message($user_id, $id)
830 836
     {
831
-        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id)))
832
-            return false;
837
+        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id))) {
838
+                    return false;
839
+        }
833 840
         $table_message = Database::get_main_table(TABLE_MESSAGE);
834 841
         $query = "SELECT id FROM $table_message
835 842
                   WHERE
@@ -860,8 +867,9 @@  discard block
 block discarded – undo
860 867
             $direction = 'DESC';
861 868
         } else {
862 869
             $column = intval($column);
863
-            if (!in_array($direction, array('ASC', 'DESC')))
864
-                $direction = 'ASC';
870
+            if (!in_array($direction, array('ASC', 'DESC'))) {
871
+                            $direction = 'ASC';
872
+            }
865 873
         }
866 874
         $table_message = Database::get_main_table(TABLE_MESSAGE);
867 875
         $request = api_is_xml_http_request();
Please login to merge, or discard this patch.
Doc Comments   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -639,6 +639,8 @@  discard block
 block discarded – undo
639 639
      * @param  int	message id
640 640
      * @param  int	message user id (receiver user id or sender user id)
641 641
      * @param  int	group id (optional)
642
+     * @param integer $message_id
643
+     * @param integer $message_uid
642 644
      * @return void
643 645
      */
644 646
     public static function delete_message_attachment_file($message_id, $message_uid, $group_id = 0)
@@ -683,7 +685,7 @@  discard block
 block discarded – undo
683 685
      * update messages by user id and message id
684 686
      * @param  int		$user_id
685 687
      * @param  int		$message_id
686
-     * @return resource
688
+     * @return false|null
687 689
      */
688 690
     public static function update_message($user_id, $message_id)
689 691
     {
@@ -703,7 +705,7 @@  discard block
 block discarded – undo
703 705
      * @param int $user_id
704 706
      * @param int $message_id
705 707
      * @param string $type
706
-     * @return bool
708
+     * @return false|null
707 709
      */
708 710
     public static function update_message_status($user_id, $message_id,$type)
709 711
     {
@@ -740,6 +742,7 @@  discard block
 block discarded – undo
740 742
     /**
741 743
      * get messages by group id
742 744
      * @param  int		group id
745
+     * @param integer $group_id
743 746
      * @return array
744 747
      */
745 748
     public static function get_messages_by_group($group_id)
@@ -1477,7 +1480,7 @@  discard block
 block discarded – undo
1477 1480
      * Sort date by desc from a multi-dimensional array
1478 1481
      * @param array $array1  first array to compare
1479 1482
      * @param array $array2  second array to compare
1480
-     * @return bool
1483
+     * @return integer
1481 1484
      */
1482 1485
     public function order_desc_date($array1, $array2)
1483 1486
     {
@@ -1555,7 +1558,6 @@  discard block
 block discarded – undo
1555 1558
     /**
1556 1559
      * @param $id
1557 1560
      * @param array $params
1558
-     * @param string $display
1559 1561
      * @return string
1560 1562
      */
1561 1563
     public static function generate_invitation_form($id, $params = array())
@@ -1644,7 +1646,7 @@  discard block
 block discarded – undo
1644 1646
 
1645 1647
     /**
1646 1648
      * @param string $keyword
1647
-     * @return null|string
1649
+     * @return string
1648 1650
      */
1649 1651
     public static function outbox_display($keyword = '')
1650 1652
     {
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
      * @param string $type
714 714
      * @return bool
715 715
      */
716
-    public static function update_message_status($user_id, $message_id,$type)
716
+    public static function update_message_status($user_id, $message_id, $type)
717 717
     {
718 718
         $type = intval($type);
719 719
         if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
 
1051 1051
         $receiverUserInfo = api_get_user_info($row['user_receiver_id']);
1052 1052
 
1053
-        $message_content .='<tr>';
1053
+        $message_content .= '<tr>';
1054 1054
         if (api_get_setting('allow_social_tool') == 'true') {
1055 1055
             $message_content .= '<div class="row">';
1056 1056
 
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
                 $message_content .= get_lang('From').':&nbsp;'.$name.'</b> '.api_strtolower(get_lang('To')).' <b>'.get_lang('Me').'</b>';
1090 1090
             }
1091 1091
         }
1092
-        $message_content .='
1092
+        $message_content .= '
1093 1093
 		        <br />
1094 1094
 		        <hr style="color:#ddd" />
1095 1095
 		        <table height="209px" width="100%">
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
         $message_content .= '<a href="inbox.php?action=deleteone&id='.$message_id.'&'.$social_link.'" >'.
1116 1116
             Display::return_icon('delete.png', get_lang('DeleteMessage')).'</a>&nbsp';
1117 1117
 
1118
-        $message_content .='</div></td>
1118
+        $message_content .= '</div></td>
1119 1119
 		      <td width=10></td>
1120 1120
 		    </tr>
1121 1121
 		</table>';
@@ -1193,7 +1193,7 @@  discard block
 block discarded – undo
1193 1193
 
1194 1194
                 $items = $topic['count'];
1195 1195
                 $reply_label = ($items == 1) ? get_lang('GroupReply') : get_lang('GroupReplies');
1196
-                $label =  '<i class="fa fa-envelope"></i> ' . $items . ' ' . $reply_label;
1196
+                $label = '<i class="fa fa-envelope"></i> '.$items.' '.$reply_label;
1197 1197
                 $topic['title'] = trim($topic['title']);
1198 1198
 
1199 1199
                 if (empty($topic['title'])) {
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
                 } else {
1224 1224
                     $date .= '<i class="fa fa-calendar"></i> '.get_lang('Created').' '.date_to_str_ago($topic['send_date']);
1225 1225
                 }
1226
-                $html .= '<div class="date">'. $label.' - '.$date.$actions . '</div>';
1226
+                $html .= '<div class="date">'.$label.' - '.$date.$actions.'</div>';
1227 1227
                 $html .= '</div>';
1228 1228
 
1229 1229
                 $image = $user_sender_info['avatar'];
@@ -1293,8 +1293,8 @@  discard block
 block discarded – undo
1293 1293
 
1294 1294
         $topic_page_nr = isset($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : null;
1295 1295
 
1296
-        $links.= '<div class="pull-right">';
1297
-        $links.= '<div class="btn-group">';
1296
+        $links .= '<div class="pull-right">';
1297
+        $links .= '<div class="btn-group">';
1298 1298
 
1299 1299
         if (($my_group_role == GROUP_USER_PERMISSION_ADMIN ||
1300 1300
             $my_group_role == GROUP_USER_PERMISSION_MODERATOR) ||
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
                 'group_id' => $group_id,
1308 1308
                 'message_id' => $main_message['id'],
1309 1309
                 'action' => 'edit_message_group',
1310
-                'anchor_topic' => 'topic_' . $main_message['id'],
1310
+                'anchor_topic' => 'topic_'.$main_message['id'],
1311 1311
                 'topics_page_nr' => $topic_page_nr,
1312 1312
                 'items_page_nr' => $items_page_nr,
1313 1313
                 'topic_id' => $main_message['id']
@@ -1340,7 +1340,7 @@  discard block
 block discarded – undo
1340 1340
             'group_id' => $group_id,
1341 1341
             'message_id' => $main_message['id'],
1342 1342
             'action' => 'reply_message_group',
1343
-            'anchor_topic' => 'topic_' . $main_message['id'],
1343
+            'anchor_topic' => 'topic_'.$main_message['id'],
1344 1344
             'topics_page_nr' => $topic_page_nr,
1345 1345
             'topic_id' => $main_message['id']
1346 1346
         ]);
@@ -1355,8 +1355,8 @@  discard block
 block discarded – undo
1355 1355
                 'data-size' => 'lg'
1356 1356
             ]
1357 1357
         );
1358
-        $links.= '</div>';
1359
-        $links.= '</div>';
1358
+        $links .= '</div>';
1359
+        $links .= '</div>';
1360 1360
 
1361 1361
         $title = '<h4>'.Security::remove_XSS($main_message['title'], STUDENT, true).$links.'</h4>';
1362 1362
 
@@ -1375,10 +1375,10 @@  discard block
 block discarded – undo
1375 1375
             $date = '<div class="message-date"> '.get_lang('Created').' '.date_to_str_ago($main_message['send_date']).'</div>';
1376 1376
         }
1377 1377
         $attachment = '<div class="message-attach">'.(!empty($files_attachments) ? implode('<br />', $files_attachments) : '').'</div>';
1378
-        $main_content.= '<div class="message-content"> '.$date.$main_message['content'].$attachment.'</div>';
1378
+        $main_content .= '<div class="message-content"> '.$date.$main_message['content'].$attachment.'</div>';
1379 1379
         //$main_content = Security::remove_XSS($main_content, STUDENT, true);
1380 1380
 
1381
-        $html .= Display::div(Display::div($title . $main_content, array('class' => 'message-topic')), array('class' => 'sm-groups-message'));
1381
+        $html .= Display::div(Display::div($title.$main_content, array('class' => 'message-topic')), array('class' => 'sm-groups-message'));
1382 1382
 
1383 1383
         $topic_id = $main_message['id'];
1384 1384
 
@@ -1391,25 +1391,25 @@  discard block
 block discarded – undo
1391 1391
                 }
1392 1392
                 $items_page_nr = isset($_GET['items_'.$topic['id'].'_page_nr']) ? intval($_GET['items_'.$topic['id'].'_page_nr']) : null;
1393 1393
                 $links = '';
1394
-                $links.= '<div class="pull-right">';
1394
+                $links .= '<div class="pull-right">';
1395 1395
                 $html_items = '';
1396 1396
                 $user_sender_info = api_get_user_info($topic['user_sender_id']);
1397 1397
                 $files_attachments = self::get_links_message_attachment_files($topic['id']);
1398 1398
                 $name = $user_sender_info['complete_name'];
1399 1399
 
1400
-                $links.= '<div class="btn-group">';
1400
+                $links .= '<div class="btn-group">';
1401 1401
                 if (($my_group_role == GROUP_USER_PERMISSION_ADMIN || $my_group_role == GROUP_USER_PERMISSION_MODERATOR) || $topic['user_sender_id'] == $current_user_id) {
1402
-                    $links.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn btn-default" data-size="lg" data-title="'.get_lang('Edit').'" title="'.get_lang('Edit').'">'.
1403
-                    Display::returnFontAwesomeIcon('pencil') . '</a>';
1402
+                    $links .= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn btn-default" data-size="lg" data-title="'.get_lang('Edit').'" title="'.get_lang('Edit').'">'.
1403
+                    Display::returnFontAwesomeIcon('pencil').'</a>';
1404 1404
                 }
1405
-                $links.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn btn-default" data-size="lg" data-title="'.get_lang('Reply').'" title="'.get_lang('Reply').'">';
1406
-                $links.= Display::returnFontAwesomeIcon('commenting') . '</a>';
1407
-                $links.= '</div>';
1408
-                $links.= '</div>';
1405
+                $links .= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn btn-default" data-size="lg" data-title="'.get_lang('Reply').'" title="'.get_lang('Reply').'">';
1406
+                $links .= Display::returnFontAwesomeIcon('commenting').'</a>';
1407
+                $links .= '</div>';
1408
+                $links .= '</div>';
1409 1409
 
1410 1410
                 $userPicture = $user_sender_info['avatar'];
1411 1411
                 $user_link = '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$topic['user_sender_id'].'">'.$name.'&nbsp</a>';
1412
-                $html_items.= '<div class="avatar-author"><img src="'.$userPicture.'" alt="'.$name.'" class="img-responsive img-circle"  width="64" height="64" title="'.$name.'" />'.$user_link.'</div>';
1412
+                $html_items .= '<div class="avatar-author"><img src="'.$userPicture.'" alt="'.$name.'" class="img-responsive img-circle"  width="64" height="64" title="'.$name.'" />'.$user_link.'</div>';
1413 1413
 
1414 1414
 
1415 1415
                 $date = '';
@@ -1421,7 +1421,7 @@  discard block
 block discarded – undo
1421 1421
                     $date = '<div class="message-date"> '.get_lang('Created').' '.date_to_str_ago($topic['send_date']).'</div>';
1422 1422
                 }
1423 1423
                 $attachment = '<div class="message-attach">'.(!empty($files_attachments) ? implode('<br />', $files_attachments) : '').'</div>';
1424
-                $html_items.= '<div class="message-content">'.$links.' '.$date.Security::remove_XSS($topic['content'], STUDENT, true).$attachment.'</div>';
1424
+                $html_items .= '<div class="message-content">'.$links.' '.$date.Security::remove_XSS($topic['content'], STUDENT, true).$attachment.'</div>';
1425 1425
 
1426 1426
                 $base_padding = 20;
1427 1427
 
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
                     break;
1702 1702
                 case 'deleteone' :
1703 1703
                     MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_GET['id']);
1704
-                    $html .=Display::return_message(api_xml_http_response_encode($success), 'normal', false);
1704
+                    $html .= Display::return_message(api_xml_http_response_encode($success), 'normal', false);
1705 1705
                     $html .= '<br/>';
1706 1706
                     break;
1707 1707
             }
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
                 ON m.user_sender_id = u.user_id
1796 1796
                 WHERE
1797 1797
                     m.user_receiver_id = $userId AND
1798
-                    m.msg_status = " . MESSAGE_STATUS_UNREAD . "
1798
+                    m.msg_status = ".MESSAGE_STATUS_UNREAD."
1799 1799
                     AND m.id > $lastId
1800 1800
                 ORDER BY m.send_date DESC";
1801 1801
 
@@ -1866,11 +1866,11 @@  discard block
 block discarded – undo
1866 1866
         $tplMailBody = new Template(null, false, false, false, false, false, false);
1867 1867
         $tplMailBody->assign('user', $user);
1868 1868
         $tplMailBody->assign('is_western_name_order', api_is_western_name_order());
1869
-        $tplMailBody->assign('manageUrl', api_get_path(WEB_CODE_PATH) . 'admin/user_edit.php?user_id=' . $user->getId());
1869
+        $tplMailBody->assign('manageUrl', api_get_path(WEB_CODE_PATH).'admin/user_edit.php?user_id='.$user->getId());
1870 1870
 
1871 1871
         $layoutContent = $tplMailBody->get_template('mail/new_user_mail_to_admin.tpl');
1872 1872
 
1873
-        $emailsubject = '[' . get_lang('UserRegistered') . '] ' . $user->getUsername();
1873
+        $emailsubject = '['.get_lang('UserRegistered').'] '.$user->getUsername();
1874 1874
         $emailbody = $tplMailBody->fetch($layoutContent);
1875 1875
 
1876 1876
         $admins = UserManager::get_all_administrators();
Please login to merge, or discard this patch.
main/inc/lib/search/xapian/XapianQuery.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@  discard block
 block discarded – undo
8 8
  * Code
9 9
  */
10 10
 require_once 'xapian.php';
11
-require_once dirname(__FILE__) . '/../IndexableChunk.class.php';
11
+require_once dirname(__FILE__).'/../IndexableChunk.class.php';
12 12
 //TODO: think another way without including specific fields here
13
-require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
13
+require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
14 14
 
15
-define('XAPIAN_DB', api_get_path(SYS_UPLOAD_PATH) . 'plugins/xapian/searchdb/');
15
+define('XAPIAN_DB', api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/');
16 16
 
17 17
 /**
18 18
  * Queries the database.
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
                 // process each specific field prefix
97 97
                 foreach ($specific_fields as $specific_field) {
98
-                    $results[$count]['sf-' . $specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']);
98
+                    $results[$count]['sf-'.$specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']);
99 99
                 }
100 100
 
101 101
                 // rest of data
@@ -261,6 +261,6 @@  discard block
 block discarded – undo
261 261
     } else {
262 262
         $message_error = get_lang('SearchOtherXapianError');
263 263
     }
264
-    $display_message = get_lang('Error') . ' : ' . $message_error;
264
+    $display_message = get_lang('Error').' : '.$message_error;
265 265
     Display::display_error_message($display_message);
266 266
 }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -239,6 +239,7 @@
 block discarded – undo
239 239
 /**
240 240
  * @author Isaac flores paz <[email protected]>
241 241
  * @param String The xapian error message
242
+ * @param string $xapian_error_message
242 243
  * @return String The chamilo error message
243 244
  */
244 245
 function display_xapian_error($xapian_error_message) {
Please login to merge, or discard this patch.
main/inc/lib/search/get_terms.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
     return;
18 18
 }
19 19
 
20
-require_once dirname(__FILE__) . '../../../global.inc.php';
21
-require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloQuery.php';
20
+require_once dirname(__FILE__).'../../../global.inc.php';
21
+require_once api_get_path(LIBRARY_PATH).'search/ChamiloQuery.php';
22 22
 
23 23
 /**
24 24
  * search with filter and build base array avoding repeated terms
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     if (is_array($dkterms) && is_array($dkterms[1])) {
34 34
         foreach ($specific_fields as $specific_field) {
35 35
             foreach ($dkterms[1] as $obj) {
36
-                foreach ($obj['sf-' . $specific_field['code']] as $raw_term) {
36
+                foreach ($obj['sf-'.$specific_field['code']] as $raw_term) {
37 37
                     if (count($raw_term['name']) > 1) {
38 38
                         $normal_term = substr($raw_term['name'], 1);
39 39
                         $sf_terms[$specific_field['code']][$normal_term] = $normal_term;
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 
55 55
 if (($cid = api_get_course_id()) != -1) { // with cid
56 56
     // course filter
57
-    $filter[] = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID . $cid);
57
+    $filter[] = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID.$cid);
58 58
     // term filter
59 59
     if ($term != '__all__') {
60
-        $filter[] = chamilo_get_boolean_query($prefix . $term);
60
+        $filter[] = chamilo_get_boolean_query($prefix.$term);
61 61
         // always and between term and courseid
62 62
         $filter = chamilo_join_queries($filter, null, 'and');
63 63
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     $sf_terms = get_usual_sf_terms($filter, $specific_fields);
66 66
 } else { // without cid
67 67
     if ($term != '__all__') {
68
-        $filter[] = chamilo_get_boolean_query($prefix . $term);
68
+        $filter[] = chamilo_get_boolean_query($prefix.$term);
69 69
 
70 70
         $sf_terms = get_usual_sf_terms($filter, $specific_fields);
71 71
     } else { // no cid and all/any terms
Please login to merge, or discard this patch.
main/inc/lib/baker.lib.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@
 block discarded – undo
150 150
                 $data = substr($png,$ipos,$chunk['size']);
151 151
                 $sections = explode("\0", $data);
152 152
                 if ($sections[0] == $key) {
153
-                   return $sections;
153
+                    return $sections;
154 154
                 }
155 155
             }
156 156
             // Extract the data and the CRC
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             foreach (array_keys($this->_chunks[$type]) as $typekey) {
52 52
                 list($key, $data) = explode("\0", $this->_chunks[$type][$typekey]);
53 53
                 if (strcmp($key, $check) == 0) {
54
-                    echo 'Key "' . $check . '" already exists in "' . $type . '" chunk.';
54
+                    echo 'Key "'.$check.'" already exists in "'.$type.'" chunk.';
55 55
                     return false;
56 56
                 }
57 57
             }
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function addChunk($chunkType, $key, $value) {
72 72
         
73
-        $chunkData = $key . "\0" . $value;
74
-        $crc = pack("N", crc32($chunkType . $chunkData));
73
+        $chunkData = $key."\0".$value;
74
+        $crc = pack("N", crc32($chunkType.$chunkData));
75 75
         $len = pack("N", strlen($chunkData));
76 76
         
77
-        $newChunk = $len . $chunkType . $chunkData . $crc;
77
+        $newChunk = $len.$chunkType.$chunkData.$crc;
78 78
         $result = substr($this->_contents, 0, $this->_size - 12)
79 79
                 . $newChunk
80 80
                 . substr($this->_contents, $this->_size - 12, 12);
@@ -92,30 +92,30 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function removeChunks($chunkType, $key, $png) {
94 94
         // Read the magic bytes and verify
95
-        $retval = substr($png,0,8);
95
+        $retval = substr($png, 0, 8);
96 96
         $ipos = 8;
97 97
         if ($retval != "\x89PNG\x0d\x0a\x1a\x0a")
98 98
             throw new Exception('Is not a valid PNG image');
99 99
         // Loop through the chunks. Byte 0-3 is length, Byte 4-7 is type
100
-        $chunkHeader = substr($png,$ipos,8);
100
+        $chunkHeader = substr($png, $ipos, 8);
101 101
         $ipos = $ipos + 8;
102 102
         while ($chunkHeader) {
103 103
             // Extract length and type from binary data
104 104
             $chunk = @unpack('Nsize/a4type', $chunkHeader);
105 105
             $skip = false;
106
-            if ( $chunk['type'] == $chunkType ) {
107
-                $data = substr($png,$ipos,$chunk['size']);
106
+            if ($chunk['type'] == $chunkType) {
107
+                $data = substr($png, $ipos, $chunk['size']);
108 108
                 $sections = explode("\0", $data);
109 109
                 print_r($sections);
110
-                if ( $sections[0] == $key ) $skip = true;
110
+                if ($sections[0] == $key) $skip = true;
111 111
             }
112 112
             // Extract the data and the CRC
113
-            $data = substr($png,$ipos,$chunk['size']+4);
113
+            $data = substr($png, $ipos, $chunk['size'] + 4);
114 114
             $ipos = $ipos + $chunk['size'] + 4;
115 115
             // Add in the header, data, and CRC
116
-            if ( ! $skip ) $retval = $retval . $chunkHeader . $data;
116
+            if (!$skip) $retval = $retval.$chunkHeader.$data;
117 117
             // Read next chunk header
118
-            $chunkHeader = substr($png,$ipos,8);
118
+            $chunkHeader = substr($png, $ipos, 8);
119 119
             $ipos = $ipos + 8;
120 120
         }
121 121
         return $retval;
@@ -131,34 +131,34 @@  discard block
 block discarded – undo
131 131
      * If there is PNG information that matches the key an array is returned
132 132
      * 
133 133
      */
134
-    public function extractBadgeInfo($png, $key='openbadges') {
134
+    public function extractBadgeInfo($png, $key = 'openbadges') {
135 135
         // Read the magic bytes and verify
136
-        $retval = substr($png,0,8);
136
+        $retval = substr($png, 0, 8);
137 137
         $ipos = 8;
138 138
         if ($retval != "\x89PNG\x0d\x0a\x1a\x0a") {
139 139
             return false;
140 140
         }
141 141
 
142 142
         // Loop through the chunks. Byte 0-3 is length, Byte 4-7 is type
143
-        $chunkHeader = substr($png,$ipos,8);
143
+        $chunkHeader = substr($png, $ipos, 8);
144 144
         $ipos = $ipos + 8;
145 145
         while ($chunkHeader) {
146 146
             // Extract length and type from binary data
147 147
             $chunk = @unpack('Nsize/a4type', $chunkHeader);
148 148
             $skip = false;
149 149
             if ($chunk['type'] == 'tEXt') {
150
-                $data = substr($png,$ipos,$chunk['size']);
150
+                $data = substr($png, $ipos, $chunk['size']);
151 151
                 $sections = explode("\0", $data);
152 152
                 if ($sections[0] == $key) {
153 153
                    return $sections;
154 154
                 }
155 155
             }
156 156
             // Extract the data and the CRC
157
-            $data = substr($png,$ipos,$chunk['size']+4);
157
+            $data = substr($png, $ipos, $chunk['size'] + 4);
158 158
             $ipos = $ipos + $chunk['size'] + 4;
159 159
 
160 160
             // Read next chunk header
161
-            $chunkHeader = substr($png,$ipos,8);
161
+            $chunkHeader = substr($png, $ipos, 8);
162 162
             $ipos = $ipos + 8;
163 163
         }
164 164
     }
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -94,8 +94,9 @@  discard block
 block discarded – undo
94 94
         // Read the magic bytes and verify
95 95
         $retval = substr($png,0,8);
96 96
         $ipos = 8;
97
-        if ($retval != "\x89PNG\x0d\x0a\x1a\x0a")
98
-            throw new Exception('Is not a valid PNG image');
97
+        if ($retval != "\x89PNG\x0d\x0a\x1a\x0a") {
98
+                    throw new Exception('Is not a valid PNG image');
99
+        }
99 100
         // Loop through the chunks. Byte 0-3 is length, Byte 4-7 is type
100 101
         $chunkHeader = substr($png,$ipos,8);
101 102
         $ipos = $ipos + 8;
@@ -107,13 +108,17 @@  discard block
 block discarded – undo
107 108
                 $data = substr($png,$ipos,$chunk['size']);
108 109
                 $sections = explode("\0", $data);
109 110
                 print_r($sections);
110
-                if ( $sections[0] == $key ) $skip = true;
111
+                if ( $sections[0] == $key ) {
112
+                    $skip = true;
113
+                }
111 114
             }
112 115
             // Extract the data and the CRC
113 116
             $data = substr($png,$ipos,$chunk['size']+4);
114 117
             $ipos = $ipos + $chunk['size'] + 4;
115 118
             // Add in the header, data, and CRC
116
-            if ( ! $skip ) $retval = $retval . $chunkHeader . $data;
119
+            if ( ! $skip ) {
120
+                $retval = $retval . $chunkHeader . $data;
121
+            }
117 122
             // Read next chunk header
118 123
             $chunkHeader = substr($png,$ipos,8);
119 124
             $ipos = $ipos + 8;
Please login to merge, or discard this patch.
main/inc/lib/pdf.lib.php 4 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -536,8 +536,9 @@
 block discarded – undo
536 536
             }
537 537
         } else {
538 538
             $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
539
-            if (file_exists($store_path))
540
-                $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
539
+            if (file_exists($store_path)) {
540
+                            $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
541
+            }
541 542
         }
542 543
         return $web_path;
543 544
     }
Please login to merge, or discard this patch.
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
  * @author Patrick Cool
17 17
  * @author René Haentjens, added CSV file import (October 2004)
18 18
  * @package chamilo.link
19
-
20 19
  */
21 20
 
22 21
 // Including libraries
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         /* More info @ http://mpdf1.com/manual/index.php?tid=184&searchstring=mPDF
32 32
          * mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]])
33 33
          */
34
-        if (!in_array($orientation, array('P','L'))) {
34
+        if (!in_array($orientation, array('P', 'L'))) {
35 35
             $orientation = 'P';
36 36
         }
37 37
         //$this->pdf = $pdf = new mPDF('UTF-8', $pageFormat, '', '', 30, 20, 27, 25, 16, 13, $orientation);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             $visualTheme = api_get_visual_theme();
112 112
             $img = api_get_path(SYS_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png';
113 113
             if (file_exists($img)) {
114
-                $img = api_get_path(WEB_CSS_PATH) . 'themes/' . $visualTheme . '/images/pdf_logo_header.png';
114
+                $img = api_get_path(WEB_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png';
115 115
                 $organization = "<img src='$img'>";
116 116
             }
117 117
         }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             // then print the title in the PDF
251 251
             if (is_array($file) && isset($file['title'])) {
252 252
                 $html_title = $file['title'];
253
-                $file  = $file['path'];
253
+                $file = $file['path'];
254 254
             } else {
255 255
                 //we suppose we've only been sent a file path
256 256
                 $html_title = basename($file);
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
             //it's not a chapter but the file exists, print its title
283 283
             if ($print_title) {
284 284
                 $this->pdf->WriteHTML(
285
-                    '<html><body><h3>' . $html_title . '</h3></body></html>',
285
+                    '<html><body><h3>'.$html_title.'</h3></body></html>',
286 286
                     2
287 287
                 );
288 288
             }
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
 
293 293
             if (in_array($extension, array('html', 'htm'))) {
294 294
                 $filename = $file_info['basename'];
295
-                $filename = str_replace('_',' ',$filename);
295
+                $filename = str_replace('_', ' ', $filename);
296 296
 
297 297
                 if ($extension == 'html') {
298
-                    $filename = basename($filename,'.html');
299
-                } elseif($extension == 'htm'){
300
-                    $filename = basename($filename,'.htm');
298
+                    $filename = basename($filename, '.html');
299
+                } elseif ($extension == 'htm') {
300
+                    $filename = basename($filename, '.htm');
301 301
                 }
302 302
 
303 303
                 $document_html = @file_get_contents($file);
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                 $document_html = str_replace('href="./css/frames.css"', $absolute_css_path, $document_html);
309 309
 
310 310
                 if (!empty($course_data['path'])) {
311
-                    $document_html= str_replace('../','', $document_html);
311
+                    $document_html = str_replace('../', '', $document_html);
312 312
                     $document_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document/';
313 313
 
314 314
                     $doc = new DOMDocument();
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                                         $new_path = $old_src;
341 341
                                     }
342 342
 
343
-                                    $document_html= str_replace($old_src, $new_path, $document_html);
343
+                                    $document_html = str_replace($old_src, $new_path, $document_html);
344 344
                                 }
345 345
                             } else {
346 346
                                 //Check if this is a complete URL
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                 if (!empty($document_html)) {
369 369
                     $this->pdf->WriteHTML($document_html.$page_break, 2);
370 370
                 }
371
-            } elseif (in_array($extension, array('jpg','jpeg','png','gif'))) {
371
+            } elseif (in_array($extension, array('jpg', 'jpeg', 'png', 'gif'))) {
372 372
                 //Images
373 373
                 $image = Display::img($file);
374 374
                 $this->pdf->WriteHTML('<html><body>'.$image.'</body></html>'.$page_break, 2);
@@ -431,11 +431,11 @@  discard block
 block discarded – undo
431 431
 
432 432
         //absolute path for frames.css //TODO: necessary?
433 433
         $absolute_css_path = api_get_path(WEB_CSS_PATH).api_get_setting('stylesheets').'/frames.css';
434
-        $document_html = str_replace('href="./css/frames.css"','href="'.$absolute_css_path.'"', $document_html);
434
+        $document_html = str_replace('href="./css/frames.css"', 'href="'.$absolute_css_path.'"', $document_html);
435 435
 
436
-        $document_html= str_replace('../../','',$document_html);
437
-        $document_html= str_replace('../','',$document_html);
438
-        $document_html= str_replace((empty($_configuration['url_append'])?'':$_configuration['url_append'].'/').'courses/'.$course_code.'/document/','',$document_html);
436
+        $document_html = str_replace('../../', '', $document_html);
437
+        $document_html = str_replace('../', '', $document_html);
438
+        $document_html = str_replace((empty($_configuration['url_append']) ? '' : $_configuration['url_append'].'/').'courses/'.$course_code.'/document/', '', $document_html);
439 439
 
440 440
         if (!empty($course_data['path'])) {
441 441
             $document_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document/';
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
                                 $old_src_fixed = str_replace(api_get_path(REL_COURSE_PATH).$course_data['path'].'/document/', '', $old_src);
456 456
                                 $old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src_fixed);
457 457
                                 $new_path = $document_path.$old_src_fixed;
458
-                                $document_html= str_replace($old_src, $new_path, $document_html);
458
+                                $document_html = str_replace($old_src, $new_path, $document_html);
459 459
 
460 460
                             }
461 461
                         }
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
         //$document_html= str_replace('temp_template_path', 'src="/main/default_course_document/', $document_html);// restore src templates
475 475
 
476 476
         api_set_encoding_html($document_html, 'UTF-8'); // The library mPDF expects UTF-8 encoded input data.
477
-        $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8');  // TODO: Maybe it is better idea the title to be passed through
477
+        $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8'); // TODO: Maybe it is better idea the title to be passed through
478 478
         // $_GET[] too, as it is done with file name.
479 479
         // At the moment the title is retrieved from the html document itself.
480 480
 
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
         //$this->pdf->Output($output_file, $outputMode); // F to save the pdf in a file
497 497
 
498 498
         if ($outputMode == 'F') {
499
-            $output_file = api_get_path(SYS_ARCHIVE_PATH) . $output_file;
499
+            $output_file = api_get_path(SYS_ARCHIVE_PATH).$output_file;
500 500
         }
501 501
 
502 502
         if ($saveInFile) {
@@ -529,14 +529,14 @@  discard block
 block discarded – undo
529 529
         $web_path = false;
530 530
         if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') {
531 531
             $course_info = api_get_course_info($course_code);
532
-            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
532
+            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path
533 533
             if (file_exists($store_path)) {
534
-                $web_path   = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';
534
+                $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';
535 535
             }
536 536
         } else {
537
-            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
537
+            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path
538 538
             if (file_exists($store_path))
539
-                $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
539
+                $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
540 540
         }
541 541
         return $web_path;
542 542
     }
@@ -576,10 +576,10 @@  discard block
 block discarded – undo
576 576
     {
577 577
         if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') {
578 578
             $course_info = api_get_course_info($course_code);
579
-            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'];   // course path
579
+            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path']; // course path
580 580
             $web_path   = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/pdf_watermark.png';
581 581
         } else {
582
-            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images';   // course path
582
+            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images'; // course path
583 583
             $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
584 584
         }
585 585
         $course_image = $store_path.'/'.api_get_current_access_url_id().'_pdf_watermark.png';
@@ -614,9 +614,9 @@  discard block
 block discarded – undo
614 614
      */
615 615
     public function set_footer()
616 616
     {
617
-        $this->pdf->defaultfooterfontsize = 12;   // in pts
618
-        $this->pdf->defaultfooterfontstyle = 'B';   // blank, B, I, or BI
619
-        $this->pdf->defaultfooterline = 1;        // 1 to include line below header/above footer
617
+        $this->pdf->defaultfooterfontsize = 12; // in pts
618
+        $this->pdf->defaultfooterfontstyle = 'B'; // blank, B, I, or BI
619
+        $this->pdf->defaultfooterline = 1; // 1 to include line below header/above footer
620 620
         $platform_name   = api_get_setting('Institution');
621 621
         $left_content    = $platform_name;
622 622
         $center_content  = '';
@@ -683,9 +683,9 @@  discard block
 block discarded – undo
683 683
      */
684 684
     public function set_header($course_data)
685 685
     {
686
-        $this->pdf->defaultheaderfontsize   = 10;   // in pts
687
-        $this->pdf->defaultheaderfontstyle  = 'BI';   // blank, B, I, or BI
688
-        $this->pdf->defaultheaderline       = 1;    // 1 to include line below header/above footer
686
+        $this->pdf->defaultheaderfontsize   = 10; // in pts
687
+        $this->pdf->defaultheaderfontstyle  = 'BI'; // blank, B, I, or BI
688
+        $this->pdf->defaultheaderline       = 1; // 1 to include line below header/above footer
689 689
 
690 690
         if (!empty($course_data['code'])) {
691 691
             $teacher_list = CourseManager::get_teacher_list_from_course_code($course_data['code']);
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
             if (!empty($teacher_list)) {
695 695
 
696 696
                 foreach ($teacher_list as $teacher) {
697
-                    $teachers[]= $teacher['firstname'].' '.$teacher['lastname'];
697
+                    $teachers[] = $teacher['firstname'].' '.$teacher['lastname'];
698 698
                 }
699 699
                 if (count($teachers) > 1) {
700 700
                     $teachers = get_lang('Teachers').': '.implode(', ', $teachers);
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
                     'line' => 1,
762 762
                 ),
763 763
             );
764
-            $this->pdf->SetHeader($header);// ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title);
764
+            $this->pdf->SetHeader($header); // ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title);
765 765
         }
766 766
     }
767 767
 
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
         $this->pdf->directionality = api_get_text_direction();
807 807
         $this->pdf->useOnlyCoreFonts = true;
808 808
         // Use different Odd/Even headers and footers and mirror margins
809
-        $this->pdf->mirrorMargins       = 1;
809
+        $this->pdf->mirrorMargins = 1;
810 810
 
811 811
         // Add decoration only if not stated otherwise
812 812
         if ($complete) {
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
                     $watermark_text = api_get_setting('pdf_export_watermark_text');
835 835
                 }
836 836
                 if (!empty($watermark_text)) {
837
-                    $this->pdf->SetWatermarkText(strcode2utf($watermark_text),0.1);
837
+                    $this->pdf->SetWatermarkText(strcode2utf($watermark_text), 0.1);
838 838
                     $this->pdf->showWatermarkText = true;
839 839
                 }
840 840
             }
@@ -842,8 +842,8 @@  discard block
 block discarded – undo
842 842
             if (empty($this->custom_header)) {
843 843
                 self::set_header($course_data);
844 844
             } else {
845
-                $this->pdf->SetHTMLHeader($this->custom_header,'E');
846
-                $this->pdf->SetHTMLHeader($this->custom_header,'O');
845
+                $this->pdf->SetHTMLHeader($this->custom_header, 'E');
846
+                $this->pdf->SetHTMLHeader($this->custom_header, 'O');
847 847
             }
848 848
 
849 849
             if (empty($this->custom_footer)) {
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      * @param   string  pdf name
193 193
      * @param   string  course code (if you are using html that are located in the document tool you must provide this)
194 194
      * @param bool Whether to print the header, footer and watermark (true) or just the content (false)
195
-     * @return bool
195
+     * @return false|null
196 196
      */
197 197
     public function html_to_pdf(
198 198
         $html_file_array,
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
     }
767 767
 
768 768
     /**
769
-     * @param array $header html content
769
+     * @param string $header html content
770 770
      */
771 771
     public function set_custom_header($header)
772 772
     {
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
     }
775 775
 
776 776
     /**
777
-     * @param array $footer html content
777
+     * @param string $footer html content
778 778
      */
779 779
     public function set_custom_footer($footer)
780 780
     {
Please login to merge, or discard this patch.