1
# See bottom of file for license and copyright information
3
# Plug-in module for finding and handling plugins
4
package Foswiki::Configure::PLUGINS;
5
use base 'Foswiki::Configure::Pluggable';
9
use Foswiki::Configure::Pluggable;
10
use Foswiki::Configure::Type;
11
use Foswiki::Configure::Value;
13
my $scanner = Foswiki::Configure::Type::load('SELECTCLASS');
18
my $this = $class->SUPER::new('Installed Plugins');
20
my $classes = $scanner->findClasses('Foswiki::Plugins::*Plugin');
21
my $twikiclasses = $scanner->findClasses('TWiki::Plugins::*Plugin');
22
push( @$classes, @$twikiclasses );
23
foreach my $module (@$classes) {
25
$simple =~ s/^.*::([^:]*)/$1/;
27
# only add the first instance of any plugin, as only
28
# the first can get loaded from @INC.
29
$modules{$simple} = $module;
31
foreach my $module ( sort { lc( $a ) cmp lc( $b ) } keys %modules ) {
33
new Foswiki::Configure::Value(
35
keys => '{Plugins}{' . $module . '}{Enabled}',
40
new Foswiki::Configure::Value(
42
keys => '{Plugins}{' . $module . '}{Module}',
46
$Foswiki::cfg{Plugins}{$module}{Module} ||= $modules{$module};
54
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
56
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
57
# Foswiki Contributors are listed in the AUTHORS file in the root
58
# of this distribution. NOTE: Please extend that file, not this notice.
60
# Additional copyrights apply to some or all of the code in this
63
# Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
64
# TWiki Contributors are listed in the AUTHORS file in the root
65
# of this distribution. NOTE: Please extend that file, not this notice.
67
# This program is free software; you can redistribute it and/or
68
# modify it under the terms of the GNU General Public License
69
# as published by the Free Software Foundation; either version 2
70
# of the License, or (at your option) any later version. For
71
# more details read LICENSE in the root of this distribution.
73
# This program is distributed in the hope that it will be useful,
74
# but WITHOUT ANY WARRANTY; without even the implied warranty of
75
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
77
# As per the GPL, removal of this notice is prohibited.