X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FI18n.php;h=c7ea606ba2dfff433d3076833342b494df8021a3;hb=a3aee94f26d113c118d2fc75eea8a75fa99d8098;hp=7a833b933a6de38c034415b3c535c545b1e597ee;hpb=e69d8df222fb3a4f7d30d5842b91c1bf40d90e46;p=Pman.Core diff --git a/DataObjects/I18n.php b/DataObjects/I18n.php index 7a833b93..c7ea606b 100644 --- a/DataObjects/I18n.php +++ b/DataObjects/I18n.php @@ -121,7 +121,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject function applyFilters($q, $au) { $this->buildDB(); - DB_DataObject::debugLevel(1); + //DB_DataObject::debugLevel(1); if (!empty($q['query']['_with_en'])) { $this->buildDB(); // ensure we have the full database... @@ -151,6 +151,23 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject } } + function lookupCode($inlang,$ltype,$name) + { + $x = DB_DataObject::factory('i18n'); + $x->ltype = $ltype; + $x->lval = $name; + $x->inlang= $inlang; + + $x->limit(1); + if ($x->find(true) && !empty($x->lkey)) { + return $x->lkey; + } + return ''; + + + } + + function translate($inlang,$ltype,$kval) {