Index: openacs-4/packages/forums/lib/forums/edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums/edit.tcl,v diff -u -N -r1.7.2.2 -r1.7.2.3 --- openacs-4/packages/forums/lib/forums/edit.tcl 19 Jun 2019 16:43:21 -0000 1.7.2.2 +++ openacs-4/packages/forums/lib/forums/edit.tcl 19 Jun 2019 17:26:58 -0000 1.7.2.3 @@ -19,10 +19,20 @@ forums::form::forum forum +# Check if the attachments package is mounted under the forum package instance +set attachments_p [forum::attachments_enabled_p] + if {[form is_valid forum]} { template::form get_values forum return_url forum_id \ - name charter presentation_type posting_policy new_threads_p anonymous_allowed_p attachments_allowed_p + name charter presentation_type posting_policy new_threads_p anonymous_allowed_p + # Display the option only if the attachments package is mounted + if {$attachments_p} { + template::form get_values forum attachments_allowed_p + } else { + set attachments_allowed_p [db_string att_p {select attachments_allowed_p from forums_forums where forum_id=:forum_id}] + } + # Users can create new threads? set new_questions_allowed_p [expr { $new_threads_p && $posting_policy ne "closed" ? t : f}] @@ -58,8 +68,11 @@ -value $forum(new_questions_allowed_p) element set_properties forum anonymous_allowed_p \ -value $forum(anonymous_allowed_p) - element set_properties forum attachments_allowed_p \ - -value $forum(attachments_allowed_p) + # Display the option only if the attachments package is mounted + if {$attachments_p} { + element set_properties forum attachments_allowed_p \ + -value $forum(attachments_allowed_p) + } } if {[info exists alt_template] && $alt_template ne ""} { Index: openacs-4/packages/forums/lib/forums/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums/new.tcl,v diff -u -N -r1.9.2.2 -r1.9.2.3 --- openacs-4/packages/forums/lib/forums/new.tcl 19 Jun 2019 16:43:21 -0000 1.9.2.2 +++ openacs-4/packages/forums/lib/forums/new.tcl 19 Jun 2019 17:26:58 -0000 1.9.2.3 @@ -24,10 +24,20 @@ forums::form::forum forum +# Check if the attachments package is mounted under the forum package instance +set attachments_p [forum::attachments_enabled_p] + if {[form is_valid forum]} { template::form get_values forum \ - forum_id name charter presentation_type posting_policy new_threads_p anonymous_allowed_p attachments_allowed_p + forum_id name charter presentation_type posting_policy new_threads_p anonymous_allowed_p + # Display the option only if the attachments package is mounted + if {$attachments_p} { + template::form get_values forum attachments_allowed_p + } else { + set attachments_allowed_p t + } + # Users can create new threads? set new_questions_allowed_p [expr {$new_threads_p && $posting_policy ne "closed" ? t : f}] @@ -53,8 +63,11 @@ element set_properties forum forum_id -value $forum_id element set_value forum new_threads_p t element set_value forum anonymous_allowed_p f - element set_value forum attachments_allowed_p t element set_value forum name $name + # Display the option only if the attachments package is mounted + if {$attachments_p} { + element set_value forum attachments_allowed_p t + } } if {[info exists alt_template] && $alt_template ne ""} { Index: openacs-4/packages/forums/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/form-procs.tcl,v diff -u -N -r1.13.2.3 -r1.13.2.4 --- openacs-4/packages/forums/tcl/form-procs.tcl 19 Jun 2019 16:43:21 -0000 1.13.2.3 +++ openacs-4/packages/forums/tcl/form-procs.tcl 19 Jun 2019 17:26:58 -0000 1.13.2.4 @@ -186,11 +186,13 @@ -help_text [_ forums.help_new_threads] \ -options [list [list [_ forums.Yes] t] [list [_ forums.No] f] ] - template::element create $form_name ${prefix}attachments_allowed_p \ - -label [_ forums.lt_Users_Can_Add_Attachments] \ - -datatype text \ - -widget radio \ - -options [list [list [_ forums.Yes] t] [list [_ forums.No] f] ] + if {[forum::attachments_enabled_p]} { + template::element create $form_name ${prefix}attachments_allowed_p \ + -label [_ forums.lt_Users_Can_Add_Attachments] \ + -datatype text \ + -widget radio \ + -options [list [list [_ forums.Yes] t] [list [_ forums.No] f] ] + } } # Local variables: