--- loncom/interface/loncommunicate.pm 2006/04/25 17:08:27 1.33 +++ loncom/interface/loncommunicate.pm 2006/12/07 21:06:57 1.37 @@ -1,7 +1,7 @@ # The LearningOnline Network # Communicate # -# $Id: loncommunicate.pm,v 1.33 2006/04/25 17:08:27 albertel Exp $ +# $Id: loncommunicate.pm,v 1.37 2006/12/07 21:06:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,16 +38,23 @@ 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' ); @@ -57,26 +64,36 @@ 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'}) || - &Apache::lonnet::allowed('srm',$env{'request.course.id'}.'/'.$env{'request.course.sec'}) - )) { + if ($can_srm || !$can_dcm) { + $r->print(''); + } + if ($can_srm) { $r->print(< + $lt{'bmc'}$help{'Course_Broadcast_Message'} @@ -85,11 +102,17 @@ END $lt{'unr'}$help{'Course_Face_To_Face_Records,Course_Critical_Message'} - - $lt{'cbs'} - END } + if ($can_dcm) { + $r->print(' + + '.$lt{'cbs'}.' +'); + } + if ($can_srm || $can_dcm) { + $r->print(''); + } $r->print(''); }