Page MenuHomePhabricator

Make getEditToolbar() in includes/EditPage.php static
Closed, ResolvedPublic

Description

Please make getEditToolbar() in EditPage.php static, so that it can be called from extensions wishing to create their own edit fields (example: http://spiele.j-crew.de/wiki/Spezial:Neues_Spiel)

The patch is very simple:

  • a/includes/EditPage.php

+++ b/includes/EditPage.php
@@ -1132,7 +1132,7 @@ class EditPage {

if( $wgUser->getOption('showtoolbar') and !$this->isCssJsSubpage ) {
        # prepare toolbar for edit buttons
  • $toolbar = $this->getEditToolbar();

+ $toolbar = EditPage::getEditToolbar();

} else {
        $toolbar = '';
}

@@ -1674,7 +1674,7 @@ END

    • It can be disabled in the user preferences.
    • The necessary JavaScript code can be found in style/wikibits.js. */
  • function getEditToolbar() {

+ static function getEditToolbar() {

global $wgStylePath, $wgContLang, $wgJsMimeType;

/**

Version: 1.12.x
Severity: enhancement

Details

Reference
bz11951

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:58 PM
bzimport set Reference to bz11951.
bzimport added a subscriber: Unknown Object (MLST).