Minor - format code

pull/3368/head
Julio Montoya 5 years ago
parent 26d57fe0a5
commit fd2670e106
  1. 37
      main/inc/lib/pear/Pager/Common.php
  2. 4
      main/inc/lib/sortable_table.class.php

@ -837,7 +837,7 @@ class Pager_Common
*/
function _renderLink($altText, $linkText)
{
if ($this->_httpMethod == 'GET') {
if ($this->_httpMethod === 'GET') {
if ($this->_append) {
$href = '?' . $this->_http_build_query_wrapper($this->_linkData);
} else {
@ -1020,6 +1020,7 @@ class Pager_Common
$qs = $_GET;
}
}
foreach ($this->_excludeVars as $exclude) {
$use_preg = $this->_isRegexp($exclude);
foreach (array_keys($qs) as $qs_item) {
@ -1039,6 +1040,7 @@ class Pager_Common
$this->_recursive_urldecode($this->_extraVars);
$qs = array_merge($qs, $this->_extraVars);
}
if (count($qs)
&& function_exists('get_magic_quotes_gpc')
&& -1 == version_compare(PHP_VERSION, '5.2.99')
@ -1121,15 +1123,15 @@ class Pager_Common
$this->_linkData[$this->_urlVar] = $this->getPreviousPageID();
$back = $this->_renderLink($this->_altPrev, $this->_prevImg)
.$this->_spacesBefore.$this->_spacesAfter;
} else if ($this->_prevImgEmpty !== null && $this->_totalPages > 1) {
} else {
if ($this->_prevImgEmpty !== null && $this->_totalPages > 1) {
$back = $this->_prevImgEmpty
.$this->_spacesBefore.$this->_spacesAfter;
}
return $back;
}
// }}}
// {{{ _getPageLinks()
return $back;
}
/**
* Returns pages link
@ -1145,9 +1147,6 @@ class Pager_Common
return $this->raiseError($msg, ERROR_PAGER_NOT_IMPLEMENTED);
}
// }}}
// {{{ _getNextLink()
/**
* Returns next link
*
@ -1173,16 +1172,16 @@ class Pager_Common
$next = $this->_spacesAfter
.$this->_renderLink($this->_altNext, $this->_nextImg)
.$this->_spacesBefore.$this->_spacesAfter;
} else if ($this->_nextImgEmpty !== null && $this->_totalPages > 1) {
} else {
if ($this->_nextImgEmpty !== null && $this->_totalPages > 1) {
$next = $this->_spacesAfter
.$this->_nextImgEmpty
.$this->_spacesBefore.$this->_spacesAfter;
}
return $next;
}
// }}}
// {{{ _getFirstLinkTag()
return $next;
}
/**
* Returns first link tag
@ -1209,9 +1208,6 @@ class Pager_Common
);
}
// }}}
// {{{ _getPrevLinkTag()
/**
* Returns previous link tag
*
@ -1439,9 +1435,6 @@ class Pager_Common
}
}
// }}}
// {{{ _http_build_query_wrapper()
/**
* This is a slightly modified version of the http_build_query() function;
* it heavily borrows code from PHP_Compat's http_build_query().
@ -1460,10 +1453,10 @@ class Pager_Common
return '';
}
$separator = ini_get('arg_separator.output');
if ($separator == '&') {
if ($separator === '&') {
$separator = '&'; //the string is escaped by htmlentities anyway...
}
$tmp = array ();
$tmp = [];
foreach ($data as $key => $val) {
if (is_scalar($val)) {
//array_push($tmp, $key.'='.$val);
@ -1477,12 +1470,10 @@ class Pager_Common
continue;
}
}
return implode($separator, $tmp);
}
// }}}
// {{{ __http_build_query()
/**
* Helper function
*

@ -337,6 +337,7 @@ class SortableTable extends HTML_Table
);
}
$query_vars_exclude = array_diff($query_vars, $query_vars_needed);
$params['excludeVars'] = $query_vars_exclude;
$this->pager = &Pager::factory($params);
}
@ -936,7 +937,7 @@ class SortableTable extends HTML_Table
{
$param_string_parts = [];
if (is_array($this->additional_parameters) && count($this->additional_parameters) > 0) {
foreach ($this->additional_parameters as $key => &$value) {
foreach ($this->additional_parameters as $key => $value) {
$param_string_parts[] = urlencode($key).'='.urlencode($value);
}
}
@ -944,7 +945,6 @@ class SortableTable extends HTML_Table
foreach ($this->other_tables as $index => &$tablename) {
$param = [];
if (isset($_GET[$tablename.'_direction'])) {
//$param[$tablename.'_direction'] = $_GET[$tablename.'_direction'];
$my_get_direction = $_GET[$tablename.'_direction'];
if (!in_array($my_get_direction, ['ASC', 'DESC'])) {
$param[$tablename.'_direction'] = 'ASC';

Loading…
Cancel
Save