Skip to content

Commit

Permalink
Item11808: perltidy them all, so people are not accidentally impacted…
Browse files Browse the repository at this point in the history
… by the new enforced rule -- Sorry Micha, could not find a way to define specific values within the file

git-svn-id: http://svn.foswiki.org/trunk/TaskExePlugin@14686 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed May 4, 2012
1 parent e206a17 commit 78a5911
Showing 1 changed file with 73 additions and 36 deletions.
109 changes: 73 additions & 36 deletions lib/TWiki/Plugins/TaskExePlugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ 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 $SHORTDESCRIPTION $debug $pluginName $NO_PREFS_IN_TOPIC );
use vars
qw( $VERSION $RELEASE $SHORTDESCRIPTION $debug $pluginName $NO_PREFS_IN_TOPIC );

# 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
Expand Down Expand Up @@ -127,11 +128,12 @@ FOOBARSOMETHING. This avoids namespace issues.
=cut

sub initPlugin {
my( $topic, $web, $user, $installWeb ) = @_;
my ( $topic, $web, $user, $installWeb ) = @_;

# check for Plugins.pm versions
if( $TWiki::Plugins::VERSION < 1.026 ) {
TWiki::Func::writeWarning( "Version mismatch between $pluginName and Plugins.pm" );
if ( $TWiki::Plugins::VERSION < 1.026 ) {
TWiki::Func::writeWarning(
"Version mismatch between $pluginName and Plugins.pm");
return 0;
}

Expand All @@ -148,32 +150,30 @@ sub initPlugin {
# register the _EXAMPLETAG function to handle %EXAMPLETAG{...}%
# This will be called whenever %EXAMPLETAG% or %EXAMPLETAG{...}% is
# seen in the topic text.
TWiki::Func::registerTagHandler( 'TASKEXE_TASKWEB', \&_TASKWEB );
TWiki::Func::registerTagHandler( 'TASKEXE_TASKWEB', \&_TASKWEB );
TWiki::Func::registerTagHandler( 'TASKEXE_TASKPARENT', \&_TASKPARENT );
TWiki::Func::registerTagHandler( 'TASKEXE_EXECUTERPARENT', \&_EXECUTERPARENT );
TWiki::Func::registerTagHandler( 'TASKEXE_EXECUTERPARENT',
\&_EXECUTERPARENT );
TWiki::Func::registerTagHandler( 'TASKEXE_INSTALLEDWEB', \&_INSTALLEDWEB );


# * Set TASKPLUGIN_TASKWEB = Sandbox
# * Set TASKPLUGIN_TASKPARENT = Sandbox.TaskParent
# * Set TASKPLUGIN_EXECUTERPARENT = Sandbox.TaskParent
# * Set TASKPLUGIN_INSTALLEDWEB = TWiki


# Allow a sub to be called from the REST interface
# Allow a sub to be called from the REST interface
# using the provided alias
# TWiki::Func::registerRESTHandler('example', \&restExample);

# Plugin correctly initialized
return 1;
}



# The function used to handle the %EXAMPLETAG{...}% variable
# You would have one of these for each variable you want to process.
sub _EXAMPLETAG {
my($session, $params, $theTopic, $theWeb) = @_;
my ( $session, $params, $theTopic, $theWeb ) = @_;

# $session - a reference to the TWiki session object (if you don't know
# what this is, just ignore it)
# $params= - a reference to a TWiki::Attrs object containing parameters.
Expand All @@ -191,30 +191,31 @@ sub _EXAMPLETAG {
}

sub _TASKWEB {
my($session, $params, $theTopic, $theWeb) = @_;
my ( $session, $params, $theTopic, $theWeb ) = @_;
my $setting = $TWiki::cfg{Plugins}{TaskExePlugin}{TASKWEB} || 'Sandbox';
return $setting;
}

sub _TASKPARENT {
my($session, $params, $theTopic, $theWeb) = @_;
my $setting = $TWiki::cfg{Plugins}{TaskExePlugin}{TASKPARENT} || 'Sandbox.TaskExeParent'; #TODO: fix that
my ( $session, $params, $theTopic, $theWeb ) = @_;
my $setting = $TWiki::cfg{Plugins}{TaskExePlugin}{TASKPARENT}
|| 'Sandbox.TaskExeParent'; #TODO: fix that
return $setting;
}

sub _EXECUTERPARENT {
my($session, $params, $theTopic, $theWeb) = @_;
my $setting = $TWiki::cfg{Plugins}{TaskExePlugin}{EXECUTERPARENT} || 'Sandbox.TaskExeParent'; #TODO: fix that
my ( $session, $params, $theTopic, $theWeb ) = @_;
my $setting = $TWiki::cfg{Plugins}{TaskExePlugin}{EXECUTERPARENT}
|| 'Sandbox.TaskExeParent'; #TODO: fix that
return $setting;
}

sub _INSTALLEDWEB {
my($session, $params, $theTopic, $theWeb) = @_;
my ( $session, $params, $theTopic, $theWeb ) = @_;
my $setting = $TWiki::cfg{Plugins}{TaskExePlugin}{INSTALLEDWEB} || 'TWiki';
return $setting;
}


=pod
---++ earlyInitPlugin()
Expand Down Expand Up @@ -247,10 +248,13 @@ __Since:__ TWiki::Plugins::VERSION = '1.010'
=cut

sub DISABLE_initializeUserHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $loginName, $url, $pathInfo ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::initializeUserHandler( $_[0], $_[1] )" ) if $debug;
TWiki::Func::writeDebug(
"- ${pluginName}::initializeUserHandler( $_[0], $_[1] )")
if $debug;
}

=pod
Expand All @@ -267,10 +271,13 @@ __Since:__ TWiki::Plugins::VERSION = '1.010'
=cut

sub DISABLE_registrationHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $web, $wikiName, $loginName ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::registrationHandler( $_[0], $_[1] )" ) if $debug;
TWiki::Func::writeDebug(
"- ${pluginName}::registrationHandler( $_[0], $_[1] )")
if $debug;
}

=pod
Expand Down Expand Up @@ -303,10 +310,12 @@ handler.
=cut

sub DISABLE_commonTagsHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $text, $topic, $web ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::commonTagsHandler( $_[2].$_[1] )" ) if $debug;
TWiki::Func::writeDebug("- ${pluginName}::commonTagsHandler( $_[2].$_[1] )")
if $debug;

# do custom extension rule, like for example:
# $_[0] =~ s/%XYZ%/&handleXyz()/ge;
Expand Down Expand Up @@ -336,10 +345,13 @@ __NOTE:__ This handler is not separately called on included topics.
=cut

sub DISABLE_beforeCommonTagsHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $text, $topic, $web ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::beforeCommonTagsHandler( $_[2].$_[1] )" ) if $debug;
TWiki::Func::writeDebug(
"- ${pluginName}::beforeCommonTagsHandler( $_[2].$_[1] )")
if $debug;
}

