Index: openacs-4/packages/acs-lang/tcl/locale-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/locale-procs.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/acs-lang/tcl/locale-procs.tcl 15 Oct 2003 11:21:53 -0000 1.22 +++ openacs-4/packages/acs-lang/tcl/locale-procs.tcl 21 Oct 2003 13:55:05 -0000 1.23 @@ -183,6 +183,23 @@ return [util_memoize [list lang::system::get_locales_not_cached]] } +ad_proc -public lang::system::locale_set_enabled { + {-locale:required} + {-enabled_p:required} +} { + Enables or disables a locale. + + @param enabled_p Should be t or f + + @author Peter Marklund +} { + db_dml set_enabled_p { update ad_locales set enabled_p = :enabled_p where locale = :locale } + + # Flush caches + util_memoize_flush_regexp {^lang::util::default_locale_from_lang_not_cached} + util_memoize_flush_regexp {^lang::system::get_locales} +} + ad_proc -private lang::system::get_locales_not_cached {} { Return all enabled locales in the system. Index: openacs-4/packages/acs-lang/www/admin/locale-set-enabled-p.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/locale-set-enabled-p.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-lang/www/admin/locale-set-enabled-p.tcl 10 Sep 2003 15:01:54 -0000 1.4 +++ openacs-4/packages/acs-lang/www/admin/locale-set-enabled-p.tcl 21 Oct 2003 13:55:05 -0000 1.5 @@ -10,11 +10,9 @@ enabled_p:boolean } -db_dml set_enabled_p { update ad_locales set enabled_p = :enabled_p where locale = :locale } +lang::system::locale_set_enabled \ + -locale $locale \ + -enabled_p $enabled_p -# Flush caches -util_memoize_flush_regexp {^lang::util::default_locale_from_lang_not_cached} -util_memoize_flush_regexp {^lang::system::get_locales} - ad_returnredirect . ad_script_abort