version 1.57, 2001/12/05 20:25:20
|
version 1.61, 2001/12/05 22:00:14
|
Line 37
|
Line 37
|
# 05/03,05/05,05/07 Gerd Kortemeyer |
# 05/03,05/05,05/07 Gerd Kortemeyer |
# 05/28/2001 Scott Harrison |
# 05/28/2001 Scott Harrison |
# 06/23,08/07,08/11,8/13,8/17,8/18,8/24,9/26,10/16 Gerd Kortemeyer |
# 06/23,08/07,08/11,8/13,8/17,8/18,8/24,9/26,10/16 Gerd Kortemeyer |
|
# 12/04,12/05 Guy Albertelli |
|
# 12/05 Gerd Kortemeyer |
|
|
package Apache::lonpublisher; |
package Apache::lonpublisher; |
|
|
Line 351 sub publish {
|
Line 353 sub publish {
|
$scrout.='<h3>Dependencies</h3>'; |
$scrout.='<h3>Dependencies</h3>'; |
my $allowstr="\n"; |
my $allowstr="\n"; |
map { |
map { |
$allowstr.='<allow src="'.$_.'" />'."\n"; |
my $thisdep=$_; |
|
$allowstr.='<allow src="'.$thisdep.'" />'."\n"; |
$scrout.='<br>'; |
$scrout.='<br>'; |
unless ($_=~/\*/) { |
unless ($thisdep=~/\*/) { |
$scrout.='<a href="'.$_.'">'; |
$scrout.='<a href="'.$thisdep.'">'; |
} |
} |
$scrout.='<tt>'.$_.'</tt>'; |
$scrout.='<tt>'.$thisdep.'</tt>'; |
unless ($_=~/\*/) { |
unless ($thisdep=~/\*/) { |
$scrout.='</a>'; |
$scrout.='</a>'; |
|
if ( |
|
&Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonDocRoot'}.'/'. |
|
$thisdep.'.meta') eq '-1') { |
|
$scrout.= |
|
' - <font color=red>Currently not available</font>'; |
|
} else { |
|
my %temphash=(&Apache::lonnet::declutter($target).'___'. |
|
&Apache::lonnet::declutter($thisdep).'___usage' |
|
=> time); |
|
$thisdep=~/^\/res\/(\w+)\/(\w+)\//; |
|
if ((defined($1)) && (defined($2))) { |
|
&Apache::lonnet::put('resevaldata',\%temphash,$1,$2); |
|
} |
|
} |
} |
} |
} keys %allow; |
} keys %allow; |
$outstring=~s/(\<\/[^\>]+\>\s*)$/$allowstr$1/s; |
$outstring=~s/(\<\/[^\>]+\>\s*)$/$allowstr$1/s; |
Line 489 sub publish {
|
Line 506 sub publish {
|
|
|
$scrout.= |
$scrout.= |
'<form action="/adm/publish" method="post">'. |
'<form action="/adm/publish" method="post">'. |
|
'<p><input type="submit" value="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)). |
|
&hiddenfield('dependencies',join(',',keys %allow)). |
&textfield('Title','title',$metadatafields{'title'}). |
&textfield('Title','title',$metadatafields{'title'}). |
&textfield('Author(s)','author',$metadatafields{'author'}). |
&textfield('Author(s)','author',$metadatafields{'author'}). |
&textfield('Subject','subject',$metadatafields{'subject'}); |
&textfield('Subject','subject',$metadatafields{'subject'}); |
Line 579 sub publish {
|
Line 598 sub publish {
|
$metadatafields{'copyright'},%cprtag); |
$metadatafields{'copyright'},%cprtag); |
|
|
return $scrout. |
return $scrout. |
'<p><input type="submit" value="Finalize Publication"></form>'; |
'<p><input type="submit" value="Finalize Publication" /></p></form>'; |
} |
} |
|
|
# -------------------------------------------------------- Publication Step Two |
# -------------------------------------------------------- Publication Step Two |
Line 613 sub phasetwo {
|
Line 632 sub phasetwo {
|
$metadatafields{'lastrevisiondate'}=$ENV{'form.lastrevisiondate'}; |
$metadatafields{'lastrevisiondate'}=$ENV{'form.lastrevisiondate'}; |
$metadatafields{'owner'}=$ENV{'form.owner'}; |
$metadatafields{'owner'}=$ENV{'form.owner'}; |
$metadatafields{'copyright'}=$ENV{'form.copyright'}; |
$metadatafields{'copyright'}=$ENV{'form.copyright'}; |
|
$metadatafields{'dependencies'}=$ENV{'form.dependencies'}; |
|
|
my $allkeywords=$ENV{'form.addkey'}; |
my $allkeywords=$ENV{'form.addkey'}; |
map { |
map { |