--- loncom/interface/lonaboutme.pm 2004/05/03 19:04:49 1.22
+++ loncom/interface/lonaboutme.pm 2005/11/18 13:35:30 1.39
@@ -1,7 +1,7 @@
# The LearningOnline Network
# "About Me" Personal Information
#
-# $Id: lonaboutme.pm,v 1.22 2004/05/03 19:04:49 sakharuk Exp $
+# $Id: lonaboutme.pm,v 1.39 2005/11/18 13:35:30 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -34,6 +34,7 @@ use Apache::loncommon;
use Apache::lonnet;
use Apache::lontexconvert;
use Apache::lonfeedback;
+use Apache::lonrss();
use Apache::lonlocal;
sub handler {
@@ -41,16 +42,17 @@ sub handler {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
return OK if $r->header_only;
- my $target=$ENV{'form.grade_target'};
+ my $target=$env{'form.grade_target'};
# ------------------------------------------------------------ Print the screen
if ($target ne 'tex') {
+ my $html=&Apache::lonxml::xmlbegin();
$r->print(< '.&Apache::loncommon::messagewrapper('Send me a message',$cnum,$cdom).' '.&Apache::loncommon::messagewrapper('Send me a message',$cnum,$cdom).' '.&mt('Privacy Note').': '.
- &mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.').
- ''.&Apache::loncommon::plainname($cnum,$cdom).'
');
} else {
$r->print('\noindent{\large\textbf{'.&Apache::loncommon::plainname($cnum,$cdom).'}}\\\\\\\\');
@@ -96,7 +98,7 @@ ENDDOCUMENT
}
if ($target ne 'tex') {
$r->print(''.$Apache::lonnet::domaindescription{$cdom}.'
'.
- '
Show Public View'. - &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'
'); - } else { - $r->print(' \textbf{'.&mt('Privacy Note').'}: '. - &mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.').'\\\\\\\\'); - } - } - if (($ENV{'form.uploaddoc.filename'}) && - ($ENV{'form.storeupl'}) && ($allowed)) { - if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) { + $r->print(''.&mt('Privacy Note').': '. + &mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.'). + '
'. + &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'Show Public View'. + &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'
'); + } elsif ($privleged && $target ne 'tex') { + $r->print(''); + } + if (($env{'form.uploaddoc.filename'}) && + ($env{'form.storeupl'}) && ($allowed)) { + if ($env{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) { if ($syllabus{'uploaded.photourl'}) { &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'}); } @@ -133,12 +133,19 @@ ENDDOCUMENT $syllabus{'uploaded.lastmodified'}=time; &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum); } - if (($allowed) && ($ENV{'form.storesyl'})) { + if ($allowed && $env{'form.delupl'}) { + if ($syllabus{'uploaded.photourl'}) { + &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'}); + delete($syllabus{'uploaded.photourl'}); + &Apache::lonnet::del('aboutme',['uploaded.photourl'],$cdom,$cnum); + } + } + if (($allowed) && ($env{'form.storesyl'})) { foreach (keys %syllabusfields) { - my $field=$ENV{'form.'.$_}; + my $field=$env{'form.'.$_}; $field=~s/\s+$//s; $field=&Apache::lonfeedback::clear_out_html($field, - $ENV{'user.adv'}); + $env{'user.adv'}); $syllabus{$_}=$field; } $syllabus{'uploaded.lastmodified'}=time; @@ -153,32 +160,43 @@ ENDDOCUMENT if ($syllabus{'uploaded.photourl'}) { &Apache::lonnet::allowuploaded('/adm/aboutme', $syllabus{'uploaded.photourl'}); - $r->print('