resources: allow to retrieve the elements of the resources sidebox calendar elements only and not as full html

This commit is contained in:
Klaus Leithoff 2010-10-13 07:15:09 +00:00
parent a104512988
commit 0aaf531ec7

View File

@ -479,7 +479,7 @@ class ui_resources
* get data für calendar sidebox
*
* @author Lukas Weiss <wnz_gh05t@users.sourceforge.net>
* @param array $param with keys menuaction, owner and optional date
* @param array $param with keys menuaction, owner and optional date and return_array
* @return array with: label=>link or array with text
*/
function get_calendar_sidebox($param)
@ -487,6 +487,12 @@ class ui_resources
$cats = $this->bo->acl->get_cats(EGW_ACL_READ);
if (!$cats) return array();
if(array_key_exists('return_array', $param))
{
$return_array = $param['return_array'];
unset($param['return_array']);
}
$owners = explode(',',$param['owner']);
unset($param['owner']);
$res_cats = $selected = array();
@ -529,6 +535,8 @@ class ui_resources
$resources['r'.$data['res_id']] = $data['name'];
}
}
if(!isset($return_array))
{
$selectbox = html::select(
'owner',
$selected,
@ -546,5 +554,10 @@ class ui_resources
)
);
}
else
{
return array_merge($resources,$res_cats);
}
}
}