diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-08-02 22:20:26 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-08-02 22:20:26 -0400 |
commit | 6f65cb1cbe0f8a17147c843eb6b668f84014c1a4 (patch) | |
tree | 69d8bd9f8d1e99bad1a40755d0a7c9a4c96103e6 /IkiWiki/Plugin/websetup.pm | |
parent | 15341aed015e4b23d0a1171779d5baa0414c4fad (diff) | |
download | ikiwiki-6f65cb1cbe0f8a17147c843eb6b668f84014c1a4.tar ikiwiki-6f65cb1cbe0f8a17147c843eb6b668f84014c1a4.tar.gz |
avoid setting default value in websetup_force_plugins
This would make changes not be seen later.
Diffstat (limited to 'IkiWiki/Plugin/websetup.pm')
-rw-r--r-- | IkiWiki/Plugin/websetup.pm | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 2b9240a29..94c1b4214 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -12,7 +12,6 @@ my @rcs_plugins=(qw{git svn bzr mercurial monotone tla norcs}); my @default_force_plugins=(qw{amazon_s3 external}); sub import { #{{{ - hook(type => "checkconfig", id => "websetup", call => \&checkconfig); hook(type => "getsetup", id => "websetup", call => \&getsetup); hook(type => "sessioncgi", id => "websetup", call => \&sessioncgi); hook(type => "formbuilder_setup", id => "websetup", @@ -30,12 +29,6 @@ sub getsetup () { #{{{ }, } #}}} -sub checkconfig () { #{{{ - if (! exists $config{websetup_force_plugins}) { - $config{websetup_force_plugins}=\@default_force_plugins; - } -} #}}} - sub formatexample ($) { #{{{ my $example=shift; @@ -141,7 +134,16 @@ sub showplugintoggle ($$$$) { #{{{ my $enabled=shift; my $section=shift; - return 0 if (grep { $_ eq $plugin } @{$config{websetup_force_plugins}}, @rcs_plugins); + if (exists $config{websetup_force_plugins} && + grep { $_ eq $plugin } @{$config{websetup_force_plugins}}, @rcs_plugins) { + return 0; + } + elsif (! exists $config{websetup_force_plugins} && + grep { $_ eq $plugin } @default_force_plugins, @rcs_plugins) { + return 0; + } + + print STDERR ">>$plugin (@{$config{websetup_force_plugins}})\n"; $form->field( name => "enable.$plugin", @@ -219,7 +221,7 @@ sub showform ($$) { #{{{ } elsif ($form->submitted eq 'Save Setup' && $form->validate) { # TODO - + IkiWiki::Setup::dump("/tmp/s"); $form->text(gettext("Setup saved.")); } |