--- loncom/publisher/lonpublisher.pm 2008/06/27 18:52:35 1.238
+++ loncom/publisher/lonpublisher.pm 2008/08/01 18:11:19 1.244
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.238 2008/06/27 18:52:35 bisitz Exp $
+# $Id: lonpublisher.pm,v 1.244 2008/08/01 18:11:19 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -123,6 +123,7 @@ use Apache::loncacc;
use DBI;
use Apache::lonnet;
use Apache::loncommon();
+use Apache::lonhtmlcommon;
use Apache::lonmysql;
use Apache::lonlocal;
use Apache::loncfile;
@@ -274,7 +275,7 @@ sub metaread {
}
&metaeval($metastring,$prefix);
return ''.&mt('Processed file').': '.
- &Apache::loncfile::display($fn).' ';
+ &Apache::loncfile::display($fn).' ';
}
#########################################
@@ -325,7 +326,7 @@ string which presents the form field (fo
#########################################
#########################################
sub textfield {
- my ($title,$name,$value)=@_;
+ my ($title,$name,$value,$noline)=@_;
$value=~s/^\s+//gs;
$value=~s/\s+$//gs;
$value=~s/\s+/ /gs;
@@ -333,11 +334,11 @@ sub textfield {
$env{'form.'.$name}=$value;
return "\n".&Apache::lonhtmlcommon::row_title($title)
.' '
- .&Apache::lonhtmlcommon::row_closure();
+ .&Apache::lonhtmlcommon::row_closure($noline);
}
sub text_with_browse_field {
- my ($title,$name,$value,$restriction)=@_;
+ my ($title,$name,$value,$restriction,$noline)=@_;
$value=~s/^\s+//gs;
$value=~s/\s+$//gs;
$value=~s/\s+/ /gs;
@@ -352,7 +353,7 @@ sub text_with_browse_field {
.''
.&mt('Search')
.' '
- .&Apache::lonhtmlcommon::row_closure();
+ .&Apache::lonhtmlcommon::row_closure($noline);
}
sub hiddenfield {
@@ -797,7 +798,7 @@ sub fix_ids_and_indices {
}
if ((($token->[1] eq 'part') || ($token->[1] eq 'problem'))
&& (!$responsecounter)) {
- my $outstring=''.&mt('Found [_1] without responses',$token->[1]).' ';
+ my $outstring=''.&mt('Found [_1] without responses. This resource cannot be published.',$token->[1]).' ';
return ($outstring,1);
}
} else {
@@ -886,17 +887,21 @@ sub checkonthis {
'return_only_error_and_warning_counts' => 1));
my ($errorcount,$warningcount)=split(':',$result);
if (($errorcount) || ($warningcount)) {
- $r->print(''.$uri.' : ');
- if ($errorcount) {
- $r->print(''.
- $errorcount.' '.
- &mt('error(s)').' ');
- }
- if ($warningcount) {
- $r->print(''.
- $warningcount.' '.
- &mt('warning(s)').' ');
- }
+ $r->print('
'.&mt('Warnings and Errors').' ');
+ $r->print(''.$uri.' :');
+ $r->print('');
} else {
#$r->print(''.&mt('ok').' ');
}
@@ -968,7 +973,7 @@ sub publish {
print $logfile "Copied original file to ".$copyfile."\n";
} else {
print $logfile "Unable to write backup ".$copyfile.':'.$!."\n";
- return ("Failed to write backup copy, $!,FAIL ",1);
+ return ("".&mt("Failed to write backup copy, [_1], FAIL",$1)." ",1);
}
# ------------------------------------------------------------- IDs and indices
@@ -1044,7 +1049,7 @@ sub publish {
unless ($batch) {
$scrout.=''.&mt('Metadata Information').' ' .
- Apache::loncommon::help_open_topic("Metadata_Description")
+ &Apache::loncommon::help_open_topic("Metadata_Description")
. ' ';
}
@@ -1195,15 +1200,17 @@ sub publish {
# $env{'from.'..} so that it can be used by the phase two handler in
# batch mode
- my $intr_scrout.=&Apache::lonhtmlcommon::start_pick_box()
+ my $intr_scrout.=' '
.''
- .&Apache::lonhtmlcommon::end_pick_box();
+ .'" />'
+ .'';
}
return($scrout,0);
}
@@ -1597,7 +1618,7 @@ sub phasetwo {
unless ($srcd=~/^\/home\/httpd\/html\/res/) {
print $logfile "\nPANIC: Target dir is ".$srcd;
$r->print(
- "Invalid target directory, FAIL ");
+ "".&mt('Invalid target directory, FAIL')." ");
return 0;
}
opendir(DIR,$srcd);
@@ -2122,28 +2143,55 @@ sub handler {
my $thistype=$1;
my $thisembstyle=&Apache::loncommon::fileembstyle($thistype);
if ($thistype eq 'page') { $thisembstyle = 'rat'; }
- $r->print(''.&mt('Publishing').' '.
- &Apache::loncommon::filedescription($thistype).' ');
+ $r->print(''.&mt('Publishing [_1]',''.$thisdisfn.' ').' ');
+
+ $r->print(''.&mt('Resource Details').' ');
+
+ $r->print(&Apache::lonhtmlcommon::start_pick_box());
+
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Type'))
+ .&Apache::loncommon::filedescription($thistype)
+ .&Apache::lonhtmlcommon::row_closure()
+ );
+
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Link to Resource'))
+ .''
+ );
$r->print(<
$thisdisfn
ENDCAPTION
- $r->print(' '.&mt('Target').': '.
- $thisdistarget.' ');
-
+ $r->print(''
+ .&Apache::lonhtmlcommon::row_closure()
+ );
+
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Target'))
+ .''.$thisdistarget.' '
+ );
+# SB - ToDo:
if (($cuname ne $env{'user.name'})||($cudom ne $env{'user.domain'})) {
- $r->print(''.&mt('Co-Author').': '.
- $cuname.&mt(' at ').$cudom.' ');
+# $r->print(&Apache::lonhtmlcommon::row_title(''.&mt('Co-Author').' ')
+ $r->print(&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title(&mt('Co-Author'))
+ .''
+ .&mt('[_1] at [_2]',$cuname,$cudom)
+ .' '
+ );
}
if (&Apache::loncommon::fileembstyle($thistype) eq 'ssi') {
+ $r->print(&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title(&mt('Diffs')));
$r->print(<
ENDDIFF
- $r->print(&mt('Diffs with Current Version').' ');
+ $r->print(&mt('Diffs with Current Version').'');
}
+
+ $r->print(&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::end_pick_box()
+ );
# ------------------ Publishing from $thisfn to $thistarget with $thisembstyle.
@@ -2158,7 +2206,7 @@ ENDDIFF
&publish($thisfn,$thistarget,$thisembstyle);
$r->print(' '.$outstring);
} else {
- $r->print(''.
+ $r->print(''.
&mt('The document contains errors and cannot be published.').
' ');
}