Index: openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl 20 Mar 2004 11:04:39 -0000 1.1.1.1 +++ openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl 28 Dec 2005 17:55:43 -0000 1.1.1.1.2.1 @@ -183,7 +183,7 @@ $root insertBefore $pi $doc_node # Create a generator comment - set comment [$doc createComment " eenerated by the [ad_system_name] news aggregator. [ad_url] "] + set comment [$doc createComment " generated by the [ad_system_name] news aggregator. [ad_url] "] $root insertBefore $comment $doc_node # Fetch the aggregator information @@ -269,6 +269,7 @@ ad_proc -private news_aggregator::aggregator::set_user_default { {-user_id:required} + {-package_id:required} {-aggregator_id:required} } { Sets the user's default aggregator to aggregator_id. @@ -284,26 +285,46 @@ ad_proc -private news_aggregator::aggregator::user_default { {-user_id:required} + {-package_id:required} } { Returns the user's default aggregator, or 0 if none exists. @author Guan Yang (guan@unicast.org) @creation-date 2003-06-29 } { - set aggregator_id [db_string find_default {} -default 0] - - if { [string equal $aggregator_id "0"] } { - set aggregator_id [db_string lowest_aggregator ""] - if { [exists_and_not_null aggregator_id] } { - news_aggregator::aggregator::set_user_default \ - -user_id $user_id \ - -aggregator_id $aggregator_id - } else { - return 0 - } + set aggregator_id [db_string select_user_default {} -default 0] + if { $aggregator_id eq "" } { + return 0 + } else { + return $aggregator_id } +# if { [string equal $aggregator_id "0"] } { +# set aggregator_id [db_string lowest_aggregator ""] +# if { [exists_and_not_null aggregator_id] } { +# news_aggregator::aggregator::set_user_default \ +# -user_id $user_id \ +# -aggregator_id $aggregator_id +# } else { +# return 0 +# } +# } +# return $aggregator_id +} - return $aggregator_id +ad_proc -private news_aggregator::aggregator::instance_default { + {-package_id:required} +} { + Returns the instance's default aggregator, or 0 if none exists. + + @author Michael Steigman (michael@steigman.net) + @creation-date 2005-12-25 +} { + set aggregator_id [db_string select_instance_default {} -default 0] + if { $aggregator_id eq "" } { + return 0 + } else { + return $aggregator_id + } } ad_proc -public news_aggregator::aggregator::edit {