From a13283e39db3d542663f89bb67dcc6cc7b576b5c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 26 Aug 2011 10:09:23 +0000 Subject: [PATCH] backported r33878, r33880 from Nathan to display supported fileformats in addressbook prefs --- addressbook/inc/class.addressbook_hooks.inc.php | 4 ++-- etemplate/inc/class.bo_merge.inc.php | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index c113c0129d..d240cebc05 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -258,7 +258,7 @@ class addressbook_hooks 'name' => 'default_document', 'help' => lang('If you specify a document (full vfs path) here, addressbook displays an extra document icon for each address. That icon allows to download the specified document with the contact data inserted.').' '. lang('The document can contain placeholder like $$n_fn$$, to be replaced with the contact data (%1full list of placeholder names%2).','','').' '. - lang('At the moment the following document-types are supported:').'*.rtf, *.txt', + lang('At the moment the following document-types are supported:'). implode(',',bo_merge::get_file_extensions()), 'run_lang' => false, 'xmlrpc' => True, 'admin' => False, @@ -270,7 +270,7 @@ class addressbook_hooks 'name' => 'document_dir', 'help' => lang('If you specify a directory (full vfs path) here, addressbook displays an action for each document. That action allows to download the specified document with the contact data inserted.').' '. lang('The document can contain placeholder like $$n_fn$$, to be replaced with the contact data (%1full list of placeholder names%2).','','').' '. - lang('At the moment the following document-types are supported:').'*.rtf, *.txt', + lang('At the moment the following document-types are supported:'). implode(',',bo_merge::get_file_extensions()), 'run_lang' => false, 'xmlrpc' => True, 'admin' => False, diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index df66f0a67e..76e2326000 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -734,4 +734,11 @@ abstract class bo_merge } return etemplate::number_format($number,$num_decimal_places); } + + /** + * Get a list of supported extentions + */ + public static function get_file_extensions() { + return array('txt', 'rtf', 'odt', 'ods', 'docx', 'xml'); + } }