From b356e6fbee2bae9a8cc56753df9c49c6a62dc11d Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 21 Mar 2011 16:06:16 +0000 Subject: [PATCH] Set default export definition --- calendar/inc/class.calendar_hooks.inc.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index 3094471652..8bf0ba8508 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -619,18 +619,24 @@ class calendar_hooks 'application' => 'calendar' )); $options = array(); - foreach ((array)$definitions->get_definitions() as $identifier) { - try { + 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); } + $default_def = 'export-calendar-csv'; $settings['nextmatch-export-definition'] = array( 'type' => 'select', 'values' => $options, @@ -640,6 +646,7 @@ class calendar_hooks 'run_lang' => false, 'xmlrpc' => True, 'admin' => False, + 'default'=> isset($options[$default_def]) ? $default_def : false, ); } return $settings;