--- loncom/interface/londocs.pm 2011/05/27 19:39:25 1.434.2.4 +++ loncom/interface/londocs.pm 2010/11/28 00:04:05 1.440 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.434.2.4 2011/05/27 19:39:25 raeburn Exp $ +# $Id: londocs.pm,v 1.440 2010/11/28 00:04:05 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1660,7 +1660,7 @@ sub editor { .''.&mt('Actions').'' .''.&mt('Document').''); if ($folder !~ /^supplemental/) { - $r->print(''.&mt('Settings').''); + $->print(''.&mt('Settings').''); } $r->print(&Apache::loncommon::end_data_table_header_row()); } @@ -1721,7 +1721,7 @@ sub process_file_upload { $destination .= $newidx; my $url=&Apache::lonnet::userfileupload('uploaddoc','coursedoc',$destination, $parseaction,$allfiles, - $codebase,undef,undef,undef,undef, + $codebase,undef,undef,undef,undef, undef,undef,\$mimetype); if ($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E.*/([^/]+)$}) { my $stored = $1; @@ -1729,7 +1729,7 @@ sub process_file_upload { $stored.'').'

'; } else { my ($filename) = ($env{'form.uploaddoc.filename'} =~ m{([^/]+)$}); - + $$upload_output = '

'.&mt('Unable to save file [_1].',''.$filename.'').'

'; return; } @@ -1758,14 +1758,14 @@ sub process_file_upload { if ($total_embedded > 0) { my $uploadphase = 'upload_embedded'; my $primaryurl = &HTML::Entities::encode($url,'<>&"'); - my $state = &embedded_form_elems($uploadphase,$primaryurl,$newidx); - my ($embedded,$num) = + my $state = &embedded_form_elems($uploadphase,$primaryurl,$newidx); + my ($embedded,$num) = &Apache::loncommon::ask_for_embedded_content( '/adm/coursedocs',$state,$allfiles,$codebase,{'docs_url' => $url}); if ($embedded) { if ($num) { $$upload_output .= - '

'.&mt('This file contains embedded multimedia objects, which need to be uploaded.').'

'.$embedded; + '

'.&mt('This file contains embedded multimedia objects, which need to be uploaded.').'

'.$embedded; $nextphase = $uploadphase; } else { $$upload_output .= $embedded; @@ -2825,9 +2825,9 @@ sub create_form_ul { if ($allowed) { if (($env{'form.uploaddoc.filename'}) && ($env{'form.cmd'}=~/^upload_(\w+)/)) { - my $context = $1; + my $context = $1; # Process file upload - phase one - upload and parse primary file. - undef($hadchanges); + undef($hadchanges); $uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom, \%allfiles,\%codebase,$context); if ($hadchanges) { @@ -2835,9 +2835,9 @@ sub create_form_ul { } $r->print($upload_output); } elsif ($env{'form.phase'} eq 'upload_embedded') { - # Process file upload - phase two - upload embedded objects + # Process file upload - phase two - upload embedded objects $uploadphase = 'check_embedded'; - my $primaryurl = &HTML::Entities::encode($env{'form.primaryurl'},'<>&"'); + my $primaryurl = &HTML::Entities::encode($env{'form.primaryurl'},'<>&"'); my $state = &embedded_form_elems($uploadphase,$primaryurl, $env{'form.newidx'}); my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; @@ -2845,7 +2845,7 @@ sub create_form_ul { my ($destination,$dir_root) = &embedded_destination(); my $url_root = '/uploaded/'.$docudom.'/'.$docuname; my $actionurl = '/adm/coursedocs'; - my ($result,$flag) = + my ($result,$flag) = &Apache::loncommon::upload_embedded('coursedoc',$destination, $docuname,$docudom,$dir_root,$url_root,undef,undef,undef,$state, $actionurl); @@ -2863,7 +2863,7 @@ sub create_form_ul { } } - unless ($showdoc || $uploadphase) { + unless ($showdoc || $uploadphase) { # ----------------------------------------------------------------------------- my %lt=&Apache::lonlocal::texthash( 'uplm' => 'Upload a new main '.lc($crstype).' document', @@ -2873,7 +2873,7 @@ sub create_form_ul { 'upld' => 'Import Document', 'srch' => 'Search', 'impo' => 'Import', - 'book' => 'Import Bookmarks', + 'wish' => 'Import from Wishlist', 'selm' => 'Select Map', 'load' => 'Load Map', 'reco' => 'Recover Deleted Documents', @@ -2946,7 +2946,7 @@ SEDFFORM my @simpleeditdefaultforma = ( { ''.$lt{srch}.'' => "$uploadtag$lt{'srch'}" }, { ''.$lt{impo}.'' => "$lt{'impo'}$help{'Importing_LON-CAPA_Resource'}" }, - { ''.$lt{book}.'' => "$lt{'book'}" }, + { ''.$lt{wish}.'' => "$lt{'wish'}" }, ); $simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma)); $simpleeditdefaultform .=(< - $lt{'reco'} + $lt{'reco'} RFORM @@ -3261,7 +3261,7 @@ if($env{'form.pagepath'}) { my @tools = ( # {''.$lt{extr}.''=>$extresourcesform}, # {''.$lt{imsf}.''=>$imspform}, - {''.$lt{reco}.''=>$recoverform}, + {''.$lt{reco}.''=>$recoverform}, ); my %orderhash = ( @@ -3464,7 +3464,7 @@ sub embedded_destination { sub return_to_editor { my $actionurl = '/adm/coursedocs'; - return '

'."\n". + return '

'."\n". '

'."\n". ''.&mt('Return to Editor'). '

';