]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/websetup.pm
allow for a html formatted description in websetup
[ikiwiki.git] / IkiWiki / Plugin / websetup.pm
index 11b4428e3fc0a55f6637516c56b2dca8a7460163..f95017c90d71a6408dbd81028fcb15b32c7a3265 100644 (file)
@@ -151,7 +151,10 @@ sub showfields ($$$@) {
                my %info=%{shift @show};
 
                my $description=$info{description};
-               if (exists $info{link} && length $info{link}) {
+               if (exists $info{htmldescription}) {
+                       $description=$info{htmldescription};
+               }
+               elsif (exists $info{link} && length $info{link}) {
                        if ($info{link} =~ /^\w+:\/\//) {
                                $description="<a href=\"$info{link}\">$description</a>";
                        }
@@ -219,7 +222,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);
                        }
                }
@@ -287,7 +291,7 @@ sub showform ($$) {
                fieldsets => [
                        [main => gettext("main")], 
                ],
-               action => $config{cgiurl},
+               action => IkiWiki::cgiurl(),
                template => {type => 'div'},
                stylesheet => 1,
        );
@@ -295,6 +299,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", 
@@ -342,7 +347,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) {
@@ -445,10 +450,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."<pre>\n";
@@ -473,7 +478,7 @@ sub showform ($$) {
                                                join(" ", @command), $ret).
                                        '</p>';
                                open(OUT, ">", $config{setupfile}) || error("$config{setupfile}: $!");
-                               print OUT $oldsetup;
+                               print OUT Encode::encode_utf8($oldsetup);
                                close OUT;
                        }