diff options
author | Matteo Pasotti <matteo.pasotti@gmail.com> | 2014-01-19 01:11:21 +0100 |
---|---|---|
committer | Matteo Pasotti <matteo.pasotti@gmail.com> | 2014-01-19 01:11:21 +0100 |
commit | 97d9107d09e7112c012bd3637e30e0821b5f6885 (patch) | |
tree | a6591e00c239b8324aeab92a0169a1f8143c70ef /AdminPanel/Shared.pm | |
parent | 03509ca6ac225c921d5f15479198908eac6df605 (diff) | |
parent | 8be4c570361e4df7a3e319e9b9bd029d7520fb7b (diff) | |
download | manatools-97d9107d09e7112c012bd3637e30e0821b5f6885.tar manatools-97d9107d09e7112c012bd3637e30e0821b5f6885.tar.gz manatools-97d9107d09e7112c012bd3637e30e0821b5f6885.tar.bz2 manatools-97d9107d09e7112c012bd3637e30e0821b5f6885.tar.xz manatools-97d9107d09e7112c012bd3637e30e0821b5f6885.zip |
Merge branch 'master' of ssh://git.mageia.org/software/adminpanel
Diffstat (limited to 'AdminPanel/Shared.pm')
-rw-r--r-- | AdminPanel/Shared.pm | 53 |
1 files changed, 50 insertions, 3 deletions
diff --git a/AdminPanel/Shared.pm b/AdminPanel/Shared.pm index c337dfcc..5d052e08 100644 --- a/AdminPanel/Shared.pm +++ b/AdminPanel/Shared.pm @@ -77,18 +77,22 @@ along with this file. If not, see <http://www.gnu.org/licenses/>. use strict; use warnings; use diagnostics; -#use lib qw(/usr/lib/libDrakX); -use common qw(N); + +use lib qw(/usr/lib/libDrakX); +use common qw(N + N_); use yui; use base qw(Exporter); +# TODO move GUI dialogs to Shared::GUI our @EXPORT = qw(warningMsgBox msgBox infoMsgBox ask_YesOrNo ask_OkCancel AboutDialog - trim); + trim + member); =head1 VERSION @@ -99,6 +103,21 @@ Version 0.01 our $VERSION = '0.01'; +our $License = N_("This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +"); + #============================================================= @@ -569,4 +588,32 @@ sub trim { return $st; } +#============================================================= + +=head2 member + +=head3 INPUT + + $e: Array element to be found into array + @_: any array + +=head3 OUTPUT + + 1 or 0: if $e is a member of the given array + +=head3 DESCRIPTION + +This function look for an element into an array + +=cut + +#============================================================= +sub member { + my $e = shift; + foreach (@_) { + $e eq $_ and return 1; + } + 0; +} + 1; # End of AdminPanel::Shared |