From 58df04b36cd17ba990022e9e3c6359eb3e833938 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 7 Dec 2005 16:28:55 +0000 Subject: [PATCH] added getLabel method --- lib/WebGUI/Operation/Profile.pm | 2 ++ lib/WebGUI/ProfileCategory.pm | 14 ++++++++++++++ lib/WebGUI/ProfileField.pm | 16 +++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Operation/Profile.pm b/lib/WebGUI/Operation/Profile.pm index 9d53004c6..5b8d261eb 100644 --- a/lib/WebGUI/Operation/Profile.pm +++ b/lib/WebGUI/Operation/Profile.pm @@ -31,6 +31,8 @@ use WebGUI::SQL; use WebGUI::URL; use WebGUI::User; use WebGUI::Utility; +use WebGUI::ProfileField; +use WebGUI::ProfileCategory; use WebGUI::Operation::Shared; #------------------------------------------------------------------- diff --git a/lib/WebGUI/ProfileCategory.pm b/lib/WebGUI/ProfileCategory.pm index cf721e25c..e0a0b8347 100644 --- a/lib/WebGUI/ProfileCategory.pm +++ b/lib/WebGUI/ProfileCategory.pm @@ -19,6 +19,7 @@ use strict; use WebGUI::ProfileField; use WebGUI::Session; use WebGUI::SQL; +use WebGUI::Operation::Shared; =head1 NAME @@ -159,6 +160,19 @@ sub getId { #------------------------------------------------------------------- +=head2 getLabel () + +Returns the eval'd label for this category. + +=cut + +sub getLabel { + my $self = shift; + return WebGUI::Operation::Shared::secureEval($self->get("label")); +} + +#------------------------------------------------------------------- + =head2 moveDown () Moves this category down one position. diff --git a/lib/WebGUI/ProfileField.pm b/lib/WebGUI/ProfileField.pm index db06d7b08..fbda28573 100644 --- a/lib/WebGUI/ProfileField.pm +++ b/lib/WebGUI/ProfileField.pm @@ -21,6 +21,7 @@ use WebGUI::Session; use WebGUI::SQL; use WebGUI::Form; use WebGUI::FormProcessor; +use WebGUI::Operation::Shared; =head1 NAME @@ -116,7 +117,7 @@ Optionally pass in a list of properties to override the default properties of an sub formField { my $self = shift; my $properties = shift; - $properties->{label} = WebGUI::Operation::Shared::secureEval($self->get("label")); + $properties->{label} = $self->getLabel; $properties->{fieldType} = $self->get("fieldType"); $properties->{name} = $self->getId; my $values = WebGUI::Operation::Shared::secureEval($self->get("possibleValues")); @@ -204,6 +205,19 @@ sub getId { #------------------------------------------------------------------- +=head2 getLabel () + +Returns the eval'd label for this field. + +=cut + +sub getLabel { + my $self = shift; + return WebGUI::Operation::Shared::secureEval($self->get("label")); +} + +#------------------------------------------------------------------- + =head2 moveDown () Moves this field down one position within it's category.