Diff for /loncom/interface/portfolio.pm between versions 1.191 and 1.194

version 1.191, 2008/04/16 23:11:06 version 1.194, 2008/06/09 22:34:55
Line 93  sub display_common { Line 93  sub display_common {
  'Upload file to current directory:',   'Upload file to current directory:',
  'createdir' => 'Create Subdirectory',   'createdir' => 'Create Subdirectory',
  'createdir_label' =>    'createdir_label' => 
  'Create subdirectory in current directory:');   'Create subdirectory in current directory:',
                                            'parse' => 'If HTML file, upload embedded images/multimedia/css/linked files'
                                               );
         my $escuri = &HTML::Entities::encode($r->uri,'&<>"');          my $escuri = &HTML::Entities::encode($r->uri,'&<>"');
  my $help_fileupload = &Apache::loncommon::help_open_topic('Portfolio AddFiles');   my $help_fileupload = &Apache::loncommon::help_open_topic('Portfolio AddFiles');
  my $help_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory');   my $help_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory');
Line 116  sub display_common { Line 118  sub display_common {
  <input type="hidden" name="fieldname" value="$env{"form.fieldname"}" />   <input type="hidden" name="fieldname" value="$env{"form.fieldname"}" />
  <input type="hidden" name="mode" value="$env{"form.mode"}" />   <input type="hidden" name="mode" value="$env{"form.mode"}" />
  <input type="submit" name="storeupl" value="$text{'upload'}" />$help_fileupload   <input type="submit" name="storeupl" value="$text{'upload'}" />$help_fileupload
           <br />
           <span class="LC_nobreak">
            <label>$text{'parse'}
            <input type="checkbox" name="parserflag" checked="checked" />
            </label>
           </span>
       </form>        </form>
     </td>      </td>
   </tr>    </tr>
Line 1815  sub upload { Line 1823  sub upload {
     my $port_path = &get_port_path();      my $port_path = &get_port_path();
     my (%allfiles,%codebase,$mode);      my (%allfiles,%codebase,$mode);
     if ($env{'form.uploaddoc.filename'} =~ m/(\.htm|\.html|\.shtml)$/i) {      if ($env{'form.uploaddoc.filename'} =~ m/(\.htm|\.html|\.shtml)$/i) {
  $mode = 'parse';          if ($env{'form.parserflag'}) {
       $mode = 'parse';
           }
     }      }
     my $result=      my $result=
  &Apache::lonnet::userfileupload('uploaddoc','',   &Apache::lonnet::userfileupload('uploaddoc','',
Line 1837  STATE Line 1846  STATE
             $r->print("<h2>".&mt("Reference Warning")."</h2>");              $r->print("<h2>".&mt("Reference Warning")."</h2>");
             $r->print("<p>".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."</p>");              $r->print("<p>".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."</p>");
             $r->print("<p>".&mt("Please select the locations from which the referenced files are to be uploaded.")."</p>");              $r->print("<p>".&mt("Please select the locations from which the referenced files are to be uploaded.")."</p>");
     $r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase,      $r->print(&Apache::loncommon::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase,
       {'error_on_invalid_names'   => 1,        {'error_on_invalid_names'   => 1,
        'ignore_remote_references' => 1,}));         'ignore_remote_references' => 1,}));
     $r->print('<p>Or '.&done('Return to directory',$url).'</p>');      $r->print('<p>Or '.&done('Return to directory',$url).'</p>');
Line 2336  sub handler { Line 2345  sub handler {
             &Apache::lonhtmlcommon::clear_breadcrumbs();              &Apache::lonhtmlcommon::clear_breadcrumbs();
             $r->print(&coursegrp_portfolio_header($udom,$uname,$grp_desc));              $r->print(&coursegrp_portfolio_header($udom,$uname,$grp_desc));
         }          }
         my @dir_list=&get_dir_list($portfolio_root,undef,$group);          my @dir_list=&get_dir_list($portfolio_root,$current_path,$group);
  if ($dir_list[0] eq 'no_such_dir'){   if ($dir_list[0] eq 'no_such_dir'){
     # two main reasons for this:      # two main reasons for this:
             #    1) never been here, so directory structure not created              #    1) never been here, so directory structure not created
Line 2352  sub handler { Line 2361  sub handler {
  $current_path = '/'; # force it back to the root           $current_path = '/'; # force it back to the root        
     }      }
     # now grab the directory list again, for the first time      # now grab the directory list again, for the first time
     @dir_list=              @dir_list=&get_dir_list($portfolio_root,$current_path,$group);
                 &Apache::lonnet::dirlist($portfolio_root.$current_path,  
                                          $udom,$uname,$getpropath);  
         }          }
  # need to know if directory is empty so it can be removed if desired   # need to know if directory is empty so it can be removed if desired
  my $is_empty=(@dir_list == 2);   my $is_empty=(@dir_list == 2);

Removed from v.1.191  
changed lines
  Added in v.1.194


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