File:  [LON-CAPA] / loncom / interface / loncommunicate.pm
Revision 1.34: download - view: text, annotated - select for diffs
Tue May 30 20:09:25 2006 UTC (17 years, 11 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_2_X, version_2_2_2, version_2_2_1, version_2_2_0, version_2_1_99_3, version_2_1_99_2, version_2_1_99_1, version_2_1_99_0, HEAD
Adding thin veneer to support "ANGEL-style" groups.

    1: # The LearningOnline Network
    2: # Communicate
    3: #
    4: # $Id: loncommunicate.pm,v 1.34 2006/05/30 20:09:25 raeburn Exp $
    5: #
    6: # Copyright Michigan State University Board of Trustees
    7: #
    8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
    9: #
   10: # LON-CAPA is free software; you can redistribute it and/or modify
   11: # it under the terms of the GNU General Public License as published by
   12: # the Free Software Foundation; either version 2 of the License, or
   13: # (at your option) any later version.
   14: #
   15: # LON-CAPA is distributed in the hope that it will be useful,
   16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18: # GNU General Public License for more details.
   19: #
   20: # You should have received a copy of the GNU General Public License
   21: # along with LON-CAPA; if not, write to the Free Software
   22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23: #
   24: # /home/httpd/html/adm/gpl.txt
   25: #
   26: # http://www.lon-capa.org/
   27: #
   28: ###
   29: 
   30: package Apache::loncommunicate;
   31: 
   32: use strict;
   33: use Apache::Constants qw(:common);
   34: use Apache::lonmsgdisplay();
   35: use Apache::loncommon;
   36: use Apache::lonlocal;
   37: use Apache::lonnet;
   38: 
   39: sub menu {
   40:     my $r=shift;
   41:     my $crstype = 'Course';
   42:     my $usertype = 'Student';
   43:     if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {
   44:         $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
   45:         if ($crstype eq 'Group') {
   46:             $usertype = 'Member';
   47:         }   
   48:     }
   49:     my %lt=&Apache::lonlocal::texthash(
   50: 'mnf' => 'Make New Folder',
   51: 'vcm' => 'View Critical Messages',
   52: 'smu' => 'Send Message to User(s)',
   53: 'bmc' => "Broadcast Message to $crstype",
   54: 'dmu' => "Distribute Messages from Uploaded File to $crstype",
   55: 'unr' => 
   56:      'User Notes, Records of Face-to-Face Discussions, and Critical Messages',
   57: 
   58: 'cbs' => "Configure Blocking of $usertype Communication during Exams",
   59: 'blog' => 'Add or Edit Blog Entries' 
   60: 
   61: );
   62:     my %help=();
   63:     foreach ('Course_Face_To_Face_Records,Course_Critical_Message',
   64: 	     'Course_Broadcast_Message') {
   65: 	$help{$_}=&Apache::loncommon::help_open_topic($_);
   66:     }
   67: # ------------------------------------------------------------------------ Menu
   68:    $r->print(<<END);
   69: <table cellspacing="10" cellpadding="2">
   70: <tr><td bgcolor="#FFFFAA"><form method="post" action="/adm/email">
   71: <input type="submit" value="$lt{'mnf'}" />
   72: <input type="text" size="15" name="newfolder" value="" />
   73: </form></td>
   74: <td bgcolor="#FFFFAA">
   75:   <b><a href="/adm/email?compose=individual">$lt{'smu'}</a></b>
   76: </td></tr>
   77: <tr><td bgcolor="#FFFFAA">
   78:   <b><a href="/adm/$env{'user.domain'}/$env{'user.name'}/_rss.html">$lt{'blog'}</a></b>
   79: </td><td></td></tr>
   80: END
   81:     if (($env{'request.course.id'}) && 
   82:         (
   83: 	 &Apache::lonnet::allowed('srm',$env{'request.course.id'}) ||
   84: 	 &Apache::lonnet::allowed('srm',$env{'request.course.id'}.'/'.$env{'request.course.sec'})
   85: 	 )) {
   86:         $r->print(<<END);
   87: <tr><td bgcolor="#FFFFAA">
   88:     <b><a href="/adm/email?compose=group">$lt{'bmc'}</a></b>$help{'Course_Broadcast_Message'}
   89: </td>
   90: <td bgcolor="#FFFFAA">
   91:   <b><a href="/adm/email?compose=upload">$lt{'dmu'}</a></b>
   92: </td></tr>
   93: <tr><td bgcolor="#FFFFAA">
   94: <b><a href="/adm/email?recordftf=query">$lt{'unr'}</a></b>$help{'Course_Face_To_Face_Records,Course_Critical_Message'}
   95: </td>
   96: <td bgcolor="#FFFFAA">
   97:   <b><a href="/adm/email?block=display">$lt{'cbs'}</a>
   98: </td></tr>
   99: END
  100:     }
  101:     $r->print('</table>');
  102: }
  103: 
  104: sub handler {
  105:     my $r = shift;
  106:     &Apache::loncommon::content_type($r,'text/html');
  107:     $r->send_http_header;
  108:     return OK if $r->header_only;
  109: #
  110: # Start document
  111: #
  112: 
  113: # ----------------------------------------------------------------- Breadcrumbs
  114:     &Apache::lonhtmlcommon::clear_breadcrumbs();
  115:     &Apache::lonhtmlcommon::add_breadcrumb
  116:         ({href=>"/adm/communicate",
  117:           text=>"Communication/Messages",
  118:           faq=>12,bug=>'Communication Tools',});
  119: 
  120: # ---------------------------------------------------------------------- Header
  121:     &Apache::lonmsgdisplay::header($r);
  122:     &menu($r);
  123:     &Apache::lonmsgdisplay::disall($r,'new');
  124:     $r->print(&Apache::loncommon::end_page());
  125:     return OK;
  126: }
  127: 
  128: 1;
  129: __END__

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