Example #1
0
 public function get_state()
 {
     if (empty($this->db_table) || !$this->is_valid()) {
         return FALSE;
     } else {
         if ($this->db_table->get_state() || !$this->is_valid()) {
             return TRUE;
         } else {
             return FALSE;
         }
     }
 }
Example #2
0
 public function get_state()
 {
     return $this->db_table->get_state();
 }
Example #3
0
 public function set_config($login_db_table, $user_login_field, $user_password_field, $user_level_field = NULL)
 {
     $this->user_login_db_table = $login_db_table;
     $this->db_table = new \k1lib\crudlexs\class_db_table($this->db_object, $this->user_login_db_table);
     if ($this->db_table->get_state()) {
         $this->user_login_field = $user_login_field;
         $this->user_password_field = $user_password_field;
         $this->user_level_field = $user_level_field;
     }
 }
Example #4
0
 /**
  * @param \k1lib\crudlexs\class_db_table $db_table
  * @param array $field_links_array
  * @param string $board_root
  * @param string $board_read
  * @param boolean $clear_url
  * @return \k1lib\crudlexs\listing|boolean
  */
 public function do_related_list(class_db_table $db_table, $field_links_array, $board_root, $board_read, $clear_url = FALSE)
 {
     $table_alias = \k1lib\db\security\db_table_aliases::encode($db_table->get_db_table_name());
     if ($this->is_enabled && $this->read_object->is_valid()) {
         /**
          * Clients list
          */
         if ($db_table->get_state()) {
             if ($this->related_use_rows_key_text) {
                 $current_row_keys_array = $this->read_object->get_row_keys_array();
                 $db_table->set_field_constants($current_row_keys_array);
                 $db_table->set_query_filter($current_row_keys_array, TRUE, $this->related_do_clean_array_on_query_filter);
             }
             /**
              * LIST OBJECT must be created here to know if ther is data or not to show
              * all data button.
              */
             $this->related_list = new \k1lib\crudlexs\listing($db_table, FALSE);
             $this->related_list->set_rows_per_page($this->related_rows_to_show);
             $data_loaded = $this->related_list->load_db_table_data($this->related_use_show_rule);
             if ($data_loaded) {
                 if ($this->related_apply_filters) {
                     $this->related_apply_filters();
                     $this->related_apply_link_read_field($field_links_array, $board_root, $board_read, $clear_url);
                 }
             }
             return $this->related_list;
         } else {
             trigger_error("DB Table couldn't be opened : " . $db_table->get_db_table_name(), E_USER_NOTICE);
             return FALSE;
         }
     } else {
         return FALSE;
     }
 }