- return unless @show;
-
- my $section=defined $plugin ? $plugin." ".gettext("plugin") : gettext("main");
-
- my %shownfields;
- if (defined $plugin) {
- if (showplugintoggle($form, $plugin, $enabled, $section)) {
- $shownfields{"enable.$plugin"}=[$plugin];
+ my $section=defined $plugin ? $plugin." ".gettext("plugin") : "main";
+ my %enabledfields;
+ my $shownfields=0;
+
+ my $plugin_forced=defined $plugin && (! $plugininfo{safe} ||
+ (exists $config{websetup_force_plugins} && grep { $_ eq $plugin } @{$config{websetup_force_plugins}}));
+ if ($plugin_forced && ! $enabled) {
+ # plugin is forced disabled, so skip its configuration
+ @show=();
+ }
+ # show plugin toggle
+ if (defined $plugin && (! $plugin_forced || $config{websetup_advanced})) {
+ my $name="enable.$plugin";
+ $form->field(
+ name => $name,
+ label => "",
+ type => "checkbox",
+ options => [ [ 1 => sprintf(gettext("enable %s?"), $plugin) ] ],
+ value => $enabled,
+ fieldset => $section,
+ );
+ if ($plugin_forced) {
+ $form->field(name => $name, disabled => 1);