Set default export definition

This commit is contained in:
Nathan Gray 2011-03-21 15:58:08 +00:00
parent 60fea18906
commit 6da2289f8e

View File

@ -284,14 +284,20 @@ class addressbook_hooks
'application' => 'addressbook'
));
$options = array();
foreach ((array)$definitions->get_definitions() as $identifier) {
try {
$default_def = 'export-addressbook';
foreach ((array)$definitions->get_definitions() as $identifier)
{
try
{
$definition = new importexport_definition($identifier);
} catch (Exception $e) {
}
catch (Exception $e)
{
// permission error
continue;
}
if ($title = $definition->get_title()) {
if ($title = $definition->get_title())
{
$options[$title] = $title;
}
unset($definition);
@ -305,6 +311,7 @@ class addressbook_hooks
'run_lang' => false,
'xmlrpc' => True,
'admin' => False,
'default'=> isset($options[$default_def]) ? $default_def : false,
);
}
return $settings;