Skip to content

Commit

Permalink
Document: Fix document tool pagination - refs #3748
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbeeznest committed Aug 10, 2021
1 parent 899bfcf commit 350f612
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions main/inc/lib/SortableTableFromArrayConfig.php
Expand Up @@ -26,7 +26,8 @@ class SortableTableFromArrayConfig extends SortableTable
private $column_order;

private $doc_filter;

private $handlePagination = true;

/**
* Constructor.
*
Expand All @@ -53,6 +54,10 @@ public function __construct(
$this->column_order = $column_order;
$this->doc_filter = $doc_filter;

// if data is empty the pagination is handled with query in database
if (empty($data)) {
$this->handlePagination = false;
}
parent::__construct(
$tableName,
null,
Expand Down Expand Up @@ -85,8 +90,10 @@ public function get_table_data(
SORT_REGULAR,
$this->doc_filter
);

// return array_slice($table, $from, $this->per_page);

if ($this->handlePagination) {
return array_slice($table, $from, $this->per_page);
}
return $table;
}

Expand All @@ -107,4 +114,4 @@ public function get_total_number_of_items()
return 0;
}
}
}
}

0 comments on commit 350f612

Please sign in to comment.