Ejemplo n.º 1
0
 public function create_from_xml_array($data)
 {
     parent::create_from_xml_array($data);
     $this->obj_match_customs = array();
     $this->obj_match_entries = array();
     // customs
     if (isset($data['customs'])) {
         if (isset($data['customs']['match_custom'])) {
             if (isset($data['customs']['match_custom']['@attributes'])) {
                 $match_custom = new match_custom();
                 $match_custom->obj_version = $this->obj_version;
                 $match_custom->create_from_xml_array($data['customs']['match_custom']);
                 $this->obj_match_customs[] = $match_custom;
             } else {
                 foreach ($data['customs']['match_custom'] as $mcustom) {
                     $match_custom = new match_custom();
                     $match_custom->obj_version = $this->obj_version;
                     $match_custom->create_from_xml_array($mcustom);
                     $this->obj_match_customs[] = $match_custom;
                 }
             }
         }
     }
     // matchentries
     if (isset($data['matchentries'])) {
         if (isset($data['matchentries']['match_entry'])) {
             if (isset($data['matchentries']['match_entry']['@attributes'])) {
                 $match_entry = new match_entry();
                 $match_entry->obj_version = $this->obj_version;
                 $match_entry->create_from_xml_array($data['matchentries']['match_entry']);
                 $this->obj_match_entries[] = $match_entry;
             } else {
                 foreach ($data['matchentries']['match_entry'] as $mentry) {
                     $match_entry = new match_entry();
                     $match_entry->obj_version = $this->obj_version;
                     $match_entry->create_from_xml_array($mentry);
                     $this->obj_match_entries[] = $match_entry;
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
            $this_hf->update_raw(array("str_cache_approved" => $this_hf->str_cache_latest));
        }
    }
    // 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