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_alt_text@  @header_text@ -
+ + + + + +
+
+ @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 "

  • Your icon is too large. The publisher of [ad_system_name] has chosen to limit attachments to [util_commify_number [ad_parameter MaximumFileSize]] bytes.\n" - ad_script_abort -} + ad_return_complaint 1 "
  • Your icon is too large. The publisher of [ad_system_name] has chosen to limit attachments to [util_commify_number [ad_parameter MaximumFileSize]] bytes.\n" + ad_script_abort + } if { $tmp_size > 0 } { - # import the content now, so that we can spit it out in the preview - db_transaction { - set parent_id 0 - - # 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" - ] + # import the content now, so that we can spit it out in the preview + db_transaction { - ns_log notice "aks1: new revision_id $revision_id" + # We will store the image in the communities' shared folder. + set parent_id [dotlrn_fs::get_community_shared_folder -community_id $community_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 -

    Here is the actual error message:

    $errmsg
    " + # 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 +

    Here is the actual error message:

    $errmsg
    " - 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 @@ - - Header Icon   - + + Header Logo   + + +    + + + - Header Icon Alt text   - - + Header Alternate Text   + + Index: openacs-4/packages/dotlrn/www/community-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/dotlrn/www/community-edit.tcl 9 Aug 2002 18:39:26 -0000 1.5 +++ openacs-4/packages/dotlrn/www/community-edit.tcl 17 Oct 2002 12:25:30 -0000 1.5.2.1 @@ -23,7 +23,7 @@ @version $Id$ } -query { - {referer "community-edit"} + {referer "one-community-admin"} } set user_id [ad_conn user_id] @@ -128,8 +128,54 @@ -community_id $community_id \ -attribute_name header_logo_alt_text ] + +set revision_id [dotlrn_community::get_attribute \ + -community_id $community_id \ + -attribute_name header_logo_item_id + ] + +# Default logos are served from know locations in the file system +# based on community type. + +# Customized logos are stored in the public file-storage folder +# for the community. + +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" +} + set title {Edit Properties} set context_bar {{one-community-admin Administer} {Edit Properties}} ad_return_template + + + + + + + Index: openacs-4/packages/dotlrn/www/community-member.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-member.adp,v diff -u -r1.11 -r1.11.2.1 --- openacs-4/packages/dotlrn/www/community-member.adp 9 Aug 2002 18:39:26 -0000 1.11 +++ openacs-4/packages/dotlrn/www/community-member.adp 17 Oct 2002 12:25:30 -0000 1.11.2.1 @@ -56,7 +56,11 @@
  • Personal home page: @url@
  • - + + +
  • @weblogs.name@ - Lastest post: @weblogs.lastest_post@ + +

    Biography: @bio@ @@ -71,7 +75,7 @@

    Shared Files

    - +
    Index: openacs-4/packages/dotlrn/www/community-member.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-member.tcl,v diff -u -r1.9 -r1.9.2.1 --- openacs-4/packages/dotlrn/www/community-member.tcl 9 Aug 2002 18:39:26 -0000 1.9 +++ openacs-4/packages/dotlrn/www/community-member.tcl 17 Oct 2002 12:25:30 -0000 1.9.2.1 @@ -59,6 +59,7 @@ where user_id = :user_id } + if {![db_0or1row user_information $user_info_sql]} { ad_return_error "No user found" "There is no community member with the user_id of $user_id" ad_script_abort @@ -74,6 +75,17 @@ and attribute_name = 'bio') } -default ""] +set weblog_p 0 +if {1} { + set weblog_package_id [site_node_apm_integration::get_child_package_id -package_key "forums"] + set weblog_url "[dotlrn_community::get_url -package_id $weblog_package_id]/forum-view" +#set to check if you are using webloggers + + db_multirow weblogs weblogs {select name, forum_id, to_char(o.last_modified, 'Mon DD, YYYY') as lastest_post from forums_forums_enabled f, acs_objects o where o.object_id = forum_id + and o.creation_user = :user_id and f.package_id = :weblog_package_id} + set weblog_p 1 +} + set portrait_p 0 if {[ad_parameter "show_portrait_p" dotlrn]} { set portrait_p 1 @@ -114,6 +126,9 @@ db_multirow user_contributions user_contributions {} set folder_id [dotlrn_fs::get_user_shared_folder -user_id $user_id] +set scope_fs_url "/packages/file-storage/www/folder-chunk" +set n_past_days "" +set url [site_node_object_map::get_url -object_id $folder_id] set context_bar [ad_context_bar_ws_or_index "Community member"] set system_name [ad_system_name]