Exemplo n.º 1
0
 /**
  * @return \k1lib\html\div|boolean
  */
 public function start_board()
 {
     if (!parent::start_board()) {
         return FALSE;
     }
     /**
      * IFRAME for KF tool
      */
     $fk_iframe = new \k1lib\html\iframe('', 'utility-iframe', "fk-iframe");
     DOM::html()->body()->content()->append_child_tail($fk_iframe);
     if ($this->search_object->get_state()) {
         $close_search_buttom = new \k1lib\html\a(NULL, " " . \k1lib\common_strings::$button_cancel, "_parent");
         $close_search_buttom->set_id("close-search-button");
         $close_search_buttom->set_attrib("class", "button warning fi-page-close");
         $close_search_buttom->set_attrib("onClick", "parent.close_search();");
         $close_search_buttom->append_to($this->button_div_tag);
         $this->search_object->set_search_catch_post_enable($this->search_catch_post_enable);
         $this->search_object->set_html_column_classes("column large-11 medium-11 small-12");
         $this->search_object->set_html_form_column_classes("large-11");
         $this->search_object->do_html_object()->append_to($this->board_content_div);
         return $this->board_content_div;
     } else {
         DOM_notification::queue_mesasage(board_base_labels::$error_mysql_table_not_opened, "alert", $this->notifications_div_id);
         DOM_notification::queue_title(board_base_labels::$error_mysql);
         return FALSE;
     }
 }
Exemplo n.º 2
0
 /**
  * @return \k1lib\html\div|boolean
  */
 public function start_board()
 {
     if (!parent::start_board()) {
         return FALSE;
     }
     if ($this->list_object->get_state()) {
         /**
          * BACK
          */
         if ($this->back_enable && isset($_GET['back-url'])) {
             $back_url = \k1lib\urlrewrite\get_back_url();
             $back_link = \k1lib\html\get_link_button($back_url, board_read_strings::$button_back);
             $back_link->append_to($this->button_div_tag);
         }
         /**
          * NEW BUTTON
          */
         $related_url_keys_text = url::get_url_level_value_by_name("related_url_keys_text");
         if (empty($related_url_keys_text)) {
             $related_url_keys_text = "";
             $new_link = \k1lib\html\get_link_button(url::do_url("../{$this->controller_object->get_board_create_url_name()}/" . $related_url_keys_text), board_list_strings::$button_new);
         } else {
             $related_url_keys_text .= "/";
             $new_link = \k1lib\html\get_link_button(url::do_url("../../{$this->controller_object->get_board_create_url_name()}/" . $related_url_keys_text), board_list_strings::$button_new);
         }
         if ($this->create_enable) {
             //                $new_link = \k1lib\html\get_link_button(url::do_url("../{$this->controller_object->get_board_create_url_name()}/" . $related_url_keys_text), board_list_strings::$button_new);
             //                $new_link = \k1lib\html\get_link_button("../{$this->controller_object->get_board_create_url_name()}/?back-url={$this_url}", board_list_strings::$button_new);
             $new_link->append_to($this->button_div_tag);
         }
         /**
          * Search
          */
         if ($this->search_enable) {
             $search_iframe = new \k1lib\html\iframe(url::do_url($this->controller_object->get_controller_root_dir() . "search/?just-controller=1&caller-url=" . urlencode($_SERVER['REQUEST_URI'])), 'utility-iframe', "search-iframe");
             //                $this->board_content_div->append_child_tail($search_iframe);
             DOM::html()->body()->append_child_tail($search_iframe);
             //                $search_iframe->append_to($this->board_content_div);
             $search_buttom = new \k1lib\html\a(NULL, " " . board_list_strings::$button_search, "_self");
             $search_buttom->set_id("search-button");
             $search_buttom->set_attrib("class", "button fi-page-search");
             $search_buttom->append_to($this->button_div_tag);
             if (isset($_POST) && isset($_POST['from-search']) && urldecode($_POST['from-search']) == $_SERVER['REQUEST_URI']) {
                 //                    if ($this->)
                 /**
                  * decrypt post field names
                  */
                 $incomming_search_data = \k1lib\forms\check_all_incomming_vars($_POST);
                 if ($this->list_object->get_do_table_field_name_encrypt()) {
                     $search_data = $this->list_object->decrypt_field_names($incomming_search_data);
                 } else {
                     $search_data = $incomming_search_data;
                 }
                 $this->controller_object->db_table->set_query_filter($search_data);
                 $search_post = \k1lib\common\serialize_var($_POST, urlencode($_SERVER['REQUEST_URI']));
                 /**
                  * Clear search
                  */
                 $clear_search_buttom = new \k1lib\html\a(url::do_url($_SERVER['REQUEST_URI']), board_list_strings::$button_search_cancel, "_self");
                 $search_buttom->set_value(" " . board_list_strings::$button_search_modify);
                 $clear_search_buttom->set_attrib("class", "button warning");
                 $clear_search_buttom->append_to($this->button_div_tag);
             } else {
                 $search_post = \k1lib\common\unset_serialize_var(urlencode($_SERVER['REQUEST_URI']));
             }
         }
         $this->data_loaded = $this->list_object->load_db_table_data($this->show_rule_to_apply);
         return $this->board_content_div;
     } else {
         DOM_notification::queue_mesasage(board_base_strings::$error_mysql_table_not_opened, "alert", $this->notifications_div_id);
         DOM_notification::queue_title(board_base_strings::$error_mysql);
         $this->list_object->make_invalid();
         $this->is_enabled = FALSE;
         return FALSE;
     }
 }
