/[cvs]/nfo/php/libs/org.netfrag.flib/Application/l10n/LocaleText.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.flib/Application/l10n/LocaleText.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by joko, Thu Dec 19 10:30:06 2002 UTC revision 1.6 by joko, Sun Feb 9 17:33:54 2003 UTC
# Line 3  Line 3 
3  //    $Id$  //    $Id$
4  //    ------------------------------------------------------------------  //    ------------------------------------------------------------------
5  //    $Log$  //    $Log$
6    //    Revision 1.6  2003/02/09 17:33:54  joko
7    //    + minor update related to new log level constants
8    //
9  //    Revision 1.5  2002/12/19 10:30:06  joko  //    Revision 1.5  2002/12/19 10:30:06  joko
10  //    + argument 'newMode' for function getlt and function _getldsvar: let _getldsvar evaluate variable to still provide old behaviour/functionality  //    + argument 'newMode' for function getlt and function _getldsvar: let _getldsvar evaluate variable to still provide old behaviour/functionality
11  //  //
# Line 59  class LocaleText { Line 62  class LocaleText {
62    // ----------------------------------------------------    // ----------------------------------------------------
63    function LocaleText() {    function LocaleText() {
64    
     /*  
     // was:  
     global $cfg, $slt;  
     session_register_safe('slt');  
     $this->langs_avail = $cfg[GLBL_LANGSAVAIL];  
     $this->load();  
     */  
       
65      // look at the bottom of this file!!!      // look at the bottom of this file!!!
66      //$smarty->register_block("translate", "do_translation");      //$smarty->register_block("translate", "do_translation");
67      //$this->site->smarty->register_block("translate", "_do_translation");      //$this->site->smarty->register_block("translate", "_do_translation");
# Line 77  class LocaleText { Line 72  class LocaleText {
72    }    }
73    
74    function start() {    function start() {
75      global $cfg, $slt;      global $app, $slt;
76      session_register_safe('slt');      session_register_safe('slt');
77      $this->langs_avail = $cfg[GLBL_LANGSAVAIL];      $this->langs_avail = $app->getConfig("languages.available");
78      $this->load();      $this->load();
79    }    }
80    
# Line 113  class LocaleText { Line 108  class LocaleText {
108        return $langs_avail[0];        return $langs_avail[0];
109      }      }
110    }    }
111      
112      // TODO: refactor this to Data::Deep  
113    function _dbkey2ldskey($dbkey) {    function _dbkey2ldskey($dbkey) {
114      // TODO: log this      // TODO: log this
115      //dprint("dbkey: $dbkey");      //dprint("dbkey: $dbkey");
# Line 127  class LocaleText { Line 123  class LocaleText {
123      }      }
124    }    }
125        
126      // TODO: refactor this to Data::Deep  
127    function _getldsvar($ldskey, $tpl=array(), $newMode = 0) {    function _getldsvar($ldskey, $tpl=array(), $newMode = 0) {
128            
129  //print "ldskey: $ldskey<br>";  //print "ldskey: $ldskey<br>";
# Line 153  class LocaleText { Line 150  class LocaleText {
150      return $var_value;      return $var_value;
151    }    }
152        
153      // TODO: refactor this to Data::Deep  
154    function _setldsvar($ldskey, $val) {    function _setldsvar($ldskey, $val) {
155      $var_name = '$this->lds' . $ldskey;      $var_name = '$this->lds' . $ldskey;
156      $value_new = addslashes($val);      $value_new = addslashes($val);
# Line 164  class LocaleText { Line 162  class LocaleText {
162        
163    function _loadStructure_FromDb() {    function _loadStructure_FromDb() {
164      //global $site;      //global $site;
165      $this->site->log( get_class($this) . "->_loadStructure_FromDb loading language information", LOG_DEBUG);      $this->site->log( get_class($this) . "->_loadStructure_FromDb loading language information", PEAR_LOG_DEBUG);
166      //print "- loading structure from db ($this->langkey)<br>";      //print "- loading structure from db ($this->langkey)<br>";
167      //connectdb();      //connectdb();
168      $sql = "SELECT * FROM td_res_langtext WHERE countrykey='" . $this->langkey . "'";      $sql = "SELECT * FROM td_res_langtext WHERE countrykey='" . $this->langkey . "'";
# Line 176  class LocaleText { Line 174  class LocaleText {
174            $this->_loadStructure_FromDb_add($row["tkey"], $row["tval"]);            $this->_loadStructure_FromDb_add($row["tkey"], $row["tval"]);
175        }        }
176      }      }
177      $this->site->log( get_class($this) . "->_loadStructure_FromDb ready", LOG_DEBUG);      $this->site->log( get_class($this) . "->_loadStructure_FromDb ready", PEAR_LOG_DEBUG);
178    }    }
179        
180    function _loadStructure_FromDb_add($dbkey, $val) {    function _loadStructure_FromDb_add($dbkey, $val) {

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed