mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-28 10:53:39 +01:00
add missing is_global function
This commit is contained in:
parent
5f99cac425
commit
312c782961
@ -668,6 +668,20 @@ class categories
|
||||
return $cache[$cat['cat_name']] = (int) $cats[0]['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if catgory is global (owner <= 0 || appname == 'phpgw')
|
||||
*
|
||||
* @param int|array $cat
|
||||
* @return boolean
|
||||
*/
|
||||
static function is_global($cat)
|
||||
{
|
||||
if (!is_array($cat) && !($cat = self::read($cat))) return null; // cat not found
|
||||
|
||||
return $cat['owner'] <= self::GLOBAL_ACCOUNT || $cat['appname'] == self::GLOBAL_APPNAME;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* return category information for a given id
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user