--- loncom/interface/loncommunicate.pm 2005/04/07 06:56:23 1.28 +++ loncom/interface/loncommunicate.pm 2006/12/23 06:58:17 1.40 @@ -1,7 +1,7 @@ # The LearningOnline Network # Communicate # -# $Id: loncommunicate.pm,v 1.28 2005/04/07 06:56:23 albertel Exp $ +# $Id: loncommunicate.pm,v 1.40 2006/12/23 06:58:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,23 +31,31 @@ package Apache::loncommunicate; use strict; use Apache::Constants qw(:common); -use Apache::lonmsg(); +use Apache::lonmsgdisplay(); use Apache::loncommon; use Apache::lonlocal; use Apache::lonnet; sub menu { my $r=shift; + my $crstype = 'Course'; + my $usertype = 'Student'; + if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) { + $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; + if ($crstype eq 'Group') { + $usertype = 'Member'; + } + } my %lt=&Apache::lonlocal::texthash( -'mnf' => 'Make New Folder', 'vcm' => 'View Critical Messages', 'smu' => 'Send Message to User(s)', -'bmc' => 'Broadcast Message to Course', -'dmu' => 'Distribute Messages from Uploaded File to Course', +'bmc' => "Broadcast Message to $crstype", +'dmu' => "Distribute Messages from Uploaded File to $crstype", 'unr' => 'User Notes, Records of Face-to-Face Discussions, and Critical Messages', -'cbs' => 'Configure blocking of student communication during exams' +'cbs' => "Configure Blocking of $usertype Communication during Exams", +'blog' => 'Add or Edit Blog Entries' ); my %help=(); @@ -56,33 +64,65 @@ sub menu { $help{$_}=&Apache::loncommon::help_open_topic($_); } # ------------------------------------------------------------------------ Menu - $r->print(<print(< -
- - -
+ $lt{'smu'} - + + + $lt{'blog'} + + END - if (($env{'request.course.id'}) && - (&Apache::lonnet::allowed('srm',$env{'request.course.id'}))) { + if ($can_srm) { $r->print(< + + $lt{'bmc'}$help{'Course_Broadcast_Message'} $lt{'dmu'} - +END + } + if ($can_dcm || $can_dff) { + $r->print(''); + } + if ($can_dff) { + $r->print(< $lt{'unr'}$help{'Course_Face_To_Face_Records,Course_Critical_Message'} - - $lt{'cbs'} - END } + if ($can_dcm) { + $r->print(' + + '.$lt{'cbs'}.' +'); + } + if ($can_dff || $can_dcm) { + $r->print(''); + } $r->print(''); } @@ -94,13 +134,6 @@ sub handler { # # Start document # - my $html=&Apache::lonxml::xmlbegin(); - $r->print(< -The LearningOnline Network with CAPA - -END # ----------------------------------------------------------------- Breadcrumbs &Apache::lonhtmlcommon::clear_breadcrumbs(); @@ -110,9 +143,10 @@ END faq=>12,bug=>'Communication Tools',}); # ---------------------------------------------------------------------- Header - &Apache::lonmsg::header($r); + &Apache::lonmsgdisplay::header($r); &menu($r); - &Apache::lonmsg::disall($r,'new'); + &Apache::lonmsgdisplay::disall($r); + $r->print(&Apache::loncommon::end_page()); return OK; }