| 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 |
// |
// |
| 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"); |
| 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 |
|
|
| 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"); |
| 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>"; |
| 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); |
| 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 . "'"; |
| 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) { |