public static function defaultCountry($lang) { $countryXml = system::systemtext()->country; // look for default value $retArray = $countryXml->xpath("//country/*/{$lang}[@default='TRUE']"); // if no default, take first entry if (!count($retArray)) { $retArray = $countryXml->xpath("//country/*/{$lang}"); } if (count($retArray)) { $parent = $retArray[0]->xpath(".."); return $parent[0]->getName(); } }
public static function _($text, $lang = "") { $systemText = system::systemtext(); $textXml = $systemText->XPath("//{$text}"); return OLIVText::xml($textXml[0], $lang); }