--- loncom/interface/lonsimplepage.pm 2004/02/11 00:22:21 1.15 +++ loncom/interface/lonsimplepage.pm 2004/02/13 15:01:29 1.16 @@ -1,7 +1,7 @@ # The LearningOnline Network # Simple Page Editor # -# $Id: lonsimplepage.pm,v 1.15 2004/02/11 00:22:21 albertel Exp $ +# $Id: lonsimplepage.pm,v 1.16 2004/02/13 15:01:29 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -84,7 +84,7 @@ ENDDOCUMENT # ------------------------------------------------------------ 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'}) { @@ -95,6 +95,8 @@ ENDDOCUMENT # --------------------------------------------------------------- Force Student my $forcestudent=''; if ($ENV{'form.forcestudent'} ||$ENV{'form.grade_target'} eq 'tex' ) { $forcestudent='student'; }; + my $forceedit=''; + if ($ENV{'form.forceedit'}) { $forceedit='edit'; } my %syllabus=&Apache::lonnet::dump('smppage_'.$marker,$dom,$crs); @@ -107,15 +109,21 @@ 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) { - if ($ENV{'form.grade_target'} ne 'tex') { - $r->print('

'. - &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'
Show Student View'. + if ($ENV{'form.grade_target'} ne 'tex') { + if ($allowed) { + $r->print('

'. + &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').'

'); - } + } elsif ($privileged) { + $r->print(''.&mt('Edit').''); + } } if (($ENV{'form.uploaddoc.filename'}) && ($ENV{'form.storeupl'}) && ($allowed)) { @@ -149,6 +157,7 @@ ENDDOCUMENT if ($allowed && ($ENV{'form.grade_target'} ne 'tex')) { $r->print( '
'. + ''. '

Upload a Photo

'. ''. ''.