Annotation of loncom/interface/longroupchat.pm, revision 1.7

1.1       raeburn     1: # The LearningOnline Network
                      2: # "Group Chat Frame" Personal Information
                      3: #
                      4: # Copyright Michigan State University Board of Trustees
                      5: #
                      6: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
                      7: #
                      8: # LON-CAPA is free software; you can redistribute it and/or modify
                      9: # it under the terms of the GNU General Public License as published by
                     10: # the Free Software Foundation; either version 2 of the License, or
                     11: # (at your option) any later version.
                     12: #
                     13: # LON-CAPA is distributed in the hope that it will be useful,
                     14: # but WITHOUT ANY WARRANTY; without even the implied warranty of
                     15: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     16: # GNU General Public License for more details.
                     17: #
                     18: # You should have received a copy of the GNU General Public License
                     19: # along with LON-CAPA; if not, write to the Free Software
                     20: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
                     21: #
                     22: # /home/httpd/html/adm/gpl.txt
                     23: #
                     24: # http://www.lon-capa.org/
                     25: #
                     26: package Apache::longroupchat;
                     27: 
                     28: use strict;
1.7     ! albertel   29: use Apache::Constants qw(:common);
1.1       raeburn    30: use Apache::lonnet;
1.7     ! albertel   31: use Apache::loncommon();
1.1       raeburn    32: use Apache::lonlocal;
1.7     ! albertel   33: use Apache::longroup();
1.1       raeburn    34: 
                     35: sub handler {
1.2       albertel   36:     my ($r) = @_;
1.1       raeburn    37:     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['group']);
                     38:     my $group = $env{'form.group'};
                     39:     my $grouptitle;
                     40:     if (defined($group)) {
                     41:         my $cnum=$env{'course.'.$env{'request.course.id'}.'.num'};
                     42:         my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'};
1.6       raeburn    43:         my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum,$group);
1.5       albertel   44:         if (%curr_groups) {
1.2       albertel   45:             my %group_info = 
1.6       raeburn    46: 		&Apache::longroup::get_group_settings($curr_groups{$group});
1.2       albertel   47:             $grouptitle = &mt('Group Chat:').' '.
                     48: 		&Apache::lonnet::unescape($group_info{description});
1.1       raeburn    49:         }
                     50:     }
1.4       albertel   51: 
1.7     ! albertel   52:     &Apache::loncommon::content_type($r,'text/html');
        !            53:     $r->send_http_header;
        !            54:     return OK if $r->header_only;
1.3       albertel   55:     my $start_page =
                     56: 	&Apache::loncommon::start_page($grouptitle,undef,
                     57: 				       {'frameset'    => 1,
                     58: 					'add_entries' => {
                     59: 					    'rows'   => "80,100,*",
                     60: 					    'border' => "0"},});
                     61:     my $end_page =
                     62: 	&Apache::loncommon::end_page({'frameset' => 1});
                     63: 
1.1       raeburn    64:     $r->print(<<"END");
1.3       albertel   65: $start_page
1.1       raeburn    66: <frame name="chatacc" src="/adm/chatfetch?group=$group">
                     67: <frame name="chatpost" src="/adm/chat?group=$group">
                     68: <frame name="chatout" src="/adm/rat/empty.html">
1.3       albertel   69: $end_page
1.1       raeburn    70: END
                     71: 
                     72: }
                     73: 
                     74: 1;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>