=pod
Expand All @@ -362,10 +374,13 @@ handler.
=cut

sub DISABLE_afterCommonTagsHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $text, $topic, $web ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::afterCommonTagsHandler( $_[2].$_[1] )" ) if $debug;
TWiki::Func::writeDebug(
"- ${pluginName}::afterCommonTagsHandler( $_[2].$_[1] )")
if $debug;
}

=pod
Expand Down Expand Up @@ -416,6 +431,7 @@ Since TWiki::Plugins::VERSION = '1.026'
=cut

sub DISABLE_preRenderingHandler {

# do not uncomment, use $_[0], $_[1]... instead
#my( $text, $pMap ) = @_;
}
Expand All @@ -436,6 +452,7 @@ Since TWiki::Plugins::VERSION = '1.026'
=cut

sub DISABLE_postRenderingHandler {

# do not uncomment, use $_[0], $_[1]... instead
#my $text = shift;
}
Expand All @@ -457,10 +474,12 @@ __Since:__ TWiki::Plugins::VERSION = '1.010'
=cut

sub DISABLE_beforeEditHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $text, $topic, $web ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::beforeEditHandler( $_[2].$_[1] )" ) if $debug;
TWiki::Func::writeDebug("- ${pluginName}::beforeEditHandler( $_[2].$_[1] )")
if $debug;
}

=pod
Expand All @@ -482,10 +501,12 @@ __Since:__ TWiki::Plugins::VERSION = '1.010'
=cut

