*** lib/TWiki/Plugins/CacheContentPlugin.pm~ Fri Feb 10 12:03:13 2006 --- lib/TWiki/Plugins/CacheContentPlugin.pm Thu Jul 13 05:17:49 2006 *************** *** 24,33 **** # Always use strict to enforce variable scoping use strict; # $VERSION is referred to by TWiki, and is the only global variable that # *must* exist in this package use vars qw( $VERSION $RELEASE $debug $pluginName ); ! use vars qw( $savedAlready ); # This should always be $Rev$ so that TWiki can determine the checked-in # status of the plugin. It is used by the build automation tools, so --- 24,35 ---- # Always use strict to enforce variable scoping use strict; + use File::Basename qw( basename ); + # $VERSION is referred to by TWiki, and is the only global variable that # *must* exist in this package use vars qw( $VERSION $RELEASE $debug $pluginName ); ! use vars qw( $savedAlready $script ); # This should always be $Rev$ so that TWiki can determine the checked-in # status of the plugin. It is used by the build automation tools, so *************** *** 42,47 **** --- 44,52 ---- # Name of this Plugin, only used in this module $pluginName = 'CacheContentPlugin'; + # get the name of the script that called us + my $script = basename( $0 ); + sub initPlugin { my( $topic, $web, $user, $installWeb ) = @_; *************** *** 132,145 **** =cut ! sub DISABLE_commonTagsHandler { # do not uncomment, use $_[0], $_[1]... instead ### my ( $text, $topic, $web ) = @_; TWiki::Func::writeDebug( "- ${pluginName}::commonTagsHandler( $_[2].$_[1] )" ) if $debug; # do custom extension rule, like for example: ! # $_[0] =~ s/%XYZ%/&handleXyz()/ge; # $_[0] =~ s/%XYZ{(.*?)}%/&handleXyz($1)/ge; } --- 137,153 ---- =cut ! sub commonTagsHandler { # do not uncomment, use $_[0], $_[1]... instead ### my ( $text, $topic, $web ) = @_; TWiki::Func::writeDebug( "- ${pluginName}::commonTagsHandler( $_[2].$_[1] )" ) if $debug; # do custom extension rule, like for example: ! if (!($script =~ /save/)) { ! my $tmp = "use Edit to modify "; ! $_[0] =~ s/%STARTCACHE{"(.*?)"}%(.*?)%ENDCACHE%/$tmp$1/gs; ! } # $_[0] =~ s/%XYZ{(.*?)}%/&handleXyz($1)/ge; } Diff finished at Thu Jul 13 05:24:15