DataObjects/I18n.php
[Pman.Core] / DataObjects / I18n.php
index d33a6fd..b3c1730 100644 (file)
@@ -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']));
@@ -287,10 +291,10 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
         if ($ltype === false) {
             // trigger all builds.
             //DB_DataObject::debugLevel(1);
-//            $this->buildDB('c');
-//            $this->buildDB('l');
-//            $this->buildDB('m');
-            $this->buildDB('p');
+            $this->buildDB('c');
+            $this->buildDB('l');
+            $this->buildDB('m');
+            $this->buildDB('p', 'en');
             return;
         }
         
@@ -377,7 +381,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
                 'l' =>  new I18Nv2_Language($lang, 'UTF-8'),
                 'c' => new I18Nv2_Country($lang, 'UTF-8'),
                 'm' => new I18Nv2_Currency($lang, 'UTF-8'),
-                't' => new I18Nv2_PhonePrefix($lang, 'UTF-8')
+                'p' => new I18Nv2_PhonePrefix($lang, 'UTF-8')
             );
             //echo '<PRE>';print_r(array($lang, $cache[$lang]['c']));
         }