2010-10-20 01:30:16 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* EGroupware: GroupDAV hooks: eg. preferences
|
|
|
|
*
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @package api
|
|
|
|
* @subpackage groupdav
|
|
|
|
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
2012-02-10 09:58:08 +01:00
|
|
|
* @copyright (c) 2010-12 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
2010-10-20 01:30:16 +02:00
|
|
|
* @version $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GroupDAV hooks: eg. preferences
|
|
|
|
*/
|
|
|
|
class groupdav_hooks
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Show GroupDAV preferences link in preferences
|
2010-10-31 08:56:29 +01:00
|
|
|
*
|
2010-10-20 01:30:16 +02:00
|
|
|
* @param string|array $args
|
|
|
|
*/
|
|
|
|
public static function menus($args)
|
|
|
|
{
|
|
|
|
$appname = 'groupdav';
|
|
|
|
$location = is_array($args) ? $args['location'] : $args;
|
|
|
|
|
|
|
|
if ($location == 'preferences')
|
|
|
|
{
|
|
|
|
$file = array(
|
|
|
|
'Preferences' => egw::link('/index.php','menuaction=preferences.uisettings.index&appname='.$appname),
|
|
|
|
);
|
|
|
|
if ($location == 'preferences')
|
|
|
|
{
|
|
|
|
display_section($appname,$file);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
display_sidebox($appname,lang('Preferences'),$file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-10-31 08:56:29 +01:00
|
|
|
|
2010-10-20 01:30:16 +02:00
|
|
|
/**
|
|
|
|
* populates $settings for the preferences
|
|
|
|
*
|
|
|
|
* @param array|string $hook_data
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
static function settings($hook_data)
|
|
|
|
{
|
|
|
|
$settings = array();
|
|
|
|
|
|
|
|
if ($hook_data['setup'])
|
|
|
|
{
|
2012-02-10 12:27:26 +01:00
|
|
|
$apps = array('addressbook','calendar','infolog');
|
2010-10-20 01:30:16 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-02-10 12:27:26 +01:00
|
|
|
$apps = array_keys($GLOBALS['egw_info']['user']['apps']);
|
2010-10-20 01:30:16 +02:00
|
|
|
}
|
2012-02-10 12:27:26 +01:00
|
|
|
foreach($apps as $app)
|
2012-02-10 09:53:50 +01:00
|
|
|
{
|
2012-02-10 12:27:26 +01:00
|
|
|
$class_name = $app.'_groupdav';
|
|
|
|
if (class_exists($class_name, true))
|
2012-02-10 09:53:50 +01:00
|
|
|
{
|
2012-02-10 12:27:26 +01:00
|
|
|
$settings += call_user_func(array($class_name,'get_settings'));
|
2012-02-10 09:53:50 +01:00
|
|
|
}
|
|
|
|
}
|
2011-11-06 10:40:33 +01:00
|
|
|
|
2010-10-31 08:56:29 +01:00
|
|
|
$settings['debug_level'] = array(
|
|
|
|
'type' => 'select',
|
|
|
|
'label' => 'Debug level for Apache/PHP error-log',
|
|
|
|
'name' => 'debug_level',
|
|
|
|
'help' => 'Enables debug-messages to Apache/PHP error-log, allowing to diagnose problems on a per user basis.',
|
|
|
|
'values' => array(
|
2011-11-23 17:37:43 +01:00
|
|
|
'0' => 'Off',
|
|
|
|
'r' => 'Requests and truncated responses',
|
2011-11-24 13:21:02 +01:00
|
|
|
'f' => 'Requests and full responses to files directory',
|
2011-11-23 17:37:43 +01:00
|
|
|
'1' => 'Debug 1 - function calls',
|
|
|
|
'2' => 'Debug 2 - more info',
|
|
|
|
'3' => 'Debug 3 - complete $_SERVER array',
|
2010-10-31 08:56:29 +01:00
|
|
|
),
|
|
|
|
'xmlrpc' => true,
|
|
|
|
'admin' => false,
|
|
|
|
'default' => '0',
|
|
|
|
);
|
2010-10-20 01:30:16 +02:00
|
|
|
return $settings;
|
|
|
|
}
|
|
|
|
}
|