Ejemplo n.º 1
0
 protected function _prepareData()
 {
     $this->order_name_array = JUDirectoryFrontHelperField::getFrontEndOrdering();
     $this->order_dir_array = JUDirectoryFrontHelperField::getFrontEndDirection();
     $this->listing_order = $this->escape($this->state->get('list.ordering'));
     $this->listing_dir = $this->escape($this->state->get('list.direction', 'ASC'));
     $this->listing_columns = (int) $this->params->get('listing_columns', 2);
     if (!is_numeric($this->listing_columns) || $this->listing_columns <= 0) {
         $this->listing_columns = 1;
     }
     $this->listing_bootstrap_columns = JUDirectoryFrontHelper::getBootstrapColumns($this->listing_columns);
     $this->listing_row_class = htmlspecialchars($this->params->get('listing_row_class', ''));
     $this->listing_column_class = htmlspecialchars($this->params->get('listing_column_class', ''));
     $this->load_bootstrap = $this->params->get('load_bootstrap', 2);
     if ($this->load_bootstrap) {
         $this->listing_bootstrap_columns = JUDirectoryFrontHelper::getBootstrapColumns($this->listing_columns);
     }
     $this->allow_user_select_view_mode = $this->params->get('allow_user_select_view_mode', 1);
     if ($this->allow_user_select_view_mode && isset($_COOKIE['judir-view-mode']) && !empty($_COOKIE['judir-view-mode'])) {
         $viewMode = $_COOKIE['judir-view-mode'] == 'judir-view-grid' ? 2 : 1;
     } else {
         $viewMode = $this->params->get('default_view_mode', 2);
     }
     $this->view_mode = $viewMode;
 }