Changeset 5575
- Timestamp:
- 11/18/09 12:21:02 (3 years ago)
- Location:
- trunk/SetVariablePlugin
- Files:
-
- 3 edited
-
data/System/SetVariablePlugin.txt (modified) (1 diff)
-
lib/Foswiki/Plugins/SetVariablePlugin.pm (modified) (3 diffs)
-
lib/Foswiki/Plugins/SetVariablePlugin/Core.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SetVariablePlugin/data/System/SetVariablePlugin.txt
r5552 r5575 104 104 and scope of the variable 105 105 106 ---+++ DEBUGRULES107 Display a table of all definition rules as far as collected by SETVAR and UNSERVAR.108 109 106 ---++ Installation Instructions 110 107 %$INSTALL_INSTRUCTIONS% -
trunk/SetVariablePlugin/lib/Foswiki/Plugins/SetVariablePlugin.pm
r5552 r5575 24 24 25 25 $VERSION = '$Rev: 4287 (2009-06-23) $'; 26 $RELEASE = '1.0 1';26 $RELEASE = '1.02'; 27 27 28 28 $SHORTDESCRIPTION = 'Flexible handling of topic variables'; 29 29 $NO_PREFS_IN_TOPIC = 1; 30 30 31 use constant DEBUG => 0; #toggle me 31 32 32 33 ############################################################################### 33 34 sub initPlugin { 34 my ( $topic, $web, $user, $installWeb) = @_;35 my ($topic, $web, $user, $installWeb) = @_; 35 36 36 37 Foswiki::Func::registerTagHandler('SETVAR', \&handleSetVar); … … 38 39 Foswiki::Func::registerTagHandler('DELVAR', \&handleUnsetVar); 39 40 Foswiki::Func::registerTagHandler('UNSETVAR', \&handleUnsetVar); 40 Foswiki::Func::registerTagHandler('DEBUGRULES', \&handleDebugRules) ;41 Foswiki::Func::registerTagHandler('DEBUGRULES', \&handleDebugRules) if DEBUG; 41 42 42 undef $core;43 $core = undef; 43 44 44 45 return 1; … … 56 57 57 58 ############################################################################### 58 sub handleSetVar { getCore()->handleSetVar(@_); } 59 sub handleSetVar { 60 getCore()->handleSetVar(@_) if Foswiki::Func::getContext()->{save} || DEBUG; 61 return '' ; 62 } 63 64 ############################################################################### 65 sub handleUnsetVar { 66 getCore()->handleUnsetVar(@_) if Foswiki::Func::getContext()->{save} || DEBUG; 67 return '' ; 68 } 69 70 ############################################################################### 59 71 sub handleGetVar { getCore()->handleGetVar(@_); } 60 sub handleUnsetVar { getCore()->handleUnsetVar(@_); }61 72 sub handleDebugRules { getCore()->handleDebugRules(@_); } 62 73 sub beforeSaveHandler { getCore()->handleBeforeSave(@_); } -
trunk/SetVariablePlugin/lib/Foswiki/Plugins/SetVariablePlugin/Core.pm
r5552 r5575 24 24 sub new { 25 25 my $class = shift; 26 my $this = bless({}, $class); 27 28 $this->{rules} = (); 29 30 return $this; 26 27 return bless({}, $class); 31 28 } 32 29 … … 56 53 sub applyRules { 57 54 my ($this, $web, $topic, $meta, $text) = @_; 55 56 return unless $this->{rules}; 58 57 59 58 $text ||= '';
Note: See TracChangeset
for help on using the changeset viewer.
