Set default export definition

This commit is contained in:
Nathan Gray 2011-03-21 16:06:16 +00:00
parent 6da2289f8e
commit b356e6fbee

View File

@ -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;