| MySQL-Admin documentation | Contained in the MySQL-Admin distribution. |
MySQL::Admin::Actions - actions for Mysql::Admin
use vars qw($m_hrActions);
*actions = \$MySQL::Admin::Actions::actions;
$m_hrActions = {
welcome => {
sub => 'main',
file => 'content.pl',
title => 'Welcome',
whatever => 'storeyour own Stuff'
},
};
saveActions(); # stored into %CONFIG%
actions
Actions for MySQL::Admin.
loadActions() saveActions() $m_hrActions
Dirk Lindner <lze@cpan.org>
Copyright (C) 2005-2009 by Hr. Dirk Lindner
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; 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 Lesser General Public License for more details.
| MySQL-Admin documentation | Contained in the MySQL-Admin distribution. |
package MySQL::Admin::Actions; use strict; use warnings; require Exporter; use vars qw($m_hrActions $DefaultClass @EXPORT @ISA $defaultconfig); @MySQL::Admin::Actions::EXPORT = qw(loadActions saveActions $m_hrActions); use MySQL::Admin::Config; @MySQL::Admin::Actions::ISA = qw( Exporter MySQL::Admin::Config); $MySQL::Admin::Actions::VERSION = '0.62'; $DefaultClass = 'MySQL::Admin::Actions' unless defined $MySQL::Admin::Actions::DefaultClass; $defaultconfig = '%CONFIG%';
sub new { my ($class, @initializer) = @_; my $self = {}; bless $self, ref $class || $class || $DefaultClass; return $self; }
sub loadActions { my ($self, @p) = getSelf(@_); my $do = (defined $p[0]) ? $p[0] : $defaultconfig; if (-e $do) {do $do;} }
sub saveActions { my ($self, @p) = getSelf(@_); $self->SUPER::saveConfig(@p, $m_hrActions, 'actions'); }
sub getSelf { return @_ if defined($_[0]) && (!ref($_[0])) && ($_[0] eq 'MySQL::Admin::Actions'); return (defined($_[0]) && (ref($_[0]) eq 'MySQL::Admin::Actions' || UNIVERSAL::isa($_[0], 'MySQL::Admin::Actions'))) ? @_ : ($MySQL::Admin::Actions::DefaultClass->new, @_); }
1;