Exemple #1
0
 /**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  *                     object data should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  *                     data is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 public function parse_tree($tree, $ver)
 {
     $this->ver = $ver;
     if (($i1 = parent::find_tag($tree, Rp_Tags::NOTE)) !== false) {
         $str = parent::parse_ptr_id($tree[$i1], Rp_Tags::NOTE);
         if (isset($str) && $str != '') {
             $this->id = $str;
         } else {
             $this->text = parent::parse_con_tag($tree[$i1], Rp_Tags::NOTE);
         }
     }
 }
 /**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  *                     object data should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  *                     data is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 public function parse_tree($tree, $ver)
 {
     $this->ver = $ver;
     if (($i1 = parent::find_tag($tree, Rp_Tags::ADDR)) !== false) {
         $this->address = parent::parse_con_tag($tree[$i1], Rp_Tags::ADDR);
         if (isset($tree[$i1][1])) {
             $sub2 = $tree[$i1][1];
             if (($i2 = parent::find_tag($sub2, Rp_Tags::ADDR1)) !== false) {
                 $this->address_line1 = parent::parse_text($sub2[$i2], Rp_Tags::ADDR1);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::ADDR2)) !== false) {
                 $this->address_line2 = parent::parse_text($sub2[$i2], Rp_Tags::ADDR2);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::ADDR3)) !== false) {
                 $this->address_line3 = parent::parse_text($sub2[$i2], Rp_Tags::ADDR3);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::CITY)) !== false) {
                 $this->city = parent::parse_text($sub2[$i2], Rp_Tags::CITY);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::STATE)) !== false) {
                 $this->state = parent::parse_text($sub2[$i2], Rp_Tags::STATE);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::POSTAL)) !== false) {
                 $this->postal_code = parent::parse_text($sub2[$i2], Rp_Tags::POSTAL);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::CTRY)) !== false) {
                 $this->country = parent::parse_text($sub2[$i2], Rp_Tags::CTRY);
             }
         }
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::PHONE)) !== false) {
         $this->phone = parent::parse_text($tree[$i1], Rp_Tags::PHONE);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::EMAIL)) !== false) {
         $this->email = parent::parse_text($tree[$i1], Rp_Tags::EMAIL);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::FAX)) !== false) {
         $this->fax = parent::parse_text($tree[$i1], Rp_Tags::FAX);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::WWW)) !== false) {
         $this->www = parent::parse_text($tree[$i1], Rp_Tags::WWW);
     }
 }
Exemple #3
0
 /**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  * object rpData should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  * rpData is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 public function parse_tree($tree, $ver)
 {
     if (($i1 = parent::find_tag($tree, Rp_Tags::DATA)) !== false) {
         $this->source_name = parent::parse_text($tree[$i1], Rp_Tags::DATA);
         if (isset($tree[$i1][1])) {
             $sub2 = $tree[$i1][1];
             if (($i2 = parent::find_tag($sub2, Rp_Tags::DATE)) !== false) {
                 $this->date .= parent::parse_text($sub2[$i2], Rp_Tags::DATE);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::COPYRIGHT)) !== false) {
                 $this->copyright .= parent::parse_con_tag($sub2[$i2], Rp_Tags::COPYRIGHT);
             }
         }
     }
 }
 /**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  *                     object data should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  *                     data is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 public function parse_tree($tree, $ver)
 {
     $this->ver = $ver;
     if (($i1 = parent::find_tag($tree, Rp_Tags::SOURCE)) !== false) {
         $this->source_id = parent::parse_ptr_id($tree[$i1], Rp_Tags::SOURCE);
         if (isset($tree[$i1][1])) {
             $sub2 = $tree[$i1][1];
             if (($i2 = parent::find_tag($sub2, Rp_Tags::PAGE)) !== false) {
                 $this->page = parent::parse_text($sub2[$i2], Rp_Tags::PAGE);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::QUAY)) !== false) {
                 $this->quay = parent::parse_text($sub2[$i2], Rp_Tags::QUAY);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::EVENTTYPE)) !== false) {
                 $this->event_type = parent::parse_text($sub2[$i2], Rp_Tags::EVENTTYPE);
                 if (isset($sub2[$i2][1])) {
                     if (($i3 = parent::find_tag($sub2[$i2][1], Rp_Tags::ROLE)) !== false) {
                         $this->role_in_event = parent::parse_text($sub2[$i2][1][$i3], Rp_Tags::ROLE);
                     }
                 }
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::DATA)) !== false) {
                 $sub3 = $sub2[$i2][1];
                 if (isset($sub3)) {
                     if (($i3 = parent::find_tag($sub3, Rp_Tags::DATE)) !== false) {
                         $this->entry_date = parent::parse_text($sub3[$i3], Rp_Tags::DATE);
                     }
                     $off = 0;
                     while (($i3 = parent::find_tag($sub3, Rp_Tags::TEXT, $off)) !== false) {
                         $this->texts[] = parent::parse_con_tag($sub3[$i3], Rp_Tags::TEXT);
                         $off = $i3 + 1;
                     }
                 }
             }
             $off = 0;
             while (($i2 = parent::find_tag($sub2, Rp_Tags::MEDIA, $off)) !== false) {
                 $tmp = new RP_Media_Link();
                 $tmp->parse_tree(array($sub2[$i2]), $ver);
                 $this->media_links[] = $tmp;
                 $off = $i2 + 1;
             }
             $off = 0;
             while (($i2 = parent::find_tag($sub2, Rp_Tags::NOTE, $off)) !== false) {
                 $tmp = new RP_Note();
                 $tmp->parse_tree(array($sub2[$i2]), $ver);
                 $this->notes[] = $tmp;
                 $off = $i2 + 1;
             }
         }
     }
 }