Completed
Push — 1.11.x ( 6c3085...b368fe )
by José
83:26 queued 56:20
created
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
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     }
34 34
 
35 35
     /**
36
-     * @return array
36
+     * @return string[]
37 37
      */
38 38
     public static function toolList()
39 39
     {
@@ -293,7 +293,6 @@  discard block
 block discarded – undo
293 293
      * 					'page_nr' = The page to display
294 294
      * 					'hide_navigation' =  true to hide the navigation
295 295
      * @param array $query_vars Additional variables to add in the query-string
296
-     * @param array $form actions Additional variables to add in the query-string
297 296
      * @param mixed An array with bool values to know which columns show.
298 297
      * i.e: $visibility_options= array(true, false) we will only show the first column
299 298
      * 				Can be also only a bool value. TRUE: show all columns, FALSE: show nothing
@@ -334,7 +333,6 @@  discard block
 block discarded – undo
334 333
      * 					'page_nr' = The page to display
335 334
      * 					'hide_navigation' =  true to hide the navigation
336 335
      * @param array $query_vars Additional variables to add in the query-string
337
-     * @param array $form actions Additional variables to add in the query-string
338 336
      * @param mixed An array with bool values to know which columns show. i.e:
339 337
      *  $visibility_options= array(true, false) we will only show the first column
340 338
      * 	Can be also only a bool value. TRUE: show all columns, FALSE: show nothing
@@ -391,10 +389,11 @@  discard block
 block discarded – undo
391 389
      * 					'per_page' = number of items to show per page
392 390
      * 					'page_nr' = The page to display
393 391
      * @param array $query_vars Additional variables to add in the query-string
394
-     * @param array $column_show Array of binaries 1= show columns 0. hide a column
392
+     * @param integer[] $column_show Array of binaries 1= show columns 0. hide a column
395 393
      * @param array $column_order An array of integers that let us decide how the columns are going to be sort.
396 394
      * 						      i.e:  $column_order=array('1''4','3','4'); The 2nd column will be order like the 4th column
397 395
      * @param array $form_actions Set optional forms actions
396
+     * @param string $table_name
398 397
      *
399 398
      * @author Julio Montoya
400 399
      */
@@ -449,7 +448,7 @@  discard block
 block discarded – undo
449 448
      *
450 449
      * @deprecated use Display::addFlash with Display::return_message($message, 'normal');
451 450
      *
452
-     * @return void
451
+     * @return string|null
453 452
      */
454 453
     public static function display_normal_message($message, $filter = true, $returnValue = false)
455 454
     {
@@ -481,7 +480,7 @@  discard block
 block discarded – undo
481 480
      * Displays an confirmation message. Use this if something has been done successfully
482 481
      * @param bool	Filter (true) or not (false)
483 482
      * @deprecated use Display::addFlash with Display::return_message
484
-     * @return void
483
+     * @return string|null
485 484
      */
486 485
     public static function display_confirmation_message ($message, $filter = true, $returnValue = false)
487 486
     {
@@ -500,7 +499,7 @@  discard block
 block discarded – undo
500 499
      * @param bool	Filter (true) or not (false)
501 500
      * @deprecated use Display::addFlash with Display::return_message
502 501
      *
503
-     * @return void
502
+     * @return string|null
504 503
      */
505 504
     public static function display_error_message ($message, $filter = true, $returnValue = false)
506 505
     {
@@ -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(
@@ -917,6 +917,7 @@  discard block
 block discarded – undo
917 917
     /**
918 918
      * Displays an HTML input tag
919 919
      *
920
+     * @param string $type
920 921
      */
921 922
     public static function input($type, $name, $value, $attributes = array())
922 923
     {
@@ -933,8 +934,8 @@  discard block
 block discarded – undo
933 934
     }
934 935
 
935 936
     /**
936
-     * @param $name
937
-     * @param $value
937
+     * @param string $name
938
+     * @param string $value
938 939
      * @param array $attributes
939 940
      * @return string
940 941
      */
@@ -949,6 +950,7 @@  discard block
 block discarded – undo
949 950
     /**
950 951
      * Displays an HTML select tag
951 952
      *
953
+     * @param string $blank_item_text
952 954
      */
953 955
     public static function select(
954 956
         $name,
@@ -1015,8 +1017,8 @@  discard block
 block discarded – undo
1015 1017
                         $( "#tabs" ).tabs();
1016 1018
                     });
1017 1019
                 </script>
1018
-     * @param   array   $headers list of the tab titles
1019
-     * @param   array   $items
1020
+     * @param   string[]   $headers list of the tab titles
1021
+     * @param   string[]   $items
1020 1022
      * @param   string  $id id of the container of the tab in the example "tabs"
1021 1023
      * @param   array   $attributes for the ul
1022 1024
      * @param array $ul_attributes
@@ -1070,7 +1072,7 @@  discard block
 block discarded – undo
1070 1072
 
1071 1073
     /**
1072 1074
      * @param $headers
1073
-     * @param null $selected
1075
+     * @param integer $selected
1074 1076
      *
1075 1077
      * @return string
1076 1078
      */
@@ -1108,6 +1110,7 @@  discard block
 block discarded – undo
1108 1110
      * As you can see both function use the same "my_grid_name" this is very important otherwise nothing will work
1109 1111
      *
1110 1112
      * @param   string  the div id, this value must be the same with the first parameter of Display::grid_js()
1113
+     * @param string $div_id
1111 1114
      * @return  string  html
1112 1115
      *
1113 1116
      */
@@ -1668,6 +1671,8 @@  discard block
 block discarded – undo
1668 1671
      * @param  string  url that will be added (for jquery see hot_courses.tpl)
1669 1672
 	 * @param	string	point info array see function CourseManager::get_course_ranking()
1670 1673
 	 * @param	bool	add a div wrapper
1674
+	 * @param string $id
1675
+	 * @param string $url
1671 1676
 	 * @todo	use     templates
1672 1677
      **/
1673 1678
     public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true)
@@ -1758,6 +1763,9 @@  discard block
 block discarded – undo
1758 1763
         return '<'.$size.'>'.Security::remove_XSS($title).'</'.$size.'>';
1759 1764
     }
1760 1765
 
1766
+    /**
1767
+     * @param string $title
1768
+     */
1761 1769
     public static function page_subheader2($title, $second_title = null)
1762 1770
     {
1763 1771
         return self::page_header($title, $second_title, 'h4');
@@ -2005,6 +2013,7 @@  discard block
 block discarded – undo
2005 2013
 
2006 2014
     /**
2007 2015
      * @todo use twig
2016
+     * @param string $title
2008 2017
      */
2009 2018
     public static function groupButtonWithDropDown($title, $elements)
2010 2019
     {
@@ -2378,9 +2387,9 @@  discard block
 block discarded – undo
2378 2387
 
2379 2388
     /**
2380 2389
      * @param int $id
2381
-     * @param array $content
2390
+     * @param string[] $content
2382 2391
      * @param int $col
2383
-     * @param bool|true $right
2392
+     * @param boolean $right
2384 2393
      * @return string
2385 2394
      */
2386 2395
     public static function toolbarAction($id, $content = array(), $col = 2, $right = true)
@@ -2464,10 +2473,10 @@  discard block
 block discarded – undo
2464 2473
     /**
2465 2474
      * @param string $title
2466 2475
      * @param string $content
2467
-     * @param null $id
2476
+     * @param string $id
2468 2477
      * @param array $params
2469
-     * @param null $idAccordion
2470
-     * @param null $idCollapse
2478
+     * @param string $idAccordion
2479
+     * @param string $idCollapse
2471 2480
      * @param bool|true $open
2472 2481
      * @param bool|false $fullClickable
2473 2482
      * @return null|string
Please login to merge, or discard this patch.
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
         );
51 51
     }
52 52
 
53
-     /**
54
-     * Displays the page header
55
-     * @param string The name of the page (will be showed in the page title)
56
-     * @param string Optional help file name
57
-     * @param string $page_header
58
-     */
53
+        /**
54
+         * Displays the page header
55
+         * @param string The name of the page (will be showed in the page title)
56
+         * @param string Optional help file name
57
+         * @param string $page_header
58
+         */
59 59
     public static function display_header($tool_name ='', $help = null, $page_header = null)
60 60
     {
61 61
         $origin = api_get_origin();
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
      */
454 454
     public static function display_normal_message($message, $filter = true, $returnValue = false)
455 455
     {
456
-    	$message = self::return_message($message, 'normal', $filter);
456
+        $message = self::return_message($message, 'normal', $filter);
457 457
         if ($returnValue) {
458 458
             return $message;
459 459
         } else {
@@ -537,22 +537,22 @@  discard block
 block discarded – undo
537 537
         }
538 538
 
539 539
         if ($filter) {
540
-        	$message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
540
+            $message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
541 541
         }
542 542
 
543 543
         $class = '';
544 544
         switch ($type) {
545 545
             case 'warning':
546 546
                $class .= 'alert alert-warning';
547
-               break;
547
+                break;
548 548
             case 'error':
549 549
                $class .= 'alert alert-danger';
550
-               break;
550
+                break;
551 551
             case 'confirmation':
552 552
             case 'confirm':
553 553
             case 'success':
554 554
                 $class .= 'alert alert-success';
555
-               break;
555
+                break;
556 556
             case 'normal':
557 557
             default:
558 558
                 $class .= 'alert alert-info';
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
      * @param array    additional attributes (for instance height, width, onclick, ...)
683 683
      * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
684 684
      * @return void
685
-    */
685
+     */
686 686
     public static function display_icon(
687 687
         $image,
688 688
         $alt_text = '',
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
      * @author Julio Montoya 2010 Function improved, adding image constants
719 719
      * @author Yannick Warnier 2011 Added size handler
720 720
      * @version Feb 2011
721
-    */
721
+     */
722 722
     public static function return_icon(
723 723
         $image,
724 724
         $alt_text = '',
@@ -920,14 +920,14 @@  discard block
 block discarded – undo
920 920
      */
921 921
     public static function input($type, $name, $value, $attributes = array())
922 922
     {
923
-         if (isset($type)) {
924
-             $attributes['type']= $type;
925
-         }
926
-         if (isset($name)) {
927
-             $attributes['name']= $name;
928
-         }
929
-         if (isset($value)) {
930
-             $attributes['value']= $value;
923
+            if (isset($type)) {
924
+                $attributes['type']= $type;
925
+            }
926
+            if (isset($name)) {
927
+                $attributes['name']= $name;
928
+            }
929
+            if (isset($value)) {
930
+                $attributes['value']= $value;
931 931
         }
932 932
         return self::tag('input', '', $attributes);
933 933
     }
@@ -940,10 +940,10 @@  discard block
 block discarded – undo
940 940
      */
941 941
     public static function button($name, $value, $attributes = array())
942 942
     {
943
-    	if (!empty($name)) {
943
+        if (!empty($name)) {
944 944
             $attributes['name'] = $name;
945
-    	}
946
-    	return self::tag('button', $value, $attributes);
945
+        }
946
+        return self::tag('button', $value, $attributes);
947 947
     }
948 948
 
949 949
     /**
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
      * in the $htmlHeadXtra variable before the display_header
1011 1011
      * Add this script
1012 1012
      * @example
1013
-             * <script>
1013
+     * <script>
1014 1014
                     $(function() {
1015 1015
                         $( "#tabs" ).tabs();
1016 1016
                     });
@@ -1076,20 +1076,20 @@  discard block
 block discarded – undo
1076 1076
      */
1077 1077
     public static function tabsOnlyLink($headers, $selected = null)
1078 1078
     {
1079
-         $id = uniqid();
1080
-         $i = 1;
1081
-         $lis = null;
1082
-         foreach ($headers as $item) {
1079
+            $id = uniqid();
1080
+            $i = 1;
1081
+            $lis = null;
1082
+            foreach ($headers as $item) {
1083 1083
             $class = null;
1084 1084
             if ($i == $selected) {
1085 1085
                 $class = 'active';
1086 1086
             }
1087
-             $item = self::tag(
1088
-                 'a',
1089
-                 $item['content'],
1090
-                 array('id' => $id.'-'.$i, 'href' => $item['url'])
1091
-             );
1092
-             $lis .= self::tag('li', $item, array('class' => $class));
1087
+                $item = self::tag(
1088
+                    'a',
1089
+                    $item['content'],
1090
+                    array('id' => $id.'-'.$i, 'href' => $item['url'])
1091
+                );
1092
+                $lis .= self::tag('li', $item, array('class' => $class));
1093 1093
             $i++;
1094 1094
         }
1095 1095
         return self::tag('ul', $lis, array('class' => 'nav nav-tabs tabs-margin'));
@@ -1301,8 +1301,8 @@  discard block
 block discarded – undo
1301 1301
      */
1302 1302
     public static function table($headers, $rows, $attributes = array())
1303 1303
     {
1304
-    	if (empty($attributes)) {
1305
-    		$attributes['class'] = 'data_table';
1304
+        if (empty($attributes)) {
1305
+            $attributes['class'] = 'data_table';
1306 1306
         }
1307 1307
         $table = new HTML_Table($attributes);
1308 1308
         $row = 0;
@@ -1310,17 +1310,17 @@  discard block
 block discarded – undo
1310 1310
 
1311 1311
         // Course headers
1312 1312
         if (!empty($headers)) {
1313
-	        foreach ($headers as $item) {
1314
-	            $table->setHeaderContents($row, $column, $item);
1315
-	            $column++;
1316
-	        }
1317
-	        $row = 1;
1318
-	        $column = 0;
1313
+            foreach ($headers as $item) {
1314
+                $table->setHeaderContents($row, $column, $item);
1315
+                $column++;
1316
+            }
1317
+            $row = 1;
1318
+            $column = 0;
1319 1319
         }
1320 1320
 
1321 1321
         if (!empty($rows)) {
1322
-	        foreach($rows as $content) {
1323
-	            $table->setCellContents($row, $column, $content);
1322
+            foreach($rows as $content) {
1323
+                $table->setCellContents($row, $column, $content);
1324 1324
                 $row++;
1325 1325
             }
1326 1326
         }
@@ -1666,21 +1666,21 @@  discard block
 block discarded – undo
1666 1666
      *
1667 1667
      * @param  string  id of the rating ul element
1668 1668
      * @param  string  url that will be added (for jquery see hot_courses.tpl)
1669
-	 * @param	string	point info array see function CourseManager::get_course_ranking()
1670
-	 * @param	bool	add a div wrapper
1671
-	 * @todo	use     templates
1669
+     * @param	string	point info array see function CourseManager::get_course_ranking()
1670
+     * @param	bool	add a div wrapper
1671
+     * @todo	use     templates
1672 1672
      **/
1673 1673
     public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true)
1674 1674
     {
1675
-		$number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1676
-		$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1675
+        $number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1676
+        $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1677 1677
 
1678
-		if (!empty($percentage)) {
1678
+        if (!empty($percentage)) {
1679 1679
             $percentage = $percentage*125/100;
1680 1680
         }
1681
-		$accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1681
+        $accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1682 1682
 
1683
-		$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1683
+        $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1684 1684
 
1685 1685
         $html = '<ul id="'.$id.'" class="star-rating">
1686 1686
 					<li class="current-rating" style="width:'.$percentage.'px;"></li>
@@ -1691,26 +1691,26 @@  discard block
 block discarded – undo
1691 1691
 					<li><a href="javascript:void(0);" data-link="'.$url.'&amp;star=5" title="'.$star_label.'" class="five-stars">5</a></li>
1692 1692
 				</ul>';
1693 1693
 
1694
-		$labels = array();
1694
+        $labels = array();
1695 1695
 
1696
-		$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1697
-		$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1698
-		/* if (!empty($number_of_users_who_voted)) {
1696
+        $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1697
+        $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1698
+        /* if (!empty($number_of_users_who_voted)) {
1699 1699
 			$labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1700 1700
 		} */
1701 1701
 
1702
-		$labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1702
+        $labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1703 1703
 
1704
-		if (!$add_div_wrapper && api_is_anonymous()) {
1705
-			$labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1706
-		}
1704
+        if (!$add_div_wrapper && api_is_anonymous()) {
1705
+            $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1706
+        }
1707 1707
 
1708 1708
         $html .= Display::div(implode(' | ', $labels) , array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1709 1709
         $html .= ' '.Display::span(' ', array('id' =>  'vote_label2_'.$id));
1710 1710
 
1711 1711
         if ($add_div_wrapper) {
1712
-			$html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1713
-		}
1712
+            $html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1713
+        }
1714 1714
 
1715 1715
         return $html;
1716 1716
     }
@@ -1743,8 +1743,8 @@  discard block
 block discarded – undo
1743 1743
         return self::page_header($title, $second_title);
1744 1744
     }
1745 1745
 
1746
-     public static function page_subheader_and_translate($title, $second_title = null)
1747
-     {
1746
+        public static function page_subheader_and_translate($title, $second_title = null)
1747
+        {
1748 1748
         $title = get_lang($title);
1749 1749
         return self::page_subheader($title, $second_title);
1750 1750
     }
@@ -2527,7 +2527,7 @@  discard block
 block discarded – undo
2527 2527
      */
2528 2528
     public static function dateToStringAgoAndLongDate($dateTime)
2529 2529
     {
2530
-       if (empty($dateTime) || $dateTime === '0000-00-00 00:00:00') {
2530
+        if (empty($dateTime) || $dateTime === '0000-00-00 00:00:00') {
2531 2531
             return '';
2532 2532
         }
2533 2533
 
Please login to merge, or discard this patch.
Spacing   +72 added lines, -73 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * @param string Optional help file name
57 57
      * @param string $page_header
58 58
      */
59
-    public static function display_header($tool_name ='', $help = null, $page_header = null)
59
+    public static function display_header($tool_name = '', $help = null, $page_header = null)
60 60
     {
61 61
         $origin = api_get_origin();
62 62
         $showHeader = true;
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         $grid_class = array(),
355 355
         $elementCount = 0
356 356
     ) {
357
-        $column =  0;
357
+        $column = 0;
358 358
         $default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20;
359 359
 
360 360
         $table = new SortableTableFromArray($content, $column, $default_items_per_page, $name);
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
      * @deprecated use Display::addFlash with Display::return_message
484 484
      * @return void
485 485
      */
486
-    public static function display_confirmation_message ($message, $filter = true, $returnValue = false)
486
+    public static function display_confirmation_message($message, $filter = true, $returnValue = false)
487 487
     {
488 488
         $message = self::return_message($message, 'confirm', $filter);
489 489
         if ($returnValue) {
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
      *
503 503
      * @return void
504 504
      */
505
-    public static function display_error_message ($message, $filter = true, $returnValue = false)
505
+    public static function display_error_message($message, $filter = true, $returnValue = false)
506 506
     {
507 507
         $message = self::return_message($message, 'error', $filter);
508 508
         if ($returnValue) {
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
      * @param string $type
518 518
      * @param bool $filter
519 519
      */
520
-    public static function return_message_and_translate($message, $type='normal', $filter = true)
520
+    public static function return_message_and_translate($message, $type = 'normal', $filter = true)
521 521
     {
522 522
         $message = get_lang($message);
523 523
         echo self::return_message($message, $type, $filter);
@@ -584,14 +584,14 @@  discard block
 block discarded – undo
584 584
         }
585 585
         // Encrypt email
586 586
         $hmail = '';
587
-        for ($i = 0; $i < strlen($email); $i ++) {
587
+        for ($i = 0; $i < strlen($email); $i++) {
588 588
             $hmail .= '&#'.ord($email {
589 589
             $i }).';';
590 590
         }
591 591
         $hclickable_text = null;
592 592
         // Encrypt clickable text if @ is present
593 593
         if (strpos($clickable_text, '@')) {
594
-            for ($i = 0; $i < strlen($clickable_text); $i ++) {
594
+            for ($i = 0; $i < strlen($clickable_text); $i++) {
595 595
                 $hclickable_text .= '&#'.ord($clickable_text {
596 596
                 $i }).';';
597 597
             }
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
         }
624 624
         // Encrypt email
625 625
         $hmail = '';
626
-        for ($i = 0; $i < strlen($email); $i ++) {
626
+        for ($i = 0; $i < strlen($email); $i++) {
627 627
             $hmail .= '&#'.ord($email {
628 628
             $i }).';';
629 629
         }
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
     public static function get_alphabet_options($selected_letter = '')
644 644
     {
645 645
         $result = '';
646
-        for ($i = 65; $i <= 90; $i ++) {
646
+        for ($i = 65; $i <= 90; $i++) {
647 647
             $letter = chr($i);
648 648
             $result .= '<option value="'.$letter.'"';
649 649
             if ($selected_letter == $letter) {
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
     public static function get_numeric_options($min, $max, $selected_num = 0)
665 665
     {
666 666
         $result = '';
667
-        for ($i = $min; $i <= $max; $i ++) {
667
+        for ($i = $min; $i <= $max; $i++) {
668 668
             $result .= '<option value="'.$i.'"';
669 669
             if (is_int($selected_num))
670 670
                 if ($selected_num == $i) {
@@ -734,8 +734,8 @@  discard block
 block discarded – undo
734 734
         // important to use the public path (i.e. web/css/) rather than the
735 735
         // internal path (/app/Resource/public/css/) because the path used
736 736
         // in the end must be the public path
737
-        $alternateCssPath = api_get_path(SYS_PUBLIC_PATH) . 'css/';
738
-        $alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH) . 'css/';
737
+        $alternateCssPath = api_get_path(SYS_PUBLIC_PATH).'css/';
738
+        $alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH).'css/';
739 739
 
740 740
         $image = trim($image);
741 741
 
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
             $size = ICON_SIZE_SMALL;
746 746
         }
747 747
 
748
-        $size_extra = $size . '/';
748
+        $size_extra = $size.'/';
749 749
 
750 750
         // Checking the img/ folder
751 751
         $icon = $w_code_path.'img/'.$image;
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
         $theme = 'themes/chamilo/icons/';
754 754
 
755 755
         if ($loadThemeIcon) {
756
-            $theme = 'themes/' . api_get_visual_theme() . '/icons/';
756
+            $theme = 'themes/'.api_get_visual_theme().'/icons/';
757 757
             // Checking the theme icons folder example: app/Resources/public/css/themes/chamilo/icons/XXX
758 758
             if (is_file($alternateCssPath.$theme.$size_extra.$image)) {
759 759
                 $icon = $alternateWebCssPath.$theme.$size_extra.$image;
@@ -775,11 +775,11 @@  discard block
 block discarded – undo
775 775
         // ask for the SVG version directly
776 776
         $svgIcons = api_get_setting('icons_mode_svg');
777 777
         if ($svgIcons == 'true' && $return_only_path == false) {
778
-            $svgImage = substr($image, 0, -3) . 'svg';
779
-            if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
780
-                $icon = $w_code_path . $theme . 'svg/' . $svgImage;
781
-            } elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) {
782
-                $icon = $w_code_path . 'img/icons/svg/' . $svgImage;
778
+            $svgImage = substr($image, 0, -3).'svg';
779
+            if (is_file($code_path.$theme.'svg/'.$svgImage)) {
780
+                $icon = $w_code_path.$theme.'svg/'.$svgImage;
781
+            } elseif (is_file($code_path.'img/icons/svg/'.$svgImage)) {
782
+                $icon = $w_code_path.'img/icons/svg/'.$svgImage;
783 783
             }
784 784
 
785 785
             if (empty($additional_attributes['height'])) {
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
             }
869 869
         }
870 870
         //some tags don't have this </XXX>
871
-        if (in_array($tag, array('img','input','br'))) {
871
+        if (in_array($tag, array('img', 'input', 'br'))) {
872 872
             $return_value = '<'.$tag.' '.$attribute_list.' />';
873 873
         } else {
874 874
             $return_value = '<'.$tag.' '.$attribute_list.' >'.$content.'</'.$tag.'>';
@@ -921,13 +921,13 @@  discard block
 block discarded – undo
921 921
     public static function input($type, $name, $value, $attributes = array())
922 922
     {
923 923
          if (isset($type)) {
924
-             $attributes['type']= $type;
924
+             $attributes['type'] = $type;
925 925
          }
926 926
          if (isset($name)) {
927
-             $attributes['name']= $name;
927
+             $attributes['name'] = $name;
928 928
          }
929 929
          if (isset($value)) {
930
-             $attributes['value']= $value;
930
+             $attributes['value'] = $value;
931 931
         }
932 932
         return self::tag('input', '', $attributes);
933 933
     }
@@ -960,14 +960,14 @@  discard block
 block discarded – undo
960 960
     ) {
961 961
         $html = '';
962 962
         $extra = '';
963
-        $default_id = 'id="' . $name . '" ';
963
+        $default_id = 'id="'.$name.'" ';
964 964
         foreach ($extra_attributes as $key => $parameter) {
965 965
             if ($key == 'id') {
966 966
                 $default_id = '';
967 967
             }
968
-            $extra .= $key . '="' . $parameter . '" ';
968
+            $extra .= $key.'="'.$parameter.'" ';
969 969
         }
970
-        $html .= '<select name="' . $name . '" ' . $default_id . ' ' . $extra . '>';
970
+        $html .= '<select name="'.$name.'" '.$default_id.' '.$extra.'>';
971 971
 
972 972
         if ($show_blank_item) {
973 973
             if (empty($blank_item_text)) {
@@ -975,14 +975,14 @@  discard block
 block discarded – undo
975 975
             } else {
976 976
                 $blank_item_text = Security::remove_XSS($blank_item_text);
977 977
             }
978
-            $html .= self::tag('option', '-- ' . $blank_item_text . ' --', array('value' => '-1'));
978
+            $html .= self::tag('option', '-- '.$blank_item_text.' --', array('value' => '-1'));
979 979
         }
980 980
         if ($values) {
981 981
             foreach ($values as $key => $value) {
982 982
                 if (is_array($value) && isset($value['name'])) {
983 983
                     $value = $value['name'];
984 984
                 }
985
-                $html .= '<option value="' . $key . '"';
985
+                $html .= '<option value="'.$key.'"';
986 986
 
987 987
                 if (is_array($default)) {
988 988
                     foreach ($default as $item) {
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
                     }
998 998
                 }
999 999
 
1000
-                $html .= '>' . $value . '</option>';
1000
+                $html .= '>'.$value.'</option>';
1001 1001
             }
1002 1002
         }
1003 1003
         $html .= '</select>';
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
      */
1026 1026
     public static function tabs($headers, $items, $id = 'tabs', $attributes = array(), $ul_attributes = array())
1027 1027
     {
1028
-        if (empty($headers) || count($headers) == 0 ) {
1028
+        if (empty($headers) || count($headers) == 0) {
1029 1029
             return '';
1030 1030
         }
1031 1031
 
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
             if ($i == 1) {
1037 1037
                 $active = ' active';
1038 1038
             }
1039
-            $item = self::tag('a', $item, array('href'=>'#'.$id.'-'.$i, 'role'=> 'tab', 'data-toggle' => 'tab', 'id' => $id . $i));
1039
+            $item = self::tag('a', $item, array('href'=>'#'.$id.'-'.$i, 'role'=> 'tab', 'data-toggle' => 'tab', 'id' => $id.$i));
1040 1040
             $ul_attributes['role'] = 'presentation';
1041 1041
             $ul_attributes['class'] = $active;
1042 1042
             $lis .= self::tag('li', $item, $ul_attributes);
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 
1066 1066
         $main_div = self::tag('div', $ul.self::tag('div', $divs, ['class' => 'tab-content']), $attributes);
1067 1067
 
1068
-        return $main_div ;
1068
+        return $main_div;
1069 1069
     }
1070 1070
 
1071 1071
     /**
@@ -1113,8 +1113,8 @@  discard block
 block discarded – undo
1113 1113
      */
1114 1114
     public static function grid_html($div_id)
1115 1115
     {
1116
-        $table = self::tag('table','', array('id' => $div_id));
1117
-        $table .= self::tag('div','', array('id' => $div_id.'_pager'));
1116
+        $table = self::tag('table', '', array('id' => $div_id));
1117
+        $table .= self::tag('div', '', array('id' => $div_id.'_pager'));
1118 1118
         return $table;
1119 1119
     }
1120 1120
 
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
         $obj->colNames      = $column_names;
1176 1176
         $obj->colModel      = $column_model;
1177 1177
         $obj->pager         = '#'.$div_id.'_pager';
1178
-        $obj->datatype  = 'json';
1178
+        $obj->datatype = 'json';
1179 1179
         $obj->viewrecords = 'true';
1180 1180
 
1181 1181
         $all_value = 10000000;
@@ -1236,10 +1236,10 @@  discard block
 block discarded – undo
1236 1236
         // Adding static data.
1237 1237
         if (!empty($data)) {
1238 1238
             $data_var = $div_id.'_data';
1239
-            $json.=' var '.$data_var.' = '.json_encode($data).';';
1239
+            $json .= ' var '.$data_var.' = '.json_encode($data).';';
1240 1240
             $obj->data = $data_var;
1241 1241
             $obj->datatype = 'local';
1242
-            $json.="\n";
1242
+            $json .= "\n";
1243 1243
         }
1244 1244
 
1245 1245
         $obj->end = 'end';
@@ -1253,12 +1253,12 @@  discard block
 block discarded – undo
1253 1253
         }
1254 1254
 
1255 1255
         // Fixing true/false js values that doesn't need the ""
1256
-        $json_encode = str_replace(':"true"',':true',$json_encode);
1256
+        $json_encode = str_replace(':"true"', ':true', $json_encode);
1257 1257
         // wrap_cell is not a valid jqgrid attributes is a hack to wrap a text
1258 1258
         $json_encode = str_replace('"wrap_cell":true', 'cellattr : function(rowId, value, rowObject, colModel, arrData) { return \'class = "jqgrid_whitespace"\'; }', $json_encode);
1259
-        $json_encode = str_replace(':"false"',':false',$json_encode);
1259
+        $json_encode = str_replace(':"false"', ':false', $json_encode);
1260 1260
         $json_encode = str_replace('"formatter":"action_formatter"', 'formatter:action_formatter', $json_encode);
1261
-        $json_encode = str_replace(array('{"first":"first",','"end":"end"}'), '', $json_encode);
1261
+        $json_encode = str_replace(array('{"first":"first",', '"end":"end"}'), '', $json_encode);
1262 1262
 
1263 1263
         // Creating the jqgrid element.
1264 1264
         $json .= '$("#'.$div_id.'").jqGrid({';
@@ -1273,22 +1273,22 @@  discard block
 block discarded – undo
1273 1273
             $groups = '';
1274 1274
             foreach ($extra_params['groupHeaders'] as $group) {
1275 1275
                 //{ "startColumnName" : "courses", "numberOfColumns" : 1, "titleText" : "Order Info" },
1276
-                $groups .= '{ "startColumnName" : "' . $group['startColumnName'] . '", "numberOfColumns" : ' . $group['numberOfColumns'] . ', "titleText" : "' . $group['titleText']  . '" },';
1276
+                $groups .= '{ "startColumnName" : "'.$group['startColumnName'].'", "numberOfColumns" : '.$group['numberOfColumns'].', "titleText" : "'.$group['titleText'].'" },';
1277 1277
 
1278 1278
             }
1279 1279
             $json .= '$("#'.$div_id.'").jqGrid("setGroupHeaders", {
1280 1280
                 "useColSpanStyle" : false,
1281 1281
                 "groupHeaders"    : [
1282
-                    ' . $groups . '
1282
+                    ' . $groups.'
1283 1283
                 ]
1284 1284
             });';
1285 1285
         }
1286 1286
 
1287 1287
         $all_text = addslashes(get_lang('All'));
1288 1288
         $json .= '$("'.$obj->pager.' option[value='.$all_value.']").text("'.$all_text.'");';
1289
-        $json.= "\n";
1289
+        $json .= "\n";
1290 1290
         // Adding edit/delete icons.
1291
-        $json.= $formatter;
1291
+        $json .= $formatter;
1292 1292
 
1293 1293
         return $json;
1294 1294
     }
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
         }
1320 1320
 
1321 1321
         if (!empty($rows)) {
1322
-	        foreach($rows as $content) {
1322
+	        foreach ($rows as $content) {
1323 1323
 	            $table->setCellContents($row, $column, $content);
1324 1324
                 $row++;
1325 1325
             }
@@ -1431,7 +1431,7 @@  discard block
 block discarded – undo
1431 1431
                             lastedit_user_id != $user_id $sessionCondition AND 
1432 1432
                             visibility != 2 AND
1433 1433
                             (to_user_id IN ('$user_id', '0') OR to_user_id IS NULL) AND
1434
-                            (to_group_id IN ('".implode("','",$group_ids)."') OR to_group_id IS NULL)       
1434
+                            (to_group_id IN ('".implode("','", $group_ids)."') OR to_group_id IS NULL)       
1435 1435
                         ORDER BY lastedit_date DESC
1436 1436
                         LIMIT 1";
1437 1437
 
@@ -1450,9 +1450,8 @@  discard block
 block discarded – undo
1450 1450
         $return = '&nbsp;';
1451 1451
         foreach ($notifications as $notification) {
1452 1452
             $toolName = $notification['tool'];
1453
-            if (!
1454
-                (
1455
-                    $notification['visibility'] == '1'  ||
1453
+            if (!(
1454
+                    $notification['visibility'] == '1' ||
1456 1455
                     ($status == '1' && $notification['visibility'] == '0') ||
1457 1456
                     !isset($notification['visibility'])
1458 1457
                 )
@@ -1536,9 +1535,9 @@  discard block
 block discarded – undo
1536 1535
             $main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
1537 1536
             $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
1538 1537
             // Request for the name of the general coach
1539
-            $sql ='SELECT tu.lastname, tu.firstname, ts.*
1538
+            $sql = 'SELECT tu.lastname, tu.firstname, ts.*
1540 1539
                     FROM '.$tbl_session.' ts
1541
-                    LEFT JOIN '.$main_user_table .' tu
1540
+                    LEFT JOIN '.$main_user_table.' tu
1542 1541
                     ON ts.id_coach = tu.user_id
1543 1542
                     WHERE ts.id = '.intval($session_id);
1544 1543
             $rs = Database::query($sql);
@@ -1550,7 +1549,7 @@  discard block
 block discarded – undo
1550 1549
             $session['title'] = $session_info['name'];
1551 1550
             $session['id_coach'] = $session_info['id_coach'];
1552 1551
             $session['coach'] = '';
1553
-            $session['dates'] =  '';
1552
+            $session['dates'] = '';
1554 1553
 
1555 1554
             if (($session_info['access_end_date'] == '0000-00-00 00:00:00' && $session_info['access_start_date'] == '0000-00-00 00:00:00') ||
1556 1555
                 ($session_info['access_end_date'] == '0000-00-00 00:00:00' && $session_info['access_start_date'] == '0000-00-00 00:00:00') ||
@@ -1622,7 +1621,7 @@  discard block
 block discarded – undo
1622 1621
                 $session['dates'] = $dates['access'];
1623 1622
 
1624 1623
 
1625
-                if (api_get_setting('show_session_coach') === 'true' ) {
1624
+                if (api_get_setting('show_session_coach') === 'true') {
1626 1625
                     $session['coach'] = api_get_person_name(
1627 1626
                         $session_info['firstname'],
1628 1627
                         $session_info['lastname']
@@ -1676,9 +1675,9 @@  discard block
 block discarded – undo
1676 1675
 		$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1677 1676
 
1678 1677
 		if (!empty($percentage)) {
1679
-            $percentage = $percentage*125/100;
1678
+            $percentage = $percentage * 125 / 100;
1680 1679
         }
1681
-		$accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1680
+		$accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1682 1681
 
1683 1682
 		$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1684 1683
 
@@ -1693,19 +1692,19 @@  discard block
 block discarded – undo
1693 1692
 
1694 1693
 		$labels = array();
1695 1694
 
1696
-		$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1697
-		$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1695
+		$labels[] = $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1696
+		$labels[] = $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1698 1697
 		/* if (!empty($number_of_users_who_voted)) {
1699 1698
 			$labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1700 1699
 		} */
1701 1700
 
1702
-		$labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1701
+		$labels[] = $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote').' [?] ';
1703 1702
 
1704 1703
 		if (!$add_div_wrapper && api_is_anonymous()) {
1705
-			$labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1704
+			$labels[] = Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1706 1705
 		}
1707 1706
 
1708
-        $html .= Display::div(implode(' | ', $labels) , array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1707
+        $html .= Display::div(implode(' | ', $labels), array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1709 1708
         $html .= ' '.Display::span(' ', array('id' =>  'vote_label2_'.$id));
1710 1709
 
1711 1710
         if ($add_div_wrapper) {
@@ -1778,8 +1777,8 @@  discard block
 block discarded – undo
1778 1777
         if (!empty($list)) {
1779 1778
             $html = '<dl class="dl-horizontal">';
1780 1779
             foreach ($list as $item) {
1781
-                $html .= '<dt>' . $item['title'] . '</dt>';
1782
-                $html .= '<dd>' . $item['content'] . '</dd>';
1780
+                $html .= '<dt>'.$item['title'].'</dt>';
1781
+                $html .= '<dd>'.$item['content'].'</dd>';
1783 1782
             }
1784 1783
             $html .= '</dl>';
1785 1784
         }
@@ -1821,7 +1820,7 @@  discard block
 block discarded – undo
1821 1820
      * @param string $type
1822 1821
      * @return null|string
1823 1822
      */
1824
-    public static function badge($count, $type ="warning")
1823
+    public static function badge($count, $type = "warning")
1825 1824
     {
1826 1825
         $class = '';
1827 1826
 
@@ -1897,7 +1896,7 @@  discard block
 block discarded – undo
1897 1896
         if (!empty($content)) {
1898 1897
             $html = '<span class="label '.$class.'">';
1899 1898
             $html .= $content;
1900
-            $html .='</span>';
1899
+            $html .= '</span>';
1901 1900
         }
1902 1901
 
1903 1902
         return $html;
@@ -1918,7 +1917,7 @@  discard block
 block discarded – undo
1918 1917
                     $class = 'class ="active"';
1919 1918
                 }
1920 1919
 
1921
-                if (basename($_SERVER['REQUEST_URI']) == basename($value['url']) ) {
1920
+                if (basename($_SERVER['REQUEST_URI']) == basename($value['url'])) {
1922 1921
                     $class = 'class ="active"';
1923 1922
                 }
1924 1923
                 $html .= "<li $class >";
@@ -2187,7 +2186,7 @@  discard block
 block discarded – undo
2187 2186
         }
2188 2187
         $label = $nextValue + $localCounter + 1;
2189 2188
         if ($isMedia) {
2190
-            $label = ($fixedValue + 1) .' '.chr(97 + $localCounter);
2189
+            $label = ($fixedValue + 1).' '.chr(97 + $localCounter);
2191 2190
             $link_to_show = $link.$fixedValue.'#questionanchor'.$itemId;
2192 2191
         }
2193 2192
         $link = Display::url($label.' ', $link_to_show, $linkAttributes);
@@ -2370,7 +2369,7 @@  discard block
 block discarded – undo
2370 2369
         $attributes['title'] = isset($attributes['title']) ? $attributes['title'] : $text;
2371 2370
 
2372 2371
         if (!$includeText) {
2373
-            $text = '<span class="sr-only">' . $text . '</span>';
2372
+            $text = '<span class="sr-only">'.$text.'</span>';
2374 2373
         }
2375 2374
 
2376 2375
         return self::url("$icon $text", $url, $attributes);
@@ -2385,9 +2384,9 @@  discard block
 block discarded – undo
2385 2384
      */
2386 2385
     public static function toolbarAction($id, $content = array(), $col = 2, $right = true)
2387 2386
     {
2388
-        $columns = 12/$col;
2387
+        $columns = 12 / $col;
2389 2388
         $html = '';
2390
-        $html .= '<div id="' . $id . '" class="actions">';
2389
+        $html .= '<div id="'.$id.'" class="actions">';
2391 2390
         $html .= '<div class="row">';
2392 2391
         if ($col > 4) {
2393 2392
             $html = '<div class="alert alert-warning" role="alert">
@@ -2395,7 +2394,7 @@  discard block
 block discarded – undo
2395 2394
             </div>';
2396 2395
         } else {
2397 2396
             for ($i = 0; $i < $col; $i++) {
2398
-                $html .= '<div class="col-md-' . $columns . '">';
2397
+                $html .= '<div class="col-md-'.$columns.'">';
2399 2398
                 if ($col == 2 && $i == 1) {
2400 2399
                     if ($right === true) {
2401 2400
                         $html .= '<div class="pull-right">';
@@ -2511,9 +2510,9 @@  discard block
 block discarded – undo
2511 2510
             $params['class'] = 'panel panel-default';
2512 2511
             $html = null;
2513 2512
             if (!empty($title)) {
2514
-                $html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL;
2513
+                $html .= '<div class="panel-heading">'.$title.'</div>'.PHP_EOL;
2515 2514
             }
2516
-            $html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
2515
+            $html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL;
2517 2516
             $html = Display::div($html, $params);
2518 2517
         }
2519 2518
         return $html;
@@ -2547,7 +2546,7 @@  discard block
 block discarded – undo
2547 2546
      * @param string $toolbar
2548 2547
      * @return string
2549 2548
      */
2550
-    public static function getUserCard($userInfo, $status= '', $toolbar = '')
2549
+    public static function getUserCard($userInfo, $status = '', $toolbar = '')
2551 2550
     {
2552 2551
         if (!empty($status)) {
2553 2552
             $status = '<div class="items-user-status">'.$status.'</div>';
Please login to merge, or discard this patch.
main/inc/lib/events.lib.php 3 patches
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.
Spacing   +9 added lines, -11 removed lines patch added patch discarded remove patch
@@ -77,9 +77,7 @@  discard block
 block discarded – undo
77 77
         Database::query($sql);
78 78
 
79 79
         // Auto subscribe
80
-        $user_status = $userInfo['status']  == SESSIONADMIN ? 'sessionadmin' :
81
-            $userInfo['status'] == COURSEMANAGER ? 'teacher' :
82
-                $userInfo['status'] == DRH ? 'DRH' : 'student';
80
+        $user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : $userInfo['status'] == COURSEMANAGER ? 'teacher' : $userInfo['status'] == DRH ? 'DRH' : 'student';
83 81
         $autoSubscribe = api_get_setting($user_status.'_autosubscribe');
84 82
         if ($autoSubscribe) {
85 83
             $autoSubscribe = explode('|', $autoSubscribe);
@@ -336,7 +334,7 @@  discard block
 block discarded – undo
336 334
         global $debug;
337 335
 
338 336
         if ($debug) error_log('Called to update_event_exercice');
339
-        if ($debug) error_log('duration:' . $duration);
337
+        if ($debug) error_log('duration:'.$duration);
340 338
 
341 339
         if ($exeid != '') {
342 340
             /*
@@ -384,7 +382,7 @@  discard block
 block discarded – undo
384 382
         		   status = '".$status."',
385 383
         		   questions_to_check = '".$remind_list."',
386 384
         		   data_tracking = '".implode(',', $question_list)."',
387
-                   user_ip = '" . Database::escape_string(api_get_real_ip()) . "'
385
+                   user_ip = '" . Database::escape_string(api_get_real_ip())."'
388 386
         		 WHERE exe_id = '".Database::escape_string($exeid)."'";
389 387
             $res = Database::query($sql);
390 388
 
@@ -1055,15 +1053,15 @@  discard block
 block discarded – undo
1055 1053
 
1056 1054
         if (!empty($exe_list) && is_array($exe_list) && count($exe_list) > 0) {
1057 1055
             $sql = "DELETE FROM $track_e_exercises
1058
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1056
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1059 1057
             Database::query($sql);
1060 1058
 
1061 1059
             $sql = "DELETE FROM $track_attempts
1062
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1060
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1063 1061
             Database::query($sql);
1064 1062
 
1065 1063
             $sql = "DELETE FROM $recording_table
1066
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1064
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1067 1065
             Database::query($sql);
1068 1066
         }
1069 1067
 
@@ -1105,7 +1103,7 @@  discard block
 block discarded – undo
1105 1103
             Event::addEvent(
1106 1104
                 LOG_EXERCISE_RESULT_DELETE,
1107 1105
                 LOG_EXERCISE_AND_USER_ID,
1108
-                $exercise_id . '-' . $user_id,
1106
+                $exercise_id.'-'.$user_id,
1109 1107
                 null,
1110 1108
                 null,
1111 1109
                 $course_id,
@@ -1705,7 +1703,7 @@  discard block
 block discarded – undo
1705 1703
         Event::addEvent(
1706 1704
             LOG_QUESTION_RESULT_DELETE,
1707 1705
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1708
-            $exe_id . '-' . $question_id,
1706
+            $exe_id.'-'.$question_id,
1709 1707
             null,
1710 1708
             null,
1711 1709
             $courseId,
@@ -1741,7 +1739,7 @@  discard block
 block discarded – undo
1741 1739
         Event::addEvent(
1742 1740
             LOG_QUESTION_RESULT_DELETE,
1743 1741
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1744
-            $exe_id . '-' . $question_id,
1742
+            $exe_id.'-'.$question_id,
1745 1743
             null,
1746 1744
             null,
1747 1745
             $courseId,
Please login to merge, or discard this patch.
Doc Comments   +20 added lines, -9 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,
@@ -588,6 +593,8 @@  discard block
 block discarded – undo
588 593
      * @param	int		Whether this answer is correct (1) or not (0)
589 594
      * @param	string	Coordinates of this point (e.g. 123;324)
590 595
      * @param	bool update results?
596
+     * @param integer $exe_id
597
+     * @param integer $correct
591 598
      * @return	boolean	Result of the insert query
592 599
      * @uses Course code and user_id from global scope $_cid and $_user
593 600
      */
@@ -800,11 +807,11 @@  discard block
 block discarded – undo
800 807
     /**
801 808
      * Save the new message for one event and for one language
802 809
      *
803
-     * @param string $eventName
810
+     * @param string $event_name
804 811
      * @param array $users
805 812
      * @param string $message
806 813
      * @param string $subject
807
-     * @param string $eventMessageLanguage
814
+     * @param string $event_message_language
808 815
      * @param int $activated
809 816
      */
810 817
     public static function save_event_type_message($event_name, $users, $message, $subject, $event_message_language, $activated)
@@ -938,10 +945,10 @@  discard block
 block discarded – undo
938 945
     }
939 946
 
940 947
     /**
941
-     * @param $user_id
948
+     * @param integer $user_id
942 949
      * @param $exerciseId
943
-     * @param $lp_id
944
-     * @param $lp_item_id
950
+     * @param integer $lp_id
951
+     * @param integer $lp_item_id
945 952
      * @return int
946 953
      */
947 954
     public static function get_attempt_count_not_finished($user_id, $exerciseId, $lp_id, $lp_item_id)
@@ -1118,6 +1125,7 @@  discard block
 block discarded – undo
1118 1125
      * @param   int     exercise id
1119 1126
      * @param   int $courseId
1120 1127
      * @param   int     session id
1128
+     * @param integer $user_id
1121 1129
      * @return  array   with the results
1122 1130
      *
1123 1131
      */
@@ -1213,6 +1221,7 @@  discard block
 block discarded – undo
1213 1221
      * @param   int     exercise id
1214 1222
      * @param   int  $courseId
1215 1223
      * @param   int     session id
1224
+     * @param integer $user_id
1216 1225
      * @return  array   with the results
1217 1226
      *
1218 1227
      */
@@ -1301,6 +1310,8 @@  discard block
 block discarded – undo
1301 1310
      * @param   int     lp id
1302 1311
      * @param   int     lp item id
1303 1312
      * @param   string 	order asc or desc
1313
+     * @param integer $courseId
1314
+     * @param string $order
1304 1315
      * @return  array   with the results
1305 1316
      *
1306 1317
      */
@@ -1367,7 +1378,7 @@  discard block
 block discarded – undo
1367 1378
      * @param   int     exercise id
1368 1379
      * @param   int     $courseId
1369 1380
      * @param   int     session id
1370
-     * @return  array   with the results
1381
+     * @return  string   with the results
1371 1382
      *
1372 1383
      */
1373 1384
     public static function count_exercise_attempts_by_user($user_id, $exercise_id, $courseId, $session_id = 0)
@@ -1538,7 +1549,7 @@  discard block
 block discarded – undo
1538 1549
      * @param   int     exercise id
1539 1550
      * @param   int   course id
1540 1551
      * @param   int     session id
1541
-     * @return  array   with the results
1552
+     * @return  integer   with the results
1542 1553
      *
1543 1554
      */
1544 1555
     public static function get_count_exercises_attempted_by_course($courseId, $session_id = 0)
Please login to merge, or discard this patch.
main/inc/lib/skill.lib.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
     }
34 34
 
35 35
     /**
36
-    * This function is for editing profile info from profile_id.
37
-    * @param int    $profileId
38
-    * @param string $name
39
-    * @param string $description
40
-    */
36
+     * This function is for editing profile info from profile_id.
37
+     * @param int    $profileId
38
+     * @param string $name
39
+     * @param string $description
40
+     */
41 41
     public function updateProfileInfo($profileId, $name, $description)
42 42
     {
43 43
         $profileId = intval($profileId);
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
     }
129 129
 
130 130
     /**
131
-    * This function is for getting profile info from profile_id.
132
-    * @param int $profileId
133
-    */
131
+     * This function is for getting profile info from profile_id.
132
+     * @param int $profileId
133
+     */
134 134
 
135 135
     public function getProfileInfo($profileId)
136 136
     {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
                     $attributes = array(
804 804
                         'skill_id'      => $skill_id,
805 805
                         'parent_id'     => $parent_id,
806
-                        'relation_type' => (isset($params['relation_type'])?$params['relation_type']:0),
806
+                        'relation_type' => (isset($params['relation_type']) ? $params['relation_type'] : 0),
807 807
                         //'level'         => $params['level'],
808 808
                     );
809 809
                     $skill_rel_skill->save($attributes);
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
                     $skills[$skill_id] = $skill_info;
1013 1013
                     // Uncomment code below to hide the searched skill
1014 1014
                     $skills[$skill_id]['data']['parent_id'] = $skill_info['extra']['parent_id'];
1015
-                    $skills[$skill_id]['parent_id'] =  1;
1015
+                    $skills[$skill_id]['parent_id'] = 1;
1016 1016
                 }
1017 1017
             }
1018 1018
         }
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
                     $skill['data']['skill_has_gradebook'] = true;
1078 1078
                 }
1079 1079
                 $refs[$skill['id']] = &$skill;
1080
-                $flat_array[$skill['id']] =  &$skill;
1080
+                $flat_array[$skill['id']] = &$skill;
1081 1081
             }
1082 1082
 
1083 1083
             // Checking family value
@@ -1098,7 +1098,7 @@  discard block
 block discarded – undo
1098 1098
                 $refs['root']['children'][0] = $skills[1];
1099 1099
                 $skills[$skill_id]['data']['family_id'] = 1;
1100 1100
                 $refs['root']['children'][0]['children'][0] = $skills[$skill_id];
1101
-                $flat_array[$skill_id] =  $skills[$skill_id];
1101
+                $flat_array[$skill_id] = $skills[$skill_id];
1102 1102
             } else {
1103 1103
                 // Moving node to the children index of their parents
1104 1104
 
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
                         $skill['data']['family_id'] = $new_family_array[$skill['id']];
1108 1108
                     }
1109 1109
                     $refs[$skill['parent_id']]['children'][] = &$skill;
1110
-                    $flat_array[$my_skill_id] =  $skill;
1110
+                    $flat_array[$my_skill_id] = $skill;
1111 1111
                 }
1112 1112
             }
1113 1113
 
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
                 INNER JOIN {$this->table_skill_rel_user} su
1220 1220
                 ON (s.id = su.skill_id)
1221 1221
                 WHERE user_id = $user_id";
1222
-        $result  = Database::query($sql);
1222
+        $result = Database::query($sql);
1223 1223
         if (Database::num_rows($result)) {
1224 1224
             $result = Database::fetch_row($result);
1225 1225
             return $result[0];
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
      */
1262 1262
     public function get_user_list_skill_ranking_count()
1263 1263
     {
1264
-        $sql    = "SELECT count(*) FROM (
1264
+        $sql = "SELECT count(*) FROM (
1265 1265
                         SELECT count(distinct 1)
1266 1266
                         FROM {$this->table} s
1267 1267
                         INNER JOIN {$this->table_skill_rel_user} su
@@ -1316,7 +1316,7 @@  discard block
 block discarded – undo
1316 1316
                 ON c.code = g.course_code
1317 1317
                 WHERE sg.skill_id = $skill_id
1318 1318
                 AND (g.session_id IS NULL OR g.session_id = 0)";
1319
-        $result   = Database::query($sql);
1319
+        $result = Database::query($sql);
1320 1320
 
1321 1321
         return Database::store_result($result, 'ASSOC');
1322 1322
     }
@@ -1505,7 +1505,7 @@  discard block
 block discarded – undo
1505 1505
                 WHERE sg.skill_id = $skillId
1506 1506
                 AND g.session_id > 0";
1507 1507
 
1508
-        $result   = Database::query($sql);
1508
+        $result = Database::query($sql);
1509 1509
 
1510 1510
         return Database::store_result($result, 'ASSOC');
1511 1511
     }
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -348,6 +348,7 @@  discard block
 block discarded – undo
348 348
 
349 349
     /**
350 350
      * Gets an element
351
+     * @param integer $gradebook_id
351 352
      */
352 353
     public function get_skill_info($skill_id, $gradebook_id)
353 354
     {
@@ -577,7 +578,7 @@  discard block
 block discarded – undo
577 578
      * Gets an element
578 579
      * @param int $id
579 580
      *
580
-     * @return array|mixed
581
+     * @return integer
581 582
      */
582 583
     public function get($id)
583 584
     {
@@ -923,7 +924,7 @@  discard block
 block discarded – undo
923 924
     /**
924 925
      * Get user's skills
925 926
      *
926
-     * @param int $userId User's id
927
+     * @param integer $user_id User's id
927 928
      * @param bool $get_skill_data
928 929
      */
929 930
     public function get_user_skills($user_id, $get_skill_data = false)
@@ -1133,7 +1134,7 @@  discard block
 block discarded – undo
1133 1134
      * @param int skill id
1134 1135
      * @param bool return a flat array or not
1135 1136
      * @param int depth of the skills
1136
-     * @return json
1137
+     * @return string
1137 1138
      */
1138 1139
     public function get_skills_tree_json(
1139 1140
         $user_id = null,
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/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
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,6 @@
 block discarded – undo
73 73
      * Export the given HTML to PDF, using a global template
74 74
      *
75 75
      * @uses export/table_pdf.tpl
76
-
77 76
      * @param $content
78 77
      * @param bool|false $saveToFile
79 78
      * @param bool|false $returnHtml
Please login to merge, or discard this patch.
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.
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.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         /* More info @ http://mpdf1.com/manual/index.php?tid=184&searchstring=mPDF
34 34
          * 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 ]]]]]])
35 35
          */
36
-        if (!in_array($orientation, array('P','L'))) {
36
+        if (!in_array($orientation, array('P', 'L'))) {
37 37
             $orientation = 'P';
38 38
         }
39 39
         //$this->pdf = $pdf = new mPDF('UTF-8', $pageFormat, '', '', 30, 20, 27, 25, 16, 13, $orientation);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $visualTheme = api_get_visual_theme();
101 101
             $img = api_get_path(SYS_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png';
102 102
             if (file_exists($img)) {
103
-                $img = api_get_path(WEB_CSS_PATH) . 'themes/' . $visualTheme . '/images/pdf_logo_header.png';
103
+                $img = api_get_path(WEB_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png';
104 104
                 $organization = "<img src='$img'>";
105 105
             }
106 106
         }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             // then print the title in the PDF
238 238
             if (is_array($file) && isset($file['title'])) {
239 239
                 $html_title = $file['title'];
240
-                $file  = $file['path'];
240
+                $file = $file['path'];
241 241
             } else {
242 242
                 //we suppose we've only been sent a file path
243 243
                 $html_title = basename($file);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
             //it's not a chapter but the file exists, print its title
269 269
             if ($print_title) {
270 270
                 $this->pdf->WriteHTML(
271
-                    '<html><body><h3>' . $html_title . '</h3></body></html>'
271
+                    '<html><body><h3>'.$html_title.'</h3></body></html>'
272 272
                 );
273 273
             }
274 274
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
                 if ($extension === 'html') {
284 284
                     $filename = basename($filename, '.html');
285
-                } elseif($extension === 'htm'){
285
+                } elseif ($extension === 'htm') {
286 286
                     $filename = basename($filename, '.htm');
287 287
                 }
288 288
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                 $document_html = str_replace('href="./css/frames.css"', $absolute_css_path, $document_html);
295 295
 
296 296
                 if (!empty($course_data['path'])) {
297
-                    $document_html= str_replace('../', '', $document_html);
297
+                    $document_html = str_replace('../', '', $document_html);
298 298
                     $document_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document/';
299 299
 
300 300
                     $doc = new DOMDocument();
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
                 if (!empty($document_html)) {
373 373
                     $this->pdf->WriteHTML($document_html.$page_break);
374 374
                 }
375
-            } elseif (in_array($extension, array('jpg','jpeg','png','gif'))) {
375
+            } elseif (in_array($extension, array('jpg', 'jpeg', 'png', 'gif'))) {
376 376
                 //Images
377 377
                 $image = Display::img($file);
378 378
                 $this->pdf->WriteHTML('<html><body>'.$image.'</body></html>'.$page_break);
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 
436 436
         //absolute path for frames.css //TODO: necessary?
437 437
         $absolute_css_path = api_get_path(WEB_CSS_PATH).api_get_setting('stylesheets').'/frames.css';
438
-        $document_html = str_replace('href="./css/frames.css"','href="'.$absolute_css_path.'"', $document_html);
438
+        $document_html = str_replace('href="./css/frames.css"', 'href="'.$absolute_css_path.'"', $document_html);
439 439
 
440 440
         $document_html = str_replace('../../', '', $document_html);
441 441
         $document_html = str_replace('../', '', $document_html);
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
                                 $old_src_fixed = str_replace(api_get_path(REL_COURSE_PATH).$course_data['path'].'/document/', '', $old_src);
464 464
                                 $old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src_fixed);
465 465
                                 $new_path = $document_path.$old_src_fixed;
466
-                                $document_html= str_replace($old_src, $new_path, $document_html);
466
+                                $document_html = str_replace($old_src, $new_path, $document_html);
467 467
 
468 468
                             }
469 469
                         }
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
         //$document_html= str_replace('temp_template_path', 'src="/main/default_course_document/', $document_html);// restore src templates
483 483
 
484 484
         api_set_encoding_html($document_html, 'UTF-8'); // The library mPDF expects UTF-8 encoded input data.
485
-        $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8');  // TODO: Maybe it is better idea the title to be passed through
485
+        $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8'); // TODO: Maybe it is better idea the title to be passed through
486 486
         // $_GET[] too, as it is done with file name.
487 487
         // At the moment the title is retrieved from the html document itself.
488 488
 
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
         //$this->pdf->Output($output_file, $outputMode); // F to save the pdf in a file
505 505
 
506 506
         if ($outputMode == 'F') {
507
-            $output_file = api_get_path(SYS_ARCHIVE_PATH) . $output_file;
507
+            $output_file = api_get_path(SYS_ARCHIVE_PATH).$output_file;
508 508
         }
509 509
 
510 510
         if ($saveInFile) {
@@ -537,14 +537,14 @@  discard block
 block discarded – undo
537 537
         $web_path = false;
538 538
         if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') {
539 539
             $course_info = api_get_course_info($course_code);
540
-            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
540
+            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path
541 541
             if (file_exists($store_path)) {
542
-                $web_path   = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';
542
+                $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png';
543 543
             }
544 544
         } else {
545
-            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
545
+            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path
546 546
             if (file_exists($store_path))
547
-                $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
547
+                $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
548 548
         }
549 549
         return $web_path;
550 550
     }
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
     {
585 585
         if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') {
586 586
             $course_info = api_get_course_info($course_code);
587
-            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'];   // course path
587
+            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path']; // course path
588 588
             $web_path   = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/pdf_watermark.png';
589 589
         } else {
590
-            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images';   // course path
590
+            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images'; // course path
591 591
             $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
592 592
         }
593 593
         $course_image = $store_path.'/'.api_get_current_access_url_id().'_pdf_watermark.png';
@@ -620,9 +620,9 @@  discard block
 block discarded – undo
620 620
      */
621 621
     public function set_footer()
622 622
     {
623
-        $this->pdf->defaultfooterfontsize = 12;   // in pts
624
-        $this->pdf->defaultfooterfontstyle = 'B';   // blank, B, I, or BI
625
-        $this->pdf->defaultfooterline = 1;        // 1 to include line below header/above footer
623
+        $this->pdf->defaultfooterfontsize = 12; // in pts
624
+        $this->pdf->defaultfooterfontstyle = 'B'; // blank, B, I, or BI
625
+        $this->pdf->defaultfooterline = 1; // 1 to include line below header/above footer
626 626
         $platform_name   = api_get_setting('Institution');
627 627
         $left_content    = $platform_name;
628 628
         $center_content  = '';
@@ -689,9 +689,9 @@  discard block
 block discarded – undo
689 689
      */
690 690
     public function set_header($course_data)
691 691
     {
692
-        $this->pdf->defaultheaderfontsize   = 10;   // in pts
693
-        $this->pdf->defaultheaderfontstyle  = 'BI';   // blank, B, I, or BI
694
-        $this->pdf->defaultheaderline       = 1;    // 1 to include line below header/above footer
692
+        $this->pdf->defaultheaderfontsize   = 10; // in pts
693
+        $this->pdf->defaultheaderfontstyle  = 'BI'; // blank, B, I, or BI
694
+        $this->pdf->defaultheaderline       = 1; // 1 to include line below header/above footer
695 695
 
696 696
         if (!empty($course_data['code'])) {
697 697
             $teacher_list = CourseManager::get_teacher_list_from_course_code($course_data['code']);
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
             $teachers = '';
700 700
             if (!empty($teacher_list)) {
701 701
                 foreach ($teacher_list as $teacher) {
702
-                    $teachers[]= $teacher['firstname'].' '.$teacher['lastname'];
702
+                    $teachers[] = $teacher['firstname'].' '.$teacher['lastname'];
703 703
                 }
704 704
                 if (count($teachers) > 1) {
705 705
                     $teachers = get_lang('Teachers').': '.implode(', ', $teachers);
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
                     'line' => 1,
767 767
                 ),
768 768
             );
769
-            $this->pdf->SetHeader($header);// ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title);
769
+            $this->pdf->SetHeader($header); // ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title);
770 770
         }
771 771
     }
772 772
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
         $this->pdf->directionality = api_get_text_direction();
812 812
         $this->pdf->useOnlyCoreFonts = true;
813 813
         // Use different Odd/Even headers and footers and mirror margins
814
-        $this->pdf->mirrorMargins       = 1;
814
+        $this->pdf->mirrorMargins = 1;
815 815
 
816 816
         // Add decoration only if not stated otherwise
817 817
         if ($complete) {
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
                     $watermark_text = api_get_setting('pdf_export_watermark_text');
840 840
                 }
841 841
                 if (!empty($watermark_text)) {
842
-                    $this->pdf->SetWatermarkText(strcode2utf($watermark_text),0.1);
842
+                    $this->pdf->SetWatermarkText(strcode2utf($watermark_text), 0.1);
843 843
                     $this->pdf->showWatermarkText = true;
844 844
                 }
845 845
             }
@@ -847,8 +847,8 @@  discard block
 block discarded – undo
847 847
             if (empty($this->custom_header)) {
848 848
                 self::set_header($course_data);
849 849
             } else {
850
-                $this->pdf->SetHTMLHeader($this->custom_header,'E');
851
-                $this->pdf->SetHTMLHeader($this->custom_header,'O');
850
+                $this->pdf->SetHTMLHeader($this->custom_header, 'E');
851
+                $this->pdf->SetHTMLHeader($this->custom_header, 'O');
852 852
             }
853 853
 
854 854
             if (empty($this->custom_footer)) {
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/receivers.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
 	 */
42 42
 	function _createElements()
43 43
 	{
44
-		$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array ('onclick' => 'javascript:receivers_hide(\'receivers_to\')'));
44
+		$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array('onclick' => 'javascript:receivers_hide(\'receivers_to\')'));
45 45
 		$this->_elements[0]->setChecked(true);
46
-		$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array ('onclick' => 'javascript:receivers_show(\'receivers_to\')'));
46
+		$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array('onclick' => 'javascript:receivers_show(\'receivers_to\')'));
47 47
 		$this->_elements[] = new HTML_QuickForm_advmultiselect('to', '', $this->receivers);
48 48
 		$this->_elements[2]->setSelected($this->receivers_selected);
49 49
 	}
Please login to merge, or discard this patch.
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -10,66 +10,66 @@  discard block
 block discarded – undo
10 10
  */
11 11
 class HTML_QuickForm_receivers extends HTML_QuickForm_group
12 12
 {
13
-	/**
14
-	 * Array of all receivers
15
-	 */
16
-	var $receivers;
17
-	/**
18
-	 * Array of selected receivers
19
-	 */
20
-	var $receivers_selected;
13
+    /**
14
+     * Array of all receivers
15
+     */
16
+    var $receivers;
17
+    /**
18
+     * Array of selected receivers
19
+     */
20
+    var $receivers_selected;
21 21
 
22
-	/**
23
-	 * Constructor
24
-	 * @param string $elementName
25
-	 * @param string $elementLabel
26
-	 * @param array $attributes This should contain the keys 'receivers' and
27
-	 * 'receivers_selected'
28
-	 */
29
-	public function __construct($elementName = null, $elementLabel = null, $attributes = null)
30
-	{
31
-		$this->receivers = $attributes['receivers'];
32
-		$this->receivers_selected = $attributes['receivers_selected'];
33
-		unset($attributes['receivers']);
34
-		unset($attributes['receivers_selected']);
35
-		parent::__construct($elementName, $elementLabel, $attributes);
36
-		$this->_persistantFreeze = true;
37
-		$this->_appendName = true;
38
-		$this->_type = 'receivers';
39
-	}
40
-	/**
41
-	 * Create the form elements to build this element group
42
-	 */
43
-	function _createElements()
44
-	{
45
-		$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array ('onclick' => 'javascript:receivers_hide(\'receivers_to\')'));
46
-		$this->_elements[0]->setChecked(true);
47
-		$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array ('onclick' => 'javascript:receivers_show(\'receivers_to\')'));
48
-		$this->_elements[] = new HTML_QuickForm_advmultiselect('to', '', $this->receivers);
49
-		$this->_elements[2]->setSelected($this->receivers_selected);
50
-	}
51
-	/**
52
-	 * HTML representation
53
-	 */
54
-	public function toHtml()
55
-	{
56
-		include_once ('HTML/QuickForm/Renderer/Default.php');
57
-		$this->_separator = '<br/>';
58
-		$renderer = & new HTML_QuickForm_Renderer_Default();
59
-		$renderer->setElementTemplate('{element}');
60
-		$select_boxes = $this->_elements[2];
61
-		$select_boxes->setElementTemplate('<div style="margin-left:20px;display:block;" id="receivers_'.$select_boxes->getName().'">'.$select_boxes->_elementTemplate.'</div>');
62
-		parent :: accept($renderer);
63
-		$js = $this->getElementJS();
64
-		return $renderer->toHtml().$js;
65
-	}
22
+    /**
23
+     * Constructor
24
+     * @param string $elementName
25
+     * @param string $elementLabel
26
+     * @param array $attributes This should contain the keys 'receivers' and
27
+     * 'receivers_selected'
28
+     */
29
+    public function __construct($elementName = null, $elementLabel = null, $attributes = null)
30
+    {
31
+        $this->receivers = $attributes['receivers'];
32
+        $this->receivers_selected = $attributes['receivers_selected'];
33
+        unset($attributes['receivers']);
34
+        unset($attributes['receivers_selected']);
35
+        parent::__construct($elementName, $elementLabel, $attributes);
36
+        $this->_persistantFreeze = true;
37
+        $this->_appendName = true;
38
+        $this->_type = 'receivers';
39
+    }
40
+    /**
41
+     * Create the form elements to build this element group
42
+     */
43
+    function _createElements()
44
+    {
45
+        $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array ('onclick' => 'javascript:receivers_hide(\'receivers_to\')'));
46
+        $this->_elements[0]->setChecked(true);
47
+        $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array ('onclick' => 'javascript:receivers_show(\'receivers_to\')'));
48
+        $this->_elements[] = new HTML_QuickForm_advmultiselect('to', '', $this->receivers);
49
+        $this->_elements[2]->setSelected($this->receivers_selected);
50
+    }
51
+    /**
52
+     * HTML representation
53
+     */
54
+    public function toHtml()
55
+    {
56
+        include_once ('HTML/QuickForm/Renderer/Default.php');
57
+        $this->_separator = '<br/>';
58
+        $renderer = & new HTML_QuickForm_Renderer_Default();
59
+        $renderer->setElementTemplate('{element}');
60
+        $select_boxes = $this->_elements[2];
61
+        $select_boxes->setElementTemplate('<div style="margin-left:20px;display:block;" id="receivers_'.$select_boxes->getName().'">'.$select_boxes->_elementTemplate.'</div>');
62
+        parent :: accept($renderer);
63
+        $js = $this->getElementJS();
64
+        return $renderer->toHtml().$js;
65
+    }
66 66
 
67
-	/**
68
-	 * Get the necessary javascript
69
-	 */
67
+    /**
68
+     * Get the necessary javascript
69
+     */
70 70
     public function getElementJS()
71
-	{
72
-		$js = "<script type=\"text/javascript\">
71
+    {
72
+        $js = "<script type=\"text/javascript\">
73 73
 					/* <![CDATA[ */
74 74
 					receivers_hide('receivers_to');
75 75
 					function receivers_show(item) {
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 					}
83 83
 					/* ]]> */
84 84
 					</script>\n";
85
-		return $js;
86
-	}
87
-	/**
88
-	 * accept renderer
89
-	 */
90
-	function accept(& $renderer, $required = false, $error = null)
91
-	{
92
-		$renderer->renderElement($this, $required, $error);
93
-	}
85
+        return $js;
86
+    }
87
+    /**
88
+     * accept renderer
89
+     */
90
+    function accept(& $renderer, $required = false, $error = null)
91
+    {
92
+        $renderer->renderElement($this, $required, $error);
93
+    }
94 94
 }
95 95
 ?>
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/DateRangePicker.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 class DateRangePicker extends HTML_QuickForm_text
8 8
 {
9 9
     /**
10
-    * Constructor
11
-    */
10
+     * Constructor
11
+     */
12 12
     public function __construct($elementName = null, $elementLabel = null, $attributes = null)
13 13
     {
14 14
         if (!isset($attributes['id'])) {
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
     }
145 145
 
146 146
     /**
147
-    * @param array $dates result of parseDateRange()
148
-    *
149
-    * @return bool
150
-    */
147
+     * @param array $dates result of parseDateRange()
148
+     *
149
+     * @return bool
150
+     */
151 151
     public function validateDates($dates, $format = null)
152 152
     {
153 153
         if (empty($dates['start']) || empty($dates['end'])) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
         }
89 89
 
90 90
         $timePicker = 'true';
91
-        $timePickerValue =  $this->getAttribute('timePicker');
91
+        $timePickerValue = $this->getAttribute('timePicker');
92 92
         if (!empty($timePickerValue)) {
93 93
             $timePicker = $timePickerValue;
94 94
         }
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/HtmlEditor.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,9 +74,9 @@
 block discarded – undo
74 74
             $styleCss = $this->editor->getConfigAttribute('style');
75 75
 
76 76
             if ($styleCss) {
77
-               $style = true;
77
+                $style = true;
78 78
             } else {
79
-               $style = false;
79
+                $style = false;
80 80
             }
81 81
 
82 82
             return $this->buildEditor($style);
Please login to merge, or discard this patch.