second (optional) param. to add_app to specify the language

This commit is contained in:
Ralf Becker 2003-09-15 08:42:47 +00:00
parent 582faaec62
commit 43024ba1cc

View File

@ -78,17 +78,19 @@
return $ret; return $ret;
} }
function add_app($app) function add_app($app,$lang=False)
{ {
if (!isset($this->loaded_apps[$app])) $lang = $lang ? $lang : $this->userlang;
if (!isset($this->loaded_apps[$app]) || $this->loaded_apps[$app] != $lang)
{ {
$sql = "select message_id,content from phpgw_lang where lang='".$this->userlang."' and app_name='".$app."'"; $sql = "select message_id,content from phpgw_lang where lang='".$lang."' and app_name='".$app."'";
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__); $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
while ($GLOBALS['phpgw']->db->next_record()) while ($GLOBALS['phpgw']->db->next_record())
{ {
$GLOBALS['lang'][strtolower ($GLOBALS['phpgw']->db->f('message_id'))] = $GLOBALS['phpgw']->db->f('content'); $GLOBALS['lang'][strtolower ($GLOBALS['phpgw']->db->f('message_id'))] = $GLOBALS['phpgw']->db->f('content');
} }
$this->loaded_apps[$app] = $this->userlang; $this->loaded_apps[$app] = $lang;
} }
} }