';
- } elsif (&Apache::loncommon::is_archive_file($mimetype)) {
+ } elsif ((&Apache::loncommon::is_archive_file($mimetype)) &&
+ ($env{'form.uploaddoc.filename'} =~ /\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/i)) {
$nextphase = 'decompress_uploaded';
my $position = scalar(@LONCAPA::map::order)-1;
my $noextract = &return_to_editor();
@@ -3309,7 +3378,7 @@ sub is_supplemental_title {
sub entryline {
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom,
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups)=@_;
- my ($foldertitle,$renametitle);
+ my ($foldertitle,$renametitle,$oldtitle);
if (&is_supplemental_title($title)) {
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title);
} else {
@@ -3322,7 +3391,10 @@ sub entryline {
$renametitle=~s/\\/\\\\/g;
$renametitle=~s/\"\;/\\\"/g;
+ $renametitle=~s/"/%22/g;
$renametitle=~s/ /%20/g;
+ $oldtitle = $renametitle;
+ $renametitle=~s/\'/\\\'/g;
my $line=&Apache::loncommon::start_data_table_row();
my ($form_start,$form_end,$form_common,$form_param);
# Edit commands
@@ -3472,7 +3544,7 @@ ENDREM
}
}
$renamelink=(<$lt{'rn'}
+$lt{'rn'}
ENDREN
$line.=(<
@@ -3787,6 +3859,7 @@ sub new_timebased_suffix {
if ($type eq 'paste') {
$prefix = $type;
$namespace = 'courseeditor';
+ $idtype = 'addcode';
} elsif ($type eq 'map') {
$prefix = 'docs';
if ($area eq 'supplemental') {
@@ -3798,9 +3871,8 @@ sub new_timebased_suffix {
$prefix = $type;
$namespace = 'templated';
}
- $idtype = 'concat';
my ($suffix,$freedlock,$error) =
- &Apache::lonnet::get_timebased_id($prefix,'num',$namespace,$dom,$num);
+ &Apache::lonnet::get_timebased_id($prefix,'num',$namespace,$dom,$num,$idtype);
if (!$suffix) {
if ($type eq 'paste') {
$errtext = &mt('Failed to acquire a unique timestamp-based suffix when adding to the paste buffer.');
@@ -3820,9 +3892,19 @@ sub new_timebased_suffix {
'
'.
&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.');
@@ -4468,12 +4550,8 @@ sub handler {
$allowed = &Apache::lonnet::allowed('mdc',$env{'request.course.id'});
}
- &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['chooseserver',
- 'inhibitmenu']);
- if ($allowed && $env{'form.chooseserver'}) {
- &choose_dump_server($r);
- return OK;
- } elsif ($allowed && $env{'form.verify'}) {
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['inhibitmenu']);
+ if ($allowed && $env{'form.verify'}) {
&init_breadcrumbs('verify','Verify Content','Docs_Verify_Content');
&verifycontent($r);
} elsif ($allowed && $env{'form.listsymbs'}) {
@@ -4815,7 +4893,11 @@ sub handler {
'title' => 'Title',
'comment' => 'Comment',
'parse' => 'Upload embedded images/multimedia files if HTML file',
- );
+ 'bb5' => 'Blackboard 5',
+ 'bb6' => 'Blackboard 6',
+ 'angel5' => 'ANGEL 5.5',
+ 'webctce4' => 'WebCT 4 Campus Edition',
+ );
# -----------------------------------------------------------------------------
my $fileupload=(<
@@ -4846,10 +4928,10 @@ CHBO
$lt{'cms'}:
@@ -5422,7 +5504,7 @@ sub decompression_info {
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'};
my $container='sequence';
my ($pathitem,$hiddenelem);
- my @hiddens = ('newidx','comment','position','folderpath');
+ my @hiddens = ('newidx','comment','position','folderpath','archiveurl');
if ($env{'form.folderpath'} =~ /\:1$/) {
$container='page';
}
@@ -5430,7 +5512,7 @@ sub decompression_info {
foreach my $item (@hiddens) {
if ($env{'form.'.$item}) {
$hiddenelem .= ''."\n";
+ &HTML::Entities::encode($env{'form.'.$item},'<>&"').'" />'."\n";
}
}
return ($destination,$dir_root,$londocroot,$docudom,$docuname,$container,
@@ -5487,25 +5569,34 @@ sub remove_archive {
} else {
$delwarning = &mt('An error occurred retrieving the contents of the current folder.');
}
- $delwarning .= &mt('As a result the archive file has not been removed.');
+ $delwarning .= ' '.&mt('As a result the archive file has not been removed.');
} else {
my $currcmd = $env{'form.cmd'};
my $position = $env{'form.position'};
+ my $archiveidx = $position;
if ($position > 0) {
- $env{'form.cmd'} = 'remove_'.$position;
- my ($title,$url,@rrest) =
- split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]);
- if (&handle_edit_cmd($docuname,$docudom)) {
- ($errtext,$fatal) = &storemap($docuname,$docudom,$map,1);
- if ($fatal) {
- if ($container eq 'page') {
- $delwarning = &mt('An error occurred updating the contents of the current page.');
+ if (($env{'form.autoextract_camtasia'}) && (scalar(@LONCAPA::map::order) == 2)) {
+ $archiveidx = $position-1;
+ }
+ $env{'form.cmd'} = 'remove_'.$archiveidx;
+ my ($title,$url,@rrest) =
+ split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$archiveidx]]);
+ if ($url eq $env{'form.archiveurl'}) {
+ if (&handle_edit_cmd($docuname,$docudom)) {
+ ($errtext,$fatal) = &storemap($docuname,$docudom,$map,1);
+ if ($fatal) {
+ if ($container eq 'page') {
+ $delwarning = &mt('An error occurred updating the contents of the current page.');
+ } else {
+ $delwarning = &mt('An error occurred updating the contents of the current folder.');
+ }
} else {
- $delwarning = &mt('An error occurred updating the contents of the current folder.');
+ $delresult = &mt('Archive file removed.');
}
- } else {
- $delresult = &mt('Archive file removed.');
}
+ } else {
+ $delwarning .= &mt('Archive file had unexpected item number in folder.').
+ ' '.&mt('As a result the archive file has not been removed.');
}
}
$env{'form.cmd'} = $currcmd;
@@ -5708,7 +5799,7 @@ END
sub editing_js {
my ($udom,$uname,$supplementalflag) = @_;
- my %lt = &Apache::lonlocal::texthash(
+ my %js_lt = &Apache::lonlocal::texthash(
p_mnf => 'Name of New Folder',
t_mnf => 'New Folder',
p_mnp => 'Name of New Page',
@@ -5746,7 +5837,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;
@@ -5768,6 +5859,7 @@ sub editing_js {
if (&Apache::lonnet::is_on_map($res)) {
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='.
&HTML::Entities::encode($caller,'<>&"');
+ $backtourl = &Apache::loncommon::escape_single($backtourl);
} else {
$backtourl = '/adm/navmaps';
}
@@ -5790,7 +5882,7 @@ sub editing_js {
return <$lt{'more'}';
+ document.getElementById('more'+caller).innerHTML = ' $js_lt{'more'}';
} else {
document.getElementById('more'+caller).innerHTML = '';
}
@@ -6353,10 +6445,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');
@@ -6512,12 +6604,12 @@ function checkSubmits() {
if (numchanges > 0) {
if ((cutwarnings > 0) || (remwarnings > 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 (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;
}
}
@@ -6533,12 +6625,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;
@@ -6653,13 +6745,19 @@ ENDINJECT
sub dump_switchserver_js {
my @hosts = @_;
- my %lt = &Apache::lonlocal::texthash(
- dump => 'Copying Content to Authoring Space requires switching server.',
+ 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";