Ejemplo n.º 1
0
 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
     }
 }
Ejemplo n.º 2
0
        }
    }
    // end if (action)
}
// end if (action)
// add/update cxml header & footers
if (isset($_GET['action'])) {
    if ($_GET['action'] == "update-custom-text") {
        if (isset($_POST['str_txt']) && isset($_POST['id_expr']) && isset($_POST['idx_key'])) {
            if (strlen($_POST['id_expr']) > 0 && strlen($_POST['idx_key']) > 0 && strlen($_POST['str_txt']) >= 0) {
                $props = array();
                $props["id_expr"] = $_POST['id_expr'];
                $props["idx_key"] = $_POST['idx_key'];
                $props["str_txt"] = $_POST['str_txt'];
                $match_custom = new match_custom();
                $match_custom->get_from_hashrange($props['id_expr'], $props['idx_key']);
                if ($match_custom->id_expr == 'undefined') {
                    $match_custom->create($props);
                } else {
                    $match_custom->update(array("str_txt" => $props['str_txt']));
                }
            }
            // end if values
        }
        // end if values
    }
    // end if (action)
}
// end if (action)
// job node filtering - getting certain jobs to only run on certain remote nodes
if (isset($_GET['action'])) {