aboutsummaryrefslogtreecommitdiffstats
path: root/AdminPanel/Shared.pm
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-01-16 22:56:16 +0100
committerAngelo Naselli <anaselli@linux.it>2014-01-16 22:56:16 +0100
commitce5290dcdbba11a8ea5c80fb8ba9f221c6863f85 (patch)
treef65b8e09b1d611f9b2581875ca15873b24a48d2d /AdminPanel/Shared.pm
parentfed16eef71eacf5e06b7efb633e6cbf1e55f38f0 (diff)
downloadmanatools-ce5290dcdbba11a8ea5c80fb8ba9f221c6863f85.tar
manatools-ce5290dcdbba11a8ea5c80fb8ba9f221c6863f85.tar.gz
manatools-ce5290dcdbba11a8ea5c80fb8ba9f221c6863f85.tar.bz2
manatools-ce5290dcdbba11a8ea5c80fb8ba9f221c6863f85.tar.xz
manatools-ce5290dcdbba11a8ea5c80fb8ba9f221c6863f85.zip
Added License into Shared to be used by admin panel modules easily
set back dependency from /usr/lib/libDrakX to use apanel without -I
Diffstat (limited to 'AdminPanel/Shared.pm')
-rw-r--r--AdminPanel/Shared.pm53
1 files changed, 50 insertions, 3 deletions
diff --git a/AdminPanel/Shared.pm b/AdminPanel/Shared.pm
index c337dfcc..21f98684 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