webgui/lib/WebGUI/Macro/PageTitle.pm
Colin Kuskie 4adafce696 Internationalize error messages in SQL.pm
Add POD to 5 macros
2005-12-20 19:26:25 +00:00

45 lines
1.3 KiB
Perl

package WebGUI::Macro::PageTitle;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2005 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use strict;
use WebGUI::Session;
=head1 NAME
Package WebGUI::Macro::PageTitle
=head1 DESCRIPTION
Macro for returning the title of the current Asset.
=head2 process ( )
Returns the title of the current Asset. If a WebGUI operation or function
is active, then the title is returned as a link to the Asset. If there is
no asset cached in the session variable, nothing is returned.
=cut
#-------------------------------------------------------------------
sub process {
if (exists $session{asset}) {
if ($session{form}{op} || $session{form}{func}) {
return '<a href="'.$session{asset}->getUrl.'">'.$session{asset}->get("title").'</a>';
} else {
return $session{asset}->get("title");
}
}
}
1;