aboutsummaryrefslogtreecommitdiffstats
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
parentc436aaa48cc82520f47cce38d93e875018f5f181 (diff)
downloadcolin-keep-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.tar
colin-keep-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.tar.gz
colin-keep-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.tar.bz2
colin-keep-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.tar.xz
colin-keep-82ffcc5aeba0f55c7adb0114034d9b6ba743e5ef.zip
ask_multiple_fromList returns arrayref or undef
-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 e305276..d01ec85 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;
}
#=============================================================