From 821db803214718da21d0102cd3ca00c3e4d3a9fb Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 31 May 2016 16:04:28 +0200 Subject: [PATCH] Minor - format code --- main/inc/lib/sortable_table.class.php | 140 ++++++++++++++------------ 1 file changed, 73 insertions(+), 67 deletions(-) diff --git a/main/inc/lib/sortable_table.class.php b/main/inc/lib/sortable_table.class.php index 418397cd61..b5ff7a855a 100755 --- a/main/inc/lib/sortable_table.class.php +++ b/main/inc/lib/sortable_table.class.php @@ -174,21 +174,21 @@ class SortableTable extends HTML_Table $this->per_page = isset($_SESSION[$this->param_prefix.'per_page']) ? intval($_SESSION[$this->param_prefix.'per_page']) : $default_items_per_page; $this->per_page = isset($_GET[$this->param_prefix.'per_page']) ? intval($_GET[$this->param_prefix.'per_page']) : $this->per_page; - $_SESSION[$this->param_prefix.'per_page'] = $this->per_page; - $_SESSION[$this->param_prefix.'direction'] = $this->direction ; - $_SESSION[$this->param_prefix.'page_nr'] = $this->page_nr; - $_SESSION[$this->param_prefix.'column'] = $this->column; - $this->pager = null; - $this->default_items_per_page = $default_items_per_page; - $this->total_number_of_items = -1; - $this->get_total_number_function = $get_total_number_function; - $this->get_data_function = $get_data_function; - $this->column_filters = array(); - $this->form_actions = array(); - $this->checkbox_name = null; - $this->td_attributes = array(); - $this->th_attributes = array(); - $this->other_tables = array(); + $_SESSION[$this->param_prefix.'per_page'] = $this->per_page; + $_SESSION[$this->param_prefix.'direction'] = $this->direction; + $_SESSION[$this->param_prefix.'page_nr'] = $this->page_nr; + $_SESSION[$this->param_prefix.'column'] = $this->column; + $this->pager = null; + $this->default_items_per_page = $default_items_per_page; + $this->total_number_of_items = -1; + $this->get_total_number_function = $get_total_number_function; + $this->get_data_function = $get_data_function; + $this->column_filters = array(); + $this->form_actions = array(); + $this->checkbox_name = null; + $this->td_attributes = array(); + $this->th_attributes = array(); + $this->other_tables = array(); } /** @@ -197,23 +197,23 @@ class SortableTable extends HTML_Table public function get_pager() { if (is_null($this->pager)) { - $total_number_of_items = $this->get_total_number_of_items(); - $params['mode'] = 'Sliding'; - $params['perPage'] = $this->per_page; - $params['totalItems'] = $total_number_of_items; - $params['urlVar'] = $this->param_prefix.'page_nr'; - $params['currentPage'] = $this->page_nr; - $icon_attributes = array('style' => 'vertical-align: middle;'); - $params['prevImg'] = Display :: return_icon('action_prev.png', get_lang('PreviousPage'), $icon_attributes); - $params['nextImg'] = Display :: return_icon('action_next.png', get_lang('NextPage'), $icon_attributes); - $params['firstPageText'] = Display :: return_icon('action_first.png', get_lang('FirstPage'), $icon_attributes); - $params['lastPageText'] = Display :: return_icon('action_last.png', get_lang('LastPage'), $icon_attributes); - $params['firstPagePre'] = ''; - $params['lastPagePre'] = ''; + $total_number_of_items = $this->get_total_number_of_items(); + $params['mode'] = 'Sliding'; + $params['perPage'] = $this->per_page; + $params['totalItems'] = $total_number_of_items; + $params['urlVar'] = $this->param_prefix.'page_nr'; + $params['currentPage'] = $this->page_nr; + $icon_attributes = array('style' => 'vertical-align: middle;'); + $params['prevImg'] = Display:: return_icon('action_prev.png', get_lang('PreviousPage'), $icon_attributes); + $params['nextImg'] = Display:: return_icon('action_next.png', get_lang('NextPage'), $icon_attributes); + $params['firstPageText'] = Display:: return_icon('action_first.png', get_lang('FirstPage'), $icon_attributes); + $params['lastPageText'] = Display:: return_icon('action_last.png', get_lang('LastPage'), $icon_attributes); + $params['firstPagePre'] = ''; + $params['lastPagePre'] = ''; $params['firstPagePost'] = ''; - $params['lastPagePost'] = ''; + $params['lastPagePost'] = ''; $params['spacesBeforeSeparator'] = ''; - $params['spacesAfterSeparator'] = ''; + $params['spacesAfterSeparator'] = ''; $query_vars = array_keys($_GET); $query_vars_needed = array ($this->param_prefix.'column', $this->param_prefix.'direction', $this->param_prefix.'per_page'); if (count($this->additional_parameters) > 0) { @@ -231,9 +231,7 @@ class SortableTable extends HTML_Table */ public function display() { - echo $this->return_table(); - } /** @@ -243,7 +241,6 @@ class SortableTable extends HTML_Table public function return_table() { $empty_table = false; - $content = $this->get_table_html(); if ($this->get_total_number_of_items() == 0) { $cols = $this->getColCount(); @@ -299,21 +296,21 @@ class SortableTable extends HTML_Table if (count($this->form_actions) > 0) { $html .= '
'; - $html .= '
'; - $html .= ''.get_lang('SelectAll').''; - $html .= ''.get_lang('UnSelectAll').' '; - $html .= '
'; - $html .= '
- - '; - $html .= ''; - $html .= '
';//btn-group + $html .= '
'; + $html .= ''.get_lang('SelectAll').''; + $html .= ''.get_lang('UnSelectAll').' '; + $html .= '
'; + $html .= '
+ + '; + $html .= ''; + $html .= '
';//btn-group $html .= '
'; //toolbar } else { $html .= $form; @@ -336,7 +333,7 @@ class SortableTable extends HTML_Table $html .= ''; } } - + return '
' . $html . '
'; } @@ -346,7 +343,6 @@ class SortableTable extends HTML_Table **/ public function display_grid() { - $empty_table = false; if ($this->get_total_number_of_items() == 0) { $cols = $this->getColCount(); @@ -358,7 +354,7 @@ class SortableTable extends HTML_Table $html = ''; if (!$empty_table) { $form = $this->get_page_select_form(); - $nav = $this->get_navigation_html(); + $nav = $this->get_navigation_html(); // @todo This style css must be moved to default.css only for dev echo '