Diff for /loncom/interface/portfolio.pm between versions 1.87 and 1.88

version 1.87, 2005/08/26 21:47:25 version 1.88, 2005/09/09 19:12:29
Line 43  my $dirptr=16384; Line 43  my $dirptr=16384;
 sub display_common {  sub display_common {
     my ($r,$current_path,$is_empty,$dir_list)=@_;      my ($r,$current_path,$is_empty,$dir_list)=@_;
     my $iconpath= $r->dir_config('lonIconsURL') . "/";      my $iconpath= $r->dir_config('lonIconsURL') . "/";
     $r->print('<table border="0" cellspacing="2" cellpadding="2"><tr valign="middle">');      my %text=&Apache::lonlocal::texthash('upload' => 'Upload',
     $r->print('<td bgcolor="#ccddaa" align="center">');   'upload_label' =>  
     my $displayOut = '<form method="post" enctype="multipart/form-data">';   'Upload file to current directory:',
     $displayOut .= '<input name="uploaddoc" type="file" />'.   'createdir' => 'Create Subdirectory',
         '<input type="hidden" name="currentpath" value="'.$current_path.'" />'.   'createdir_label' => 
         '<input type="hidden" name="action" value="'.$env{"form.action"}.'" />'.   'Create subdirectory in current directory:');
         '<input type="hidden" name="fieldname" value="'.$env{"form.fieldname"}.'" />'.      $r->print(<<"TABLE"); 
         '<input type="hidden" name="mode" value="'.$env{"form.mode"}.'" />'.   <table border="0" cellspacing="2" cellpadding="2">
         '<input type="submit" name="storeupl" value="Upload" />'.    <form method="post" enctype="multipart/form-data">
         '</form>';      <tr valign="middle">
     $r->print($displayOut);        <td bgcolor="#ccddaa" align="right">
     $r->print('</td></tr><tr><td bgcolor="#ccddaa" align="center">');          $text{'upload_label'}
     $displayOut = '<form method="post">';        </td>
     $displayOut .= '<input name="newdir" type="input" />'.        <td bgcolor="#ccddaa" align="left">
         '<input type="hidden" name="currentpath" value="'.$current_path.'" />'.          <input name="uploaddoc" type="file" />
         '<input type="hidden" name="action" value="'.$env{"form.action"}.'" />'.   <input type="hidden" name="currentpath" value="$current_path" />
         '<input type="hidden" name="fieldname" value="'.$env{"form.fieldname"}.'" />'.   <input type="hidden" name="action" value="$env{"form.action"}" />
         '<input type="hidden" name="mode" value="'.$env{"form.mode"}.'" />'.    <input type="hidden" name="fieldname" value="$env{"form.fieldname"}" />
         '<input type="submit" name="createdir" value="'.&mt("Create Directory").'" />'.   <input type="hidden" name="mode" value="$env{"form.mode"}" />
         '</form>';   <input type="submit" name="storeupl" value="$text{'upload'}" />
     $r->print($displayOut);        </td>
     $r->print('</td></tr></table>');      </tr>
     </form>
     <form method="post">
       <tr>
         <td bgcolor="#ccddaa" align="right">
           $text{'createdir_label'}
         </td>
         <td bgcolor="#ccddaa" align="left">
           <input name="newdir" type="input" />
           <input type="hidden" name="currentpath" value="$current_path" />
           <input type="hidden" name="action" value="$env{"form.action"}" />
           <input type="hidden" name="fieldname" value="$env{"form.fieldname"}" />
           <input type="hidden" name="mode" value="$env{"form.mode"}" />
           <input type="submit" name="createdir" value="$text{'createdir'}" />
         </td>
       </tr>
     </form>
   </table>
   TABLE
     my @tree = split (/\//,$current_path);      my @tree = split (/\//,$current_path);
     $r->print('<font size="+2">'.&make_anchor('portfolio','/',$env{"form.mode"},$env{"form.fieldname"},$env{"form.continue"}).'/');      $r->print('<font size="+2">'.&make_anchor('portfolio','/',$env{"form.mode"},$env{"form.fieldname"},$env{"form.continue"}).'/');
     if (@tree > 1){      if (@tree > 1){
Line 387  ENDSMP Line 405  ENDSMP
 ENDSMP  ENDSMP
     $r->print($javascript);      $r->print($javascript);
     $r->print("<h1>Select portfolio files</h1>      $r->print("<h1>Select portfolio files</h1>
                 Check as many as you wish in response to the essay problem.<br />");                  Check as many as you wish in response to the problem.<br />");
     $r->print("<strong>Files selected from other directories:</strong><br />");      my @otherfiles=&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'});
     foreach (&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'})) {      if (@otherfiles) {
         $r->print($_."<br />");   $r->print("<strong>Files selected from other directories:</strong><br />");
    foreach my $file (@otherfiles) {
       $r->print($file."<br />");
    }
     }      }
 }  }
 sub upload {  sub upload {
Line 529  sub handler { Line 550  sub handler {
         $r->print(&Apache::loncommon::bodytag('Portfolio Manager'));          $r->print(&Apache::loncommon::bodytag('Portfolio Manager'));
     }      }
     $r->rflush();      $r->rflush();
  if (($env{'form.storeupl'} eq 'Upload') & (!$env{'form.uploaddoc.filename'})){   if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){
        $r->print('<font color="red"> No file was selected to upload.'.         $r->print('<font color="red"> No file was selected to upload.'.
                'To upload a file, click <strong>Browse...</strong>'.                 'To upload a file, click <strong>Browse...</strong>'.
                ', select a file, then click <strong>Upload</strong>,</font>');                 ', select a file, then click <strong>Upload</strong>,</font>');

Removed from v.1.87  
changed lines
  Added in v.1.88


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