]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/editpage.pm
po: inject custom isselflink to fix selflink detection on translation pages
[git.ikiwiki.info.git] / IkiWiki / Plugin / editpage.pm
index eb6a7bbcb845bbe2563a7f3e7e0a84f5af0c2a5c..fca970c60be3a13199298ddf736c70d14dd2528d 100644 (file)
@@ -229,8 +229,9 @@ sub cgi_editpage ($$) {
                                my $dir=$from."/";
                                $dir=~s![^/]+/+$!!;
                                
-                               if ((defined $form->field('subpage') && length $form->field('subpage')) ||
-                                   $page eq gettext('discussion')) {
+                               if ((defined $form->field('subpage') &&
+                                    length $form->field('subpage')) ||
+                                   $page eq lc($config{discussionpage})) {
                                        $best_loc="$from/$page";
                                }
                                else {
@@ -277,14 +278,10 @@ sub cgi_editpage ($$) {
                        my @page_types;
                        if (exists $hooks{htmlize}) {
                                foreach my $key (grep { !/^_/ } keys %{$hooks{htmlize}}) {
-                                       my $pluginref = ${$hooks{htmlize}}{$key};
-                                       if(${$pluginref}{'longname'}) {
-                                               push @page_types, [$key, ${$pluginref}{'longname'}];
-                                       } else {
-                                               push @page_types, [$key, $key];
-                                       }
+                                       push @page_types, [$key, $hooks{htmlize}{$key}{longname} || $key];
                                }
                        }
+                       @page_types=sort @page_types;
                        
                        $form->tmpl_param("page_select", 1);
                        $form->field(name => "page", type => 'select',