--- loncom/interface/lonbulletin.pm 2003/09/15 13:38:19 1.13 +++ loncom/interface/lonbulletin.pm 2004/04/30 23:13:52 1.20 @@ -1,7 +1,7 @@ # The LearningOnline Network # Bulletin Board Handler # -# $Id: lonbulletin.pm,v 1.13 2003/09/15 13:38:19 www Exp $ +# $Id: lonbulletin.pm,v 1.20 2004/04/30 23:13:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,10 +34,11 @@ use Apache::loncommon; use Apache::lonnet; use Apache::lontexconvert; use Apache::lonfeedback; +use Apache::lonlocal; sub handler { my $r = shift; - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; return OK if $r->header_only; @@ -65,14 +66,14 @@ ENDDOCUMENT my $crs = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; # --------------------------------------------------------- The syllabus fields - my %syllabusfields=( + my %syllabusfields=&Apache::lonlocal::texthash( 'aaa_title' => 'Topic', 'bbb_content' => 'Task', 'ccc_webreferences' => 'Web References'); # ------------------------------------------------------------ Get Query String &Apache::loncommon::get_unprocessed_cgi - ($ENV{'QUERY_STRING'},['forcestudent','register']); + ($ENV{'QUERY_STRING'},['forcestudent','forceedit','register']); # ----------------------------------------------------- Force menu registration my $addentries=''; if ($ENV{'form.register'}) { @@ -82,7 +83,10 @@ ENDDOCUMENT } # --------------------------------------------------------------- Force Student my $forcestudent=''; - if ($ENV{'form.forcestudent'}) { $forcestudent='student'; }; + if ($ENV{'form.forcestudent'}) { $forcestudent='student'; } + + my $forceedit=''; + if ($ENV{'form.forceedit'}) { $forceedit='edit'; } my %syllabus=&Apache::lonnet::dump('bulletinpage_'.$marker,$dom,$crs); @@ -94,19 +98,31 @@ ENDDOCUMENT my $allowed=&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'}); + my $privileged=$allowed; + if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) { + $forcestudent='student'; + } + if ($forcestudent) { $allowed=0; } if ($allowed) { $r->print( '
'.
-&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'
Show Student View'.
+&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'
'.&mt('Show Student View').''.
&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'