aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo.pasotti@gmail.com>2015-01-11 10:41:27 +0100
committerMatteo Pasotti <matteo.pasotti@gmail.com>2015-01-11 10:41:27 +0100
commit82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef (patch)
treec452565cd920c5e9ed7b9d85a677bddc2679a968 /lib
parentc436aaa48cc82520f47cce38d93e875018f5f181 (diff)
downloadmanatools-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.tar
manatools-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.tar.gz
manatools-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.tar.bz2
manatools-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.tar.xz
manatools-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.zip
ask_multiple_fromList returns arrayref or undef
Diffstat (limited to 'lib')
-rw-r--r--lib/AdminPanel/Shared/GUI.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/AdminPanel/Shared/GUI.pm b/lib/AdminPanel/Shared/GUI.pm
index e3052767..d01ec85d 100644
--- a/lib/AdminPanel/Shared/GUI.pm
+++ b/lib/AdminPanel/Shared/GUI.pm
@@ -541,7 +541,7 @@ $info: HASH, information to be passed to the dialog.
=head3 OUTPUT
undef: if Cancel button has been pressed
- selected item: if Select button has been pressed
+ selected items: ArrayRef , if Select button has been pressed
=head3 DESCRIPTION
@@ -563,7 +563,7 @@ sub ask_multiple_fromList {
die "List is mandatory" if (! exists $info->{list} );
die "At least one element is mandatory into list" if (scalar(@{$info->{list}}) < 1);
- my @selections = ();
+ my $selections = [];
my $factory = yui::YUI::widgetFactory;
## push application title
@@ -622,6 +622,7 @@ sub ask_multiple_fromList {
}
}
if ($widget == $cancelButton) {
+ $selections = undef;
last;
}
elsif ($widget == $selectButton) {
@@ -629,7 +630,7 @@ sub ask_multiple_fromList {
{
if($ckbox->{value} == 1)
{
- push @selections, $ckbox->{text};
+ push @{$selections}, $ckbox->{text};
}
}
last;
@@ -641,8 +642,8 @@ sub ask_multiple_fromList {
#restore old application title
yui::YUI::app()->setApplicationTitle($appTitle);
-
- return @selections;
+
+ return $selections;
}
#=============================================================