[siesta-commit] siesta/lib/Siesta Plugin.pm,1.15,1.16

[prev] [thread] [next] [lurker] [Date index for 2002/09/09]

From: clampr
Subject: [siesta-commit] siesta/lib/Siesta Plugin.pm,1.15,1.16
Date: 14:04 on 09 Sep 2002
Update of /cvsroot/siesta/siesta/lib/Siesta
In directory usw-pr-cvs1:/tmp/cvs-serv551

Modified Files:
	Plugin.pm 
Log Message:
layout fixes


Index: Plugin.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Plugin.pm	9 Sep 2002 11:17:29 -0000	1.15
+++ Plugin.pm	9 Sep 2002 13:04:36 -0000	1.16
@@ -1,15 +1,8 @@
 # $Id$
 package Siesta::Plugin;
 use strict;
-use vars qw/ $DESCRIPTION /;
-
 use Class::MethodMaker new => 'new';
 
-
-$DESCRIPTION = "Base class for all Siesta::Plugins\n";
-
-
-
 =head1 NAME
 
 Siesta::Plugin - base class for Siesta Plugins
@@ -33,7 +26,6 @@
 
 sub process { die "virtual" }
 
-
 =item ->config($message, $key, [$value])
 
 gets (or sets) the value of key for this plugin based on the
@@ -45,15 +37,12 @@
 
 sub config {
     my $self = shift;
-    (my $package = ref $self) =~ s!^.*::!!;
-
     my $mail = shift;
 
-    my $list_id = (defined $mail->list)? $mail->list->id() : undef;
-    my $user_id = (defined $mail->user)? $mail->user->id() : undef;
+    (my $package = ref $self) =~ s!^.*::!!;
 
-    $list_id ||= '';
-    $user_id ||= '';  
+    my $list_id = $mail->list ? $mail->list->id() : undef;
+    my $user_id = $mail->user ? $mail->user->id() : undef;
 
     return Siesta->storage->config($package, $user_id, $list_id, @_);
 }
@@ -61,28 +50,23 @@
 
 =item ->options()
 
-Returns a hashref, the keys of which are the various config 
-options a plugin accepts.
-
-The value is another hashref which has the keys 
-
-description - a short description of the option
-
-type        - string, number, list, hash, boolean (1 or 0)
-
-default     - the default value
+Returns a hashref, the keys of which are the various config options a
+plugin accepts.  These are:
 
-widget      - what widget should be used in a gui to represent this
+ description - a short description of the option
+ type        - string, number, list, hash, boolean (1 or 0)
+ default     - the default value
+ widget      - what widget should be used in a gui to represent this
 
 This should be overridden by a deriving class.
 
 =cut
 
-sub options
-{
+sub options { +{} }
 
-	return {};
+1;
+__END__
 
-}
+=back
 
-1;
+=cut



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52