Index: openacs-4/packages/categories/tcl/categories-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/categories-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/categories/tcl/categories-procs.tcl 18 Feb 2004 18:40:08 -0000 1.16 +++ openacs-4/packages/categories/tcl/categories-procs.tcl 19 Apr 2004 16:24:22 -0000 1.17 @@ -20,6 +20,7 @@ {-deprecated_p "f"} {-user_id ""} {-creation_ip ""} + -noflush:boolean } { Insert a new category. The same translation will be added in the default language if it's in a different language. @@ -33,6 +34,9 @@ @option parent_id id of the parent category. "" if top level category. @option user_id user that adds the category. [ad_conn user_id] used by default. @option creation_ip ip-address of the user that adds the category. [ad_conn peeraddr] used by default. + @option noflush defer calling category_tree::flush_cache (which if adding multiple categories to + a large tree can be very expensive). note that if you set this flag you must + call category_tree::flush_cache once the adds are complete. @return category_id @author Timo Hentschel (timo@timohentschel.de) } { @@ -50,9 +54,11 @@ set default_locale [ad_parameter DefaultLocale acs-lang "en_US"] if {$locale != $default_locale} { - db_exec_plsql insert_default_category "" + db_exec_plsql insert_default_category "" } - category_tree::flush_cache $tree_id + if {!$noflush_p} { + category_tree::flush_cache $tree_id + } flush_translation_cache $category_id } return $category_id @@ -100,7 +106,7 @@ category_id } { Deletes a category. - category_tree:flush_cache should be used afterwards. + category_tree::flush_cache should be used afterwards. @option batch_mode Indicates that the cache for category translations should not be flushed. Useful when deleting several Index: openacs-4/packages/categories/tcl/category-trees-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/category-trees-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/categories/tcl/category-trees-procs.tcl 1 Apr 2004 12:58:17 -0000 1.9 +++ openacs-4/packages/categories/tcl/category-trees-procs.tcl 19 Apr 2004 16:24:22 -0000 1.10 @@ -142,7 +142,8 @@ db_exec_plsql insert_default_tree "" } } - flush_translation_cache $tree_id + + flush_translation_cache $tree_id return $tree_id }