From 9f6c1c1994be543f75d28e963352b6142447c5b9 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 28 Sep 2010 20:53:00 +0000 Subject: [PATCH] Add a parameter to allow an extra 'Custom' country option when using 2 letter codes --- etemplate/inc/class.select_widget.inc.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/etemplate/inc/class.select_widget.inc.php b/etemplate/inc/class.select_widget.inc.php index 693709714b..5169a85f59 100644 --- a/etemplate/inc/class.select_widget.inc.php +++ b/etemplate/inc/class.select_widget.inc.php @@ -139,15 +139,17 @@ class select_widget ); break; - case 'select-country': // #Row|Extralabel,1=use country name, 0=use 2 letter-code - $cell['sel_options'] = $GLOBALS['egw']->country->countries(); - + case 'select-country': // #Row|Extralabel,1=use country name, 0=use 2 letter-code,custom country field name + $cell['sel_options'] = ($type == 0 && $type2 ? array('-custom-' => lang('Custom')) : array()) + $GLOBALS['egw']->country->countries(); if (($extension_data['country_use_name'] = $type) && $value) { $value = $GLOBALS['egw']->country->country_code($value); if (!isset($cell['sel_options'][$value])) { - $cell['sel_options'][$value] = $value; + if($type2) + { + $cell['sel_options'][$value] = $value; + } } } $cell['no_lang'] = True;