Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -48,7 +48,7 @@ class _Custom extends Table
|
||||
* @param array $dataSource Data source
|
||||
* @param \IPS\Http\Url $baseUrl Base URL
|
||||
*/
|
||||
public function __construct( $dataSource, \IPS\Http\Url $baseUrl )
|
||||
public function __construct( $dataSource, \IPS\Http\Url $baseUrl, $count = NULL )
|
||||
{
|
||||
$this->dataSource = $dataSource;
|
||||
$this->count = \count( $this->dataSource );
|
||||
@@ -107,7 +107,7 @@ class _Custom extends Table
|
||||
}
|
||||
|
||||
/* Do we need to sort? */
|
||||
if( !empty( $rows ) and $this->sortBy and isset( $rows[ key( $rows ) ][ $this->sortBy ] ) )
|
||||
if( $this->parseSource and !empty( $rows ) and $this->sortBy and isset( $rows[ key( $rows ) ][ $this->sortBy ] ) )
|
||||
{
|
||||
$sortBy = $this->sortBy;
|
||||
$sortDirection = $this->sortDirection;
|
||||
@@ -125,7 +125,7 @@ class _Custom extends Table
|
||||
}
|
||||
|
||||
/* Limit */
|
||||
if ( $this->limit and $this->count > $this->limit )
|
||||
if ( $this->limit and $this->count > $this->limit and $this->parseSource )
|
||||
{
|
||||
$rows = \array_slice( $rows, ( $this->limit * ( $this->page - 1 ) ), $this->limit, TRUE );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user