X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FI18n.php;h=c7ea606ba2dfff433d3076833342b494df8021a3;hb=0e5308c605bf1edf392e6e3f4dd6d14fc7ffd3ac;hp=a94eeb35bd48687353a3d39a9d094c536063432c;hpb=3931008d3141f5b827b9b7fbb69ba01ba8f905a2;p=Pman.Core diff --git a/DataObjects/I18n.php b/DataObjects/I18n.php index a94eeb35..c7ea606b 100644 --- a/DataObjects/I18n.php +++ b/DataObjects/I18n.php @@ -131,6 +131,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject "); } + if (!empty($q['!code'])) { $this->whereAddIn('!lkey', explode(',', $q['!code']), 'string'); } @@ -150,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) {