add missing is_global function

This commit is contained in:
Klaus Leithoff 2010-02-05 09:13:30 +00:00
parent 5f99cac425
commit 312c782961

View File

@ -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
*