X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/f69c072d8aad7ad68547f17bf60bd804542b064f..d240f576643219905d7732a111e3ec94c5f9b46a:/IkiWiki/Plugin/websetup.pm diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index c4b75c4b3..0a3d90aec 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -219,7 +219,8 @@ sub showfields ($$$@) { options => [ [ 1 => $description ] ], fieldset => $section, ); - if (! $form->submitted) { + if (! $form->submitted || + ($info{advanced} && $form->submitted eq 'Advanced Mode')) { $form->field(name => $name, value => $value); } } @@ -253,12 +254,8 @@ sub enable_plugin ($) { sub disable_plugin ($) { my $plugin=shift; - if (grep { $_ eq $plugin } @{$config{add_plugins}}) { - $config{add_plugins}=[grep { $_ ne $plugin } @{$config{add_plugins}}]; - } - else { - push @{$config{disable_plugins}}, $plugin; - } + $config{add_plugins}=[grep { $_ ne $plugin } @{$config{add_plugins}}]; + push @{$config{disable_plugins}}, $plugin; } sub showform ($$) { @@ -291,7 +288,7 @@ sub showform ($$) { fieldsets => [ [main => gettext("main")], ], - action => $config{cgiurl}, + action => IkiWiki::cgiurl(), template => {type => 'div'}, stylesheet => 1, ); @@ -299,6 +296,7 @@ sub showform ($$) { $form->field(name => "do", type => "hidden", value => "setup", force => 1); $form->field(name => "rebuild_asked", type => "hidden"); + $form->field(name => "showadvanced", type => "hidden"); if ($form->submitted eq 'Basic Mode') { $form->field(name => "showadvanced", type => "hidden", @@ -346,7 +344,7 @@ sub showform ($$) { IkiWiki::decode_form_utf8($form); if ($form->submitted eq "Cancel") { - IkiWiki::redirect($cgi, $config{url}); + IkiWiki::redirect($cgi, IkiWiki::baseurl(undef)); return; } elsif (($form->submitted eq 'Save Setup' || $form->submitted eq 'Rebuild Wiki') && $form->validate) { @@ -449,10 +447,10 @@ sub showform ($$) { IkiWiki::saveindex(); IkiWiki::unlockwiki(); - # Print the top part of a standard misctemplate, + # Print the top part of a standard cgitemplate, # then show the rebuild or refresh, live. my $divider="\0"; - my $html=IkiWiki::misctemplate("setup", $divider); + my $html=IkiWiki::cgitemplate($cgi, "setup", $divider); IkiWiki::printheader($session); my ($head, $tail)=split($divider, $html, 2); print $head."
\n";
@@ -477,7 +475,7 @@ sub showform ($$) {
 						join(" ", @command), $ret).
 					'

'; open(OUT, ">", $config{setupfile}) || error("$config{setupfile}: $!"); - print OUT $oldsetup; + print OUT Encode::encode_utf8($oldsetup); close OUT; }