From 938adaa78654756d19bd2dd0a364997bae9bb6a9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 3 Sep 2006 05:14:03 +0000 Subject: [PATCH] some sanatizing ;-) --- calendar/inc/class.holidaycalc.inc.php | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 calendar/inc/class.holidaycalc.inc.php diff --git a/calendar/inc/class.holidaycalc.inc.php b/calendar/inc/class.holidaycalc.inc.php new file mode 100755 index 0000000000..0583aafa27 --- /dev/null +++ b/calendar/inc/class.holidaycalc.inc.php @@ -0,0 +1,34 @@ + * + * http://www.itheart.com * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id$ */ + + if (empty($GLOBALS['egw_info']['user']['preferences']['common']['country']) || + strlen($GLOBALS['egw_info']['user']['preferences']['common']['country']) > 2) + { + $rule = 'US'; + } + else + { + $rule = $GLOBALS['egw_info']['user']['preferences']['common']['country']; + } + + $calc_include = EGW_INCLUDE_ROOT.'/calendar/inc/class.holidaycalc_'.$rule.'.inc.php'; + if(@file_exists($calc_include)) + { + include($calc_include); + } + else + { + include(EGW_INCLUDE_ROOT.'/calendar/inc/class.holidaycalc_US.inc.php'); + }