/** * @param string $resource */ public function __construct($resource) { $this->resource = $resource; $this->lang = Registry::getLanguage(); $this->theme_src = Registry::getThemeSrc(); $this->theme_location = Registry::getThemeLocation(); $this->current_page = isset($_GET["_page_{$this->resource}"]) && $_GET["_page_{$this->resource}"] > 0 ? (int) $_GET["_page_{$this->resource}"] : 1; $this->session = new SessionNamespace($this->resource); if (!isset($this->session->access)) { $this->session->access = new \stdClass(); } if (!isset($this->session->db)) { $this->session->db = new \stdClass(); } if (!isset($this->session->table)) { $this->session->table = new \stdClass(); } if (isset($this->session->table)) { // Количество записей if (isset($this->session->table->records_per_page)) { $this->records_per_page = $this->session->table->records_per_page; $this->records_per_page = $this->records_per_page === 0 ? 1000000000 : $this->records_per_page; } // Поисковые данные if (isset($this->session->table->search)) { $this->sessData['search'] = $this->session->table->search; } // Сортировка if (isset($this->session->table->order) && isset($this->session->table->order_type)) { $this->sessData['order'] = $this->session->table->order; $this->sessData['order_type'] = $this->session->table->order_type; } } }
/** * @param string $label * @param string $name */ public function __construct($label, $name = '') { $this->label = $label; if (!empty($name)) { $this->attributes['name'] = $name; } $this->lang = Registry::getLanguage(); $this->theme_src = Registry::getThemeSrc(); $this->theme_location = Registry::getThemeLocation(); }
/** * @param string $resource */ public function __construct($resource) { $this->resource = $resource; $this->lang = Registry::getLanguage(); $this->theme_src = Registry::getThemeSrc(); $this->theme_location = Registry::getThemeLocation(); $this->session = new SessionNamespace($this->resource); if (!isset($this->session->form)) { $this->session->form = new \stdClass(); } }