sub DISABLE_afterEditHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $text, $topic, $web ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::afterEditHandler( $_[2].$_[1] )" ) if $debug;
TWiki::Func::writeDebug("- ${pluginName}::afterEditHandler( $_[2].$_[1] )")
if $debug;
}

=pod
Expand All @@ -510,10 +531,12 @@ __Since:__ TWiki::Plugins::VERSION = '1.010'
=cut

sub DISABLE_beforeSaveHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $text, $topic, $web ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::beforeSaveHandler( $_[2].$_[1] )" ) if $debug;
TWiki::Func::writeDebug("- ${pluginName}::beforeSaveHandler( $_[2].$_[1] )")
if $debug;
}

=pod
Expand All @@ -535,10 +558,12 @@ __Since:__ TWiki::Plugins::VERSION = '1.020'
=cut

sub DISABLE_afterSaveHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $text, $topic, $web, $error, $meta ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::afterSaveHandler( $_[2].$_[1] )" ) if $debug;
TWiki::Func::writeDebug("- ${pluginName}::afterSaveHandler( $_[2].$_[1] )")
if $debug;
}

=pod
Expand All @@ -559,11 +584,13 @@ __Since:__ TWiki::Plugins::VERSION = '1.110'
=cut

sub DISABLE_afterRenameHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my ( $oldWeb, $oldTopic, $oldAttachment, $newWeb, $newTopic, $newAttachment ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::afterRenameHandler( " .
"$_[0].$_[1] $_[2] -> $_[3].$_[4] $_[5] )" ) if $debug;
TWiki::Func::writeDebug( "- ${pluginName}::afterRenameHandler( "
. "$_[0].$_[1] $_[2] -> $_[3].$_[4] $_[5] )" )
if $debug;
}

=pod
Expand All @@ -586,9 +613,12 @@ __Since:__ TWiki::Plugins::VERSION = '1.023'
=cut

sub DISABLE_beforeAttachmentSaveHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my( $attrHashRef, $topic, $web ) = @_;
TWiki::Func::writeDebug( "- ${pluginName}::beforeAttachmentSaveHandler( $_[2].$_[1] )" ) if $debug;
TWiki::Func::writeDebug(
"- ${pluginName}::beforeAttachmentSaveHandler( $_[2].$_[1] )")
if $debug;
}

=pod
Expand All @@ -609,9 +639,12 @@ __Since:__ TWiki::Plugins::VERSION = '1.023'
=cut

sub DISABLE_afterAttachmentSaveHandler {

# do not uncomment, use $_[0], $_[1]... instead
### my( $attrHashRef, $topic, $web ) = @_;
TWiki::Func::writeDebug( "- ${pluginName}::afterAttachmentSaveHandler( $_[2].$_[1] )" ) if $debug;
TWiki::Func::writeDebug(
"- ${pluginName}::afterAttachmentSaveHandler( $_[2].$_[1] )")
if $debug;
}

=pod
Expand Down Expand Up @@ -685,7 +718,7 @@ __Since:__ TWiki::Plugins::VERSION 1.026
sub DISABLE_modifyHeaderHandler {
my ( $headers, $query ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::modifyHeaderHandler()" ) if $debug;
TWiki::Func::writeDebug("- ${pluginName}::modifyHeaderHandler()") if $debug;
}

=pod
Expand All @@ -705,10 +738,13 @@ __Since:__ TWiki::Plugins::VERSION = '1.010'
=cut

sub DISABLE_redirectCgiQueryHandler {

# do not uncomment, use $_[0], $_[1] instead
### my ( $query, $url ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::redirectCgiQueryHandler( query, $_[1] )" ) if $debug;
TWiki::Func::writeDebug(
"- ${pluginName}::redirectCgiQueryHandler( query, $_[1] )")
if $debug;
}

=pod
Expand Down Expand Up @@ -749,8 +785,9 @@ For more information, check %SYSTEMWEB%.CommandAndCGIScripts#rest
=cut

sub restExample {
#my ($session) = @_;
return "This is an example of a REST invocation\n\n";

#my ($session) = @_;
return "This is an example of a REST invocation\n\n";
}

1;

0 comments on commit 78a5911

Please sign in to comment.