示例#1
0
文件: update.php 项目: klan1/k1.lib
 public function __construct(\k1lib\crudlexs\controller_base $controller_object, array $user_levels_allowed = [])
 {
     parent::__construct($controller_object, $user_levels_allowed);
     if ($this->is_enabled) {
         $this->show_rule_to_apply = "show-update";
         $this->row_keys_text = url::set_url_rewrite_var(url::get_url_level_count(), 'row-keys-text', FALSE);
         $this->update_object = new \k1lib\crudlexs\updating($this->controller_object->db_table, $this->row_keys_text);
     }
 }
示例#2
0
文件: delete.php 项目: klan1/k1.lib
 public function __construct(\k1lib\crudlexs\controller_base $controller_object, array $user_levels_allowed = [])
 {
     parent::__construct($controller_object, $user_levels_allowed);
     $this->redirect_url = isset($_GET['back-url']) ? \k1lib\urlrewrite\get_back_url() : "{$controller_object->get_controller_root_dir()}{$this->controller_object->get_board_list_url_name()}/";
     if ($this->is_enabled) {
         $this->row_keys_text = url::set_url_rewrite_var(url::get_url_level_count(), 'row-keys-text', FALSE);
         $this->read_object = new \k1lib\crudlexs\reading($this->controller_object->db_table, $this->row_keys_text);
     }
 }
示例#3
0
文件: updating.php 项目: klan1/k1.lib
 public function load_db_table_data($blank_data = FALSE)
 {
     $return_data = parent::load_db_table_data($blank_data);
     $url_action = url::set_url_rewrite_var(url::get_url_level_count(), "url_action", FALSE);
     $url_action_on_encoded_field = url::set_url_rewrite_var(url::get_url_level_count(), "url_action_on_encoded_field", FALSE);
     $url_action_on_field = $this->decrypt_field_name($url_action_on_encoded_field);
     if ($url_action == "unlink-uploaded-file") {
         \k1lib\forms\file_uploads::unlink_uploaded_file($this->db_table_data[1][$url_action_on_field]);
         $this->db_table_data[1][$url_action_on_field] = NULL;
         $this->db_table->update_data($this->db_table_data[1], $this->db_table_data_keys[1]);
         \k1lib\html\html_header_go(\k1lib\urlrewrite\get_back_url());
     }
     return $return_data;
 }
示例#4
0
 public function read_url_keys_text_for_list($db_table_name, $is_required = TRUE)
 {
     if (isset($this->board_list_object)) {
         /**
          * URL key text management
          */
         $related_url_keys_text = url::set_url_rewrite_var(url::get_url_level_count(), "related_url_keys_text", FALSE);
         if (!empty($related_url_keys_text)) {
             $related_table = $db_table_name;
             $related_db_table = new \k1lib\crudlexs\class_db_table($this->db_table->db, $related_table);
             $related_url_keys_array = \k1lib\sql\table_url_text_to_keys($related_url_keys_text, $related_db_table->get_db_table_config());
             $related_url_keys_text_auth_code = md5(\k1lib\K1MAGIC::get_value() . $related_url_keys_text);
             if (isset($_GET['auth-code']) && $_GET['auth-code'] === $related_url_keys_text_auth_code) {
                 $this->db_table->set_query_filter($related_url_keys_array, TRUE);
                 return $related_url_keys_text;
             } else {
                 $this->board_list_object->set_is_enabled(FALSE);
                 DOM_notification::queue_mesasage(board_base_strings::$error_url_keys_no_auth, "alert", $this->notifications_div_id, \k1lib\common_strings::$error);
                 return FALSE;
             }
         } else {
             if ($is_required) {
                 $this->board_list_object->set_is_enabled(FALSE);
                 DOM_notification::queue_mesasage(board_base_strings::$error_url_keys_no_keys_text, "alert", $this->notifications_div_id, \k1lib\common_strings::$error);
                 return FALSE;
             }
         }
     }
 }