php5 erroring on call to private function add() - moved to class function list_cals_add()

This commit is contained in:
Miles Lott 2004-02-20 15:14:29 +00:00
parent 2f32ca43b2
commit 9cff33854d

View File

@ -2886,14 +2886,8 @@
return $ret;
}
/*!
@function list_cals
@abstract generate list of user- / group-calendars for the selectbox in the header
@returns alphabeticaly sorted array with groups first and then users
*/
function list_cals()
{
function add($id,&$users,&$groups)
/* This is called only by list_cals(). It was moved here to remove fatal error in php5 beta4 */
function list_cals_add($id,&$users,&$groups)
{
$name = $GLOBALS['phpgw']->common->grab_owner_name($id);
if (($type = $GLOBALS['phpgw']->accounts->get_type($id)) == 'g')
@ -2910,22 +2904,30 @@
'name' => $name
);
}
/*!
@function list_cals
@abstract generate list of user- / group-calendars for the selectbox in the header
@returns alphabeticaly sorted array with groups first and then users
*/
function list_cals()
{
$users = $groups = array();
foreach($this->grants as $id => $rights)
{
add($id,$users,$groups);
$this->list_cals_add($id,$users,$groups);
}
if ($memberships = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']))
{
foreach($memberships as $group_info)
{
add($group_info['account_id'],$users,$groups);
$this->list_cals_add($group_info['account_id'],$users,$groups);
if ($account_perms = $GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar'))
{
foreach($account_perms as $id)
{
add($id,$users,$groups);
$this->list_cals_add($id,$users,$groups);
}
}
}