version 1.258.2.4, 2010/01/27 03:44:48
|
version 1.264, 2009/11/24 01:44:44
|
Line 1668 sub phasetwo {
|
Line 1668 sub phasetwo {
|
|
|
if (copy($target,$copyfile)) { |
if (copy($target,$copyfile)) { |
print $logfile "Copied old target to ".$copyfile."\n"; |
print $logfile "Copied old target to ".$copyfile."\n"; |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Copied old target file'))); |
$r->print('<p>'.&mt('Copied old target file').'</p>'); |
} else { |
} else { |
print $logfile "Unable to write ".$copyfile.':'.$!."\n"; |
print $logfile "Unable to write ".$copyfile.':'.$!."\n"; |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Failed to copy old target').", $!",1)); |
$r->print("<span class=\"LC_error\">".&mt('Failed to copy old target'). |
|
", $!, ".&mt('FAIL')."</span>"); |
return 0; |
return 0; |
} |
} |
|
|
Line 1681 sub phasetwo {
|
Line 1682 sub phasetwo {
|
|
|
if (copy($target.'.meta',$copyfile)) { |
if (copy($target.'.meta',$copyfile)) { |
print $logfile "Copied old target metadata to ".$copyfile."\n"; |
print $logfile "Copied old target metadata to ".$copyfile."\n"; |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Copied old metadata'))); |
$r->print('<p>'.&mt('Copied old metadata').'</p>') |
} else { |
} else { |
print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n"; |
print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n"; |
if (-e $target.'.meta') { |
if (-e $target.'.meta') { |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
$r->print( |
&mt('Failed to write old metadata copy').", $!",1)); |
"<span class=\"LC_error\">". |
|
&mt('Failed to write old metadata copy').", $!, ".&mt('FAIL')."</span>"); |
return 0; |
return 0; |
} |
} |
} |
} |
Line 1720 sub phasetwo {
|
Line 1721 sub phasetwo {
|
|
|
if (copy($source,$copyfile)) { |
if (copy($source,$copyfile)) { |
print $logfile "\nCopied original source to ".$copyfile."\n"; |
print $logfile "\nCopied original source to ".$copyfile."\n"; |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Copied source file'))); |
$r->print('<p>'.&mt('Copied source file').'</p>'); |
} else { |
} else { |
print $logfile "\nUnable to write ".$copyfile.':'.$!."\n"; |
print $logfile "\nUnable to write ".$copyfile.':'.$!."\n"; |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
$r->print("<span class=\"LC_error\">". |
&mt('Failed to copy source').", $!",1)); |
&mt('Failed to copy source').", $!, ".&mt('FAIL')."</span>"); |
return 0; |
return 0; |
} |
} |
|
|
# ---------------------------------------------- Delete local tmp-preview files |
|
unlink($copyfile.'.tmp'); |
|
# --------------------------------------------------------------- Copy Metadata |
# --------------------------------------------------------------- Copy Metadata |
|
|
$copyfile=$copyfile.'.meta'; |
$copyfile=$copyfile.'.meta'; |
|
|
if (copy($source.'.meta',$copyfile)) { |
if (copy($source.'.meta',$copyfile)) { |
print $logfile "\nCopied original metadata to ".$copyfile."\n"; |
print $logfile "\nCopied original metadata to ".$copyfile."\n"; |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Copied metadata'))); |
$r->print('<p>'.&mt('Copied metadata').'</p>'); |
} else { |
} else { |
print $logfile "\nUnable to write metadata ".$copyfile.':'.$!."\n"; |
print $logfile "\nUnable to write metadata ".$copyfile.':'.$!."\n"; |
$r->print(&Apache::lonhtmlcommon::confirm_success( |
$r->print( |
&mt('Failed to write metadata copy').", $!",1)); |
"<span class=\"LC_error\">".&mt('Failed to write metadata copy').", $!, ".&mt('FAIL')."</span>"); |
return 0; |
return 0; |
} |
} |
$r->rflush; |
$r->rflush; |
Line 1771 sub phasetwo {
|
Line 1770 sub phasetwo {
|
|
|
my $thissrcdir=$thissrc; |
my $thissrcdir=$thissrc; |
$thissrcdir=~s/\/[^\/]+$/\//; |
$thissrcdir=~s/\/[^\/]+$/\//; |
|
|
$r->print( |
$r->print(&Apache::loncommon::head_subbox( |
'<hr /><a href="'.$thisdistarget.'"><font size="+2">'. |
&Apache::lonhtmlcommon::start_funclist(). |
&mt('View Published Version').'</font></a>'. |
&Apache::lonhtmlcommon::add_item_funclist( |
'<p><a href="'.$thissrc.'"><font size="+2">'. |
'<a href="'.$thisdistarget.'">'. |
&mt('Back to Source').'</font></a></p>'. |
&mt('View Published Version'). |
'<p><a href="'.$thissrcdir. |
'</a>'). |
'"><font size="+2">'. |
&Apache::lonhtmlcommon::add_item_funclist( |
&mt('Back to Source Directory').'</font></a></p>'); |
'<a href="'.$thissrc.'">'. |
|
&mt('Back to Source'). |
|
'</a>'). |
|
&Apache::lonhtmlcommon::add_item_funclist( |
|
'<a href="'.$thissrcdir.'">'. |
|
&mt('Back to Source Directory'). |
|
'</a>'). |
|
&Apache::lonhtmlcommon::end_funclist()) |
|
); |
} |
} |
return 1; |
return 1; |
} |
} |
Line 2165 sub handler {
|
Line 2172 sub handler {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
|
# Breadcrumbs |
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
'text' => 'Construction Space', |
|
'href' => &Apache::loncommon::authorspace(), |
|
}); |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
'text' => 'Resource Publication', |
|
'href' => '', |
|
}); |
|
|
my $js='<script type="text/javascript">'. |
my $js='<script type="text/javascript">'. |
&Apache::loncommon::browser_and_searcher_javascript(). |
&Apache::loncommon::browser_and_searcher_javascript(). |
'</script>'; |
'</script>'; |
$r->print(&Apache::loncommon::start_page('Resource Publication',$js)); |
$r->print(&Apache::loncommon::start_page('Resource Publication',$js) |
|
.&Apache::lonhtmlcommon::breadcrumbs() |
|
.&Apache::loncommon::head_subbox( |
|
&Apache::loncommon::CSTR_pageheader()) # FIXME crumbs broken? |
|
); |
|
|
|
|
my $thisfn=$fn; |
my $thisfn=$fn; |
Line 2269 ENDDIFF
|
Line 2291 ENDDIFF
|
} |
} |
} else { |
} else { |
&phasetwo($r,$thisfn,$thistarget,$thisembstyle,$thisdistarget); |
&phasetwo($r,$thisfn,$thistarget,$thisembstyle,$thisdistarget); |
$r->print('<hr />'); |
|
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |