From 6da2289f8e1d6fba1ea5ea1515a0b40a60e87aeb Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 21 Mar 2011 15:58:08 +0000 Subject: [PATCH] Set default export definition --- addressbook/inc/class.addressbook_hooks.inc.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index 48911c75a8..ff036b7d12 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -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;