File:  [LON-CAPA] / loncom / interface / longroupchat.pm
Revision 1.5: download - view: text, annotated - select for diffs
Tue May 9 14:38:10 2006 UTC (18 years, 1 month ago) by albertel
Branches: MAIN
CVS tags: HEAD
- changing loncommon::coursegroups to be easier to use

    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;
   29: use Apache::lonnet;
   30: use Apache::loncommon;
   31: use Apache::lonlocal;
   32: 
   33: sub handler {
   34:     my ($r) = @_;
   35:     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['group']);
   36:     my $group = $env{'form.group'};
   37:     my $grouptitle;
   38:     if (defined($group)) {
   39:         my $cnum=$env{'course.'.$env{'request.course.id'}.'.num'};
   40:         my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'};
   41:         my %curr_groups = &Apache::loncommon::coursegroups($cdom,$cnum,$group);
   42:         if (%curr_groups) {
   43:             my %group_info = 
   44: 		&Apache::loncommon::get_group_settings($curr_groups{$group});
   45:             $grouptitle = &mt('Group Chat:').' '.
   46: 		&Apache::lonnet::unescape($group_info{description});
   47:         }
   48:     }
   49: 
   50:     my $start_page =
   51: 	&Apache::loncommon::start_page($grouptitle,undef,
   52: 				       {'frameset'    => 1,
   53: 					'add_entries' => {
   54: 					    'rows'   => "80,100,*",
   55: 					    'border' => "0"},});
   56:     my $end_page =
   57: 	&Apache::loncommon::end_page({'frameset' => 1});
   58: 
   59:     $r->print(<<"END");
   60: $start_page
   61: <frame name="chatacc" src="/adm/chatfetch?group=$group">
   62: <frame name="chatpost" src="/adm/chat?group=$group">
   63: <frame name="chatout" src="/adm/rat/empty.html">
   64: $end_page
   65: END
   66: 
   67: }
   68: 
   69: 1;

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