version 1.484.2.14, 2012/12/13 02:35:08
|
version 1.484.2.16, 2012/12/13 03:59:56
|
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 1949 sub editor {
|
Line 1961 sub editor {
|
&Apache::lonhtmlcommon::add_item_funclist( |
&Apache::lonhtmlcommon::add_item_funclist( |
'<a href="/adm/coursedocs?command=direct&forcesupplement=1&'. |
'<a href="/adm/coursedocs?command=direct&forcesupplement=1&'. |
'supppath='.&HTML::Entities::encode($env{'form.folderpath'}).'">'. |
'supppath='.&HTML::Entities::encode($env{'form.folderpath'}).'">'. |
'<img src="/res/adm/pages/docs.png" alt="'.$funcname.'" class="LC_icon" />'. |
'<img src="/res/adm/pages/docs-22x22.png" alt="'.$funcname.'" class="LC_icon" />'. |
'<span class="LC_menubuttons_inline_text">'.$funcname.'</span></a>'). |
'<span class="LC_menubuttons_inline_text">'.$funcname.'</span></a>'). |
&Apache::lonhtmlcommon::end_funclist())); |
&Apache::lonhtmlcommon::end_funclist())); |
} |
} |
Line 2151 sub entryline {
|
Line 2163 sub entryline {
|
$esc_path=&escape($env{'form.pagepath'}); |
$esc_path=&escape($env{'form.pagepath'}); |
$path = &HTML::Entities::encode($env{'form.pagepath'},'<>&"'); |
$path = &HTML::Entities::encode($env{'form.pagepath'},'<>&"'); |
} |
} |
|
my $isexternal; |
if (!$supplementalflag && $residx) { |
if (!$supplementalflag && $residx) { |
my $currurl = $url; |
my $currurl = $url; |
$currurl =~ s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
$currurl =~ s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
|
if ($currurl =~ m{^/adm/wrapper/ext/}) { |
|
$isexternal = 1; |
|
} |
my $path = 'uploaded/'. |
my $path = 'uploaded/'. |
$env{'course.'.$env{'request.course.id'}.'.domain'}.'/'. |
$env{'course.'.$env{'request.course.id'}.'.domain'}.'/'. |
$env{'course.'.$env{'request.course.id'}.'.num'}.'/'; |
$env{'course.'.$env{'request.course.id'}.'.num'}.'/'; |
Line 2258 sub entryline {
|
Line 2274 sub entryline {
|
$nocopy=1; |
$nocopy=1; |
} |
} |
} |
} |
my $copylink=' '; |
my ($copylink,$cutlink,$removelink,$renamelink); |
my $cutlink=' '; |
|
my $removelink=' '; |
|
|
|
my $skip_confirm = 0; |
my $skip_confirm = 0; |
if ( $folder =~ /^supplemental/ |
if ( $folder =~ /^supplemental/ |
Line 2269 sub entryline {
|
Line 2283 sub entryline {
|
|/aboutme$ |
|/aboutme$ |
|/navmaps$ |
|/navmaps$ |
|/bulletinboard$ |
|/bulletinboard$ |
|\.html$ |
|\.html$)}x) |
|^/adm/wrapper/ext)}x)) { |
|| $isexternal) { |
$skip_confirm = 1; |
$skip_confirm = 1; |
} |
} |
|
if ($nocopy) { |
if (!$nocopy) { |
$copylink=(<<ENDCOPY); |
$copylink=(<<ENDCOPY); |
<span style="visibility: hidden;">$lt{'cp'}</span> |
|
ENDCOPY |
|
} else { |
|
$copylink=(<<ENDCOPY); |
<a href="javascript:markcopy('$esc_path','$index','$renametitle','$container','$symb','$folder');" class="LC_docs_copy">$lt{'cp'}</a> |
<a href="javascript:markcopy('$esc_path','$index','$renametitle','$container','$symb','$folder');" class="LC_docs_copy">$lt{'cp'}</a> |
ENDCOPY |
ENDCOPY |
} |
} |
if (!$nocut) { |
if ($nocut) { |
$cutlink=(<<ENDCUT); |
$cutlink=(<<ENDCUT); |
|
<span style="visibility: hidden;">$lt{'ct'}</span> |
|
ENDCUT |
|
} else { |
|
$cutlink=(<<ENDCUT); |
<a href="javascript:cutres('$esc_path','$index','$renametitle','$container','$symb','$folder',$skip_confirm);" class="LC_docs_cut">$lt{'ct'}</a> |
<a href="javascript:cutres('$esc_path','$index','$renametitle','$container','$symb','$folder',$skip_confirm);" class="LC_docs_cut">$lt{'ct'}</a> |
ENDCUT |
ENDCUT |
} |
} |
if (!$noremove) { |
if ($noremove) { |
|
$removelink=(<<ENDREM); |
|
<span style="visibility: hidden;">$lt{'rm'}</a> |
|
ENDREM |
|
} else { |
$removelink=(<<ENDREM); |
$removelink=(<<ENDREM); |
<a href='javascript:removeres("$esc_path","$index","$renametitle","$container","$symb",$skip_confirm);' class="LC_docs_remove">$lt{'rm'}</a> |
<a href='javascript:removeres("$esc_path","$index","$renametitle","$container","$symb",$skip_confirm);' class="LC_docs_remove">$lt{'rm'}</a> |
ENDREM |
ENDREM |
} |
} |
|
$renamelink=(<<ENDREN); |
|
<a href='javascript:changename("$esc_path","$index","$renametitle","$container","$symb");' class="LC_docs_rename">$lt{'rn'}</a> |
|
ENDREN |
$form_start = ' |
$form_start = ' |
<form action="/adm/coursedocs" method="post"> |
<form action="/adm/coursedocs" method="post"> |
'; |
'; |
Line 2318 END
|
Line 2346 END
|
$selectbox |
$selectbox |
$form_end |
$form_end |
</td> |
</td> |
<td class="LC_docs_entry_commands"> |
<td class="LC_docs_entry_commands"><span class="LC_nobreak"> |
$removelink |
$removelink |
|
$renamelink |
$cutlink |
$cutlink |
<a href='javascript:changename("$esc_path","$index","$renametitle","$container","$symb");' class="LC_docs_rename">$lt{'rn'}</a> |
|
$copylink |
$copylink |
|
</span> |
</td> |
</td> |
END |
END |
|
|
Line 2537 ENDPARMS
|
Line 2566 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 3787 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 4017 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'},'<>&"'); |
|
|