Toolbar: Only show on WikiText pages
authorDerk-Jan Hartman <hartman.wiki@gmail.com>
Sun, 22 Jun 2014 14:04:22 +0000 (16:04 +0200)
committerDerk-Jan Hartman <hartman.wiki@gmail.com>
Sun, 22 Jun 2014 20:15:38 +0000 (22:15 +0200)
The toolbar is highly specific to Wikitext anyway. It was already not
added to JS and CSS subpages, but still visible on site css/js pages
and on Lua pages. This was inconsistent.

Ideally at some point, we might want a 'toolbar api' where you can
configure a 'toolbar' per content model, but let's first make it
consistent and then iterate from there when required.

Bug: 29908
Change-Id: If0853e9faf640f93b7030c4937137149d3f08cf5

includes/EditPage.php

index 98e0ec4..84545b1 100644 (file)
@@ -2531,7 +2531,9 @@ class EditPage {
 
                $wgOut->addHTML( $this->editFormTextBeforeContent );
 
-               if ( !$this->isCssJsSubpage && $showToolbar && $wgUser->getOption( 'showtoolbar' ) ) {
+               if ( $this->contentModel === CONTENT_MODEL_WIKITEXT &&
+                       $showToolbar && $wgUser->getOption( 'showtoolbar' ) )
+               {
                        $wgOut->addHTML( EditPage::getEditToolbar() );
                }