'.
&mt('There was a problem removing a lockfile.').' ';
if ($type eq 'paste') {
- &mt('This will prevent use of the paste buffer until th next log-in.');
+ if ($freedlock eq 'nolock') {
+ $locknotfreed =
+ '
'.
+ &mt('A lockfile was not released when you added content to the clipboard earlier in this session.').' '.
+
+ &mt('As a result addition of items to the clipboard will be unavailable until your next log-in.');
+ } else {
+ $locknotfreed .=
+ &mt('This will prevent addition of items to the clipboard until your next log-in.');
+ }
} elsif ($type eq 'map') {
- &mt('This will prevent creation of additional folders or composite pages in this course.');
+ $locknotfreed .=
+ &mt('This will prevent creation of additional folders or composite pages in this course.');
} elsif ($type eq 'smppg') {
$locknotfreed .=
&mt('This will prevent creation of additional simple pages in this course.');
@@ -4591,6 +4909,7 @@ sub handler {
my $container;
my $containertag;
my $pathitem;
+ my %ltitools;
# Do we directly jump somewhere?
@@ -4728,11 +5047,13 @@ sub handler {
}
}
my $tabidstr = join("','",@tabids);
- $script .= &editing_js($udom,$uname,$supplementalflag).
+ %ltitools = &Apache::lonnet::get_domain_ltitools($coursedom);
+ my $posslti = keys(%ltitools);
+ $script .= &editing_js($udom,$uname,$supplementalflag,$posslti).
&history_tab_js().
&inject_data_js().
&Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid).
- &Apache::lonextresedit::extedit_javascript();
+ &Apache::lonextresedit::extedit_javascript(\%ltitools);
$addentries = {
onload => "javascript:resize_scrollbox('contentscroll','1','1');",
};
@@ -4748,7 +5069,9 @@ sub handler {
.'// '."\n"
- .''."\n";
+ .''."\n"
+ .''."\n";
# Breadcrumbs
&Apache::lonhtmlcommon::clear_breadcrumbs();
@@ -4848,6 +5171,8 @@ sub handler {
'impo' => 'Import',
'lnks' => 'Import from Stored Links',
'impm' => 'Import from Assembled Map',
+ 'extr' => 'External Resource',
+ 'extt' => 'External Tool',
'selm' => 'Select Map',
'load' => 'Load Map',
'newf' => 'New Folder',
@@ -4878,9 +5203,32 @@ sub handler {
'webctce4' => 'WebCT 4 Campus Edition',
);
# -----------------------------------------------------------------------------
+
+ # Calculate free quota space for a user or course. A javascript function checks
+ # file size to determine if upload should be allowed.
+ my $quotatype = 'unofficial';
+ if ($crstype eq 'Community') {
+ $quotatype = 'community';
+ } elsif ($crstype eq 'Placement') {
+ $quotatype = 'placement';
+ } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.coursecode'}) {
+ $quotatype = 'official';
+ } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) {
+ $quotatype = 'textbook';
+ }
+ my $disk_quota = &Apache::loncommon::get_user_quota($coursenum,$coursedom,
+ 'course',$quotatype); # expressed in MB
+ my $current_disk_usage = 0;
+ foreach my $subdir ('docs','supplemental') {
+ $current_disk_usage += &Apache::lonnet::diskusage($coursedom,$coursenum,
+ "userfiles/$subdir",1); # expressed in kB
+ }
+ my $free_space = 1024 * ((1024 * $disk_quota) - $current_disk_usage);
+
my $fileupload=(<
-
+
+
FIUP
my $checkbox=(<
- $fileupload
+ $fileupload
$lt{'title'}:
@@ -4970,6 +5318,11 @@ SEDFFORM
my $extresourcesform =
&Apache::lonextresedit::extedit_form(0,0,undef,undef,$pathitem,
$help{'Adding_External_Resource'});
+ my $exttoolform =
+ &Apache::lonextresedit::extedit_form(0,0,undef,undef,$pathitem,
+ $help{'Adding_External_Tool'},undef,
+ undef,'tool',$coursedom,$coursenum,
+ \%ltitools);
if ($allowed) {
my $folder = $env{'form.folder'};
if ($folder eq '') {
@@ -5147,7 +5500,7 @@ NROSTFORM
$help{'Web_Page'}
NWEBFORM
-
+
my $specialdocumentsform;
my @specialdocumentsforma;
@@ -5215,6 +5568,11 @@ NGFFORM
my @importdoc = (
{''=>$extresourcesform}
);
+ if (keys(%ltitools)) {
+ push(@importdoc,
+ {''=>$exttoolform},
+ );
+ }
unless ($container eq 'page') {
push(@importdoc,
{''=>$imspform}
@@ -5256,7 +5614,7 @@ unless ($container eq 'page') {
$hadchanges=0;
unless (($supplementalflag || $toolsflag)) {
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,
- $supplementalflag,\%orderhash,$iconpath,$pathitem);
+ $supplementalflag,\%orderhash,$iconpath,$pathitem,\%ltitools);
if ($error) {
$r->print('
'.$error.'
');
}
@@ -5323,6 +5681,12 @@ SNFFORM
&Apache::lonextresedit::extedit_form(1,0,undef,undef,$pathitem,
$help{'Adding_External_Resource'});
+ my $supexttoolform =
+ &Apache::lonextresedit::extedit_form(1,0,undef,undef,$pathitem,
+ $help{'Adding_External_Tool'},
+ undef,undef,'tool',$coursedom,
+ $coursenum,\%ltitools);
+
my $supnewsylform=(<
@@ -5376,10 +5740,16 @@ my @specialdocs = (
);
my @supimportdoc = (
{''
- =>$supextform},
- {''
+ =>$supextform});
+ if (keys(%ltitools)) {
+ push(@supimportdoc,
+ {''
+ =>$supexttoolform});
+ }
+ push(@supimportdoc,
+ {''
=>$supupdocform},
- );
+ );
$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc));
my %suporderhash = (
@@ -5389,7 +5759,7 @@ my %suporderhash = (
);
if ($supplementalflag) {
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,
- $supplementalflag,\%suporderhash,$iconpath,$pathitem);
+ $supplementalflag,\%suporderhash,$iconpath,$pathitem,\%ltitools);
if ($error) {
$r->print('
'.$error.'
');
} else {
@@ -5777,8 +6147,8 @@ END
}
sub editing_js {
- my ($udom,$uname,$supplementalflag) = @_;
- my %lt = &Apache::lonlocal::texthash(
+ my ($udom,$uname,$supplementalflag,$posslti) = @_;
+ my %js_lt = &Apache::lonlocal::texthash(
p_mnf => 'Name of New Folder',
t_mnf => 'New Folder',
p_mnp => 'Name of New Page',
@@ -5788,23 +6158,25 @@ sub editing_js {
p_msb => 'Title for the Problem',
p_mdb => 'Title for the Drop Box',
p_mbb => 'Title for the Discussion Board',
- p_mwp => 'Title for Web Page',
+ p_mwp => 'Title for Web Page',
p_mab => "Enter user:domain for User's Personal Information Page",
p_mab2 => 'Personal Information Page of ',
p_mab_alrt1 => 'Not a valid user:domain',
p_mab_alrt2 => 'Please enter both user and domain in the format user:domain',
p_chn => 'New Title',
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!',
- p_rmr2a => 'Remove[_99]',
- p_rmr2b => '?[_99]',
- p_rmr3a => 'Remove those [_2]',
- p_rmr3b => 'items?[_2]',
+ p_rmr2a => 'Remove',
+ p_rmr2b => '?',
+ p_rmr3a => 'Remove those',
+ p_rmr3b => 'items?',
+ p_rmr4 => 'WARNING: Removing a resource uploaded to a course cannot be undone via "Undo Delete".',
+ p_rmr5 => 'Push "Cancel" and then use "Cut" instead if you might need to undo this change.',
p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!',
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.',
- p_ctr2a => 'Cut[_98]',
- p_ctr2b => '?[_98]',
- p_ctr3a => 'Cut those[_2]',
- p_ctr3b => 'items?[_2]',
+ p_ctr2a => 'Cut',
+ p_ctr2b => '?',
+ p_ctr3a => 'Cut those',
+ p_ctr3b => 'items?',
rpck => 'Enter number to pick (e.g., 3)',
imsfile => 'You must choose an IMS package for import',
imscms => 'You must select which Course Management System was the source of the IMS package',
@@ -5816,7 +6188,7 @@ sub editing_js {
noch => 'No changes to settings specified.',
noac => 'No actions selected.',
);
-
+ &js_escape(\%js_lt);
my $crstype = &Apache::loncommon::course_type();
my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"');
my $main_container_page;
@@ -5852,16 +6224,22 @@ sub editing_js {
}
my $fieldsets = "'ext','doc'";
+ if ($posslti) {
+ $fieldsets .= ",'tool'";
+ }
unless ($main_container_page) {
$fieldsets .=",'ims'";
}
if ($supplementalflag) {
$fieldsets = "'suppext','suppdoc'";
+ if ($posslti) {
+ $fieldsets .= ",'supptool'";
+ }
}
return <$lt{'more'}';
+ document.getElementById('more'+caller).innerHTML = ' $js_lt{'more'}';
} else {
document.getElementById('more'+caller).innerHTML = '';
}
@@ -6424,10 +6829,10 @@ function togglePick(caller,value) {
function toggleCheckUncheck(caller,more) {
if (more == 1) {
- document.getElementById('more'+caller).innerHTML = ' $lt{'less'}';
+ document.getElementById('more'+caller).innerHTML = ' $js_lt{'less'}';
document.getElementById('allfields'+caller).style.display='block';
} else {
- document.getElementById('more'+caller).innerHTML = ' $lt{'more'}';
+ document.getElementById('more'+caller).innerHTML = ' $js_lt{'more'}';
document.getElementById('allfields'+caller).style.display='none';
}
resize_scrollbox('contentscroll','1','1');
@@ -6469,6 +6874,7 @@ function checkSubmits() {
var doactions = multiActions();
var cutwarnings = 0;
var remwarnings = 0;
+ var removalinfo = 0;
if (doactions == 1) {
var remidxlist = document.cumulativeactions.allremoveidx.value;
if ((remidxlist != '') && (remidxlist != null)) {
@@ -6483,6 +6889,11 @@ function checkSubmits() {
remwarnings ++;
}
}
+ if (document.getElementById('confirm_removal_'+remidxs[i])) {
+ if (document.getElementById('confirm_removal_'+remidxs[i]).value == 1) {
+ removalinfo ++;
+ }
+ }
}
}
}
@@ -6581,14 +6992,19 @@ function checkSubmits() {
}
if (doactions == 1) {
if (numchanges > 0) {
- if ((cutwarnings > 0) || (remwarnings > 0)) {
+ if ((cutwarnings > 0) || (remwarnings > 0) || (removalinfo > 0)) {
if (remwarnings > 0) {
- if (!confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr3a"} '+remwarnings+' $lt{"p_rmr3b"}')) {
+ if (!confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr3a"} '+remwarnings+' $js_lt{"p_rmr3b"}')) {
+ return false;
+ }
+ }
+ if (removalinfo > 0) {
+ if (!confirm('$js_lt{"p_rmr4"}\\n$js_lt{"p_rmr5"}\\n\\n$js_lt{"p_rmr3a"} '+removalinfo+' $js_lt{"p_rmr3b"}')) {
return false;
}
}
if (cutwarnings > 0) {
- if (!confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr3a"} '+cutwarnings+' $lt{"p_ctr3b"}')) {
+ if (!confirm('$js_lt{"p_ctr1a"}\\n$js_lt{"p_ctr1b"}\\n\\n$js_lt{"p_ctr3a"} '+cutwarnings+' $js_lt{"p_ctr3b"}')) {
return false;
}
}
@@ -6604,12 +7020,12 @@ function checkSubmits() {
}
}
if ((dosettings == 1) && (doactions == 1)) {
- alert("$lt{'noor'}");
+ alert("$js_lt{'noor'}");
} else {
if (dosettings == 1) {
- alert("$lt{'noch'}");
+ alert("$js_lt{'noch'}");
} else {
- alert("$lt{'noac'}");
+ alert("$js_lt{'noac'}");
}
}
return false;
@@ -6724,13 +7140,19 @@ ENDINJECT
sub dump_switchserver_js {
my @hosts = @_;
- my %lt = &Apache::lonlocal::texthash(
+ my %js_lt = &Apache::lonlocal::texthash(
dump => 'Copying content to Authoring Space requires switching server.',
swit => 'Switch server?',
+ );
+ my %html_js_lt = &Apache::lonlocal::texthash(
+ swit => 'Switch server?',
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',
);
+ &js_escape(\%js_lt);
+ &html_escape(\%html_js_lt);
+ &js_escape(\%html_js_lt);
my $role = $env{'request.role'};
my $js = <<"ENDSWJS";