Skip to content

Commit

Permalink
Item9525: Move PluginsOrder to EnabledPlugins tab and also add
Browse files Browse the repository at this point in the history
enabled-but-missing plugins to the list of discovered plugins

git-svn-id: http://svn.foswiki.org/trunk@8779 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Aug 26, 2010
1 parent b9b9b01 commit 5ba6d01
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 17 deletions.
34 changes: 18 additions & 16 deletions core/lib/Foswiki.spec
Expand Up @@ -1437,6 +1437,24 @@ $Foswiki::cfg{ExtensionsRepositories} = 'Foswiki.org=(http://foswiki.org/Extensi
# path for modules that match the Foswiki standard e.g.
# <code>Foswiki/Plugins/MyPlugin.pm</code> or the TWiki standard i.e.
# <code>TWiki/Plugins/YourPlugin.pm</code></p>
# <p>Any plugins enabled in the configuration but not found in the <code>@INC</code>
# path are listed at the end and are flagged as errors in the PluginsOrder check.</p>
# **STRING 80**
# Plugins evaluation order. If set to a comma-separated list of plugin names,
# 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. <br/><br/>
#
# If TWiki compatibility is required, TWikiCompatibilityPlugin should be the first
# Plugin in the list. SpreadSheetPlugin should typically be next in the list for proper operation.<br/><br/>
#
# Note that some other general extension environment checks are made and reported here. Plugins
# that are enabled but not installed and duplicate plugins in the TWiki and Foswiki libraries
# are reported here. Also if a TWiki plugin is enabled and the Foswik version is installed, this
# will also be reported here. Expand the "Expert" options to find these issues.
#
$Foswiki::cfg{PluginsOrder} = 'TWikiCompatibilityPlugin,SpreadSheetPlugin';

$Foswiki::cfg{Plugins}{PreferencesPlugin}{Enabled} = 1;
$Foswiki::cfg{Plugins}{PreferencesPlugin}{Module} = 'Foswiki::Plugins::PreferencesPlugin';
$Foswiki::cfg{Plugins}{SmiliesPlugin}{Enabled} = 1;
Expand Down Expand Up @@ -1480,22 +1498,6 @@ $Foswiki::cfg{Plugins}{MailerContribPlugin}{Module} = 'Foswiki::Plugins::MailerC
# is searched last, after this list.
$Foswiki::cfg{Plugins}{WebSearchPath} = '$Foswiki::cfg{SystemWebName},TWiki';

# **STRING 80**
# Plugins evaluation order. If set to a comma-separated list of plugin names,
# 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. <br/><br/>
#
# If TWiki compatibility is required, TWikiCompatibilityPlugin should be the first
# Plugin in the list. SpreadSheetPlugin should typically be next in the list for proper operation.<br/><br/>
#
# Note that some other general extension environment checks are made and reported here. Plugins
# that are enabled but not installed and duplicate plugins in the TWiki and Foswiki libraries
# are reported here. Also if a TWiki plugin is enabled and the Foswik version is installed, this
# will also be reported here. Expand the "Expert" options to find these issues.
#
$Foswiki::cfg{PluginsOrder} = 'TWikiCompatibilityPlugin,SpreadSheetPlugin';

1;
__END__
#
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Configure/Checkers/PluginsOrder.pm
Expand Up @@ -76,7 +76,7 @@ sub check {
) if ( $enabled eq 'TWiki' && $fcount > 1 );
$e .= $this->ERROR(
"$mod is enabled in LocalSite.cfg but was not found in the path"
) unless $found;
) if (! $found && $Foswiki::cfg{Plugins}{$plug}{Enabled});
}
}
return $e;
Expand Down
25 changes: 25 additions & 0 deletions core/lib/Foswiki/Configure/Pluggables/PLUGINS.pm
Expand Up @@ -60,6 +60,31 @@ sub new {
);
$Foswiki::cfg{Plugins}{$module}{Module} ||= $modules{$module};
}

foreach my $plug ( keys %{ $Foswiki::cfg{Plugins} } ) {
next unless ( $plug =~ m/Plugin$/ );
next unless ( $Foswiki::cfg{Plugins}{$plug}{Enabled} );
my $simple = $plug;
$simple =~ s/^.*::([^:]*)/$1/;
unless ($modules{$simple}) {
$this->addChild(
new Foswiki::Configure::Value(
'BOOLEAN',
parent => $this,
keys => '{Plugins}{' . $plug . '}{Enabled}',
)
);
$this->addChild(
new Foswiki::Configure::Value(
'STRING',
parent => $this,
keys => '{Plugins}{' . $plug . '}{Module}',
expertsOnly => 1
)
);
}
}

return $this;
}

Expand Down

0 comments on commit 5ba6d01

Please sign in to comment.