version 1.145.2.1.2.1, 2004/01/27 23:11:23
|
version 1.146, 2003/12/08 18:26:01
|
Line 219 sub metaeval {
|
Line 219 sub metaeval {
|
$newentry=~s/^\s*//; |
$newentry=~s/^\s*//; |
if ($newentry !~m|^/res|) { $newentry=$prefix.$newentry; } |
if ($newentry !~m|^/res|) { $newentry=$prefix.$newentry; } |
} |
} |
# actually store |
unless ($metadatafields{$unikey}=~/\w/) { |
if ( $entry eq 'rule' && exists($metadatafields{$unikey})) { |
|
$metadatafields{$unikey}.=','.$newentry; |
|
} else { |
|
$metadatafields{$unikey}=$newentry; |
$metadatafields{$unikey}=$newentry; |
} |
} |
} |
} |
Line 270 sub metaread {
|
Line 267 sub metaread {
|
my ($logfile,$fn,$prefix)=@_; |
my ($logfile,$fn,$prefix)=@_; |
unless (-e $fn) { |
unless (-e $fn) { |
print($logfile 'No file '.$fn."\n"); |
print($logfile 'No file '.$fn."\n"); |
return '<br /><b>No file:</b> <tt>'. |
return '<br /><b>'.&mt('No file').':</b> <tt>'. |
&Apache::loncfile::display($fn).'</tt>'; |
&Apache::loncfile::display($fn).'</tt>'; |
} |
} |
print($logfile 'Processing '.$fn."\n"); |
print($logfile 'Processing '.$fn."\n"); |
Line 895 sub publish {
|
Line 892 sub publish {
|
if ($error) { return ($outstring,$error); } |
if ($error) { return ($outstring,$error); } |
# ------------------------------------------------------------ Construct Allows |
# ------------------------------------------------------------ Construct Allows |
|
|
$scrout.='<h3>Dependencies</h3>'; |
$scrout.='<h3>'.&mt('Dependencies').'</h3>'; |
my $allowstr=''; |
my $allowstr=''; |
foreach (sort(keys(%allow))) { |
foreach (sort(keys(%allow))) { |
my $thisdep=$_; |
my $thisdep=$_; |
Line 1090 sub publish {
|
Line 1087 sub publish {
|
unless ($batch) { |
unless ($batch) { |
$scrout.= |
$scrout.= |
'<form name="pubform" action="/adm/publish" method="post">'. |
'<form name="pubform" action="/adm/publish" method="post">'. |
'<p><input type="submit" value="Finalize Publication" /></p>'. |
'<p><input type="submit" value="'.&mt('Finalize Publication').'" /></p>'. |
&hiddenfield('phase','two'). |
&hiddenfield('phase','two'). |
&hiddenfield('filename',$ENV{'form.filename'}). |
&hiddenfield('filename',$ENV{'form.filename'}). |
&hiddenfield('allmeta',&Apache::lonnet::escape($allmeta)). |
&hiddenfield('allmeta',&Apache::lonnet::escape($allmeta)). |
Line 1102 sub publish {
|
Line 1099 sub publish {
|
# --------------------------------------------------- Scan content for keywords |
# --------------------------------------------------- Scan content for keywords |
|
|
my $keywords_help = Apache::loncommon::help_open_topic("Publishing_Keywords"); |
my $keywords_help = Apache::loncommon::help_open_topic("Publishing_Keywords"); |
|
my $KEYWORDS=&mt('KEYWORDS'); |
|
my $CheckAll=&mt('check all'); |
|
my $UncheckAll=&mt('uncheck all'); |
my $keywordout=<<"END"; |
my $keywordout=<<"END"; |
<script> |
<script> |
function checkAll(field) { |
function checkAll(field) { |
Line 1114 function uncheckAll(field) {
|
Line 1114 function uncheckAll(field) {
|
field[i].checked = false ; |
field[i].checked = false ; |
} |
} |
</script> |
</script> |
<p><font color="#800000" face="helvetica"><b>KEYWORDS:</b></font> |
<p><font color="#800000" face="helvetica"><b>$KEYWORDS:</b></font> |
$keywords_help</b> |
$keywords_help</b> |
<input type="button" value="check all" onclick="javascript:checkAll(document.pubform.keywords)" /> |
<input type="button" value="$CheckAll" onclick="javascript:checkAll(document.pubform.keywords)" /> |
<input type="button" value="uncheck all" onclick="javascript:uncheckAll(document.pubform.keywords)" /> |
<input type="button" value="$UncheckAll" onclick="javascript:uncheckAll(document.pubform.keywords)" /> |
</p> |
</p> |
<br /> |
<br /> |
END |
END |
Line 1150 END
|
Line 1150 END
|
$scrout.=&textfield('Notes','notes',$metadatafields{'notes'}); |
$scrout.=&textfield('Notes','notes',$metadatafields{'notes'}); |
|
|
$scrout.= |
$scrout.= |
"\n<p><font color=\"#800000\" face=\"helvetica\"><b>ABSTRACT:". |
"\n<p><font color=\"#800000\" face=\"helvetica\"><b>".&mt('ABSTRACT').":". |
"</b></font></p><br />". |
"</b></font></p><br />". |
'<textarea cols="80" rows="5" name="abstract">'. |
'<textarea cols="80" rows="5" name="abstract">'. |
$metadatafields{'abstract'}.'</textarea></p>'; |
$metadatafields{'abstract'}.'</textarea></p>'; |
Line 1731 sub handler {
|
Line 1731 sub handler {
|
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
|
my $home=&Apache::lonnet::homeserver($cuname,$cudom); |
unless (&Apache::lonnet::homeserver($cuname,$cudom) |
my $allowed=0; |
eq $r->dir_config('lonHostID')) { |
my @ids=&Apache::lonnet::current_machine_ids(); |
|
foreach my $id (@ids) { if ($id eq $home) { $allowed = 1; } } |
|
unless ($allowed) { |
|
$r->log_reason($cuname.' at '.$cudom. |
$r->log_reason($cuname.' at '.$cudom. |
' trying to publish file '.$ENV{'form.filename'}. |
' trying to publish file '.$ENV{'form.filename'}. |
' ('.$fn.') - not homeserver ('.$home.')', |
' ('.$fn.') - not homeserver ('. |
|
&Apache::lonnet::homeserver($cuname,$cudom).')', |
$r->filename); |
$r->filename); |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |