public function hash_to_expression_tree($hash, $do_substitutions = true) { if ($hash == "undefined") { return; } if (!isset($this->obj_expression)) { // $this->obj_expression=new stdClass(); $this->obj_expression = new strings(); $this->obj_expression->get_from_hashrange($hash); $this->obj_expression->build(); } if (isset($this->obj_hf_parameters) && isset($this->obj_expression) && isset($this->obj_expression->body)) { if ($do_substitutions) { $this->obj_expression->value = replace_hf_parameters($this->obj_expression->body, $this->obj_hf_parameters); } else { if (isset($this->obj_expression)) { if (isset($this->obj_expression->body)) { $this->obj_expression->value = $this->obj_expression->body; } } else { } //$this->obj_expression->value=$this->obj_expression->body; } } if (isset($this->obj_expression) && !is_bool($this->obj_expression) && get_class($this->obj_expression) == "strings") { $this->obj_expression->obj_match_customs = array(); $match_custom = new match_custom(); $all_customs = $match_custom->get_from_hashrange($hash); if ($all_customs) { foreach ($all_customs as $each_custom) { $a_custom = new match_custom(); $a_custom->set($each_custom); $a_custom->build(); $this->obj_expression->obj_match_customs[$a_custom->idx_key] = $a_custom; } } // end if $this->obj_expression->obj_match_entries = array(); $match_entry = new match_entry(); $all_entries = $match_entry->get_from_hashrange($hash); if ($all_entries) { foreach ($all_entries as $each_entry) { $a_entry = new match_entry(); $a_entry->set($each_entry); $a_entry->build(); $this->obj_expression->obj_match_entries[$a_entry->idx_id] = $a_entry; } usort($this->obj_expression->obj_match_entries, "mesort"); } // end if } }
$props["id_expr"] = $_POST['id_expr']; $props["idx_id"] = $idx_id . "#" . $sha1_new_me_id; $props["id_entry_type"] = $_POST['id_entry_type']; $props["id_entry_subtype"] = $_POST['id_entry_subtype']; $props["int_order"] = $max_order_count . ""; $new_me = new match_entry(); $new_me->create($props); } if ($_GET['action'] == "update-match-entry") { if (isset($_POST['btnDelete'])) { $match_entry = new match_entry(); $match_entry->get_from_hashrange($_POST['id_expr'], $_POST['idx_id']); $match_entry->delete(); } else { $match_entry = new match_entry(); $match_entry->get_from_hashrange($_POST['id_expr'], $_POST['idx_id']); $match_entry->update(array("id_entry_subtype" => $_POST['id_entry_subtype'])); // DATABASE CONNECTION SUBSETTINGS // LEVEL 2 - ADDSET OR ADDWHERE BUTTONS HIT foreach ($_POST as $PK => $PV) { if (strpos($PK, 'btn_subsetting_db_action_') === 0 && endsWith($PK, "_addset")) { $match_entry->build(); $db_action_prefix = str_replace("_addset", "", $PK); $db_action_prefix = str_replace("btn_", "", $db_action_prefix); $max_set_found = 0; foreach ($match_entry->obj_me_settings as $mes) { if (strpos($mes->name, $db_action_prefix . "_set_") === 0 && endsWith($mes->name, "_name")) { $mes_name = $mes->name; $mes_name = str_replace($db_action_prefix . "_set_", "", $mes_name); $mes_name = str_replace("_name", "", $mes_name); $mes_name = intval($mes_name);