Skip to content

Commit

Permalink
Item1184: reverting 'fix' with plugin reading order - just expand the…
Browse files Browse the repository at this point in the history
… variables

git-svn-id: http://svn.foswiki.org/branches/Release01x00@2831 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
ArthurClemens authored and ArthurClemens committed Mar 2, 2009
1 parent ffd094a commit e0f42ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
1 change: 0 additions & 1 deletion EditTablePlugin/data/System/EditTablePlugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ Normally this plugin is distributed and automatically installed with Foswiki. Th
%$DEPENDENCIES%
1 The Plugin depends on the =viewauth= script to authenticate the user. As described in %SYSTEMWEB%.AccessControl, copy the =view= script to =viewauth= (or better, create a symbolic link) and add =viewauth= to the list of authenticated scripts in the =.htaccess= file.
1 Visit =configure= in your installation, and enable the plugin in the ={Plugins}= section.
1 In =configure=, edit ={PluginsOrder}= and write =<nop>EditTablePlugin= before =<nop>SpreadSheetPlugin=.

Test if the Plugin is correctly installed:
* Check above example if there is an *[&nbsp;Edit&nbsp;table&nbsp;]* button below the table in above example
Expand Down
18 changes: 4 additions & 14 deletions EditTablePlugin/lib/Foswiki/Plugins/EditTablePlugin/Core.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ sub prepareForView {
# my $text = $_[0]
# my $topic = $_[1]
# my $web = $_[2]

readTables(@_);

my $query = Foswiki::Func::getCgiQuery();
Expand Down Expand Up @@ -141,7 +140,7 @@ StaticMethod handleTmlInViewMode( $text, $topic, $web )
Renders text while in view mode:
- adds spaces around %BR% to render TML around linebreaks
- add spaces around TML next to HTML tags, again to render TML
- expands variables, for example %CALC%, if $Foswiki::cfg{PluginsOrder} does not list EditTablePlugin before SpreadSheetPlugin
- expands variables, for example %CALC%
=cut

Expand All @@ -164,18 +163,9 @@ sub handleTmlInViewMode {
addSpacesToTmlNextToHtml($tableText);
}

# if the plugin reading order does not put EditTablePlugin in front of
# SpreadSheetPlugin, expand variables
my $counter = 0;
my %order =
map { $_ => $counter++ } split( /\s*,\s*/, $Foswiki::cfg{PluginsOrder} );
if ( !$order{'EditTablePlugin'}
|| $order{EditTablePlugin} > $order{SpreadSheetPlugin} )
{
$tableData->{tablesTakenOutText} = Foswiki::Func::expandCommonVariables(
$tableData->{tablesTakenOutText},
$_[1], $_[2] );
}
$tableData->{tablesTakenOutText} =
Foswiki::Func::expandCommonVariables( $tableData->{tablesTakenOutText},
$_[1], $_[2] );
}

=pod
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ $Foswiki::cfg{Plugins}{WebSearchPath} = '$Foswiki::cfg{SystemWebName},TWiki';
# will change the execution order of plugins so the listed subset of plugins
# are executed first. The default execution order is alphabetical on plugin
# name.
$Foswiki::cfg{PluginsOrder} = 'TWikiCompatibilityPlugin,EditTablePlugin,SpreadSheetPlugin';
$Foswiki::cfg{PluginsOrder} = 'TWikiCompatibilityPlugin,SpreadSheetPlugin';
#---+ Extensions
# *FINDEXTENSIONS*
Expand Down

0 comments on commit e0f42ef

Please sign in to comment.