propagate data from settings hook to handlers, to fix failed installs because setup was not detected

This commit is contained in:
Ralf Becker 2012-02-14 17:38:45 +00:00
parent 2ba0b31c43
commit 2939d7bbf3
5 changed files with 24 additions and 24 deletions

View File

@ -868,15 +868,13 @@ class addressbook_groupdav extends groupdav_handler
/**
* Return appliction specific settings
*
* return array of array with settings
* @param array $hook_data
* @return array of array with settings
*/
static function get_settings()
static function get_settings($hook_data)
{
if ($hook_data['setup'])
{
$addressbooks = array();
}
else
$addressbooks = array();
if (!isset($hook_data['setup']))
{
$user = $GLOBALS['egw_info']['user']['account_id'];
$addressbook_bo = new addressbook_bo();

View File

@ -1252,15 +1252,13 @@ class calendar_groupdav extends groupdav_handler
/**
* Return appliction specific settings
*
* return array of array with settings
* @param array $hook_data
* @return array of array with settings
*/
static function get_settings()
static function get_settings($hook_data)
{
if ($hook_data['setup'])
{
$calendars = array();
}
else
$calendars = array();
if (!isset($hook_data['setup']))
{
$user = $GLOBALS['egw_info']['user']['account_id'];
$cal_bo = new calendar_bo();

View File

@ -610,20 +610,23 @@ class infolog_groupdav extends groupdav_handler
/**
* Return appliction specific settings
*
* return array of array with settings
* @param array $hook_data
* @return array of array with settings
*/
static function get_settings()
static function get_settings($hook_data)
{
translation::add_app('infolog');
$infolog = new infolog_bo();
if (!($types = $infolog->enums['type']))
if (!isset($hook_data['setup']))
{
translation::add_app('infolog');
$infolog = new infolog_bo();
$types = $infolog->enums['type'];
}
if (!isset($types))
{
$types = array(
'task' => 'Tasks',
);
}
$settings = array();
$settings['infolog-types'] = array(
'type' => 'multiselect',

View File

@ -498,9 +498,10 @@ abstract class groupdav_handler
/**
* Return appliction specific settings
*
* return array of array with settings
* @param array $hook_data
* @return array of array with settings
*/
static function get_settings()
static function get_settings($hook_data)
{
return array();
}

View File

@ -65,7 +65,7 @@ class groupdav_hooks
$class_name = $app.'_groupdav';
if (class_exists($class_name, true))
{
$settings += call_user_func(array($class_name,'get_settings'));
$settings += call_user_func(array($class_name,'get_settings'), $hook_data);
}
}