version 1.130, 2011/10/22 12:34:01
|
version 1.133, 2011/10/26 17:31:40
|
Line 138 sub startpage {
|
Line 138 sub startpage {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
my $formaction='/priv/'.$uname.$thisdisfn.'/'; |
my $formaction='/priv'.$thisdisfn.'/'; |
$formaction=~s|/+|/|g; |
$formaction=~s|/+|/|g; |
&Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction); |
&Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction); |
|
|
Line 150 sub startpage {
|
Line 150 sub startpage {
|
# breadcrumbs (and tools) will be created |
# breadcrumbs (and tools) will be created |
# in start_page->bodytag->innerregister |
# in start_page->bodytag->innerregister |
|
|
$env{'request.noversionuri'}='/priv/'.$udom.'/'.$uname.$thisdisfn.'/'; |
$env{'request.noversionuri'}=$formaction; |
$r->print(&Apache::loncommon::start_page('Construction Space',undef)); |
$r->print(&Apache::loncommon::start_page('Construction Space',undef)); |
|
|
$r->print(&Apache::loncommon::head_subbox( |
$r->print(&Apache::loncommon::head_subbox( |
Line 164 sub startpage {
|
Line 164 sub startpage {
|
top.document.title = '$esc_thisdisfn/ - $doctitle'; |
top.document.title = '$esc_thisdisfn/ - $doctitle'; |
// Store directory location for menu bar to find |
// Store directory location for menu bar to find |
|
|
parent.lastknownpriv='/priv/$udom/$uname$esc_thisdisfn/'; |
parent.lastknownpriv='/priv$esc_thisdisfn/'; |
|
|
// Confirmation dialogues |
// Confirmation dialogues |
|
|
Line 319 sub dircontrols {
|
Line 319 sub dircontrols {
|
<option value="printdir">$lt{'prnt'}</option> |
<option value="printdir">$lt{'prnt'}</option> |
<option value="delete">$lt{'dedr'}</option> |
<option value="delete">$lt{'dedr'}</option> |
</select> |
</select> |
<input type="hidden" name="filename" value="/priv/$udom/$uname$thisdisfn/" /> |
<input type="hidden" name="filename" value="/priv$thisdisfn/" /> |
</fieldset> |
</fieldset> |
</form> |
</form> |
<form name="publishdir" method="post" action="/adm/publish" target="_parent"> |
<form name="publishdir" method="post" action="/adm/publish" target="_parent"> |
Line 335 sub dircontrols {
|
Line 335 sub dircontrols {
|
<form name="upublisher" enctype="multipart/form-data" method="post" action="/adm/upload" target="_parent"> |
<form name="upublisher" enctype="multipart/form-data" method="post" action="/adm/upload" target="_parent"> |
<fieldset> |
<fieldset> |
<legend>$lt{'updc'}</legend> |
<legend>$lt{'updc'}</legend> |
<input type="hidden" name="filename" value="/priv/$udom/$uname$thisdisfn/" /> |
<input type="hidden" name="filename" value="/priv$thisdisfn/" /> |
<input type="file" name="upfile" size="20" /> |
<input type="file" name="upfile" size="20" /> |
<input type="button" value="$lt{'uplo'}" onclick="checkUpload(this.form)" /> |
<input type="button" value="$lt{'uplo'}" onclick="checkUpload(this.form)" /> |
</fieldset> |
</fieldset> |
Line 347 sub dircontrols {
|
Line 347 sub dircontrols {
|
<fieldset> |
<fieldset> |
<legend>$lt{'crea'}</legend> |
<legend>$lt{'crea'}</legend> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input type="hidden" name="filename" value="/priv/$udom/$uname$thisdisfn/" /> |
<input type="hidden" name="filename" value="/priv$thisdisfn/" /> |
<script type="text/javascript"> |
<script type="text/javascript"> |
function validate_go() { |
function validate_go() { |
var selected = document.fileaction.action.selectedIndex; |
var selected = document.fileaction.action.selectedIndex; |
Line 448 sub putdirectory {
|
Line 448 sub putdirectory {
|
my ($r, $reqfile, $here, $dirname, $modtime, $resdir, $bombs, $numdir) = @_; |
my ($r, $reqfile, $here, $dirname, $modtime, $resdir, $bombs, $numdir) = @_; |
|
|
# construct the display filename: the directory name unless ..: |
# construct the display filename: the directory name unless ..: |
|
|
|
my $actionitem; |
|
|
my $disfilename = $dirname; |
my $disfilename = $dirname; |
if ($dirname eq '..') { |
|
$disfilename = '<i>'.&mt('Parent Directory').'</i>'; |
|
} |
|
# Don't display directory itself, and there is no way up from root directory |
# Don't display directory itself, and there is no way up from root directory |
unless ( (($dirname eq '..') && ($reqfile=~/^\/[^\/]+\/[^\/]+$/)) || ($dirname eq '.')) { |
unless ((($dirname eq '..') && ($reqfile=~/^\/[^\/]+\/[^\/]+$/)) || ($dirname eq '.')) { |
my $kaputt=0; |
my $kaputt=0; |
foreach (keys %{$bombs}) { |
foreach (keys %{$bombs}) { |
if ($_=~m:^\Q$resdir\E/\Q$disfilename\E/:) { $kaputt=1; last; } |
if ($_=~m:^\Q$resdir\E/\Q$disfilename\E/:) { $kaputt=1; last; } |
Line 467 sub putdirectory {
|
Line 466 sub putdirectory {
|
&Apache::lonpublisher::metaeval( |
&Apache::lonpublisher::metaeval( |
&Apache::lonnet::getfile($r->dir_config('lonDocRoot').$here.'/'.$dirname.'/default.meta') |
&Apache::lonnet::getfile($r->dir_config('lonDocRoot').$here.'/'.$dirname.'/default.meta') |
); |
); |
# |
if ($dirname eq '..') { |
my $actionitem = ''; |
|
if ($here eq '..') { |
|
$actionitem = &mt('Go to ...'); |
$actionitem = &mt('Go to ...'); |
|
$disfilename = '<i>'.&mt('Parent Directory').'</i>'; |
} else { |
} else { |
$actionitem = |
$actionitem = |
'<form name="dirselect_'.$$numdir. |
'<form name="dirselect_'.$$numdir. |
Line 521 sub putresource {
|
Line 519 sub putresource {
|
my $title=' '; |
my $title=' '; |
my $publish_button=&mt('Publish'); |
my $publish_button=&mt('Publish'); |
my $cstr_dir = $r->dir_config('lonDocRoot').'/priv/'.$udom.'/'.$uname.'/'.$thisdisfn.'/'; |
my $cstr_dir = $r->dir_config('lonDocRoot').'/priv/'.$udom.'/'.$uname.'/'.$thisdisfn.'/'; |
my $linkfilename='/priv'.$thisdisfn.'/'.$filename; |
my $linkfilename=&HTML::Entities::encode('/priv'.$thisdisfn.'/'.$filename,'<>&"'); |
|
|
if (-e $resdir.'/'.$filename) { |
if (-e $resdir.'/'.$filename) { |
my $same=0; |
my $same=0; |
Line 657 sub create_pubselect {
|
Line 655 sub create_pubselect {
|
'<option value="cleanup">'.&mt('Clean up').'</option>'. |
'<option value="cleanup">'.&mt('Clean up').'</option>'. |
'<option value="print">'.&mt('Print').'</option>'. |
'<option value="print">'.&mt('Print').'</option>'. |
'</select> |
'</select> |
<input type="hidden" name="filename" value="/~'. |
<input type="hidden" name="filename" value="/priv'. |
&HTML::Entities::encode($uname.$thisdisfn.'/'.$filename,'<>&"').'" /> |
&HTML::Entities::encode($thisdisfn.'/'.$filename,'<>&"').'" /> |
<input type="hidden" name="dispfilename" value="'. |
<input type="hidden" name="dispfilename" value="'. |
&HTML::Entities::encode($filename).'" /></form>'; |
&HTML::Entities::encode($filename).'" /></form>'; |
$$numres ++; |
$$numres ++; |