"added explicit init(false) calls for methods called by setup (they dont call init() as eGW does)"

This commit is contained in:
Ralf Becker 2009-04-21 13:26:40 +00:00
parent 3da8703202
commit a45c874f72

View File

@ -330,6 +330,8 @@ class translation
{ {
if (!is_array(self::$langs) || $force_read) if (!is_array(self::$langs) || $force_read)
{ {
if (is_null(self::$db)) self::init(false);
self::$langs = array(); self::$langs = array();
foreach(self::$db->select(self::LANG_TABLE,'DISTINCT lang,lang_name','lang = lang_id',__LINE__,__FILE__, foreach(self::$db->select(self::LANG_TABLE,'DISTINCT lang,lang_name','lang = lang_id',__LINE__,__FILE__,
false,'',false,0,','.self::LANGUAGES_TABLE) as $row) false,'',false,0,','.self::LANGUAGES_TABLE) as $row)
@ -548,10 +550,8 @@ class translation
*/ */
static function install_langs($langs,$upgrademethod='dumpold',$only_app=False) static function install_langs($langs,$upgrademethod='dumpold',$only_app=False)
{ {
if (is_null(self::$db)) if (is_null(self::$db)) self::init(false);
{
self::init(false);
}
@set_time_limit(0); // we might need some time @set_time_limit(0); // we might need some time
//echo "<p>translation_sql::install_langs(".print_r($langs,true).",'$upgrademthod','$only_app')</p>\n"; //echo "<p>translation_sql::install_langs(".print_r($langs,true).",'$upgrademthod','$only_app')</p>\n";
if (!isset($GLOBALS['egw_info']['server']) && $upgrademethod != 'dumpold') if (!isset($GLOBALS['egw_info']['server']) && $upgrademethod != 'dumpold')
@ -796,6 +796,8 @@ class translation
{ {
echo '<br>drop_langs(): Working on: ' . $appname; echo '<br>drop_langs(): Working on: ' . $appname;
} }
if (is_null(self::$db)) self::init(false);
if (self::$db->select(self::LANG_TABLE,'COUNT(*)',array( if (self::$db->select(self::LANG_TABLE,'COUNT(*)',array(
'app_name' => $appname 'app_name' => $appname
),__LINE__,__FILE__)->fetchColumn()) ),__LINE__,__FILE__)->fetchColumn())