PLACE>FORM * * data split/copy is done locally by javascript functions * * @param string $element_id id of PLAC input element in the form */ function print_place_subfields($element_id) { global $iso3166, $WT_IMAGE_DIR, $WT_IMAGES; //if ($element_id=="DEAT_PLAC") return; // known bug - waiting for a patch $plac_label = get_plac_label(); print "
"; $cols=40; print " \"\" "; print "
\n"; // subtags creation : _0 _1 _2 etc... $icountry=-1; $istate=-1; $icounty=-1; $icity=-1; for ($i=0; $i"; // Translate certain tags. The should be specified in english, as the gedcom file format is english. switch (strtolower($plac_label[$i])) { case 'country': echo i18n::translate('Country'); break; case 'state': echo i18n::translate('State'); break; case 'province': echo i18n::translate('Province'); break; case 'county': echo i18n::translate('County'); break; case 'city': echo i18n::translate('City'); break; case 'parish': echo i18n::translate('Parish'); break; default: echo $plac_label[$i]; break; } print "
"; print "\n"; // country selector if ($i==$icountry) { print " \"\" "; print "\n"; } else { print_specialchar_link($subtagid, false); } // clickable map if ($i<$icountry or $i>$icounty) print "
\n"; else print "
"; } print "
"; } /** * get the URL to link to a place * @string a url that can be used to link to placelist */ function get_place_url($gedcom_place) { global $GEDCOM; $exp = explode(",", $gedcom_place); $level = count($exp); $url = "placelist.php?action=show&level=".$level; for ($i=0; $i<$level; $i++) { $url .= "&parent[".$i."]=".trim($exp[$level-$i-1]); } $url .= "&ged=".$GEDCOM; return $url; } /** * get the first part of a place record * @param string $gedcom_place The original place to shorten * @return string a shortened version of the place */ function get_place_short($gedcom_place) { global $GEDCOM, $SHOW_LIST_PLACES; if ($SHOW_LIST_PLACES==9) { return $gedcom_place; } $gedcom_place = trim($gedcom_place, " ,"); $exp = explode(",", $gedcom_place); $place = ""; for($i=0; $i<$SHOW_LIST_PLACES && $i0) $place .= ", "; $place.=trim($exp[$i]); } return $place; } /** * get the last part of a place record * @param string $gedcom_place The original place to country * @return string a country version of the place */ function getPlaceCountry($gedcom_place) { global $GEDCOM; $gedcom_place = trim($gedcom_place, " ,"); $exp = explode(",", $gedcom_place); $place = trim($exp[count($exp)-1]); return $place; } ?>