@@ -56,7 +56,7 @@ discard block |
||
| 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; |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | $grid_class = array(), |
| 354 | 354 | $elementCount = 0 |
| 355 | 355 | ) { |
| 356 | - $column = 0; |
|
| 356 | + $column = 0; |
|
| 357 | 357 | $default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20; |
| 358 | 358 | |
| 359 | 359 | $table = new SortableTableFromArray($content, $column, $default_items_per_page, $name); |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | * @param bool Filter (true) or not (false) |
| 479 | 479 | * @return void |
| 480 | 480 | */ |
| 481 | - public static function display_confirmation_message ($message, $filter = true, $returnValue = false) |
|
| 481 | + public static function display_confirmation_message($message, $filter = true, $returnValue = false) |
|
| 482 | 482 | { |
| 483 | 483 | $message = self::return_message($message, 'confirm', $filter); |
| 484 | 484 | if ($returnValue) { |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | * @param bool Filter (true) or not (false) |
| 496 | 496 | * @return void |
| 497 | 497 | */ |
| 498 | - public static function display_error_message ($message, $filter = true, $returnValue = false) |
|
| 498 | + public static function display_error_message($message, $filter = true, $returnValue = false) |
|
| 499 | 499 | { |
| 500 | 500 | $message = self::return_message($message, 'error', $filter); |
| 501 | 501 | if ($returnValue) { |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | * @param string $type |
| 511 | 511 | * @param bool $filter |
| 512 | 512 | */ |
| 513 | - public static function return_message_and_translate($message, $type='normal', $filter = true) |
|
| 513 | + public static function return_message_and_translate($message, $type = 'normal', $filter = true) |
|
| 514 | 514 | { |
| 515 | 515 | $message = get_lang($message); |
| 516 | 516 | echo self::return_message($message, $type, $filter); |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | $class = ""; |
| 537 | - switch($type) { |
|
| 537 | + switch ($type) { |
|
| 538 | 538 | case 'warning': |
| 539 | 539 | $class .= 'alert alert-warning'; |
| 540 | 540 | break; |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | * @param string optional, class from stylesheet |
| 563 | 563 | * @return string encrypted mailto hyperlink |
| 564 | 564 | */ |
| 565 | - public static function encrypted_mailto_link ($email, $clickable_text = null, $style_class = '') |
|
| 565 | + public static function encrypted_mailto_link($email, $clickable_text = null, $style_class = '') |
|
| 566 | 566 | { |
| 567 | 567 | if (is_null($clickable_text)) { |
| 568 | 568 | $clickable_text = $email; |
@@ -577,14 +577,14 @@ discard block |
||
| 577 | 577 | } |
| 578 | 578 | // Encrypt email |
| 579 | 579 | $hmail = ''; |
| 580 | - for ($i = 0; $i < strlen($email); $i ++) { |
|
| 580 | + for ($i = 0; $i < strlen($email); $i++) { |
|
| 581 | 581 | $hmail .= '&#'.ord($email { |
| 582 | 582 | $i }).';'; |
| 583 | 583 | } |
| 584 | 584 | $hclickable_text = null; |
| 585 | 585 | // Encrypt clickable text if @ is present |
| 586 | 586 | if (strpos($clickable_text, '@')) { |
| 587 | - for ($i = 0; $i < strlen($clickable_text); $i ++) { |
|
| 587 | + for ($i = 0; $i < strlen($clickable_text); $i++) { |
|
| 588 | 588 | $hclickable_text .= '&#'.ord($clickable_text { |
| 589 | 589 | $i }).';'; |
| 590 | 590 | } |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | } |
| 617 | 617 | // Encrypt email |
| 618 | 618 | $hmail = ''; |
| 619 | - for ($i = 0; $i < strlen($email); $i ++) { |
|
| 619 | + for ($i = 0; $i < strlen($email); $i++) { |
|
| 620 | 620 | $hmail .= '&#'.ord($email { |
| 621 | 621 | $i }).';'; |
| 622 | 622 | } |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | public static function get_alphabet_options($selected_letter = '') |
| 650 | 650 | { |
| 651 | 651 | $result = ''; |
| 652 | - for ($i = 65; $i <= 90; $i ++) { |
|
| 652 | + for ($i = 65; $i <= 90; $i++) { |
|
| 653 | 653 | $letter = chr($i); |
| 654 | 654 | $result .= '<option value="'.$letter.'"'; |
| 655 | 655 | if ($selected_letter == $letter) { |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | public static function get_numeric_options($min, $max, $selected_num = 0) |
| 671 | 671 | { |
| 672 | 672 | $result = ''; |
| 673 | - for ($i = $min; $i <= $max; $i ++) { |
|
| 673 | + for ($i = $min; $i <= $max; $i++) { |
|
| 674 | 674 | $result .= '<option value="'.$i.'"'; |
| 675 | 675 | if (is_int($selected_num)) |
| 676 | 676 | if ($selected_num == $i) { |
@@ -740,8 +740,8 @@ discard block |
||
| 740 | 740 | // important to use the public path (i.e. web/css/) rather than the |
| 741 | 741 | // internal path (/app/Resource/public/css/) because the path used |
| 742 | 742 | // in the end must be the public path |
| 743 | - $alternateCssPath = api_get_path(SYS_PUBLIC_PATH) . 'css/'; |
|
| 744 | - $alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH) . 'css/'; |
|
| 743 | + $alternateCssPath = api_get_path(SYS_PUBLIC_PATH).'css/'; |
|
| 744 | + $alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH).'css/'; |
|
| 745 | 745 | |
| 746 | 746 | $image = trim($image); |
| 747 | 747 | |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | $size = ICON_SIZE_SMALL; |
| 752 | 752 | } |
| 753 | 753 | |
| 754 | - $size_extra = $size . '/'; |
|
| 754 | + $size_extra = $size.'/'; |
|
| 755 | 755 | |
| 756 | 756 | // Checking the img/ folder |
| 757 | 757 | $icon = $w_code_path.'img/'.$image; |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | $theme = 'themes/chamilo/icons/'; |
| 760 | 760 | |
| 761 | 761 | if ($loadThemeIcon) { |
| 762 | - $theme = 'themes/' . api_get_visual_theme() . '/icons/'; |
|
| 762 | + $theme = 'themes/'.api_get_visual_theme().'/icons/'; |
|
| 763 | 763 | // Checking the theme icons folder example: app/Resources/public/css/themes/chamilo/icons/XXX |
| 764 | 764 | if (is_file($alternateCssPath.$theme.$size_extra.$image)) { |
| 765 | 765 | $icon = $alternateWebCssPath.$theme.$size_extra.$image; |
@@ -781,11 +781,11 @@ discard block |
||
| 781 | 781 | // ask for the SVG version directly |
| 782 | 782 | $svgIcons = api_get_setting('icons_mode_svg'); |
| 783 | 783 | if ($svgIcons == 'true' && $return_only_path == false) { |
| 784 | - $svgImage = substr($image, 0, -3) . 'svg'; |
|
| 785 | - if (is_file($code_path . $theme . 'svg/' . $svgImage)) { |
|
| 786 | - $icon = $w_code_path . $theme . 'svg/' . $svgImage; |
|
| 787 | - } elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) { |
|
| 788 | - $icon = $w_code_path . 'img/icons/svg/' . $svgImage; |
|
| 784 | + $svgImage = substr($image, 0, -3).'svg'; |
|
| 785 | + if (is_file($code_path.$theme.'svg/'.$svgImage)) { |
|
| 786 | + $icon = $w_code_path.$theme.'svg/'.$svgImage; |
|
| 787 | + } elseif (is_file($code_path.'img/icons/svg/'.$svgImage)) { |
|
| 788 | + $icon = $w_code_path.'img/icons/svg/'.$svgImage; |
|
| 789 | 789 | } |
| 790 | 790 | |
| 791 | 791 | if (empty($additional_attributes['height'])) { |
@@ -874,7 +874,7 @@ discard block |
||
| 874 | 874 | } |
| 875 | 875 | } |
| 876 | 876 | //some tags don't have this </XXX> |
| 877 | - if (in_array($tag, array('img','input','br'))) { |
|
| 877 | + if (in_array($tag, array('img', 'input', 'br'))) { |
|
| 878 | 878 | $return_value = '<'.$tag.' '.$attribute_list.' />'; |
| 879 | 879 | } else { |
| 880 | 880 | $return_value = '<'.$tag.' '.$attribute_list.' > '.$content.'</'.$tag.'>'; |
@@ -927,13 +927,13 @@ discard block |
||
| 927 | 927 | public static function input($type, $name, $value, $attributes = array()) |
| 928 | 928 | { |
| 929 | 929 | if (isset($type)) { |
| 930 | - $attributes['type']= $type; |
|
| 930 | + $attributes['type'] = $type; |
|
| 931 | 931 | } |
| 932 | 932 | if (isset($name)) { |
| 933 | - $attributes['name']= $name; |
|
| 933 | + $attributes['name'] = $name; |
|
| 934 | 934 | } |
| 935 | 935 | if (isset($value)) { |
| 936 | - $attributes['value']= $value; |
|
| 936 | + $attributes['value'] = $value; |
|
| 937 | 937 | } |
| 938 | 938 | return self::tag('input', '', $attributes); |
| 939 | 939 | } |
@@ -966,14 +966,14 @@ discard block |
||
| 966 | 966 | ) { |
| 967 | 967 | $html = ''; |
| 968 | 968 | $extra = ''; |
| 969 | - $default_id = 'id="' . $name . '" '; |
|
| 969 | + $default_id = 'id="'.$name.'" '; |
|
| 970 | 970 | foreach ($extra_attributes as $key => $parameter) { |
| 971 | 971 | if ($key == 'id') { |
| 972 | 972 | $default_id = ''; |
| 973 | 973 | } |
| 974 | - $extra .= $key . '="' . $parameter . '" '; |
|
| 974 | + $extra .= $key.'="'.$parameter.'" '; |
|
| 975 | 975 | } |
| 976 | - $html .= '<select name="' . $name . '" ' . $default_id . ' ' . $extra . '>'; |
|
| 976 | + $html .= '<select name="'.$name.'" '.$default_id.' '.$extra.'>'; |
|
| 977 | 977 | |
| 978 | 978 | if ($show_blank_item) { |
| 979 | 979 | if (empty($blank_item_text)) { |
@@ -981,14 +981,14 @@ discard block |
||
| 981 | 981 | } else { |
| 982 | 982 | $blank_item_text = Security::remove_XSS($blank_item_text); |
| 983 | 983 | } |
| 984 | - $html .= self::tag('option', '-- ' . $blank_item_text . ' --', array('value' => '-1')); |
|
| 984 | + $html .= self::tag('option', '-- '.$blank_item_text.' --', array('value' => '-1')); |
|
| 985 | 985 | } |
| 986 | 986 | if ($values) { |
| 987 | 987 | foreach ($values as $key => $value) { |
| 988 | 988 | if (is_array($value) && isset($value['name'])) { |
| 989 | 989 | $value = $value['name']; |
| 990 | 990 | } |
| 991 | - $html .= '<option value="' . $key . '"'; |
|
| 991 | + $html .= '<option value="'.$key.'"'; |
|
| 992 | 992 | |
| 993 | 993 | if (is_array($default)) { |
| 994 | 994 | foreach ($default as $item) { |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | } |
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | - $html .= '>' . $value . '</option>'; |
|
| 1006 | + $html .= '>'.$value.'</option>'; |
|
| 1007 | 1007 | } |
| 1008 | 1008 | } |
| 1009 | 1009 | $html .= '</select>'; |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | */ |
| 1032 | 1032 | public static function tabs($headers, $items, $id = 'tabs', $attributes = array(), $ul_attributes = array()) |
| 1033 | 1033 | { |
| 1034 | - if (empty($headers) || count($headers) == 0 ) { |
|
| 1034 | + if (empty($headers) || count($headers) == 0) { |
|
| 1035 | 1035 | return ''; |
| 1036 | 1036 | } |
| 1037 | 1037 | |
@@ -1042,7 +1042,7 @@ discard block |
||
| 1042 | 1042 | if ($i == 1) { |
| 1043 | 1043 | $active = ' active'; |
| 1044 | 1044 | } |
| 1045 | - $item = self::tag('a', $item, array('href'=>'#'.$id.'-'.$i, 'role'=> 'tab', 'data-toggle' => 'tab', 'id' => $id . $i)); |
|
| 1045 | + $item = self::tag('a', $item, array('href'=>'#'.$id.'-'.$i, 'role'=> 'tab', 'data-toggle' => 'tab', 'id' => $id.$i)); |
|
| 1046 | 1046 | $ul_attributes['role'] = 'presentation'; |
| 1047 | 1047 | $ul_attributes['class'] = $active; |
| 1048 | 1048 | $lis .= self::tag('li', $item, $ul_attributes); |
@@ -1071,7 +1071,7 @@ discard block |
||
| 1071 | 1071 | |
| 1072 | 1072 | $main_div = self::tag('div', $ul.self::tag('div', $divs, ['class' => 'tab-content']), $attributes); |
| 1073 | 1073 | |
| 1074 | - return $main_div ; |
|
| 1074 | + return $main_div; |
|
| 1075 | 1075 | } |
| 1076 | 1076 | |
| 1077 | 1077 | /** |
@@ -1119,8 +1119,8 @@ discard block |
||
| 1119 | 1119 | */ |
| 1120 | 1120 | public static function grid_html($div_id) |
| 1121 | 1121 | { |
| 1122 | - $table = self::tag('table','', array('id' => $div_id)); |
|
| 1123 | - $table .= self::tag('div','', array('id' => $div_id.'_pager')); |
|
| 1122 | + $table = self::tag('table', '', array('id' => $div_id)); |
|
| 1123 | + $table .= self::tag('div', '', array('id' => $div_id.'_pager')); |
|
| 1124 | 1124 | return $table; |
| 1125 | 1125 | } |
| 1126 | 1126 | |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | $obj->colNames = $column_names; |
| 1182 | 1182 | $obj->colModel = $column_model; |
| 1183 | 1183 | $obj->pager = '#'.$div_id.'_pager'; |
| 1184 | - $obj->datatype = 'json'; |
|
| 1184 | + $obj->datatype = 'json'; |
|
| 1185 | 1185 | $obj->viewrecords = 'true'; |
| 1186 | 1186 | |
| 1187 | 1187 | $all_value = 10000000; |
@@ -1242,10 +1242,10 @@ discard block |
||
| 1242 | 1242 | // Adding static data. |
| 1243 | 1243 | if (!empty($data)) { |
| 1244 | 1244 | $data_var = $div_id.'_data'; |
| 1245 | - $json.=' var '.$data_var.' = '.json_encode($data).';'; |
|
| 1245 | + $json .= ' var '.$data_var.' = '.json_encode($data).';'; |
|
| 1246 | 1246 | $obj->data = $data_var; |
| 1247 | 1247 | $obj->datatype = 'local'; |
| 1248 | - $json.="\n"; |
|
| 1248 | + $json .= "\n"; |
|
| 1249 | 1249 | } |
| 1250 | 1250 | |
| 1251 | 1251 | $obj->end = 'end'; |
@@ -1259,12 +1259,12 @@ discard block |
||
| 1259 | 1259 | } |
| 1260 | 1260 | |
| 1261 | 1261 | // Fixing true/false js values that doesn't need the "" |
| 1262 | - $json_encode = str_replace(':"true"',':true',$json_encode); |
|
| 1262 | + $json_encode = str_replace(':"true"', ':true', $json_encode); |
|
| 1263 | 1263 | // wrap_cell is not a valid jqgrid attributes is a hack to wrap a text |
| 1264 | 1264 | $json_encode = str_replace('"wrap_cell":true', 'cellattr : function(rowId, value, rowObject, colModel, arrData) { return \'class = "jqgrid_whitespace"\'; }', $json_encode); |
| 1265 | - $json_encode = str_replace(':"false"',':false',$json_encode); |
|
| 1265 | + $json_encode = str_replace(':"false"', ':false', $json_encode); |
|
| 1266 | 1266 | $json_encode = str_replace('"formatter":"action_formatter"', 'formatter:action_formatter', $json_encode); |
| 1267 | - $json_encode = str_replace(array('{"first":"first",','"end":"end"}'), '', $json_encode); |
|
| 1267 | + $json_encode = str_replace(array('{"first":"first",', '"end":"end"}'), '', $json_encode); |
|
| 1268 | 1268 | |
| 1269 | 1269 | // Creating the jqgrid element. |
| 1270 | 1270 | $json .= '$("#'.$div_id.'").jqGrid({'; |
@@ -1279,22 +1279,22 @@ discard block |
||
| 1279 | 1279 | $groups = ''; |
| 1280 | 1280 | foreach ($extra_params['groupHeaders'] as $group) { |
| 1281 | 1281 | //{ "startColumnName" : "courses", "numberOfColumns" : 1, "titleText" : "Order Info" }, |
| 1282 | - $groups .= '{ "startColumnName" : "' . $group['startColumnName'] . '", "numberOfColumns" : ' . $group['numberOfColumns'] . ', "titleText" : "' . $group['titleText'] . '" },'; |
|
| 1282 | + $groups .= '{ "startColumnName" : "'.$group['startColumnName'].'", "numberOfColumns" : '.$group['numberOfColumns'].', "titleText" : "'.$group['titleText'].'" },'; |
|
| 1283 | 1283 | |
| 1284 | 1284 | } |
| 1285 | 1285 | $json .= '$("#'.$div_id.'").jqGrid("setGroupHeaders", { |
| 1286 | 1286 | "useColSpanStyle" : false, |
| 1287 | 1287 | "groupHeaders" : [ |
| 1288 | - ' . $groups . ' |
|
| 1288 | + ' . $groups.' |
|
| 1289 | 1289 | ] |
| 1290 | 1290 | });'; |
| 1291 | 1291 | } |
| 1292 | 1292 | |
| 1293 | 1293 | $all_text = addslashes(get_lang('All')); |
| 1294 | 1294 | $json .= '$("'.$obj->pager.' option[value='.$all_value.']").text("'.$all_text.'");'; |
| 1295 | - $json.= "\n"; |
|
| 1295 | + $json .= "\n"; |
|
| 1296 | 1296 | // Adding edit/delete icons. |
| 1297 | - $json.= $formatter; |
|
| 1297 | + $json .= $formatter; |
|
| 1298 | 1298 | |
| 1299 | 1299 | return $json; |
| 1300 | 1300 | } |
@@ -1325,7 +1325,7 @@ discard block |
||
| 1325 | 1325 | } |
| 1326 | 1326 | |
| 1327 | 1327 | if (!empty($rows)) { |
| 1328 | - foreach($rows as $content) { |
|
| 1328 | + foreach ($rows as $content) { |
|
| 1329 | 1329 | $table->setCellContents($row, $column, $content); |
| 1330 | 1330 | $row++; |
| 1331 | 1331 | } |
@@ -1487,7 +1487,7 @@ discard block |
||
| 1487 | 1487 | |
| 1488 | 1488 | // Show all tool icons where there is something new. |
| 1489 | 1489 | $return = ' '; |
| 1490 | - foreach($notifications as $notification) { |
|
| 1490 | + foreach ($notifications as $notification) { |
|
| 1491 | 1491 | $lastDate = date('d/m/Y H:i', convert_sql_date($notification['lastedit_date'])); |
| 1492 | 1492 | $type = $notification['lastedit_type']; |
| 1493 | 1493 | $label = get_lang('TitleNotification').": ".get_lang($type)." ($lastDate)"; |
@@ -1531,9 +1531,9 @@ discard block |
||
| 1531 | 1531 | $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
| 1532 | 1532 | $active = false; |
| 1533 | 1533 | // Request for the name of the general coach |
| 1534 | - $sql ='SELECT tu.lastname, tu.firstname, ts.* |
|
| 1534 | + $sql = 'SELECT tu.lastname, tu.firstname, ts.* |
|
| 1535 | 1535 | FROM '.$tbl_session.' ts |
| 1536 | - LEFT JOIN '.$main_user_table .' tu |
|
| 1536 | + LEFT JOIN '.$main_user_table.' tu |
|
| 1537 | 1537 | ON ts.id_coach = tu.user_id |
| 1538 | 1538 | WHERE ts.id = '.intval($session_id); |
| 1539 | 1539 | $rs = Database::query($sql); |
@@ -1545,7 +1545,7 @@ discard block |
||
| 1545 | 1545 | $session['title'] = $session_info['name']; |
| 1546 | 1546 | $session['id_coach'] = $session_info['id_coach']; |
| 1547 | 1547 | $session['coach'] = ''; |
| 1548 | - $session['dates'] = ''; |
|
| 1548 | + $session['dates'] = ''; |
|
| 1549 | 1549 | |
| 1550 | 1550 | if ( |
| 1551 | 1551 | ( |
@@ -1618,11 +1618,11 @@ discard block |
||
| 1618 | 1618 | ); |
| 1619 | 1619 | } |
| 1620 | 1620 | |
| 1621 | - $session['dates'] = $start_buffer . " " . $stop_buffer; |
|
| 1621 | + $session['dates'] = $start_buffer." ".$stop_buffer; |
|
| 1622 | 1622 | |
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | - if ( api_get_setting('show_session_coach') === 'true' ) { |
|
| 1625 | + if (api_get_setting('show_session_coach') === 'true') { |
|
| 1626 | 1626 | $session['coach'] = api_get_person_name( |
| 1627 | 1627 | $session_info['firstname'], |
| 1628 | 1628 | $session_info['lastname'] |
@@ -1677,9 +1677,9 @@ discard block |
||
| 1677 | 1677 | $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0; |
| 1678 | 1678 | |
| 1679 | 1679 | if (!empty($percentage)) { |
| 1680 | - $percentage = $percentage*125/100; |
|
| 1680 | + $percentage = $percentage * 125 / 100; |
|
| 1681 | 1681 | } |
| 1682 | - $accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0; |
|
| 1682 | + $accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0; |
|
| 1683 | 1683 | |
| 1684 | 1684 | $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']); |
| 1685 | 1685 | |
@@ -1694,19 +1694,19 @@ discard block |
||
| 1694 | 1694 | |
| 1695 | 1695 | $labels = array(); |
| 1696 | 1696 | |
| 1697 | - $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes'); |
|
| 1698 | - $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits'); |
|
| 1697 | + $labels[] = $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes'); |
|
| 1698 | + $labels[] = $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits'); |
|
| 1699 | 1699 | /* if (!empty($number_of_users_who_voted)) { |
| 1700 | 1700 | $labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5'; |
| 1701 | 1701 | } */ |
| 1702 | 1702 | |
| 1703 | - $labels[]= $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] '; |
|
| 1703 | + $labels[] = $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote').' [?] '; |
|
| 1704 | 1704 | |
| 1705 | 1705 | if (!$add_div_wrapper && api_is_anonymous()) { |
| 1706 | - $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error')); |
|
| 1706 | + $labels[] = Display::tag('span', get_lang('LoginToVote'), array('class' => 'error')); |
|
| 1707 | 1707 | } |
| 1708 | 1708 | |
| 1709 | - $html .= Display::div(implode(' | ', $labels) , array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info')); |
|
| 1709 | + $html .= Display::div(implode(' | ', $labels), array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info')); |
|
| 1710 | 1710 | $html .= ' '.Display::span(' ', array('id' => 'vote_label2_'.$id)); |
| 1711 | 1711 | |
| 1712 | 1712 | if ($add_div_wrapper) { |
@@ -1784,8 +1784,8 @@ discard block |
||
| 1784 | 1784 | if (!empty($list)) { |
| 1785 | 1785 | $html = '<dl class="dl-horizontal">'; |
| 1786 | 1786 | foreach ($list as $item) { |
| 1787 | - $html .= '<dt>' . $item['title'] . '</dt>'; |
|
| 1788 | - $html .= '<dd>' . $item['content'] . '</dd>'; |
|
| 1787 | + $html .= '<dt>'.$item['title'].'</dt>'; |
|
| 1788 | + $html .= '<dd>'.$item['content'].'</dd>'; |
|
| 1789 | 1789 | } |
| 1790 | 1790 | $html .= '</dl>'; |
| 1791 | 1791 | } |
@@ -1827,7 +1827,7 @@ discard block |
||
| 1827 | 1827 | * @param string $type |
| 1828 | 1828 | * @return null|string |
| 1829 | 1829 | */ |
| 1830 | - public static function badge($count, $type ="warning") |
|
| 1830 | + public static function badge($count, $type = "warning") |
|
| 1831 | 1831 | { |
| 1832 | 1832 | $class = ''; |
| 1833 | 1833 | |
@@ -1903,7 +1903,7 @@ discard block |
||
| 1903 | 1903 | if (!empty($content)) { |
| 1904 | 1904 | $html = '<span class="label '.$class.'">'; |
| 1905 | 1905 | $html .= $content; |
| 1906 | - $html .='</span>'; |
|
| 1906 | + $html .= '</span>'; |
|
| 1907 | 1907 | } |
| 1908 | 1908 | |
| 1909 | 1909 | return $html; |
@@ -1924,7 +1924,7 @@ discard block |
||
| 1924 | 1924 | $class = 'class ="active"'; |
| 1925 | 1925 | } |
| 1926 | 1926 | |
| 1927 | - if (basename($_SERVER['REQUEST_URI']) == basename($value['url']) ) { |
|
| 1927 | + if (basename($_SERVER['REQUEST_URI']) == basename($value['url'])) { |
|
| 1928 | 1928 | $class = 'class ="active"'; |
| 1929 | 1929 | } |
| 1930 | 1930 | $html .= "<li $class >"; |
@@ -2178,7 +2178,7 @@ discard block |
||
| 2178 | 2178 | } |
| 2179 | 2179 | $label = $nextValue + $localCounter + 1; |
| 2180 | 2180 | if ($isMedia) { |
| 2181 | - $label = ($fixedValue + 1) .' '.chr(97 + $localCounter); |
|
| 2181 | + $label = ($fixedValue + 1).' '.chr(97 + $localCounter); |
|
| 2182 | 2182 | $link_to_show = $link.$fixedValue.'#questionanchor'.$itemId; |
| 2183 | 2183 | } |
| 2184 | 2184 | $link = Display::url($label.' ', $link_to_show, $linkAttributes); |
@@ -2290,7 +2290,7 @@ discard block |
||
| 2290 | 2290 | */ |
| 2291 | 2291 | public static function getVCardUserLink($userId) |
| 2292 | 2292 | { |
| 2293 | - $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId);; |
|
| 2293 | + $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId); ; |
|
| 2294 | 2294 | |
| 2295 | 2295 | return $vCardUrl; |
| 2296 | 2296 | } |
@@ -2308,7 +2308,7 @@ discard block |
||
| 2308 | 2308 | { |
| 2309 | 2309 | $title = !empty($title) ? '<div class="panel-heading"><h3 class="panel-title">'.$title.'</h3>'.$extra.'</div>' : ''; |
| 2310 | 2310 | $footer = !empty($footer) ? '<div class="panel-footer ">'.$footer.'</div>' : ''; |
| 2311 | - $styles = ['primary','success','info','warning','danger']; |
|
| 2311 | + $styles = ['primary', 'success', 'info', 'warning', 'danger']; |
|
| 2312 | 2312 | $style = !in_array($style, $styles) ? 'default' : $style; |
| 2313 | 2313 | |
| 2314 | 2314 | return ' |
@@ -2353,7 +2353,7 @@ discard block |
||
| 2353 | 2353 | $attributes['class'] = isset($attributes['class']) ? "$buttonClass {$attributes['class']}" : $buttonClass; |
| 2354 | 2354 | |
| 2355 | 2355 | if (!$includeText) { |
| 2356 | - $text = '<span class="sr-only">' . $text . '</span>'; |
|
| 2356 | + $text = '<span class="sr-only">'.$text.'</span>'; |
|
| 2357 | 2357 | } |
| 2358 | 2358 | |
| 2359 | 2359 | return self::url("$icon $text", $url, $attributes); |
@@ -2368,9 +2368,9 @@ discard block |
||
| 2368 | 2368 | */ |
| 2369 | 2369 | public static function toolbarAction($id, $content = array(), $col = 2, $right = true) |
| 2370 | 2370 | { |
| 2371 | - $columns = 12/$col; |
|
| 2371 | + $columns = 12 / $col; |
|
| 2372 | 2372 | $html = ''; |
| 2373 | - $html .= '<div id="' . $id . '" class="actions">'; |
|
| 2373 | + $html .= '<div id="'.$id.'" class="actions">'; |
|
| 2374 | 2374 | $html .= '<div class="row">'; |
| 2375 | 2375 | if ($col > 4) { |
| 2376 | 2376 | $html = '<div class="alert alert-warning" role="alert"> |
@@ -2378,7 +2378,7 @@ discard block |
||
| 2378 | 2378 | </div>'; |
| 2379 | 2379 | } else { |
| 2380 | 2380 | for ($i = 0; $i < $col; $i++) { |
| 2381 | - $html .= '<div class="col-md-' . $columns . '">'; |
|
| 2381 | + $html .= '<div class="col-md-'.$columns.'">'; |
|
| 2382 | 2382 | if ($col == 2 && $i == 1) { |
| 2383 | 2383 | if ($right === true) { |
| 2384 | 2384 | $html .= '<div class="pull-right">'; |
@@ -2494,9 +2494,9 @@ discard block |
||
| 2494 | 2494 | $params['class'] = 'panel panel-default'; |
| 2495 | 2495 | $html = null; |
| 2496 | 2496 | if (!empty($title)) { |
| 2497 | - $html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL; |
|
| 2497 | + $html .= '<div class="panel-heading">'.$title.'</div>'.PHP_EOL; |
|
| 2498 | 2498 | } |
| 2499 | - $html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL; |
|
| 2499 | + $html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL; |
|
| 2500 | 2500 | $html = Display::div($html, $params); |
| 2501 | 2501 | } |
| 2502 | 2502 | return $html; |