--- loncom/interface/lonsyllabus.pm 2004/01/15 04:46:36 1.26 +++ loncom/interface/lonsyllabus.pm 2004/02/13 15:01:29 1.27 @@ -1,7 +1,7 @@ # The LearningOnline Network # Syllabus # -# $Id: lonsyllabus.pm,v 1.26 2004/01/15 04:46:36 albertel Exp $ +# $Id: lonsyllabus.pm,v 1.27 2004/02/13 15:01:29 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -76,7 +76,7 @@ ENDDOCUMENT # ------------------------------------------------------------ Get query string &Apache::loncommon::get_unprocessed_cgi - ($ENV{'QUERY_STRING'},['forcestudent','register']); + ($ENV{'QUERY_STRING'},['forcestudent','register','forceedit']); # ----------------------------------------------------- Force menu registration my $addentries=''; if ($ENV{'form.register'}) { @@ -87,6 +87,8 @@ ENDDOCUMENT # --------------------------------------------------------------- Force Student my $forcestudent=''; if ($ENV{'form.forcestudent'}) { $forcestudent='student'; }; + my $forceedit=''; + if ($ENV{'form.forceedit'}) { $forceedit='edit'; } # ------------------------------------- There is such a course, get environment my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum); @@ -114,6 +116,7 @@ ENDDOCUMENT # ---------------------------------------------------------- Load syllabus info my %syllabus=&Apache::lonnet::dump('syllabus',$cdom,$cnum); my $allowed=0; + my $privileged=0; # This handler might be called anonymously ... # ----------------------------------------------------- Only if not public call @@ -121,6 +124,10 @@ ENDDOCUMENT # does this user have privileges to post, etc? if ($ENV{'request.course.id'}) { $allowed=&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'}); + $privileged=$allowed; + if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) { + $forcestudent='student'; + } if ($forcestudent) { $allowed=0; } } if ($allowed) { @@ -129,9 +136,13 @@ ENDDOCUMENT .' http://'. $Apache::lonnet::hostname{$homeserver}.$r->uri.''. &Apache::loncommon::help_open_topic('Syllabus_ExtLink').'

'. - '

Show Public View'. + '

'. +&mt('Show Public View').''. &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView'). '

'); + } elsif ($privileged) { + $r->print('

'. +&mt('Edit').''); } if (($allowed) && ($ENV{'form.storesyl'})) { foreach (keys %syllabusfields) { @@ -185,7 +196,8 @@ ENDDOCUMENT $lastmod.''.&mt('by').' '.$who. '

'); if ($allowed) { - $r->print('

'); + $r->print(''. + ''); } foreach (sort keys %syllabusfields) { if (($syllabus{$_}) || ($allowed)) { @@ -210,7 +222,7 @@ ENDDOCUMENT if ($allowed) { $r->print('

'.$syllabusfields{$_}. &Apache::loncommon::help_open_topic('Syllabus_URLs').'

'. - '

Show Public View'. + '

'.&mt('Show Public View').''. &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'

'); } else { $r->print($message);