--- loncom/interface/londocs.pm 2013/11/20 04:48:18 1.484.2.43 +++ loncom/interface/londocs.pm 2013/04/03 02:00:19 1.543 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.484.2.43 2013/11/20 04:48:18 raeburn Exp $ +# $Id: londocs.pm,v 1.543 2013/04/03 02:00:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,8 +41,6 @@ use Apache::lonclonecourse; use Apache::lonnavmaps; use Apache::lonnavdisplay(); use Apache::lonextresedit(); -use Apache::lontemplate(); -use Apache::lonsimplepage(); use HTML::Entities; use HTML::TokeParser; use GDBM_File; @@ -58,7 +56,6 @@ my $hashtied; my %alreadyseen=(); my $hadchanges; -my $suppchanges; my %help=(); @@ -82,11 +79,7 @@ sub storemap { $map,1,$report); if ($errtext) { return ($errtext,2); } - if ($map =~ /^default/) { - $hadchanges=1; - } else { - $suppchanges=1; - } + $hadchanges=1; return ($errtext,0); } @@ -143,28 +136,8 @@ sub clean { sub dumpcourse { my ($r) = @_; my $crstype = &Apache::loncommon::course_type(); - my ($starthash,$js); - unless (($env{'form.authorspace'}) && ($env{'form.authorfolder'}=~/\w/)) { - $js = <<"ENDJS"; - -ENDJS - $starthash = { - add_entries => {'onload' => "hide_searching();"}, - }; - } - $r->print(&Apache::loncommon::start_page('Copy '.$crstype.' Content to Authoring Space',$js,$starthash)."\n". - &Apache::lonhtmlcommon::breadcrumbs('Copy '.$crstype.' Content to Authoring Space')."\n"); + $r->print(&Apache::loncommon::start_page('Dump '.$crstype.' Content to Authoring Space')."\n". + &Apache::lonhtmlcommon::breadcrumbs('Dump '.$crstype.' Content to Authoring Space')."\n"); $r->print(&startContentScreen('tools')); my ($home,$other,%outhash)=&authorhosts(); unless ($home) { @@ -183,407 +156,118 @@ ENDJS $r->print('
'
+ my $toolslink = '
'; - } if ($shown) { if ($allowed) { $to_show = &Apache::loncommon::start_scrollbox('900px','880px','400px','contentscroll') @@ -2992,11 +2667,11 @@ sub editor { if (@allidx > 0) { my $path; if ($env{'form.folderpath'}) { - $path = + $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); } if (@allidx > 1) { - $to_show .= + $to_show .= &Apache::loncommon::continue_data_table_row(). ' | '. ' | '.
@@ -3028,7 +2703,7 @@ sub editor {
}
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll')
.' '
- .&mt('Currently empty')
+ .&mt('Currently no documents.')
.' '
.&Apache::loncommon::end_scrollbox();
}
@@ -3041,7 +2716,7 @@ sub editor {
.'';
} else {
$to_show = ''
- .&mt('Currently empty')
+ .&mt('Currently no documents.')
.' '
}
}
@@ -3126,30 +2801,8 @@ sub multiple_check_form {
}
sub process_file_upload {
- my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd,$crstype) = @_;
+ my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd) = @_;
# upload a file, if present
- my $filesize = length($env{'form.uploaddoc'});
- if (!$filesize) {
- $$upload_output = ''.
- &mt('Unable to upload [_1]. (size = [_2] bytes)',
- ''.$env{'form.uploaddoc.filename'}.'',
- $filesize).' ';
- return;
- }
- my $quotatype = 'unofficial';
- if ($crstype eq 'Community') {
- $quotatype = 'community';
- } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) {
- $quotatype = 'official';
- }
- if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) {
- $filesize = int($filesize/1000); #expressed in kb
- $$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course',
- $env{'form.uploaddoc.filename'},$filesize,'upload');
- return if ($$upload_output);
- }
my ($parseaction,$showupload,$nextphase,$mimetype);
if ($env{'form.parserflag'}) {
$parseaction = 'parse';
@@ -3469,9 +3122,11 @@ ENDREM
push(@{$filtersref->{'canremove'}},$orderidx);
}
}
- $renamelink=(<'. - &mt('Either the file you attempted to upload was empty, or your web browser was unable to read its contents.').' '. - '
@@ -3604,13 +3259,13 @@ $form_common."\n".
push(@{$filtersref->{'randomorder'}},$orderidx);
}
}
- $formname = 'edit_rorder_'.$orderidx;
+ my $formname = 'edit_rorder_'.$orderidx;
$rand_order_text =
'
NDBFORM
@@ -4999,7 +4652,7 @@ NEXUFORM
my $newbulform=(< '.$error.' '); - } else { - if ($suppchanges) { - my %servers = &Apache::lonnet::internet_dom_servers($coursedom); - my @ids=&Apache::lonnet::current_machine_ids(); - foreach my $server (keys(%servers)) { - next if (grep(/^\Q$server\E$/,@ids)); - my $hashid=$coursenum.':'.$coursedom; - my $cachekey = &escape('suppcount').':'.&escape($hashid); - &Apache::lonnet::remote_devalidate_cache($server,[$cachekey]); - } - &Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); - undef($suppchanges); - } } } } elsif ($supplementalflag) { @@ -5463,7 +5103,7 @@ sub remove_archive { my $currcmd = $env{'form.cmd'}; my $position = $env{'form.position'}; if ($position > 0) { - $env{'form.cmd'} = 'remove_'.$position; + $env{'form.cmd'} = 'del_'.$position; my ($title,$url,@rrest) = split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]); if (&handle_edit_cmd($docuname,$docudom)) { @@ -5498,13 +5138,13 @@ sub generate_admin_menu { my ($crstype) = @_; my $lc_crstype = lc($crstype); my ($home,$other,%outhash)=&authorhosts(); - my %lt= ( # do not translate here + my %lt=&Apache::lonlocal::texthash ( 'vc' => 'Verify Content', 'cv' => 'Check/Set Resource Versions', 'ls' => 'List Resource Identifiers', 'imse' => 'Export contents to IMS Archive', - 'dcd' => "Copy $crstype Content to Authoring Space", - ); + 'dcd' => "Dump $crstype Content to Authoring Space", + ); my ($candump,$dumpurl); if ($home + $other > 0) { $candump = 'F'; @@ -5586,7 +5226,7 @@ sub generate_edit_table { my $form; my $activetab; my $active; - if (($env{'form.active'} ne '') && ($env{'form.active'} ne '00')) { + if (($env{'form.active'} ne '') && ($env{'form.active'} ne 'aa')) { $activetab = $env{'form.active'}; } my $backicon = $iconpath.'clickhere.gif'; @@ -5594,7 +5234,7 @@ sub generate_edit_table { $form = ''.
' |