Example #1
0
 /**
  * @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;
         }
     }
 }
Example #2
0
 /**
  * @param string $title
  */
 public function __construct($title)
 {
     if (!empty($title)) {
         $this->attributes['value'] = $title;
     }
     $this->theme_location = Registry::getThemeLocation();
     $this->theme_src = Registry::getThemeSrc();
 }
Example #3
0
 /**
  * @param string $resource
  * @param string $url
  */
 public function __construct($resource, $url)
 {
     $this->theme_src = Registry::getThemeSrc();
     $this->theme_location = Registry::getThemeLocation();
     $this->resource = $resource;
     $this->url = $url;
     if (isset($_GET[$this->resource])) {
         $this->active_tab = $_GET[$this->resource];
     }
 }
Example #4
0
 /**
  * @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();
 }
Example #5
0
 /**
  * @param string $name
  * @param string $value
  * @param string $active_value
  * @param string $inactive_value
  * @param bool   $default
  */
 public function __construct($name, $value, $active_value, $inactive_value, $default = true)
 {
     $this->setAttr('name', $name);
     $this->setAttr('value', $value);
     $this->active_value = $active_value;
     $this->inactive_value = $inactive_value;
     $this->default = $default;
     $this->theme_location = Registry::getThemeLocation();
     $this->theme_src = Registry::getThemeSrc();
 }
Example #6
0
 /**
  * @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();
     }
 }
Example #7
0
 /**
  * @param string $resource
  */
 public function __construct($resource)
 {
     $this->resource = $resource;
     $this->theme_src = Registry::getThemeSrc();
     $this->theme_location = Registry::getThemeLocation();
 }