Diff for /loncom/interface/lonaboutme.pm between versions 1.140 and 1.143

version 1.140, 2009/10/13 16:37:57 version 1.143, 2010/02/21 06:21:50
Line 168  sub handler { Line 168  sub handler {
   
     if ($is_course) {      if ($is_course) {
         if ($target ne 'tex') {          if ($target ne 'tex') {
             my $brcrum = [{href=>"/adm/navmaps",text=>"Navigate Course Contents"},              my $brcrum = [{href=>"/adm/navmaps",text=>"Course Contents"},
               {href=>"/adm/aboutme",text=>"Course Information"}];                {href=>"/adm/aboutme",text=>"Course Information"}];
             my $start_page =              my $start_page =
                 &Apache::loncommon::start_page(                  &Apache::loncommon::start_page(
Line 327  sub handler { Line 327  sub handler {
                 &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});                  &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});
             }              }
             $syllabus{'uploaded.photourl'}=              $syllabus{'uploaded.photourl'}=
                 &Apache::lonnet::userphotoupload('uploaddoc','aboutme');                  &Apache::lonnet::userfileupload('uploaddoc',undef,'aboutme',
                       undef,undef,undef,undef,undef,undef,undef,'400','500');
          }           }
         $syllabus{'uploaded.lastmodified'}=time;          $syllabus{'uploaded.lastmodified'}=time;
         &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);          &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);
Line 356  sub handler { Line 357  sub handler {
         if ($syllabus{'uploaded.photourl'}) {          if ($syllabus{'uploaded.photourl'}) {
             &Apache::lonnet::allowuploaded('/adm/aboutme',$syllabus{'uploaded.photourl'});              &Apache::lonnet::allowuploaded('/adm/aboutme',$syllabus{'uploaded.photourl'});
   
            #This call is to resize all "Personal Information" images in the LonCapa System. When its done, you can remove this line.  
             &Apache::lonnet::resizeImage(&Apache::lonnet::filelocation('',$syllabus{'uploaded.photourl'}));  
            #---End Resize---  
   
             $image=qq|<img name="userPhoto" src="$syllabus{'uploaded.photourl'} " class="LC_AboutMe_Image" alt="Photo of the user" />|;              $image=qq|<img name="userPhoto" src="$syllabus{'uploaded.photourl'} " class="LC_AboutMe_Image" alt="Photo of the user" />|;
   
             if ($target eq 'tex') {              if ($target eq 'tex') {
                 $image=&Apache::lonxml::xmlparse($r,'tex',$image);                  $image=&Apache::lonxml::xmlparse($r,'tex',$image);
             }              }
   
         }          }
   
         if ($allowed) {          if ($allowed) {
             $r->print(              $r->print(
                 '<form name="UploadPhoto" method="post" enctype="multipart/form-data" action="">'.                  '<form name="UploadPhoto" method="post" enctype="multipart/form-data" action="">'.
                 '<h3>'.&mt('Upload a Photo').'</h3>'.                  '<h3>'.&mt('Upload a Photo').'</h3>'.
                   '<p class="LC_info">'.
                   &mt('LON-CAPA will automatically scale your uploaded file so the image will not exceed a width of 400px and a height of 500px.').'</p>'.
                 '<input type="file" name="uploaddoc" size="50" />'.                  '<input type="file" name="uploaddoc" size="50" />'.
                 '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.                  '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.
                 '<input type="hidden" name="popup" value="'.$env{'form.popup'}.'" />'.                  '<input type="hidden" name="popup" value="'.$env{'form.popup'}.'" />'.
Line 831  sub aboutme_access { Line 829  sub aboutme_access {
     my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};      my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};      my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
     if (($cdom eq '') || ($cnum eq '')) {      if (($cdom eq '') || ($cnum eq '')) {
         my %coursehash = &coursedescription($env{'request.course.id'});          my %coursehash = &Apache::lonnet::coursedescription($env{'request.course.id'});
         $cdom = $coursehash{'domain'};          $cdom = $coursehash{'domain'};
         $cnum = $coursehash{'cnum'};          $cnum = $coursehash{'cnum'};
     }      }

Removed from v.1.140  
changed lines
  Added in v.1.143


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>