X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FI18n.php;h=d59015fa2979483366baa5c8c305e849b349c498;hb=eee01eed2776c31e6b3562ba2ffc20f0cba58d17;hp=0cb720ceaa819f10819fa76978212e51b03efdea;hpb=97c2c580d8c119af767e6065d011fe67b0ec0d64;p=Pman.Core diff --git a/DataObjects/I18n.php b/DataObjects/I18n.php index 0cb720ce..d59015fa 100644 --- a/DataObjects/I18n.php +++ b/DataObjects/I18n.php @@ -68,34 +68,45 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject if ($loaded) { return self::$cfg; } + $loaded =true; $ff= HTML_FlexyFramework::get(); // 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; + $opts = $ff->$pk; break; } } - //print_R($opts); + //echo '
';print_R($opts);//exit;
         
          
-       //  var_dump($opts);exit;
+        // var_dump($opts);exit;
         
         $i = DB_DataObject::Factory('I18n');
         // load the cofiguration
         foreach($opts as $k=>$v) {
             
             if ($v == '*') { // everything..
-                self::$cfg[$k] = $i->availableCodes($k, false);
+               // self::$cfg[$k] = $i->availableCodes($k, false);
                 continue;
             }
+             
             self::$cfg[$k] = is_array($v) ? $v  : explode(',', $v);
         }
-        //print_R(self::$cfg);
+        // available codes recursively calls this... -- so the above has to be set first..
+        foreach($opts as $k=>$v) {
+            
+            if ($v == '*') { // everything..
+                self::$cfg[$k] = '*'; //$i->availableCodes($k, false);
+                continue;
+            }
+           
+        }
+        
         
         return self::$cfg;
         
@@ -188,7 +199,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
     {
         $ret = array();
         $cfg = $this->cfg();
-
+        //echo '
';print_r($cfg);
         switch ($t) {
             case 'c':
                 require_once 'I18Nv2/Country.php';
@@ -203,7 +214,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
                  
                 
                 $ret[] = '**';
-                //print_r($ret);
+                //echo '
';print_R($cfg); print_r($ret); exit;
                 break;
             
             case 'l':
@@ -296,7 +307,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
         $complete = $x->fetchAll('lkey');
         
         $list =  $this->availableCodes($ltype);
-       echo '
'; print_r($list); 
+        //echo '
'; print_r($list); 
         
         foreach($list as $lkey) {
             // skip ones we know we have done...