Pman/Images.php
[Pman.Base] / Pman / I18N.php
index b2a5492..39ceee4 100644 (file)
@@ -1,32 +1,14 @@
 <?php
 
 /// provide language data!!!
-// THIS IS PUBLICALLY ACCESSABLE..
+// DEPRECIATED - moved to Pman_I18N
 /**
- * 
- * Either we load this as a standard array at start??
- * eg. after login...
- * 
- * or we treat it like a regular pulldown... - on demand...
- * 
- * big snag is that we can not include these until the user has specified their interface language.
- * 
- * If we do a global jS array?
- * Pman.Lang.en = [ 'en' , 'English']
- * 
- * If we do a standard 'store' version..
- * { total:  x, data [ { code: 'en', title: 'English' }] }
- * 
- * 
- * usage:
- * 
- * index.php/Pman/I18N/BuildDB -- buildes the database..
  * 
  * 
  */
 
-require_once 'Pman.php';
-class Pman_I18N extends Pman
+require_once 'Pman/Core/I18n.php';
+class Pman_I18N extends Pman_Core_I18n
 {
     
     // these are the languages we support.
@@ -72,7 +54,7 @@ class Pman_I18N extends Pman
                 $this->cfg[$k] = $this->getDefaultCfg($k);
                 continue;
             }
-            $this->cfg[$k] = explode(',', $v);
+            $this->cfg[$k] = is_array($v) ? $v  : explode(',', $v);
         }
         
         
@@ -205,7 +187,8 @@ class Pman_I18N extends Pman
              case 'Currency':
                 $ret = $this->getList('m', $lbits[0],empty($_REQUEST['filter']) ? false : $_REQUEST['filter']);
                 break;
-              
+            // part of parent!!!!
+            /*
             case 'BuildDB':
             // by admin only?!?
                 //DB_DataObject::debugLevel(1);
@@ -214,7 +197,7 @@ class Pman_I18N extends Pman
                 $this->buildDb('m');
                 die("DONE!");
                 break;
-                  
+            */      
             default: 
                 $this->jerr("ERROR");
         }
@@ -329,43 +312,6 @@ class Pman_I18N extends Pman
         
     }
     
-    
-    
-    function buildDB($ltype= false, $inlang= false )
-    {
-        if ($ltype === false) {
-            
-            die("OOPS NO LTYPE");
-        }
-        
-        if ($inlang === false) {
-            foreach( $this->cfg['l'] as $l) {
-                $this->buildDB($ltype, $l);
-            }
-            return;
-        }
-        
-        $list = $this->cfg[$ltype];
-        DB_DataObject::debugLevel(1);
-        foreach($list as $lkey) {
-            $x = DB_DataObject::factory('i18n');
-            $x->ltype = $ltype;
-            $x->lkey = $lkey;
-            $x->inlang= $inlang;
-            if ($x->find(true)) {
-                $xx= clone($x);
-                $x->lval = $this->translate($inlang, $ltype, $lkey);
-                $x->update($xx);
-                continue;
-            }
-            $x->lval = $this->translate($inlang, $ltype, $lkey);
-            $x->insert();
-            
-        }
-        
-        
-        
-        
-    }
+     
     
 }