mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
Use in_array()
This commit is contained in:
parent
ddfa5d9d4b
commit
bb762ae965
@ -519,7 +519,7 @@
|
||||
{
|
||||
$indexes[] = $val['index_name'];
|
||||
}
|
||||
if(isinarray($sOldTableName . '_pkey',$indexes))
|
||||
if(!in_array($sOldTableName . '_pkey',$indexes))
|
||||
{
|
||||
$oProc->m_odb->query("DROP INDEX " . $sOldTableName . "_pkey",__LINE__,__FILE__);
|
||||
}
|
||||
|
@ -171,7 +171,7 @@
|
||||
function add_langs($appname,$DEBUG=False,$force_en=False)
|
||||
{
|
||||
$langs = $this->get_langs($DEBUG);
|
||||
if($force_en && !isinarray('en',$langs))
|
||||
if($force_en && !@in_array('en',$langs))
|
||||
{
|
||||
$langs[] = 'en';
|
||||
}
|
||||
|
@ -48,23 +48,11 @@
|
||||
$this->add_app($appname,$lang);
|
||||
}
|
||||
|
||||
function isin_array($needle,$haystack)
|
||||
{
|
||||
while (list ($k,$v) = each($haystack))
|
||||
{
|
||||
if ($v == $needle)
|
||||
{
|
||||
return True;
|
||||
}
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
function translate($key, $vars=False)
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if (!$this->isin_array($GLOBALS['phpgw_info']['flags']['currentapp'],$this->loaded_apps) &&
|
||||
if (!@in_array($GLOBALS['phpgw_info']['flags']['currentapp'],$this->loaded_apps) &&
|
||||
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'home')
|
||||
{
|
||||
//echo '<br>loading app "' . $GLOBALS['phpgw_info']['flags']['currentapp'] . '" for the first time.';
|
||||
@ -79,7 +67,7 @@
|
||||
@ksort($GLOBALS['phpgw_info']['apps']);
|
||||
while(list($x,$app) = each($GLOBALS['phpgw_info']['apps']))
|
||||
{
|
||||
if (!$this->isin_array($app['name'],$this->loaded_apps))
|
||||
if (!@in_array($app['name'],$this->loaded_apps))
|
||||
{
|
||||
//echo '<br>loading app "' . $app['name'] . '" for the first time.';
|
||||
$this->add_app($app['name'],$lang);
|
||||
|
Loading…
Reference in New Issue
Block a user