+
|
$selectbox
|
-
+
$lt{'rm'}
-
+
$lt{'rn'} |
END
} else {
@@ -1152,9 +1184,13 @@ END
} elsif ($url=~m|^/ext/|) {
$url='/adm/wrapper'.$url;
}
- unless ($container eq 'page') {
+ $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
+ if ($container eq 'page') {
+ my $symb=$ENV{'form.pagesymb'};
+
+ $url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]);
$url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
- }
+ }
}
my $parameterset=' ';
if ($isfolder) {
@@ -1176,7 +1212,17 @@ END
my $folderpath=$ENV{'form.folderpath'};
if ($folderpath) { $pagepath = $folderpath.'&' };
$pagepath.=$pagearg.'&'.$pagename;
- $url.='pagepath='.&Apache::lonnet::escape($pagepath);
+ my $symb=$ENV{'form.pagesymb'};
+ if (!$symb) {
+ my $path='uploaded/'.
+ $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.'/'.
+ $ENV{'course.'.$ENV{'request.course.id'}.'.num'}.'/';
+ $symb=&Apache::lonnet::encode_symb($path.$folder.'.sequence',
+ $residx,
+ $path.$pagearg.'.page');
+ }
+ $url.='pagepath='.&Apache::lonnet::escape($pagepath).
+ '&pagesymb='.&Apache::lonnet::escape($symb);
}
$line.=' | '.
@@ -1210,33 +1256,24 @@ ENDPARMS
sub tiehash {
my ($mode)=@_;
$hashtied=0;
- &Apache::lonnet::logthis(" tiehash1 -- $hashtied ");
if ($ENV{'request.course.fn'}) {
- &Apache::lonnet::logthis(" tiehash2 -- $hashtied ");
if ($mode eq 'write') {
- &Apache::lonnet::logthis(" tiehash3 -- $hashtied ");
if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
&GDBM_WRCREAT(),0640)) {
$hashtied=2;
- &Apache::lonnet::logthis(" tiehash4 -- $hashtied ");
}
} else {
- &Apache::lonnet::logthis(" tiehash5 -- $hashtied ");
if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
&GDBM_READER(),0640)) {
$hashtied=1;
- &Apache::lonnet::logthis(" tiehash6 -- $hashtied ");
}
}
}
- &Apache::lonnet::logthis(" tiehash7 -- $hashtied ");
}
sub untiehash {
- &Apache::lonnet::logthis(" untiehash1 -- $hashtied ");
if ($hashtied) { untie %hash; }
$hashtied=0;
- &Apache::lonnet::logthis(" untiehash2 -- $hashtied ");
}
# --------------------------------------------------------------- check on this
@@ -1592,21 +1629,14 @@ ENDHEADERS
sub mark_hash_old {
my $retie_hash=0;
- &Apache::lonnet::logthis(" markold1 -- $hashtied $retie_hash ");
if ($hashtied) {
$retie_hash=1;
- &Apache::lonnet::logthis(" markold2 -- $hashtied $retie_hash ");
&untiehash();
- &Apache::lonnet::logthis(" markold3 -- $hashtied $retie_hash ");
}
&tiehash('write');
- &Apache::lonnet::logthis(" markold4 -- $hashtied $retie_hash ");
$hash{'old'}=1;
- &Apache::lonnet::logthis(" markold5 -- $hashtied $retie_hash ");
&untiehash();
- &Apache::lonnet::logthis(" markold6 -- $hashtied $retie_hash ");
if ($retie_hash) { &tiehash(); }
- &Apache::lonnet::logthis(" markold7 -- $hashtied $retie_hash ");
}
sub is_hash_old {
@@ -1628,6 +1658,7 @@ sub changewarning {
if (defined($ENV{'form.pagepath'})) {
$pathvar='pagepath';
$path=&Apache::lonnet::escape($ENV{'form.pagepath'});
+ $path.='&symb='.&Apache::lonnet::escape($ENV{'form.pagesymb'});
}
$r->print(
''.
@@ -1683,7 +1714,7 @@ sub handler {
# is this a standard course?
my $standard=($ENV{'request.course.uri'}=~/^\/uploaded\//);
- my $forcestandard;
+ my $forcestandard = 0;
my $forcesupplement;
my $script='';
my $allowed;
@@ -1692,7 +1723,7 @@ sub handler {
my $containertag;
my $uploadtag;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['folderpath','pagepath']);
+ ['folderpath','pagepath','pagesymb']);
if ($ENV{'form.folderpath'}) {
my (@folderpath)=split('&',$ENV{'form.folderpath'});
$ENV{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));
@@ -1702,14 +1733,19 @@ sub handler {
my (@pagepath)=split('&',$ENV{'form.pagepath'});
$ENV{'form.pagename'}=&Apache::lonnet::unescape(pop(@pagepath));
$ENV{'form.folder'}=pop(@pagepath);
- $containertag = '';
- $uploadtag = '';
+ $containertag = ''.
+ '';
+ $uploadtag = ''.
+ '';
}
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
$showdoc='/'.$1;
}
unless ($showdoc) { # got called from remote
- $forcestandard=($ENV{'form.folder'}=~/^default_/);
+ if (($ENV{'form.folder'}=~/^default_/) ||
+ ($ENV{'form.folder'} =~ m#^\d+/(pages|sequences)/#)) {
+ $forcestandard = 1;
+ }
$forcesupplement=($ENV{'form.folder'}=~/^supplemental_/);
# does this user have privileges to post, etc?
@@ -1843,7 +1879,7 @@ function finishpick() {
'";this.document.forms.'+form+'.submit();');
}
-function changename(folderpath,index,oldtitle,container) {
+function changename(folderpath,index,oldtitle,container,pagesymb) {
var title=prompt('New Title',oldtitle);
if (title) {
this.document.forms.renameform.title.value=title;
@@ -1853,12 +1889,13 @@ function changename(folderpath,index,old
}
if (container == 'page') {
this.document.forms.renameform.pagepath.value=folderpath;
+ this.document.forms.renameform.pagesymb.value=pagesymb;
}
this.document.forms.renameform.submit();
}
}
-function removeres(folderpath,index,oldtitle,container) {
+function removeres(folderpath,index,oldtitle,container,pagesymb) {
if (confirm('Remove "'+oldtitle+'"?')) {
this.document.forms.renameform.cmd.value='del_'+index;
if (container == 'sequence') {
@@ -1866,6 +1903,7 @@ function removeres(folderpath,index,oldt
}
if (container == 'page') {
this.document.forms.renameform.pagepath.value=folderpath;
+ this.document.forms.renameform.pagesymb.value=pagesymb;
}
this.document.forms.renameform.submit();
}