Index: openacs-4/packages/chat/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/index.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/chat/www/index.tcl 24 Jun 2007 15:21:19 -0000 1.7 +++ openacs-4/packages/chat/www/index.tcl 19 Nov 2007 01:14:16 -0000 1.8 @@ -20,96 +20,21 @@ set room_create_p [permission::permission_p -object_id $package_id -privilege chat_room_create] set default_client [parameter::get -parameter "DefaultClient" -default "ajax"] set warning "" -set path [ad_return_url] if { $default_client eq "ajax" && ![apm_package_installed_p xotcl-core] } { set warning "[_ chat.xotcl_missing]" } if { $room_create_p } { - lappend actions "#chat.Create_a_new_room#" room-new "#chat.Create_a_new_room#" + lappend actions "#chat.Create_a_new_room#" room-edit "#chat.Create_a_new_room#" } -lappend actions "#chat.Search_a_room#" room-search?package_id=[ad_conn package_id] "#chat.Search_a_room#" -if {[info procs dotlrn_community::get_community_id] eq ""} { - set community_id "" -} else { - set community_id [dotlrn_community::get_community_id] -} - -if { $community_id eq "" } { - set list 0 -} else { - set list 1 -} - -db_multirow -extend { active_users last_activity rss_exists rss_feed_url2 rss_service admin_professor} rooms rooms_list {} { +db_multirow -extend { active_users last_activity } rooms rooms_list {} { set room [::chat::Chat create new -volatile -chat_id $room_id] set active_users [$room nr_active_users] set last_activity [$room last_activity] - set rss_exists [rss_support::subscription_exists -summary_context_id $room_id -impl_name chat_rss] - set rss_feed_url2 [chat_util_get_url $package_id]/rss/rss.tcl?room_id=$room_id - - db_1row room_info { - select count(cru.rss_service) as counter - from chat_registered_users cru - where cru.user_id = :user_id - and cru.room_id = :room_id - and cru.rss_service = 'true' - } - if { $counter > 0} { - set rss_service 1 - } else { - set rss_service 0 - } - db_1row room_info2 { - select count(cr.creator) as counter2 - from chat_rooms cr - where cr.room_id = :room_id - and cr.creator = :user_id - } - if { $counter2 > 0} { - set admin_professor "t" - } else { - set admin_professor "f" - } } - -db_multirow -extend { active_users last_activity rss_exists rss_feed_url2 rss_service admin_professor} rooms2 rooms_list2 {} { - set room [::chat::Chat create new -volatile -chat_id $room_id] - set active_users [$room nr_active_users] - set last_activity [$room last_activity] - set rss_exists [rss_support::subscription_exists -summary_context_id $room_id -impl_name chat_rss] - set rss_feed_url2 [chat_util_get_url $package_id]/rss/rss.tcl?room_id=$room_id - - db_1row room_info { - select count(cru.rss_service) as counter - from chat_registered_users cru - where cru.user_id = :user_id - and cru.room_id = :room_id - and cru.rss_service = 'true' - } - if { $counter > 0} { - set rss_service 1 - } else { - set rss_service 0 - } - db_1row room_info2 { - select count(cr.creator) as counter2 - from chat_rooms cr - where cr.room_id = :room_id - and cr.creator = :user_id - } - if { $counter2 > 0} { - set admin_professor "t" - } else { - set admin_professor "f" - } -} - - - list::create \ -name "rooms" \ -multirow "rooms" \ @@ -118,78 +43,35 @@ -actions $actions \ -row_pretty_plural [_ chat.rooms] \ -elements { - open { - label "#chat.open_room#" + active { + label "#chat.Active#" html { align "center" } display_template { - - +
- +
- +
} - } - private { - label "#chat.private_room#" - html { align "center" } - display_template { - - -
- -
-
- -
- -
-
- } } pretty_name { label "#chat.Room_name#" - html { align "center" } + html { width 400px } display_template { - @rooms.pretty_name@ + @rooms.pretty_name@ \[#chat.HTML_chat#\] @rooms.pretty_name@ -
@rooms.description@
+
@rooms.description@
} } - community { - label "#chat.community_class#" - html { align "center"} - display_template { - - @rooms.community@ - - } - } - rss { - label "#chat.rss#" - html { align "center" } - display_template { - - - -
#rss-support.Syndication_Feed# Subscribe via RSS

-
- #chat.no_rss# - -
- #chat.no_rss# - - } - } active_users { label "#chat.active_users#" html { style "text-align:center;" } @@ -201,133 +83,12 @@ actions { label "#chat.actions#" display_template { - - - #chat.room_admin# - #chat.Transcripts# - - - \n#chat.room_change_options# -
- \n#chat.Transcripts# -
-
- - #chat.room_admin# - #chat.Transcripts# - - } - } - } - -list::create \ - -name "rooms2" \ - -multirow "rooms2" \ - -key room_id \ - -pass_properties {room_create_p} \ - -actions $actions \ - -row_pretty_plural [_ chat.rooms] \ - -elements { - open { - label "#chat.open_room#" - html { align "center" } - display_template { - - -
- -
+ #chat.Transcripts# + + #chat.room_admin# - -
- -
-
} - } - private { - label "#chat.private_room#" - html { align "center" } - display_template { - - -
- -
-
- -
- -
-
- } } - pretty_name { - label "#chat.Room_name#" - html { align "center" } - display_template { - - @rooms2.pretty_name@ - - - (NO #chat.Active#) - -
@rooms2.description@
- } - } - community { - label "#chat.community_class#" - html { align "center"} - display_template { - - @rooms2.community@ - - } - } - rss { - label "#chat.rss#" - html { align "center" } - display_template { - - - -
#rss-support.Syndication_Feed# Subscribe via RSS

-
- #chat.no_rss# - -
- #chat.no_rss# - - } - } - active_users { - label "#chat.active_users#" - html { style "text-align:center;" } - } - last_activity { - label "#chat.last_activity#" - html { style "text-align:center;" } - } - actions { - label "#chat.actions#" - display_template { - - - #chat.room_admin# - #chat.Transcripts# - - - \n#chat.room_change_options# -
- \n#chat.Transcripts# -
-
- - #chat.room_admin# - #chat.Transcripts# - - } - } } ad_return_template