X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FI18n.php;h=709f6cad2e6d342e8186a3d6ed7e570d245e2ca0;hb=696acb656788cd22a74e06a7c6690070e52e2fab;hp=6e72f41f6d485e424d0f89700377eb77c7546a39;hpb=aee8b654c18424cc1a19600e5bf7acbd66adeed0;p=Pman.Core diff --git a/DataObjects/I18n.php b/DataObjects/I18n.php index 6e72f41f..709f6cad 100644 --- a/DataObjects/I18n.php +++ b/DataObjects/I18n.php @@ -74,7 +74,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject // BC compatible.. if any of these are set, then we use them as the settings.. $opts = array(); - foreach(array('Pman_Core_I18N', 'Pman_I18N','Pman_I18n') as $pk) { + foreach(array('Pman_Core_I18n', 'Pman_Core_I18N', 'Pman_I18N','Pman_I18n') as $pk) { if (isset($ff->$pk)) { //var_dump($pk); $opts = $ff->$pk; @@ -84,7 +84,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject //echo '
';print_R($opts);//exit;
         
          
-       //  var_dump($opts);exit;
+        // var_dump($opts);exit;
         
         $i = DB_DataObject::Factory('I18n');
         // load the cofiguration
@@ -101,7 +101,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
         foreach($opts as $k=>$v) {
             
             if ($v == '*') { // everything..
-                 self::$cfg[$k] = $i->availableCodes($k, false);
+                self::$cfg[$k] = '*'; //$i->availableCodes($k, false);
                 continue;
             }
            
@@ -138,8 +138,9 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
         if (!empty($q['_filtered']) && !empty($this->ltype)) {
             $cfg = $this->cfg();
             $filter = $cfg[$this->ltype];
-            $this->whereAddIn('lkey', $filter, 'string'); 
-            
+            if(is_array($filter)){
+                $this->whereAddIn('lkey', $filter, 'string'); 
+            }
             
         }
     }
@@ -199,7 +200,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
     {
         $ret = array();
         $cfg = $this->cfg();
-        echo '
';print_r($cfg);
+        //echo '
';print_r($cfg);
         switch ($t) {
             case 'c':
                 require_once 'I18Nv2/Country.php';
@@ -248,6 +249,15 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
                 }
                 $ret[] = '**';
                 break;
+            case 't':
+                require_once 'I18Nv2/PhonePrefix.php';
+                $c = new I18Nv2_PhonePrefix('en');
+                $ret =  array_keys($c->codes);
+                if (!empty($cfg['add_t'])) {
+                    $ret = array_merge($ret, array_keys($cfg['add_m']));
+                }
+                $ret[] = '**';
+                break;
         }
         
         
@@ -279,6 +289,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
             $this->buildDB('c');
             $this->buildDB('l');
             $this->buildDB('m');
+            $this->buildDB('t');
             return;
         }