@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param string Optional help file name |
56 | 56 | * @param string $page_header |
57 | 57 | */ |
58 | - public static function display_header($tool_name ='', $help = null, $page_header = null) |
|
58 | + public static function display_header($tool_name = '', $help = null, $page_header = null) |
|
59 | 59 | { |
60 | 60 | $origin = api_get_origin(); |
61 | 61 | $showHeader = true; |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $grid_class = array(), |
352 | 352 | $elementCount = 0 |
353 | 353 | ) { |
354 | - $column = 0; |
|
354 | + $column = 0; |
|
355 | 355 | $default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20; |
356 | 356 | |
357 | 357 | $table = new SortableTableFromArray($content, $column, $default_items_per_page, $name); |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | * @param bool Filter (true) or not (false) |
477 | 477 | * @return void |
478 | 478 | */ |
479 | - public static function display_confirmation_message ($message, $filter = true, $returnValue = false) |
|
479 | + public static function display_confirmation_message($message, $filter = true, $returnValue = false) |
|
480 | 480 | { |
481 | 481 | $message = self::return_message($message, 'confirm', $filter); |
482 | 482 | if ($returnValue) { |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | * @param bool Filter (true) or not (false) |
494 | 494 | * @return void |
495 | 495 | */ |
496 | - public static function display_error_message ($message, $filter = true, $returnValue = false) |
|
496 | + public static function display_error_message($message, $filter = true, $returnValue = false) |
|
497 | 497 | { |
498 | 498 | $message = self::return_message($message, 'error', $filter); |
499 | 499 | if ($returnValue) { |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | * @param string $type |
509 | 509 | * @param bool $filter |
510 | 510 | */ |
511 | - public static function return_message_and_translate($message, $type='normal', $filter = true) |
|
511 | + public static function return_message_and_translate($message, $type = 'normal', $filter = true) |
|
512 | 512 | { |
513 | 513 | $message = get_lang($message); |
514 | 514 | echo self::return_message($message, $type, $filter); |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | } |
533 | 533 | |
534 | 534 | $class = ""; |
535 | - switch($type) { |
|
535 | + switch ($type) { |
|
536 | 536 | case 'warning': |
537 | 537 | $class .= 'alert alert-warning'; |
538 | 538 | break; |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | * @param string optional, class from stylesheet |
561 | 561 | * @return string encrypted mailto hyperlink |
562 | 562 | */ |
563 | - public static function encrypted_mailto_link ($email, $clickable_text = null, $style_class = '') |
|
563 | + public static function encrypted_mailto_link($email, $clickable_text = null, $style_class = '') |
|
564 | 564 | { |
565 | 565 | if (is_null($clickable_text)) { |
566 | 566 | $clickable_text = $email; |
@@ -575,14 +575,14 @@ discard block |
||
575 | 575 | } |
576 | 576 | // Encrypt email |
577 | 577 | $hmail = ''; |
578 | - for ($i = 0; $i < strlen($email); $i ++) { |
|
578 | + for ($i = 0; $i < strlen($email); $i++) { |
|
579 | 579 | $hmail .= '&#'.ord($email { |
580 | 580 | $i }).';'; |
581 | 581 | } |
582 | 582 | $hclickable_text = null; |
583 | 583 | // Encrypt clickable text if @ is present |
584 | 584 | if (strpos($clickable_text, '@')) { |
585 | - for ($i = 0; $i < strlen($clickable_text); $i ++) { |
|
585 | + for ($i = 0; $i < strlen($clickable_text); $i++) { |
|
586 | 586 | $hclickable_text .= '&#'.ord($clickable_text { |
587 | 587 | $i }).';'; |
588 | 588 | } |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | } |
615 | 615 | // Encrypt email |
616 | 616 | $hmail = ''; |
617 | - for ($i = 0; $i < strlen($email); $i ++) { |
|
617 | + for ($i = 0; $i < strlen($email); $i++) { |
|
618 | 618 | $hmail .= '&#'.ord($email { |
619 | 619 | $i }).';'; |
620 | 620 | } |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | public static function get_alphabet_options($selected_letter = '') |
648 | 648 | { |
649 | 649 | $result = ''; |
650 | - for ($i = 65; $i <= 90; $i ++) { |
|
650 | + for ($i = 65; $i <= 90; $i++) { |
|
651 | 651 | $letter = chr($i); |
652 | 652 | $result .= '<option value="'.$letter.'"'; |
653 | 653 | if ($selected_letter == $letter) { |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | public static function get_numeric_options($min, $max, $selected_num = 0) |
669 | 669 | { |
670 | 670 | $result = ''; |
671 | - for ($i = $min; $i <= $max; $i ++) { |
|
671 | + for ($i = $min; $i <= $max; $i++) { |
|
672 | 672 | $result .= '<option value="'.$i.'"'; |
673 | 673 | if (is_int($selected_num)) |
674 | 674 | if ($selected_num == $i) { |
@@ -745,7 +745,7 @@ discard block |
||
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 |
||
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 |
||
775 | 775 | // ask for the SVG version directly |
776 | 776 | $testServer = api_get_setting('server_type'); |
777 | 777 | if ($testServer == 'test' && $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'])) { |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | } |
860 | 860 | } |
861 | 861 | //some tags don't have this </XXX> |
862 | - if (in_array($tag, array('img','input','br'))) { |
|
862 | + if (in_array($tag, array('img', 'input', 'br'))) { |
|
863 | 863 | $return_value = '<'.$tag.' '.$attribute_list.' />'; |
864 | 864 | } else { |
865 | 865 | $return_value = '<'.$tag.' '.$attribute_list.' > '.$content.'</'.$tag.'>'; |
@@ -912,13 +912,13 @@ discard block |
||
912 | 912 | public static function input($type, $name, $value, $attributes = array()) |
913 | 913 | { |
914 | 914 | if (isset($type)) { |
915 | - $attributes['type']= $type; |
|
915 | + $attributes['type'] = $type; |
|
916 | 916 | } |
917 | 917 | if (isset($name)) { |
918 | - $attributes['name']= $name; |
|
918 | + $attributes['name'] = $name; |
|
919 | 919 | } |
920 | 920 | if (isset($value)) { |
921 | - $attributes['value']= $value; |
|
921 | + $attributes['value'] = $value; |
|
922 | 922 | } |
923 | 923 | return self::tag('input', '', $attributes); |
924 | 924 | } |
@@ -951,14 +951,14 @@ discard block |
||
951 | 951 | ) { |
952 | 952 | $html = ''; |
953 | 953 | $extra = ''; |
954 | - $default_id = 'id="' . $name . '" '; |
|
954 | + $default_id = 'id="'.$name.'" '; |
|
955 | 955 | foreach ($extra_attributes as $key => $parameter) { |
956 | 956 | if ($key == 'id') { |
957 | 957 | $default_id = ''; |
958 | 958 | } |
959 | - $extra .= $key . '="' . $parameter . '" '; |
|
959 | + $extra .= $key.'="'.$parameter.'" '; |
|
960 | 960 | } |
961 | - $html .= '<select name="' . $name . '" ' . $default_id . ' ' . $extra . '>'; |
|
961 | + $html .= '<select name="'.$name.'" '.$default_id.' '.$extra.'>'; |
|
962 | 962 | |
963 | 963 | if ($show_blank_item) { |
964 | 964 | if (empty($blank_item_text)) { |
@@ -966,14 +966,14 @@ discard block |
||
966 | 966 | } else { |
967 | 967 | $blank_item_text = Security::remove_XSS($blank_item_text); |
968 | 968 | } |
969 | - $html .= self::tag('option', '-- ' . $blank_item_text . ' --', array('value' => '-1')); |
|
969 | + $html .= self::tag('option', '-- '.$blank_item_text.' --', array('value' => '-1')); |
|
970 | 970 | } |
971 | 971 | if ($values) { |
972 | 972 | foreach ($values as $key => $value) { |
973 | 973 | if (is_array($value) && isset($value['name'])) { |
974 | 974 | $value = $value['name']; |
975 | 975 | } |
976 | - $html .= '<option value="' . $key . '"'; |
|
976 | + $html .= '<option value="'.$key.'"'; |
|
977 | 977 | |
978 | 978 | if (is_array($default)) { |
979 | 979 | foreach ($default as $item) { |
@@ -988,7 +988,7 @@ discard block |
||
988 | 988 | } |
989 | 989 | } |
990 | 990 | |
991 | - $html .= '>' . $value . '</option>'; |
|
991 | + $html .= '>'.$value.'</option>'; |
|
992 | 992 | } |
993 | 993 | } |
994 | 994 | $html .= '</select>'; |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | */ |
1015 | 1015 | public static function tabs($header_list, $content_list, $id = 'tabs', $attributes = array(), $ul_attributes = array()) |
1016 | 1016 | { |
1017 | - if (empty($header_list) || count($header_list) == 0 ) { |
|
1017 | + if (empty($header_list) || count($header_list) == 0) { |
|
1018 | 1018 | return ''; |
1019 | 1019 | } |
1020 | 1020 | |
@@ -1051,7 +1051,7 @@ discard block |
||
1051 | 1051 | |
1052 | 1052 | $main_div = self::tag('div', $ul.self::tag('div', $divs, ['class' => 'tab-content']), $attributes); |
1053 | 1053 | |
1054 | - return $main_div ; |
|
1054 | + return $main_div; |
|
1055 | 1055 | } |
1056 | 1056 | |
1057 | 1057 | /** |
@@ -1099,8 +1099,8 @@ discard block |
||
1099 | 1099 | */ |
1100 | 1100 | public static function grid_html($div_id) |
1101 | 1101 | { |
1102 | - $table = self::tag('table','', array('id' => $div_id)); |
|
1103 | - $table .= self::tag('div','', array('id' => $div_id.'_pager')); |
|
1102 | + $table = self::tag('table', '', array('id' => $div_id)); |
|
1103 | + $table .= self::tag('div', '', array('id' => $div_id.'_pager')); |
|
1104 | 1104 | return $table; |
1105 | 1105 | } |
1106 | 1106 | |
@@ -1161,7 +1161,7 @@ discard block |
||
1161 | 1161 | $obj->colNames = $column_names; |
1162 | 1162 | $obj->colModel = $column_model; |
1163 | 1163 | $obj->pager = '#'.$div_id.'_pager'; |
1164 | - $obj->datatype = 'json'; |
|
1164 | + $obj->datatype = 'json'; |
|
1165 | 1165 | $obj->viewrecords = 'true'; |
1166 | 1166 | |
1167 | 1167 | $all_value = 10000000; |
@@ -1222,10 +1222,10 @@ discard block |
||
1222 | 1222 | // Adding static data. |
1223 | 1223 | if (!empty($data)) { |
1224 | 1224 | $data_var = $div_id.'_data'; |
1225 | - $json.=' var '.$data_var.' = '.json_encode($data).';'; |
|
1225 | + $json .= ' var '.$data_var.' = '.json_encode($data).';'; |
|
1226 | 1226 | $obj->data = $data_var; |
1227 | 1227 | $obj->datatype = 'local'; |
1228 | - $json.="\n"; |
|
1228 | + $json .= "\n"; |
|
1229 | 1229 | } |
1230 | 1230 | |
1231 | 1231 | $obj->end = 'end'; |
@@ -1239,12 +1239,12 @@ discard block |
||
1239 | 1239 | } |
1240 | 1240 | |
1241 | 1241 | // Fixing true/false js values that doesn't need the "" |
1242 | - $json_encode = str_replace(':"true"',':true',$json_encode); |
|
1242 | + $json_encode = str_replace(':"true"', ':true', $json_encode); |
|
1243 | 1243 | // wrap_cell is not a valid jqgrid attributes is a hack to wrap a text |
1244 | 1244 | $json_encode = str_replace('"wrap_cell":true', 'cellattr : function(rowId, value, rowObject, colModel, arrData) { return \'class = "jqgrid_whitespace"\'; }', $json_encode); |
1245 | - $json_encode = str_replace(':"false"',':false',$json_encode); |
|
1245 | + $json_encode = str_replace(':"false"', ':false', $json_encode); |
|
1246 | 1246 | $json_encode = str_replace('"formatter":"action_formatter"', 'formatter:action_formatter', $json_encode); |
1247 | - $json_encode = str_replace(array('{"first":"first",','"end":"end"}'), '', $json_encode); |
|
1247 | + $json_encode = str_replace(array('{"first":"first",', '"end":"end"}'), '', $json_encode); |
|
1248 | 1248 | |
1249 | 1249 | // Creating the jqgrid element. |
1250 | 1250 | $json .= '$("#'.$div_id.'").jqGrid({'; |
@@ -1259,22 +1259,22 @@ discard block |
||
1259 | 1259 | $groups = ''; |
1260 | 1260 | foreach ($extra_params['groupHeaders'] as $group) { |
1261 | 1261 | //{ "startColumnName" : "courses", "numberOfColumns" : 1, "titleText" : "Order Info" }, |
1262 | - $groups .= '{ "startColumnName" : "' . $group['startColumnName'] . '", "numberOfColumns" : ' . $group['numberOfColumns'] . ', "titleText" : "' . $group['titleText'] . '" },'; |
|
1262 | + $groups .= '{ "startColumnName" : "'.$group['startColumnName'].'", "numberOfColumns" : '.$group['numberOfColumns'].', "titleText" : "'.$group['titleText'].'" },'; |
|
1263 | 1263 | |
1264 | 1264 | } |
1265 | 1265 | $json .= '$("#'.$div_id.'").jqGrid("setGroupHeaders", { |
1266 | 1266 | "useColSpanStyle" : false, |
1267 | 1267 | "groupHeaders" : [ |
1268 | - ' . $groups . ' |
|
1268 | + ' . $groups.' |
|
1269 | 1269 | ] |
1270 | 1270 | });'; |
1271 | 1271 | } |
1272 | 1272 | |
1273 | 1273 | $all_text = addslashes(get_lang('All')); |
1274 | 1274 | $json .= '$("'.$obj->pager.' option[value='.$all_value.']").text("'.$all_text.'");'; |
1275 | - $json.= "\n"; |
|
1275 | + $json .= "\n"; |
|
1276 | 1276 | // Adding edit/delete icons. |
1277 | - $json.= $formatter; |
|
1277 | + $json .= $formatter; |
|
1278 | 1278 | |
1279 | 1279 | return $json; |
1280 | 1280 | } |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | } |
1306 | 1306 | |
1307 | 1307 | if (!empty($rows)) { |
1308 | - foreach($rows as $content) { |
|
1308 | + foreach ($rows as $content) { |
|
1309 | 1309 | $table->setCellContents($row, $column, $content); |
1310 | 1310 | $row++; |
1311 | 1311 | } |
@@ -1467,7 +1467,7 @@ discard block |
||
1467 | 1467 | |
1468 | 1468 | // Show all tool icons where there is something new. |
1469 | 1469 | $return = ' '; |
1470 | - foreach($notifications as $notification) { |
|
1470 | + foreach ($notifications as $notification) { |
|
1471 | 1471 | $lastDate = date('d/m/Y H:i', convert_sql_date($notification['lastedit_date'])); |
1472 | 1472 | $type = $notification['lastedit_type']; |
1473 | 1473 | $label = get_lang('TitleNotification').": ".get_lang($type)." ($lastDate)"; |
@@ -1510,9 +1510,9 @@ discard block |
||
1510 | 1510 | $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
1511 | 1511 | $active = false; |
1512 | 1512 | // Request for the name of the general coach |
1513 | - $sql ='SELECT tu.lastname, tu.firstname, ts.* |
|
1513 | + $sql = 'SELECT tu.lastname, tu.firstname, ts.* |
|
1514 | 1514 | FROM '.$tbl_session.' ts |
1515 | - LEFT JOIN '.$main_user_table .' tu |
|
1515 | + LEFT JOIN '.$main_user_table.' tu |
|
1516 | 1516 | ON ts.id_coach = tu.user_id |
1517 | 1517 | WHERE ts.id = '.intval($session_id); |
1518 | 1518 | $rs = Database::query($sql); |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | $session = array(); |
1523 | 1523 | $session['title'] = $session_info['name']; |
1524 | 1524 | $session['coach'] = ''; |
1525 | - $session['dates'] = ''; |
|
1525 | + $session['dates'] = ''; |
|
1526 | 1526 | |
1527 | 1527 | if ( |
1528 | 1528 | ( |
@@ -1604,8 +1604,8 @@ discard block |
||
1604 | 1604 | ); |
1605 | 1605 | } |
1606 | 1606 | |
1607 | - if ( api_get_setting('show_session_coach') === 'true' ) { |
|
1608 | - $session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name( |
|
1607 | + if (api_get_setting('show_session_coach') === 'true') { |
|
1608 | + $session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name( |
|
1609 | 1609 | $session_info['firstname'], |
1610 | 1610 | $session_info['lastname'] |
1611 | 1611 | ); |
@@ -1657,9 +1657,9 @@ discard block |
||
1657 | 1657 | $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0; |
1658 | 1658 | |
1659 | 1659 | if (!empty($percentage)) { |
1660 | - $percentage = $percentage*125/100; |
|
1660 | + $percentage = $percentage * 125 / 100; |
|
1661 | 1661 | } |
1662 | - $accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0; |
|
1662 | + $accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0; |
|
1663 | 1663 | |
1664 | 1664 | $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']); |
1665 | 1665 | |
@@ -1674,19 +1674,19 @@ discard block |
||
1674 | 1674 | |
1675 | 1675 | $labels = array(); |
1676 | 1676 | |
1677 | - $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes'); |
|
1678 | - $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits'); |
|
1677 | + $labels[] = $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes'); |
|
1678 | + $labels[] = $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits'); |
|
1679 | 1679 | if (!empty($number_of_users_who_voted)) { |
1680 | - $labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5'; |
|
1680 | + $labels[] = get_lang('Average').' '.$point_info['point_average_star'].'/5'; |
|
1681 | 1681 | } |
1682 | 1682 | |
1683 | - $labels[]= $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] '; |
|
1683 | + $labels[] = $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote').' [?] '; |
|
1684 | 1684 | |
1685 | 1685 | if (!$add_div_wrapper && api_is_anonymous()) { |
1686 | - $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error')); |
|
1686 | + $labels[] = Display::tag('span', get_lang('LoginToVote'), array('class' => 'error')); |
|
1687 | 1687 | } |
1688 | 1688 | |
1689 | - $html .= Display::div(implode(' | ', $labels) , array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info')); |
|
1689 | + $html .= Display::div(implode(' | ', $labels), array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info')); |
|
1690 | 1690 | $html .= ' '.Display::span(' ', array('id' => 'vote_label2_'.$id)); |
1691 | 1691 | |
1692 | 1692 | if ($add_div_wrapper) { |
@@ -1764,8 +1764,8 @@ discard block |
||
1764 | 1764 | if (!empty($list)) { |
1765 | 1765 | $html = '<dl class="dl-horizontal">'; |
1766 | 1766 | foreach ($list as $item) { |
1767 | - $html .= '<dt>' . $item['title'] . '</dt>'; |
|
1768 | - $html .= '<dd>' . $item['content'] . '</dd>'; |
|
1767 | + $html .= '<dt>'.$item['title'].'</dt>'; |
|
1768 | + $html .= '<dd>'.$item['content'].'</dd>'; |
|
1769 | 1769 | } |
1770 | 1770 | $html .= '</dl>'; |
1771 | 1771 | } |
@@ -1807,7 +1807,7 @@ discard block |
||
1807 | 1807 | * @param string $type |
1808 | 1808 | * @return null|string |
1809 | 1809 | */ |
1810 | - public static function badge($count, $type ="warning") |
|
1810 | + public static function badge($count, $type = "warning") |
|
1811 | 1811 | { |
1812 | 1812 | $class = ''; |
1813 | 1813 | |
@@ -1883,7 +1883,7 @@ discard block |
||
1883 | 1883 | if (!empty($content)) { |
1884 | 1884 | $html = '<span class="label '.$class.'">'; |
1885 | 1885 | $html .= $content; |
1886 | - $html .='</span>'; |
|
1886 | + $html .= '</span>'; |
|
1887 | 1887 | } |
1888 | 1888 | |
1889 | 1889 | return $html; |
@@ -1904,7 +1904,7 @@ discard block |
||
1904 | 1904 | $class = 'class ="active"'; |
1905 | 1905 | } |
1906 | 1906 | |
1907 | - if (basename($_SERVER['REQUEST_URI']) == basename($value['url']) ) { |
|
1907 | + if (basename($_SERVER['REQUEST_URI']) == basename($value['url'])) { |
|
1908 | 1908 | $class = 'class ="active"'; |
1909 | 1909 | } |
1910 | 1910 | $html .= "<li $class >"; |
@@ -2155,7 +2155,7 @@ discard block |
||
2155 | 2155 | } |
2156 | 2156 | $label = $nextValue + $localCounter + 1; |
2157 | 2157 | if ($isMedia) { |
2158 | - $label = ($fixedValue + 1) .' '.chr(97 + $localCounter); |
|
2158 | + $label = ($fixedValue + 1).' '.chr(97 + $localCounter); |
|
2159 | 2159 | $link_to_show = $link.$fixedValue.'#questionanchor'.$itemId; |
2160 | 2160 | } |
2161 | 2161 | $link = Display::url($label.' ', $link_to_show, $linkAttributes); |
@@ -2267,7 +2267,7 @@ discard block |
||
2267 | 2267 | */ |
2268 | 2268 | public static function getVCardUserLink($userId) |
2269 | 2269 | { |
2270 | - $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId);; |
|
2270 | + $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId); ; |
|
2271 | 2271 | |
2272 | 2272 | return $vCardUrl; |
2273 | 2273 | } |
@@ -2285,7 +2285,7 @@ discard block |
||
2285 | 2285 | { |
2286 | 2286 | $title = !empty($title) ? '<div class="panel-heading"><h3 class="panel-title">'.$title.'</h3>'.$extra.'</div>' : ''; |
2287 | 2287 | $footer = !empty($footer) ? '<div class="panel-footer ">'.$footer.'</div>' : ''; |
2288 | - $styles = ['primary','success','info','warning','danger']; |
|
2288 | + $styles = ['primary', 'success', 'info', 'warning', 'danger']; |
|
2289 | 2289 | $style = !in_array($style, $styles) ? 'default' : $style; |
2290 | 2290 | |
2291 | 2291 | return ' |
@@ -2330,7 +2330,7 @@ discard block |
||
2330 | 2330 | $attributes['class'] = isset($attributes['class']) ? "$buttonClass {$attributes['class']}" : $buttonClass; |
2331 | 2331 | |
2332 | 2332 | if (!$includeText) { |
2333 | - $text = '<span class="sr-only">' . $text . '</span>'; |
|
2333 | + $text = '<span class="sr-only">'.$text.'</span>'; |
|
2334 | 2334 | } |
2335 | 2335 | |
2336 | 2336 | return self::url("$icon $text", $url, $attributes); |
@@ -2345,16 +2345,16 @@ discard block |
||
2345 | 2345 | */ |
2346 | 2346 | public static function toolbarAction($id, $content = array(), $col = 2, $right = true) |
2347 | 2347 | { |
2348 | - $columns = 12/$col; |
|
2348 | + $columns = 12 / $col; |
|
2349 | 2349 | $html = ''; |
2350 | - $html .= '<div id="' . $id . '" class="actions">'; |
|
2350 | + $html .= '<div id="'.$id.'" class="actions">'; |
|
2351 | 2351 | $html .= '<div class="row">'; |
2352 | 2352 | if ($col > 4) { |
2353 | 2353 | $html = '<div class="alert alert-warning" role="alert">Action toolbar design does not work when exceeding four columns - check Display::toolbarAction()</div>'; |
2354 | 2354 | } else { |
2355 | - for ( $i = 0; $i < $col; $i++ ) { |
|
2356 | - $html .= '<div class="col-md-' . $columns . '">'; |
|
2357 | - if ( $col == 2 && $i == 1 ) { |
|
2355 | + for ($i = 0; $i < $col; $i++) { |
|
2356 | + $html .= '<div class="col-md-'.$columns.'">'; |
|
2357 | + if ($col == 2 && $i == 1) { |
|
2358 | 2358 | if ($right === true) { |
2359 | 2359 | $html .= '<div class="pull-right">'; |
2360 | 2360 | $html .= (isset($content[$i]) ? $content[$i] : ''); |
@@ -2469,9 +2469,9 @@ discard block |
||
2469 | 2469 | $params['class'] = 'panel panel-default'; |
2470 | 2470 | $html = null; |
2471 | 2471 | if (!empty($title)) { |
2472 | - $html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL; |
|
2472 | + $html .= '<div class="panel-heading">'.$title.'</div>'.PHP_EOL; |
|
2473 | 2473 | } |
2474 | - $html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL; |
|
2474 | + $html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL; |
|
2475 | 2475 | $html = Display::div($html, $params); |
2476 | 2476 | } |
2477 | 2477 | return $html; |