add admin plugins API and start testing
This commit is contained in:
parent
c8cff33b97
commit
250967c898
4 changed files with 215 additions and 13 deletions
44
lib/WebGUI/Admin/Plugin.pm
Normal file
44
lib/WebGUI/Admin/Plugin.pm
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package WebGUI::Admin::Plugin;
|
||||
|
||||
use Moose;
|
||||
use Scalar::Util qw(blessed);
|
||||
|
||||
has 'id' => (
|
||||
is => 'ro',
|
||||
isa => 'Str',
|
||||
required => 1,
|
||||
);
|
||||
|
||||
has 'title' => (
|
||||
is => 'rw',
|
||||
isa => 'Str',
|
||||
);
|
||||
|
||||
has 'icon' => (
|
||||
is => 'rw',
|
||||
isa => 'Str',
|
||||
default => '', # Find a good default
|
||||
);
|
||||
|
||||
has 'iconSmall' => (
|
||||
is => 'rw',
|
||||
isa => 'Str',
|
||||
default => '', # Find a good default
|
||||
);
|
||||
|
||||
sub BUILDARGS {
|
||||
my ( $class, $session, %args ) = @_;
|
||||
return { session => $session, %args };
|
||||
}
|
||||
|
||||
sub canUse {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub getUrl {
|
||||
my ( $self, $method, $params ) = @_;
|
||||
$method ||= "view";
|
||||
return '?op=admin;plugin=' . $self->id . ';method=' . $method . ';' . $params;
|
||||
}
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue