'."\n";
if ($to_show ne '') {
- $form .= '
'.$to_show.'
'."\n";
+ my $saveform;
+ if ($need_save) {
+ my $button = &mt('Make changes');
+ my $path;
+ if ($env{'form.folderpath'}) {
+ $path =
+ &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
+ }
+ $saveform = <<"END";
+
+
+
+END
+ }
+ $form .= '
'.$to_show.'
'.$saveform."\n";
}
foreach my $field (keys(%orderhash)){
if($field ne '00'){
@@ -4814,15 +5725,24 @@ sub editing_js {
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_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]',
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',
invurl => 'Invalid URL',
titbl => 'Title is blank',
+ more => '(More ...)',
+ less => '(Less ...)',
+ noor => 'No actions selected or changes to settings specified.',
+ noch => 'No changes to settings specified.',
+ noac => 'No actions selected.',
);
my $crstype = &Apache::loncommon::course_type();
@@ -4831,7 +5751,8 @@ sub editing_js {
if (&HTML::Entities::decode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'}) =~ /\:1$/) {
$main_container_page = 1;
}
- my $toplevelmain = 'default&Main%20'.$crstype.'%20Documents%3A%3A%3A%3A%3A';
+ my $toplevelmain =
+ &escape(&mt('Main Content').':::::');
my $toplevelsupp = &supplemental_base();
my $backtourl;
@@ -4845,6 +5766,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') {
@@ -5006,7 +5929,7 @@ function makeims(imsform) {
function changename(folderpath,index,oldtitle) {
var title=prompt('$lt{"p_chn"}',oldtitle);
if (title) {
-this.document.forms.renameform.markcopy.value=-1;
+this.document.forms.renameform.markcopy.value='';
this.document.forms.renameform.title.value=title;
this.document.forms.renameform.cmd.value='rename_'+index;
this.document.forms.renameform.folderpath.value=folderpath;
@@ -5014,32 +5937,6 @@ this.document.forms.renameform.submit();
}
}
-function removeres(folderpath,index,oldtitle,skip_confirm) {
-if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) {
-this.document.forms.renameform.markcopy.value=-1;
-this.document.forms.renameform.cmd.value='del_'+index;
-this.document.forms.renameform.folderpath.value=folderpath;
-this.document.forms.renameform.submit();
-}
-}
-
-function cutres(folderpath,index,oldtitle,container,folder,skip_confirm) {
-if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) {
-this.document.forms.renameform.cmd.value='cut_'+index;
-this.document.forms.renameform.markcopy.value=index;
-this.document.forms.renameform.copyfolder.value=folder+'.'+container;
-this.document.forms.renameform.folderpath.value=folderpath;
-this.document.forms.renameform.submit();
-}
-}
-
-function markcopy(folderpath,index,oldtitle,container,folder) {
-this.document.forms.renameform.markcopy.value=index;
-this.document.forms.renameform.copyfolder.value=folder+'.'+container;
-this.document.forms.renameform.folderpath.value=folderpath;
-this.document.forms.renameform.submit();
-}
-
function updatePick(targetform,index,caller) {
var pickitem;
var picknumitem;
@@ -5064,7 +5961,7 @@ function updatePick(targetform,index,cal
propagateState(targetform,'rpicknum');
}
} else {
- checkForSubmit(targetform,'randompick');
+ checkForSubmit(targetform,'randompick','settings');
}
}
} else {
@@ -5073,13 +5970,13 @@ function updatePick(targetform,index,cal
if (regexdigit.test(picknum)) {
picknumitem.value = picknum;
if (index == 'all') {
- picknumtext.innerHTML = '
'+picknum+'';
+ picknumtext.innerHTML = '
'+picknum+'';
if (caller == 'link') {
propagateState(targetform,'rpicknum');
}
} else {
picknumtext.innerHTML = '
'+picknum+'';
- checkForSubmit(targetform,'randompick');
+ checkForSubmit(targetform,'randompick','settings');
}
} else {
if (caller == 'check') {
@@ -5090,7 +5987,7 @@ function updatePick(targetform,index,cal
}
} else {
pickitem.checked=false;
- checkForSubmit(targetform,'randompick');
+ checkForSubmit(targetform,'randompick','settings');
}
}
return;
@@ -5104,7 +6001,7 @@ function updatePick(targetform,index,cal
propagateState(targetform,'rpicknum');
}
} else {
- checkForSubmit(targetform,'randompick');
+ checkForSubmit(targetform,'randompick','settings');
}
}
}
@@ -5126,49 +6023,76 @@ function propagateState(form,param) {
setcheck = 1;
}
}
+ var allidxlist;
+ if ((param == 'remove') || (param == 'cut') || (param == 'copy')) {
+ if (document.getElementById('all'+param+'idx')) {
+ allidxlist = document.getElementById('all'+param+'idx').value;
+ }
+ var actions = new Array ('remove','cut','copy');
+ for (var i=0; i
1) {
- for (var i=0; i 1) {
+ for (var i=0; i 0) {
+ document.getElementById('randompicknum_'+allidxs[i]).innerHTML = ': '+rpick+'';
+ } else {
+ document.getElementById('randompicknum_'+allidxs[i]).innerHTML = '';
+ }
+ }
+ }
+ } else {
if (setcheck == 1) {
document.getElementById(param+'_'+allidxs[i]).checked = true;
} else {
document.getElementById(param+'_'+allidxs[i]).checked = false;
+ if (param == 'randompick') {
+ document.getElementById('randompicknum_'+allidxs[i]).innerHTML = '';
+ }
}
}
}
}
- }
- } else {
- var allmapidxlist = form.allmapidx.value;
- if (allmapidxlist != '') {
- var allmapidxs = allmapidxlist.split(',');
- if (allmapidxs.length > 1) {
- for (var i=0; i 0) {
- document.getElementById('randompicknum_'+allmapidxs[i]).innerHTML = ': '+rpick+'';
- } else {
- document.getElementById('randompicknum_'+allmapidxs[i]).innerHTML = '';
+ if (setcheck == 1) {
+ if ((param == 'remove') || (param == 'cut') || (param == 'copy')) {
+ var actions = new Array('copy','cut','remove');
+ for (var i=0; i 1) {
+ for (var j=0; j 1) {
- for (var i=0; i$lt{'more'}';
+ } else {
+ document.getElementById('more'+caller).innerHTML = '';
+ }
+ if (caller == 'actions') {
+ setClass(value);
+ setBoxes(value);
+ }
+ }
+ var showButton = multiSettings();
+ if (showButton != 1) {
+ showButton = multiActions();
+ }
+ if (document.getElementById('multisave')) {
+ if (showButton == 1) {
+ document.getElementById('multisave').style.display='block';
+ } else {
+ document.getElementById('multisave').style.display='none';
+ }
+ }
+ resize_scrollbox('contentscroll','1','1');
+ return;
+}
+
+function toggleCheckUncheck(caller,more) {
+ if (more == 1) {
+ document.getElementById('more'+caller).innerHTML = ' $lt{'less'}';
+ document.getElementById('allfields'+caller).style.display='block';
+ } else {
+ document.getElementById('more'+caller).innerHTML = ' $lt{'more'}';
+ document.getElementById('allfields'+caller).style.display='none';
+ }
+ resize_scrollbox('contentscroll','1','1');
+}
+
+function multiSettings() {
+ var inuse = 0;
+ var settingsform = document.togglemultsettings;
+ if (settingsform.showmultpick.length > 1) {
+ for (var i=0; i 1) {
+ for (var i=0; i 0) {
+ form.multichange.value = numchanges;
+ }
+ }
+ var dosettings = multiSettings();
+ var haschanges = 0;
+ if (dosettings == 1) {
+ form.allencrypturl.value = '';
+ form.allhiddenresource.value = '';
+ form.changeparms.value = 'all';
+ var patt=new RegExp(",\$");
+ var allidxlist = document.cumulativesettings.allidx.value;
+ if ((allidxlist != '') && (allidxlist != null)) {
+ var allidxs = allidxlist.split(',');
+ if (allidxs.length > 1) {
+ for (var i=0; i 0) {
+ if ((cutwarnings > 0) || (remwarnings > 0)) {
+ if (remwarnings > 0) {
+ if (!confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr3a"} '+remwarnings+' $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"}')) {
+ return false;
+ }
+ }
}
- if (randorder.checked) {
- form.allrandomorder.value += allmapidxs[i]+',';
+ form.submit();
+ return true;
+ }
+ }
+ if (dosettings == 1) {
+ if (haschanges == 1) {
+ form.submit();
+ return true;
+ }
+ }
+ if ((dosettings == 1) && (doactions == 1)) {
+ alert("$lt{'noor'}");
+ } else {
+ if (dosettings == 1) {
+ alert("$lt{'noch'}");
+ } else {
+ alert("$lt{'noac'}");
+ }
+ }
+ return false;
+}
+
+function setClass(value) {
+ var cutclass = 'LC_docs_cut';
+ var copyclass = 'LC_docs_copy';
+ var removeclass = 'LC_docs_remove';
+ var cutreg = new RegExp("\\\\b"+cutclass+"\\\\b");
+ var copyreg = new RegExp("\\\\b"+copyclass+"\\\\b");
+ var removereg = new RegExp("\\\\"+removeclass+"\\\\b");
+ var links = document.getElementsByTagName('a');
+ for (var i=0; i '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',
);
@@ -5536,6 +6801,10 @@ Return hash with valid author names
=item do_paste_from_buffer()
+=item do_buffer_empty()
+
+=item clear_from_buffer()
+
=item get_newmap_url()
=item dbcopy()