示例#1
0
文件: Db.php 项目: shabuninil/combine
 /**
  * @param string $resource
  */
 public function __construct($resource)
 {
     parent::__construct($resource);
     $this->session->access->delete = true;
     $db = Combine\Registry::getDbConnection();
     $this->db = $db->getAdapter();
 }
示例#2
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;
         }
     }
 }
示例#3
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();
 }
示例#4
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];
     }
 }
示例#5
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();
 }
示例#6
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();
 }
示例#7
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();
     }
 }
示例#8
0
 /**
  * @param string $resource
  */
 public function __construct($resource)
 {
     $this->resource = $resource;
     $this->theme_src = Registry::getThemeSrc();
     $this->theme_location = Registry::getThemeLocation();
 }
示例#9
0
 public function __construct()
 {
     $this->resource = !empty($_SERVER['HTTP_X_CMB_RESOURCE']) ? $_SERVER['HTTP_X_CMB_RESOURCE'] : '';
     $this->process = !empty($_SERVER['HTTP_X_CMB_PROCESS']) ? $_SERVER['HTTP_X_CMB_PROCESS'] : '';
     $this->db = Registry::getDbConnection()->getAdapter();
 }
示例#10
0
文件: Db.php 项目: shabuninil/combine
 /**
  * @param string $resource
  */
 public function __construct($resource)
 {
     parent::__construct($resource);
     $this->db = Registry::getDbConnection()->getAdapter();
     $this->session->form->controls = array();
 }