public function __construct(HTMLTableModel $model)
 {
     $this->model = $model;
     $this->arg_id = $this->model->get_id();
     $this->url_parameters = new UrlSerializedParameter($this->arg_id);
     $this->compute_request_parameters();
 }
Beispiel #2
0
 private function generate_table_structure()
 {
     $has_nb_rows_options = $this->model->has_nb_rows_options();
     $this->tpl->put_all(array('TABLE_ID' => $this->arg_id, 'C_PAGINATION_ACTIVATED' => $this->is_pagination_activated(), 'NUMBER_OF_COLUMNS' => count($this->columns), 'C_CSS_CLASSES' => $this->has_css_class(), 'CSS_CLASSES' => $this->get_css_class(), 'C_CSS_STYLE' => $this->has_css_style(), 'CSS_STYLE' => $this->get_css_style(), 'C_ID' => $this->model->has_id(), 'ID' => $this->model->get_id(), 'C_CAPTION' => $this->model->has_caption(), 'CAPTION' => $this->model->get_caption(), 'U_TABLE_DEFAULT_OPIONS' => $this->parameters->get_default_table_url(), 'C_NB_ROWS_OPTIONS' => $has_nb_rows_options, 'C_HAS_ROWS' => !empty($this->rows), 'C_DISPLAY_FOOTER' => $this->model->is_footer_displayed() && !empty($this->rows)));
     if ($has_nb_rows_options) {
         $first_row_index = $this->get_first_row_index();
         $nb_rows_per_page = $this->get_nb_rows_per_page();
         $nb_rows_options = $this->model->get_nb_rows_options();
         foreach ($nb_rows_options as $value) {
             $this->tpl->assign_block_vars('nbItemsOption', array('URL' => $this->parameters->get_nb_items_per_page_url($value, $first_row_index), 'VALUE' => $value, 'C_SELECTED' => $value == $nb_rows_per_page));
         }
     }
 }