Index: openacs-4/packages/dotlrn/www/community-edit-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-2.adp,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/dotlrn/www/community-edit-2.adp 9 Aug 2002 18:39:26 -0000 1.3 +++ openacs-4/packages/dotlrn/www/community-edit-2.adp 17 Oct 2002 12:25:30 -0000 1.3.2.1 @@ -29,12 +29,20 @@ -This is what the header will look like: - +This is what the header title will look like:
+ + | +
+
+ @header_text@
+
+ |
+
Index: openacs-4/packages/dotlrn/www/community-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-2.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/dotlrn/www/community-edit-2.tcl 9 Aug 2002 18:39:26 -0000 1.7 +++ openacs-4/packages/dotlrn/www/community-edit-2.tcl 17 Oct 2002 12:25:30 -0000 1.7.2.1 @@ -38,73 +38,81 @@ set page_title Preview set header_text [dotlrn_community::get_community_header_name $community_id] -# # Image stuff -# + set tmp_filename [ns_queryget header_img.tmpfile] + +#TODO - better way to get typs. +# THIS DOESN'T WORK. set mime_type [ns_guesstype $header_img] + if {[empty_string_p $tmp_filename]} { - set tmp_size 0 - set revision_id 0 -} else { - set tmp_size [file size $tmp_filename] -} + set tmp_size 0 + set revision_id 0 + } else { + set tmp_size [file size $tmp_filename] + } + set title "$header_img-[db_nextval acs_object_id_seq]" -# strip off the C:\directories... crud and just get the file name +# # strip off the C:\directories... crud and just get the file name + if ![regexp {([^/\\]+)$} $header_img match client_filename] { - set client_filename $header_img + set client_filename $header_img } if { ![empty_string_p [ad_parameter MaximumFileSize]] - && $tmp_size > 0 - && $tmp_size > [ad_parameter MaximumFileSize] } { + && $tmp_size > 0 + && $tmp_size > [ad_parameter MaximumFileSize] } { - ad_return_complaint 1 "
Here is the actual error message:
" + # the last param "object name" is unused + set revision_id [cr_import_content \ + -title $title \ + -description "group's icon" \ + -image_only \ + $parent_id \ + $tmp_filename \ + $tmp_size \ + $mime_type \ + "$client_filename-$title" + ] + + ns_log notice "aks1: new revision_id $revision_id" + + } on_error { + # most likely a duplicate name, double click, etc. + ad_return_complaint 1 " + There was an error trying to add your content. + Most likely causes you've +$errmsg
Here is the actual error message:
" - ad_script_abort - } -} else { - # if there was no img uploaded, use the old value of the attribute - # which is either "" for no img ever uploaded or the current revision_id - set revision_id [dotlrn_community::get_attribute \ - -community_id $community_id \ - -attribute_name header_logo_item_id - ] + ad_script_abort + } + } else { + # if there was no img uploaded, use the old value of the attribute + # which is either "" for no img ever uploaded or the current revision_id + set revision_id [dotlrn_community::get_attribute \ + -community_id $community_id \ + -attribute_name header_logo_item_id + ] - ns_log notice "aks2: old revision_id $revision_id" -} + ns_log notice "aks2: old revision_id $revision_id" + } # # Font stuff @@ -134,6 +142,35 @@ append style_fragment " " "color: $header_font_color;" +#logo stuff +if {[empty_string_p $revision_id]} { + + set comm_type [dotlrn_community::get_community_type_from_community_id $community_id] + + set temp_community_id $community_id + while {[dotlrn_community::subcommunity_p -community_id $temp_community_id]} { + # For a subcommunity, we use the logo of the + # the first ancestor that is not a sub_community + + set temp_community_id [dotlrn_community::get_parent_id -community_id $temp_community_id] + set comm_type [dotlrn_community::get_community_type_from_community_id $temp_community_id] + + } + + if {$comm_type == "dotlrn_club"} { + #community colors + set scope_name "comm" + } else { + set scope_name "course" + } + + set header_url "[dotlrn::get_url]/graphics/logo-$scope_name.gif" + +} else { + set header_url "[dotlrn_community::get_community_url $community_id]/file-storage/download/?version_id=$revision_id" +} + + form create header_form set yes_label "Save and use this header" @@ -149,16 +186,16 @@ -widget submit element create header_form header_logo_item_id \ - -label header_logo_item_id \ - -datatype text \ - -widget hidden \ - -value $revision_id + -label header_logo_item_id \ + -datatype text \ + -widget hidden \ + -value $revision_id element create header_form header_logo_alt_text \ - -label header_logo_alt_text \ - -datatype text \ - -widget hidden \ - -value $header_alt_text + -label header_logo_alt_text \ + -datatype text \ + -widget hidden \ + -value $header_alt_text element create header_form header_font \ -label header_font \ @@ -195,8 +232,8 @@ [list header_font_size $header_font_size] \ [list header_font_color $header_font_color] \ [list header_logo_item_id $header_logo_item_id] \ - [list header_logo_alt_text $header_logo_alt_text] \ - ] + [list header_logo_alt_text $header_logo_alt_text]] + ad_returnredirect "one-community-admin" } else { Index: openacs-4/packages/dotlrn/www/community-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit.adp,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/dotlrn/www/community-edit.adp 9 Aug 2002 18:39:26 -0000 1.8 +++ openacs-4/packages/dotlrn/www/community-edit.adp 17 Oct 2002 12:25:30 -0000 1.8.2.1 @@ -59,15 +59,21 @@ -$errmsg
Biography: @bio@