Exemplo n.º 3
0
 static function default_type(creating $crudlex_obj, $field)
 {
     $field_encrypted = $crudlex_obj->encrypt_field_name($field);
     if (!empty($crudlex_obj->db_table->get_field_config($field, 'refereced_table_name')) && self::$do_fk_search_tool && array_search($field, self::$fk_fields_to_skip) === FALSE) {
         $div_input_group = new \k1lib\html\div("input-group");
         $input_tag = new \k1lib\html\input("text", $field_encrypted, NULL, "k1lib-input-insert input-group-field");
         if (!empty($crudlex_obj->db_table->get_field_config($field, 'placeholder'))) {
             $input_tag->set_attrib("placeholder", $crudlex_obj->db_table->get_field_config($field, 'placeholder'));
         } else {
             $input_tag->set_attrib("placeholder", input_helper_strings::$input_fk_placeholder);
         }
         $input_tag->set_attrib("k1lib-data-group-" . $crudlex_obj->db_table->get_field_config($field, 'refereced_table_name'), TRUE);
         $input_tag->append_to($div_input_group);
         $div_input_group_button = new \k1lib\html\div("input-group-button");
         $div_input_group_button->append_to($div_input_group);
         /**
          * FK TABLE EXTRACTOR
          */
         $refereced_column_config = $crudlex_obj->db_table->get_field_config($field, 'refereced_column_config');
         //            while (!empty($refereced_column_config['refereced_column_config'])) {
         ////                $refereced_column_config = $refereced_column_config['refereced_column_config'];
         //            }
         $this_table = $crudlex_obj->db_table->get_db_table_name();
         $this_table_alias = \k1lib\db\security\db_table_aliases::encode($this_table);
         $fk_table = $refereced_column_config['table'];
         $fk_table_alias = \k1lib\db\security\db_table_aliases::encode($fk_table);
         //            $crudlex_obj->set_do_table_field_name_encrypt();
         $static_values = $crudlex_obj->db_table->get_constant_fields();
         $static_values_enconded = $crudlex_obj->encrypt_field_names($static_values);
         $search_button = new \k1lib\html\input("button", "search", "", "button fi-page-search fk-button");
         $search_button->set_attrib("style", "font-family:foundation-icons");
         $url_params = ["back-url" => $_SERVER['REQUEST_URI']];
         $url_params = array_merge($static_values_enconded, $url_params);
         $url_to_search_fk_data = url::do_url(self::$url_to_search_fk_data . "{$fk_table_alias}/list/{$this_table_alias}/", $url_params);
         $search_button->set_attrib("onclick", "javascript:use_select_row_keys(this.form,'{$url_to_search_fk_data}')");
         $search_button->append_to($div_input_group_button);
         $div_input_group->link_value_obj($input_tag);
         return $div_input_group;
     } elseif (strstr("date,date-past,date-future", $crudlex_obj->db_table->get_field_config($field, 'validation')) !== FALSE) {
         $div_input_group = new \k1lib\html\div("input-group");
         $input_tag = new \k1lib\html\input("text", $field_encrypted, NULL, "k1lib-input-insert input-group-field datepicker");
         $input_tag->set_attrib("placeholder", input_helper_strings::$input_date_placeholder);
         $input_tag->set_attrib("k1lib-data-datepickup", TRUE);
         $input_tag->append_to($div_input_group);
         $div_input_group_button = new \k1lib\html\div("input-group-button");
         $div_input_group_button->append_to($div_input_group);
         $search_button = new \k1lib\html\a("#", "", "_self", "button fi-calendar");
         $search_button->append_to($div_input_group_button);
         $div_input_group->link_value_obj($input_tag);
         return $div_input_group;
     } else {
         $input_tag = new \k1lib\html\input("text", $field_encrypted, NULL, "k1lib-input-insert");
         $input_tag->set_attrib("placeholder", $crudlex_obj->db_table->get_field_config($field, 'placeholder'));
         return $input_tag;
     }
 }
Exemplo n.º 4
0
 public function apply_link_on_field_filter($link_to_apply, $fields_to_change = null, $custom_field_value = null, $href_target = null)
 {
     if ($this->get_state()) {
         $this->link_on_field_filter_applied = true;
         $a_tag = new \k1lib\html\a(url::do_url($link_to_apply), "", $href_target);
         $a_tag->set_attrib("class", "k1lib-link-filter", TRUE);
         if (empty($fields_to_change)) {
             $fields_to_change = crudlexs_base::USE_KEY_FIELDS;
         }
         return $this->apply_html_tag_on_field_filter($a_tag, $fields_to_change, $custom_field_value);
     } else {
         return FALSE;
     }
 }