private static function loadHolidaysSettings() { global $AppUI; if (is_null(self::$holiday_manual)) { // Query database for settings $q = new w2p_Database_Query(); $q->addTable("holiday_settings"); $q->addQuery("holiday_manual, holiday_auto, holiday_driver, holiday_filter"); $settings = $q->loadHash(); self::$holiday_manual = $settings['holiday_manual']; self::$holiday_auto = $settings['holiday_auto']; self::$holiday_driver = $settings['holiday_driver']; self::$holiday_filter = $settings['holiday_filter']; } if (self::$holiday_auto && self::$holiday_filter >= 0 && is_null(self::$holiday_filter_instance)) { $filters_alloc = Date_Holidays::getInstalledFilters(); require_once dirname(__FILE__) . "/PEAR/Holidays/Filter/" . str_replace("_", "/", $filters_alloc[self::$holiday_filter]['title']) . ".php"; $filterclass = "Date_Holidays_Filter_" . $filters_alloc[self::$holiday_filter]['title']; self::$holiday_filter_instance = new $filterclass(); } if (self::$holiday_auto && self::$holiday_driver >= 0 && is_null(self::$holiday_driver_instance)) { $drivers_alloc = Date_Holidays::getInstalledDrivers(); self::$holiday_driver_instance = Date_Holidays::factory($drivers_alloc[self::$holiday_driver]['title'], null, $AppUI->user_locale); } }