Index: openacs-4/packages/notifications/tcl/notification-display-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-display-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/notifications/tcl/notification-display-procs.tcl 4 Jan 2003 09:30:31 -0000 1.7 +++ openacs-4/packages/notifications/tcl/notification-display-procs.tcl 16 Jan 2003 13:53:10 -0000 1.8 @@ -20,7 +20,8 @@ {-url:required} {-user_id ""} } { - Produce a widget for requesting notifications of a given type. + Produce a widget for requesting notifications of a given type. If the notifications package has not been + mounted then return the empty string. } { # Check that we're mounted if { [empty_string_p [apm_package_url_from_key [notification::package_key]]] } { @@ -46,6 +47,10 @@ set sub_chunk "[_ notifications.lt_You_may_a_hrefsub_url]" } + if { [empty_string_p $sub_url] } { + return "" + } + return "\[ $sub_chunk \]" } @@ -56,11 +61,17 @@ {-user_id:required} {-pretty_name} } { - Returns the URL that allows one to subscribe to a notification type on a particular object. + Returns the URL that allows one to subscribe to a notification type on a particular object. If the + notifications package has not been mounted return the empty string. } { set type_id [notification::type::get_type_id -short_name $type] set root_path [apm_package_url_from_key [notification::package_key]] + + if { [empty_string_p $root_path] } { + return "" + } + set subscribe_url "${root_path}request-new?[export_vars { type_id user_id object_id pretty_name {return_url $url} }]" return $subscribe_url @@ -73,6 +84,11 @@ Returns the URL that allows one to unsubscribe from a particular request. } { set root_path [apm_package_url_from_key [notification::package_key]] + + if { [empty_string_p $root_path] } { + return "" + } + set unsubscribe_url "${root_path}request-delete?request_id=$request_id&return_url=[ns_urlencode $url]" return $unsubscribe_url