Added POD to 4 macros.

Internationalized Error messages for Include and LastModified
This commit is contained in:
Colin Kuskie 2005-12-19 05:34:13 +00:00
parent 01816cd806
commit d085152304
6 changed files with 111 additions and 3 deletions

View file

@ -17,6 +17,29 @@ use WebGUI::Session;
use WebGUI::International;
use WebGUI::SQL;
=head1 NAME
Package WebGUI::Macro::LastModified
=head1 DESCRIPTION
Macro for displaying the date that the most recent revision of the Asset was last modified.
=head2 process ( [label, format] )
=head3 label
Text to prepend to the date. This can be the empty string.
=head3 format string
A string specifying how to format the date using codes similar to those used by
sprintf. See L<WebGUI::DateTime/"epochToHuman"> for a list of codes. Uses
"%z" if empty.
=cut
#-------------------------------------------------------------------
sub process {
return '' unless $session{asset};
@ -24,7 +47,7 @@ sub process {
($label, $format) = @_;
$format = '%z' if ($format eq "");
($time) = WebGUI::SQL->quickArray("SELECT max(revisionDate) FROM assetData where assetId=".quote($session{asset}->getId),WebGUI::SQL->getSlave);
return WebGUI::International::get(43,'Asset_Survey') if $time eq 0;
return WebGUI::International::get('never','Macro_LastModified') if $time eq 0;
return $label.epochToHuman($time,$format) if ($time);
}