mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-15 04:24:41 +01:00
Formatting
This commit is contained in:
parent
6c8ce90ce0
commit
6422885811
@ -26,18 +26,25 @@
|
||||
|
||||
class translation
|
||||
{
|
||||
function translate($key, $vars=false )
|
||||
function translate($key, $vars=False)
|
||||
{
|
||||
if(!$vars)
|
||||
{
|
||||
$vars = array();
|
||||
}
|
||||
$ret = $key;
|
||||
// check also if $GLOBALS['lang'] is a array
|
||||
// php-nuke and postnuke are using $GLOBALS['lang'] too
|
||||
// as string
|
||||
// this makes many problems
|
||||
if (!isset($GLOBALS['lang']) || !$GLOBALS['lang'] || !is_array($GLOBALS['lang']))
|
||||
/*
|
||||
Check also if $GLOBALS['lang'] is a array.
|
||||
php-nuke and postnuke are using $GLOBALS['lang'], too,
|
||||
as string.
|
||||
This makes many problems.
|
||||
*/
|
||||
|
||||
if(isset($GLOBALS['lang'][strtolower($key)]) && $GLOBALS['lang'][strtolower($key)])
|
||||
{
|
||||
$ret = $GLOBALS['lang'][strtolower($key)];
|
||||
}
|
||||
elseif(!isset($GLOBALS['lang']) || !$GLOBALS['lang'] || !is_array($GLOBALS['lang']))
|
||||
{
|
||||
$GLOBALS['lang'] = array();
|
||||
if(isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) &&
|
||||
@ -49,16 +56,17 @@
|
||||
{
|
||||
$userlang = 'en';
|
||||
}
|
||||
$sql = "select message_id,content from lang where lang like '".$userlang."' ".
|
||||
"and (app_name like '".$GLOBALS['phpgw_info']['flags']['currentapp']."' or app_name like 'common' or app_name like 'all')";
|
||||
$sql = "SELECT message_id,content FROM lang WHERE lang LIKE '" . $userlang
|
||||
. "' AND (app_name LIKE '" . $GLOBALS['phpgw_info']['flags']['currentapp']
|
||||
. "' OR app_name LIKE 'common' OR app_name LIKE 'all')";
|
||||
|
||||
if (strcasecmp ($GLOBALS['phpgw_info']['flags']['currentapp'], 'common')>0)
|
||||
{
|
||||
$sql .= ' order by app_name asc';
|
||||
$sql .= ' ORDER BY app_name ASC';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= ' order by app_name desc';
|
||||
$sql .= ' ORDER BY app_name DESC';
|
||||
}
|
||||
|
||||
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
|
||||
@ -69,15 +77,9 @@
|
||||
$GLOBALS['lang'][strtolower($GLOBALS['phpgw']->db->f('message_id'))] = $GLOBALS['phpgw']->db->f('content');
|
||||
$GLOBALS['phpgw']->db->next_record();
|
||||
}
|
||||
$ret = $GLOBALS['lang'][strtolower($key)] ? $GLOBALS['lang'][strtolower($key)] : $key . '*';
|
||||
}
|
||||
if (isset($GLOBALS['lang'][strtolower ($key)]) && $GLOBALS['lang'][strtolower ($key)])
|
||||
{
|
||||
$ret = $GLOBALS['lang'][strtolower ($key)];
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret = $key . '*';
|
||||
}
|
||||
|
||||
$ndx = 1;
|
||||
while(list($key,$val) = each($vars))
|
||||
{
|
||||
@ -89,9 +91,11 @@
|
||||
|
||||
function add_app($app)
|
||||
{
|
||||
// post-nuke and php-nuke are using $GLOBALS['lang'] too
|
||||
// but not as array!
|
||||
// this produces very strange results
|
||||
/*
|
||||
post-nuke and php-nuke are using $GLOBALS['lang'], too.
|
||||
But not as array!
|
||||
This produces very strange results.
|
||||
*/
|
||||
if(!is_array($GLOBALS['lang']))
|
||||
{
|
||||
$GLOBALS['lang'] = array();
|
||||
@ -105,7 +109,7 @@
|
||||
{
|
||||
$userlang = 'en';
|
||||
}
|
||||
$sql = "select message_id,content from lang where lang like '".$userlang."' and app_name like '".$app."'";
|
||||
$sql = "SELECT message_id,content FROM lang WHERE lang LIKE '".$userlang."' AND app_name LIKE '".$app."'";
|
||||
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
|
||||
$GLOBALS['phpgw']->db->next_record();
|
||||
$count = $GLOBALS['phpgw']->db->num_rows();
|
||||
|
Loading…
Reference in New Issue
Block a user