POD for final two macros
This commit is contained in:
parent
6ded5832ca
commit
24283f7ca9
2 changed files with 66 additions and 0 deletions
|
|
@ -17,12 +17,49 @@ use WebGUI::Session;
|
|||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::AOIHits
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for displaying either a login box and registration link to the
|
||||
user, or, if they're logged in, a link to access their account and log out.
|
||||
|
||||
=head2 _createURL ( text )
|
||||
|
||||
internal utility sub for wrapping text in a link.
|
||||
|
||||
=head3 text
|
||||
|
||||
text to wrap in a link for logging out.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _createURL {
|
||||
return '<a href="'.WebGUI::URL::page("op=auth;method=logout").'">'.$_[0].'</a>';
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 process ( boxSize, text, templateId )
|
||||
|
||||
=head3 boxSize
|
||||
|
||||
The size of the login box. Defaults to 12.
|
||||
|
||||
=head3 text
|
||||
|
||||
A custom text message, processed for embedded text surrounded by percent signs
|
||||
to turn into links to logout.
|
||||
|
||||
=head3 templateId
|
||||
|
||||
The ID of a template for custom layout of the login box and text.
|
||||
|
||||
=cut
|
||||
|
||||
sub process {
|
||||
my @param = @_;
|
||||
my $templateId = $param[2] || "PBtmpl0000000000000044";
|
||||
|
|
|
|||
|
|
@ -16,6 +16,35 @@ use WebGUI::Session;
|
|||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::LoginToggle
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for a login or logout message with link to the user depending on whether they are logged in or now.
|
||||
|
||||
=head2 process ( [ loginText, logoutText, templateId ] )
|
||||
|
||||
Note, if loginText = 'linkonly', then only the link will be returned.
|
||||
|
||||
=head3 loginText
|
||||
|
||||
Text that will be displayed to the user if they are not logged in. If blank, an
|
||||
internationalized message will be used.
|
||||
|
||||
=head3 logoutText
|
||||
|
||||
Text that will be displayed to the user if they are logged in. If blank, an
|
||||
internationalized message will be used.
|
||||
|
||||
=head3 templateId
|
||||
|
||||
The ID of a template for custom layout of the link and text.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my @param = @_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue