'
+ my $toolslink;
+ if ($allowed || &Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
+ $toolslink = ''
.&Apache::loncommon::help_open_menu('Navigation Screen',
'Navigation_Screen',undef,'RAT')
.' '.&mt('Tools:').' '
@@ -2640,6 +2964,7 @@ sub editor {
.'class="LC_toolbarItem" '
.'title="'.&mt('Supplemental Content Editor').'">'
.'
';
+ }
if ($shown) {
if ($allowed) {
$to_show = &Apache::loncommon::start_scrollbox('900px','880px','400px','contentscroll')
@@ -2703,7 +3028,7 @@ sub editor {
}
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll')
.''
- .&mt('Currently no documents.')
+ .&mt('Currently empty')
.'
'
.&Apache::loncommon::end_scrollbox();
}
@@ -2716,7 +3041,7 @@ sub editor {
.'';
} else {
$to_show = ''
- .&mt('Currently no documents.')
+ .&mt('Currently empty')
.'
'
}
}
@@ -2801,8 +3126,30 @@ sub multiple_check_form {
}
sub process_file_upload {
- my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd) = @_;
+ my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd,$crstype) = @_;
# 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).' '.
+ &mt('Either the file you attempted to upload was empty, or your web browser was unable to read its contents.').' '.
+ '
';
+ 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';
@@ -3122,11 +3469,9 @@ ENDREM
push(@{$filtersref->{'canremove'}},$orderidx);
}
}
- unless ($isexternal) {
- $renamelink=(<$lt{'rn'}
ENDREN
- }
$line.=(<
@@ -3259,7 +3604,7 @@ $form_common."\n".
push(@{$filtersref->{'randomorder'}},$orderidx);
}
}
- my $formname = 'edit_rorder_'.$orderidx;
+ $formname = 'edit_rorder_'.$orderidx;
$rand_order_text =
'
';
}
@@ -3650,8 +3996,8 @@ sub list_symbs {
sub verifycontent {
my ($r) = @_;
my $crstype = &Apache::loncommon::course_type();
- $r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents'));
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents'));
+ $r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Content'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Content'));
$r->print(&startContentScreen('tools'));
$r->print(''.&mt($crstype.' content verification').' ');
$hashtied=0;
@@ -3753,7 +4099,7 @@ sub checkversions {
&changewarning($r,'');
if ($env{'form.timerange'} eq 'all') {
# show all documents
- $header=&mt('All Documents in '.$crstype);
+ $header=&mt('All content in '.$crstype);
$allsel=' selected="selected"';
foreach my $key (keys(%hash)) {
if ($key=~/^ids\_(\/res\/.+)$/) {
@@ -4030,7 +4376,7 @@ sub startContentScreen {
$output .= ' '.&mt('Content Search').' '."\n";
$output .= ''.&mt('Supplemental Content').' ';
} else {
- $output .= ' '.&mt('Content Editor').' '."\n";
+ $output .= ' '.&mt('Main Content Editor').' '."\n";
$output .= ''.&mt('Supplemental Content Editor').' '."\n";
$output .= ' '.&mt('Content Utilities').' '."\n";
'> '.&mt('Content Utilities').' ';
@@ -4051,7 +4397,7 @@ sub endContentScreen {
}
sub supplemental_base {
- return 'supplemental&'.&escape(&mt('Supplemental '.&Apache::loncommon::course_type().' Content'));
+ return 'supplemental&'.&escape(&mt('Supplemental Content'));
}
sub handler {
@@ -4076,7 +4422,8 @@ sub handler {
'Supplemental','Score_Upload_Form','Adding_Pages',
'Importing_LON-CAPA_Resource','Importing_IMS_Course',
'Uploading_From_Harddrive',
- 'Check_Resource_Versions','Verify_Content') {
+ 'Check_Resource_Versions','Verify_Content',
+ 'Course_Roster','Web_Page','Dropbox') {
$help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic);
}
# Composite help files
@@ -4092,8 +4439,6 @@ sub handler {
'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages');
$help{'Group Portfolio'} = &Apache::loncommon::help_open_topic('Docs_About_Group_Files');
$help{'Caching'} = &Apache::loncommon::help_open_topic('Caching');
- $help{'Course Roster'} = &Apache::loncommon::help_open_topic('Docs_Course_Roster');
- $help{'Web Page'} = &Apache::loncommon::help_open_topic('Docs_Web_Page');
my $allowed;
# URI is /adm/supplemental when viewing supplemental docs in non-edit mode.
@@ -4124,7 +4469,7 @@ sub handler {
&init_breadcrumbs('versions','Check/Set Resource Versions');
&checkversions($r);
} elsif ($allowed && $env{'form.dumpcourse'}) {
- &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' Content to Authoring Space');
+ &init_breadcrumbs('dumpcourse','Copy '.&Apache::loncommon::course_type().' Content to Authoring Space');
&dumpcourse($r);
} elsif ($allowed && $env{'form.exportcourse'}) {
&init_breadcrumbs('exportcourse','IMS Export');
@@ -4150,9 +4495,9 @@ sub handler {
# supplementalflag=0: show standard documents
# toolsflag=1: show utilities
- $env{'form.folderpath'} = &unescape($env{'form.folderpath'});
- my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/);
- if (($env{'form.folderpath'}=~/^default/) || ($env{'form.folderpath'} eq "")) {
+ my $unesc_folderpath = &unescape($env{'form.folderpath'});
+ my $supplementalflag=($unesc_folderpath=~/^supplemental/);
+ if (($unesc_folderpath=~/^default/) || ($unesc_folderpath eq "")) {
$supplementalflag=0;
}
if ($env{'form.forcesupplement'}) { $supplementalflag=1; }
@@ -4184,7 +4529,7 @@ sub handler {
}
} elsif ($env{'form.command'} eq 'editdocs') {
$env{'form.folderpath'} = 'default&'.
- &escape(&mt('Main '.$crstype.' Content').':::::');
+ &escape(&mt('Main Content').':::::');
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => $env{'form.command'}});
} elsif ($env{'form.command'} eq 'editsupp') {
$env{'form.folderpath'} = 'supplemental&'.
@@ -4229,7 +4574,7 @@ sub handler {
if ($supplementalflag) {
$env{'form.folderpath'}=&supplemental_base();
} else {
- $env{'form.folderpath'}='default'.&escape(&mt('Main '.$crstype.' Content').
+ $env{'form.folderpath'}='default&'.&escape(&mt('Main Content').
':::::');
}
}
@@ -4255,7 +4600,7 @@ sub handler {
if ($env{'form.folder'} eq '' ||
$env{'form.folder'} eq 'supplemental') {
$folderpath='default&'.
- &escape(&mt('Main '.$crstype.' Content').':::::');
+ &escape(&mt('Main Content').':::::');
}
}
$containertag = ' ';
@@ -4292,9 +4637,11 @@ sub handler {
$script .= &dump_switchserver_js(@hosts);
}
} else {
+ my $tid = 1;
my @tabids;
if ($supplementalflag) {
@tabids = ('002','ee2','ff2');
+ $tid = 2;
} else {
@tabids = ('aa1','bb1','cc1','ff1');
unless ($env{'form.folderpath'} =~ /\:1$/) {
@@ -4306,7 +4653,7 @@ sub handler {
$script .= &editing_js($udom,$uname,$supplementalflag).
&history_tab_js().
&inject_data_js().
- &Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr).
+ &Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid).
&Apache::lonextresedit::extedit_javascript();
$addentries = {
onload => "javascript:resize_scrollbox('contentscroll','1','1');",
@@ -4358,7 +4705,7 @@ sub handler {
# Process file upload - phase one - upload and parse primary file.
undef($hadchanges);
$uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom,
- \%allfiles,\%codebase,$context);
+ \%allfiles,\%codebase,$context,$crstype);
if ($hadchanges) {
&mark_hash_old();
}
@@ -4410,7 +4757,7 @@ sub handler {
my %lt=&Apache::lonlocal::texthash(
'copm' => 'All documents out of a published map into this folder',
'upfi' => 'Upload File',
- 'upld' => 'Import Content',
+ 'upld' => 'Upload Content',
'srch' => 'Search',
'impo' => 'Import',
'lnks' => 'Import from Stored Links',
@@ -4431,8 +4778,8 @@ sub handler {
'grpo' => 'Group Portfolio',
'rost' => 'Course Roster',
'abou' => 'Personal Information Page for a User',
- 'imsf' => 'IMS Import',
- 'imsl' => 'Import IMS package',
+ 'imsf' => 'IMS Upload',
+ 'imsl' => 'Upload IMS package',
'cms' => 'Origin of IMS package',
'se' => 'Select',
'file' => 'File',
@@ -4580,7 +4927,7 @@ HIDDENFORM
if ($folder eq '' || $supplementalflag) {
$folder='default';
$savefolderpath = $env{'form.folderpath'};
- $env{'form.folderpath'}='default&'.&escape(&mt('Content'));
+ $env{'form.folderpath'}='default&'.&escape(&mt('Main Content'));
$pathitem = ' ';
}
@@ -4601,7 +4948,7 @@ HIDDENFORM
my $newnavform=(<
-
+
$pathitem
@@ -4611,7 +4958,7 @@ HIDDENFORM
NNFORM
my $newsmppageform=(<
-
+
$pathitem
@@ -4636,6 +4983,7 @@ NSPROBFORM
$pathitem
+ $help{'Dropbox'}
NDBFORM
@@ -4651,7 +4999,7 @@ NEXUFORM
my $newbulform=(<
-
+
$pathitem
@@ -4661,7 +5009,7 @@ NBFORM
my $newaboutmeform=(<
-
+
$pathitem
@@ -4672,7 +5020,7 @@ NAMFORM
my $newaboutsomeoneform=(<
-
+
$pathitem
@@ -4681,12 +5029,12 @@ NASOFORM
my $newrosterform=(<
-
+
$pathitem
- $help{'Course Roster'}
+ $help{'Course_Roster'}
NROSTFORM
@@ -4702,11 +5050,11 @@ NROSTFORM
}
my $newwebpageform =(<
-
+
$pathitem
- $help{'Web Page'}
+ $help{'Web_Page'}
NWEBFORM
@@ -4726,7 +5074,7 @@ my $newfolderb;
@@ -4737,14 +5085,14 @@ NPFORM
NFFORM
my $newsylform=(<
-
+
$pathitem
@@ -4756,7 +5104,7 @@ NSYLFORM
my $newgroupfileform=(<
-
+
$pathitem
@@ -4783,7 +5131,7 @@ NGFFORM
);
}
push(@importdoc,
- {' '=>$fileuploadform}
+ {' '=>$fileuploadform}
);
$fileuploadform = &create_form_ul(&create_list_elements(@importdoc));
@@ -4805,14 +5153,14 @@ NGFFORM
$communityform = &create_form_ul(&create_list_elements(@communityforma));
my %orderhash = (
- 'aa' => ['Import Content',$fileuploadform],
- 'bb' => ['Published Content',$importpubform],
- 'cc' => ['Grading Resources',$gradingform],
+ 'aa' => ['Upload',$fileuploadform],
+ 'bb' => ['Import',$importpubform],
+ 'cc' => ['Grading',$gradingform],
);
unless ($container eq 'page') {
$orderhash{'00'} = ['Newfolder',$newfolderform];
$orderhash{'dd'} = ['Collaboration',$communityform];
- $orderhash{'ee'} = ['Special Pages',$specialdocumentsform];
+ $orderhash{'ee'} = ['Other',$specialdocumentsform];
}
$hadchanges=0;
@@ -4873,7 +5221,7 @@ SUPDOCFORM
my $supnewfolderform=(<
-
+
$pathitem
@@ -4923,7 +5271,7 @@ SNAMFORM
$pathitem
- $help{'Web Page'}
+ $help{'Web_Page'}
SWEBFORM
@@ -4946,14 +5294,27 @@ my @supimportdoc = (
$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc));
my %suporderhash = (
'00' => ['Supnewfolder', $supnewfolderform],
- 'ee' => ['Import Content',$supupdocform],
- 'ff' => ['Special Pages',&create_form_ul(&create_list_elements(@specialdocs))]
+ 'ee' => ['Upload',$supupdocform],
+ 'ff' => ['Other',&create_form_ul(&create_list_elements(@specialdocs))]
);
if ($supplementalflag) {
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,
$supplementalflag,\%suporderhash,$iconpath,$pathitem);
if ($error) {
$r->print(''.$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) {
@@ -5102,7 +5463,7 @@ sub remove_archive {
my $currcmd = $env{'form.cmd'};
my $position = $env{'form.position'};
if ($position > 0) {
- $env{'form.cmd'} = 'del_'.$position;
+ $env{'form.cmd'} = 'remove_'.$position;
my ($title,$url,@rrest) =
split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]);
if (&handle_edit_cmd($docuname,$docudom)) {
@@ -5137,13 +5498,13 @@ sub generate_admin_menu {
my ($crstype) = @_;
my $lc_crstype = lc($crstype);
my ($home,$other,%outhash)=&authorhosts();
- my %lt=&Apache::lonlocal::texthash (
+ my %lt= ( # do not translate here
'vc' => 'Verify Content',
'cv' => 'Check/Set Resource Versions',
'ls' => 'List Resource Identifiers',
'imse' => 'Export contents to IMS Archive',
- 'dcd' => "Dump $crstype Content to Authoring Space",
- );
+ 'dcd' => "Copy $crstype Content to Authoring Space",
+ );
my ($candump,$dumpurl);
if ($home + $other > 0) {
$candump = 'F';
@@ -5225,7 +5586,7 @@ sub generate_edit_table {
my $form;
my $activetab;
my $active;
- if (($env{'form.active'} ne '') && ($env{'form.active'} ne 'aa')) {
+ if (($env{'form.active'} ne '') && ($env{'form.active'} ne '00')) {
$activetab = $env{'form.active'};
}
my $backicon = $iconpath.'clickhere.gif';
@@ -5233,7 +5594,7 @@ sub generate_edit_table {
$form = ''.
'
'."\n".
''.
- ''.
+ ' '.
' '.$backtext.' '."\n".
''.
@@ -5260,7 +5621,7 @@ sub generate_edit_table {
$form .= ' '.&mt(${$orderhash{$name}}[0]).' '."\n";
} else {
- $form .= ''.${$orderhash{$name}}[1].' '."\n";
+ $form .= ''.${$orderhash{$name}}[1].' '."\n";
}
}
@@ -5364,7 +5725,7 @@ sub editing_js {
$main_container_page = 1;
}
my $toplevelmain =
- &escape(&mt('Main '.$crstype.' Content').':::::');
+ &escape(&mt('Main Content').':::::');
my $toplevelsupp = &supplemental_base();
my $backtourl;
@@ -5378,6 +5739,8 @@ sub editing_js {
if (&Apache::lonnet::is_on_map($res)) {
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='.
&HTML::Entities::encode($caller,'<>&"');
+ } else {
+ $backtourl = '/adm/navmaps';
}
}
} elsif ($env{'docs.exit.'.$env{'request.course.id'}} eq '/adm/menu') {
@@ -5821,10 +6184,12 @@ for (i = 0; i < currentLis.length; i++)
function hideAll(current, nav, data) {
unselectInactive(nav);
-if(current.className == 'right'){
+if (current) {
+ if (current.className == 'right'){
current.className = 'right active'
- }else{
+ } else {
current.className = 'active';
+ }
}
currentData = document.getElementById(data);
currentDivs = currentData.getElementsByTagName('DIV');
@@ -5855,10 +6220,24 @@ function openTabs(pageId) {
}
function showPage(current, pageId, nav, data) {
+ currstate = current.className;
hideAll(current, nav, data);
openTabs(pageId);
unselectInactive(nav);
- current.className = 'active';
+ if ((currstate == 'active') || (currstate == 'right active')) {
+ if (currstate == 'active') {
+ current.className = '';
+ } else {
+ current.className = 'right';
+ }
+ activeTab = '';
+ toggleUpload();
+ toggleMap();
+ resize_scrollbox('contentscroll','1','0');
+ return;
+ } else {
+ current.className = 'active';
+ }
currentData = document.getElementById(pageId);
currentData.style.display = 'block';
activeTab = pageId;
@@ -6246,9 +6625,9 @@ ENDINJECT
sub dump_switchserver_js {
my @hosts = @_;
my %lt = &Apache::lonlocal::texthash(
- dump => 'Dumping to Authoring Space requires switching server.',
+ dump => 'Copying Content to Authoring Space requires switching server.',
swit => 'Switch server?',
- duco => 'Dump content to Authoring Space',
+ duco => 'Copying Content to Authoring Space',
yone => 'You need to switch to a server housing an Authoring Space for which you are author or co-author.',
chos => 'Choose server',
);