+ function transToList($ltype, $inlang)
+ {
+
+ $x = DB_DataObject::factory('i18n');
+ $x->ltype = $ltype;
+ $x->inlang= $inlang;
+ $x->selectAdd();
+ $x->selectAdd('lkey as code, lval as title');
+ $x->find();
+ $ret = array();
+ while ($x->fetch()) {
+ $ret[] = array('code' => $x->code, 'title' =>$x->title);
+ }
+
+ }
+
+ function objToList($type, $obj) {
+ $ret = array();
+
+
+ foreach($this->cfg[$type] as $k) {
+ $sub = false;
+
+ if (strpos($k, '_') !== false) {
+ $bits = explode('_', $k);
+ $k = array_shift($bits);
+ $sub = array_shift($bits);
+ }
+ $v = $k == '**' ? 'Other' : $obj->getName($k);
+
+ if ($sub) {
+ $v .= ' ('.$sub.')';
+ }
+
+ $ret[] = array(
+ 'code'=> ($type=='l' ? strtolower($k) : strtoupper($k)) . ($sub ? '_'.strtoupper($sub) : ''),
+ 'title' => $v
+ );
+ }
+ return $ret;
+ }
+