|
|
@ -482,10 +482,10 @@ class SortableTable extends HTML_Table { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($hide_navigation) { |
|
|
|
if ($hide_navigation) { |
|
|
|
$items = $this->table_data; // This is a faster way to get what we want |
|
|
|
$items = $this->table_data; // This is a faster way to get what we want |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// The normal way |
|
|
|
// The normal way |
|
|
|
$items = $this->get_clean_html($sort_data); // Getting the items of the table |
|
|
|
$items = $this->get_clean_html($sort_data); // Getting the items of the table |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Generation of style classes must be improved. Maybe we need a a table name to create style on the fly: |
|
|
|
// Generation of style classes must be improved. Maybe we need a a table name to create style on the fly: |
|
|
@ -545,11 +545,13 @@ class SortableTable extends HTML_Table { |
|
|
|
* Get the HTML-code with the data-table. |
|
|
|
* Get the HTML-code with the data-table. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function get_table_html () { |
|
|
|
public function get_table_html () { |
|
|
|
$pager = $this->get_pager(); |
|
|
|
$pager = $this->get_pager(); |
|
|
|
$val = $pager->getOffsetByPageId(); |
|
|
|
$val = $pager->getOffsetByPageId(); |
|
|
|
$offset = $pager->getOffsetByPageId(); |
|
|
|
$offset = $pager->getOffsetByPageId(); |
|
|
|
$from = $offset[0] - 1; |
|
|
|
$from = $offset[0] - 1; |
|
|
|
|
|
|
|
|
|
|
|
$table_data = $this->get_table_data($from); |
|
|
|
$table_data = $this->get_table_data($from); |
|
|
|
|
|
|
|
|
|
|
|
if (is_array($table_data)) { |
|
|
|
if (is_array($table_data)) { |
|
|
|
foreach ($table_data as $index => & $row) { |
|
|
|
foreach ($table_data as $index => & $row) { |
|
|
|
$row = $this->filter_data($row); |
|
|
|
$row = $this->filter_data($row); |
|
|
@ -576,8 +578,8 @@ class SortableTable extends HTML_Table { |
|
|
|
$val = $pager->getOffsetByPageId(); |
|
|
|
$val = $pager->getOffsetByPageId(); |
|
|
|
$offset = $pager->getOffsetByPageId(); |
|
|
|
$offset = $pager->getOffsetByPageId(); |
|
|
|
$from = $offset[0] - 1; |
|
|
|
$from = $offset[0] - 1; |
|
|
|
|
|
|
|
|
|
|
|
$table_data = $this->get_table_data($from, $sort); |
|
|
|
$table_data = $this->get_table_data($from, null, null, null, $sort); |
|
|
|
|
|
|
|
|
|
|
|
$new_table_data = array(); |
|
|
|
$new_table_data = array(); |
|
|
|
if (is_array($table_data)) { |
|
|
|
if (is_array($table_data)) { |
|
|
@ -868,7 +870,7 @@ class SortableTableFromArray extends SortableTable { |
|
|
|
* Get table data to show on current page |
|
|
|
* Get table data to show on current page |
|
|
|
* @see SortableTable#get_table_data |
|
|
|
* @see SortableTable#get_table_data |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function get_table_data ($from = 1, $per_page = null, $column = null, $direction = null, $sort = true) { |
|
|
|
public function get_table_data($from = 1, $per_page = null, $column = null, $direction = null, $sort = true) { |
|
|
|
if ($sort) { |
|
|
|
if ($sort) { |
|
|
|
$content = TableSort :: sort_table($this->table_data, $this->column, $this->direction == 'ASC' ? SORT_ASC : SORT_DESC); |
|
|
|
$content = TableSort :: sort_table($this->table_data, $this->column, $this->direction == 'ASC' ? SORT_ASC : SORT_DESC); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -937,7 +939,7 @@ class SortableTableFromArrayConfig extends SortableTable { |
|
|
|
* Get table data to show on current page |
|
|
|
* Get table data to show on current page |
|
|
|
* @see SortableTable#get_table_data |
|
|
|
* @see SortableTable#get_table_data |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function get_table_data ($from = 1, $per_page = null, $column = null, $direction = null, $sort = true) { |
|
|
|
public function get_table_data ($from = 1, $per_page = null, $column = null, $direction = null, $sort = true) { |
|
|
|
$content = TableSort :: sort_table_config($this->table_data, $this->column, $this->direction == 'ASC' ? SORT_ASC : SORT_DESC, $this->column_show, $this->column_order, SORT_REGULAR, $this->doc_filter); |
|
|
|
$content = TableSort :: sort_table_config($this->table_data, $this->column, $this->direction == 'ASC' ? SORT_ASC : SORT_DESC, $this->column_show, $this->column_order, SORT_REGULAR, $this->doc_filter); |
|
|
|
return array_slice($content, $from, $this->per_page); |
|
|
|
return array_slice($content, $from, $this->per_page); |
|
|
|
} |
|
|
|
} |
|
|
|