Replaced the account.options loop in the displayAccount auth methods with new macros for displaying deactivate account and back to site links. Another macro which allows text to be displayed according to whether the value passed in is empty or not was added to allow functionality similar to that which currently exists.
This commit is contained in:
parent
d91bc5754d
commit
32979d75e1
13 changed files with 175 additions and 82 deletions
58
lib/WebGUI/Macro/HasValueText.pm
Normal file
58
lib/WebGUI/Macro/HasValueText.pm
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package WebGUI::Macro::HasValueText;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2008 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;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::HasValueText
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for displaying text based on whether or not the value entered it empty.
|
||||
|
||||
=head2 process ( value, textIfValue, textIfNotValule )
|
||||
|
||||
Either the textIfValue or textIfNotValue fields can be empty
|
||||
|
||||
=head3 value
|
||||
|
||||
The value to test to see if it's empty.
|
||||
|
||||
=head3 textIfValue
|
||||
|
||||
The text to be displayed if the value is not empty. Use %s to represent the value itself.
|
||||
|
||||
ex: ^HasValueText(test,<li>%s</li>,);
|
||||
returns: <li>test</li>
|
||||
|
||||
=head3 textIfNoValue
|
||||
|
||||
Text to be displayed if the value is empty.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my ($value, $valueText, $noValueText ) = @_;
|
||||
$value =~ s/^\s//;
|
||||
$value =~ s/\s$//;
|
||||
if ($value eq "") {
|
||||
return $noValueText;
|
||||
}
|
||||
return sprintf($valueText,$value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue