X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FI18n.php;h=c7ea606ba2dfff433d3076833342b494df8021a3;hb=a3aee94f26d113c118d2fc75eea8a75fa99d8098;hp=82add7470fe118772c024e0cbf834fdc00c9ba89;hpb=0a64b995e8c2a7c7344cc8579255f656389b9b4d;p=Pman.Core diff --git a/DataObjects/I18n.php b/DataObjects/I18n.php index 82add747..c7ea606b 100644 --- a/DataObjects/I18n.php +++ b/DataObjects/I18n.php @@ -7,7 +7,7 @@ * It should eventually replace most of that.. * */ -require_once 'DB/DataObject.php'; +class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php'; class Pman_Core_DataObjects_I18n extends DB_DataObject { @@ -131,6 +131,10 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject "); } + + if (!empty($q['!code'])) { + $this->whereAddIn('!lkey', explode(',', $q['!code']), 'string'); + } if (!empty($q['query']['name'])) { //DB_DAtaObject::debugLevel(1); $v = strtoupper($this->escape($q['query']['name'])); @@ -147,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) {