version 1.484.2.14, 2012/12/13 02:35:08
|
version 1.484.2.15, 2012/12/13 02:45:27
|
Line 1828 sub editor {
|
Line 1828 sub editor {
|
if (defined($item)) { |
if (defined($item)) { |
my ($name,$url,$residx)= |
my ($name,$url,$residx)= |
map {&unescape($_)} split(/\=/,$item); |
map {&unescape($_)} split(/\=/,$item); |
|
if ($url=~ m{^\Q/uploaded/$coursedom/$coursenum/\E(default|supplemental)_new\.(sequence|page)$}) { |
|
my ($suffix,$errortxt,$locknotfreed) = |
|
&newmap_suffix($1,$2,$coursedom,$coursenum); |
|
if ($locknotfreed) { |
|
$r->print($locknotfreed); |
|
} |
|
if ($suffix) { |
|
$url =~ s/_new\./_$suffix./; |
|
} else { |
|
return $errortxt; |
|
} |
|
} |
push(@imports, [$name, $url, $residx]); |
push(@imports, [$name, $url, $residx]); |
} |
} |
} |
} |
Line 2537 ENDPARMS
|
Line 2549 ENDPARMS
|
return $line; |
return $line; |
} |
} |
|
|
|
sub newmap_suffix { |
|
my ($area,$container,$coursedom,$coursenum) = @_; |
|
my ($prefix,$idtype,$errtext,$locknotfreed); |
|
$prefix = 'docs'; |
|
if ($area eq 'supplemental') { |
|
$prefix = 'supp'; |
|
} |
|
$prefix .= $container; |
|
$idtype = 'concat'; |
|
my ($suffix,$freedlock,$error) = |
|
&Apache::lonnet::get_timebased_id($prefix,'num','uploadedmaps', |
|
$coursedom,$coursenum); |
|
if (!$suffix) { |
|
$errtext = &mt('Failed to acquire a unique timestamp-based suffix for the new folder/page.'); |
|
if ($error) { |
|
$errtext .= '<br />'.$error; |
|
} |
|
} |
|
if ($freedlock ne 'ok') { |
|
$locknotfreed = '<div class="LC_error">'.&mt('There was a problem removing a lockfile. This will prevent creation of additional folders or composite pages in this course. Please contact the domain coordinator for your LON-CAPA domain.').'</div>'; |
|
} |
|
return ($suffix,$errtext,$locknotfreed); |
|
} |
|
|
=pod |
=pod |
|
|
=item tiehash() |
=item tiehash() |
Line 3734 HIDDENFORM
|
Line 3770 HIDDENFORM
|
} else { |
} else { |
#$postexec='self.close();'; |
#$postexec='self.close();'; |
} |
} |
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. |
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_new.sequence'; |
'.sequence'; |
'.sequence'; |
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. |
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_new.page'; |
'.page'; |
'.page'; |
my $container='sequence'; |
my $container='sequence'; |
if ($env{'form.pagepath'}) { |
if ($env{'form.pagepath'}) { |
Line 3964 unless ($env{'form.pagepath'}) {
|
Line 4000 unless ($env{'form.pagepath'}) {
|
$env{'form.pagepath'} = ''; |
$env{'form.pagepath'} = ''; |
if ($allowed) { |
if ($allowed) { |
my $folderseq= |
my $folderseq= |
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time. |
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_new.sequence'; |
'.sequence'; |
|
|
|
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
|
|