Last modified: 2011-11-13 22:49:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9245, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7245 - Hooks for EditPage Toolbar (function getEditToolbar)
Hooks for EditPage Toolbar (function getEditToolbar)
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.6.x
PC Linux
: Low enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-06 12:51 UTC by Volker Graubaum
Modified: 2011-11-13 22:49 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Added sitetoolbar function (824 bytes, patch)
2007-03-17 10:34 UTC, Gunter Schmidt
Details
Example of customized site toolbar (5.09 KB, text/plain)
2007-03-17 10:35 UTC, Gunter Schmidt
Details

Description Volker Graubaum 2006-09-06 12:51:02 UTC
Hi,

IMHO, the function getEditToolbar should have 2 hooks for changing the toolarray
and changing the whole toolbar.

The diff should be this:

1529a1531,1537
> 		// add hook for additionalToolbar Elements
> 		// first hook extends the normal array....
> 		// change requiered for PHP5 since passByReference is not allowed anymore
> 		// 
> 		
> 		wfRunHooks( 'changeToolarray', array( &$toolarray  ) );
> 		
1550c1557
< 
---
> 		wfRunHooks( 'addToolbarElements', array( &$toolbar  ) );

Greetings
Comment 1 Gunter Schmidt 2007-03-17 10:34:12 UTC
Created attachment 3354 [details]
Added sitetoolbar function
Comment 2 Gunter Schmidt 2007-03-17 10:35:44 UTC
Created attachment 3355 [details]
Example of customized site toolbar
Comment 3 Gunter Schmidt 2007-03-17 10:35:57 UTC
I think it would be easier to have a parameter for LocalSettings.php: $wgUseSiteToolbar = true;
In order to use it, the admin would have to create a file sitetoolbar.php in the main directory (see attachment) and add the 
new buttons to /skins/common/images.

And a change in EditPage.php, see patch (Note: This change can be delivered as part of MediaWiki for there is a parameter).

Insert:
        if ( $wgUseSiteToolbar = true ) {
            // would be nicer if we could have MediaWiki:SiteToolbar like MediaWiki:common.css
            #print "<br>$IP/sitetoolbar.php";
            if(file_exists("$IP/sitetoolbar.php")) { 
                include_once("$IP/sitetoolbar.php"); 
                $toolarray=$sitetoolarray;
            }
        }
        if ( count ($toolarray) == 0 ) // if there is a problem with the sitetoolarray

before: $toolarray = array(
Comment 4 Rob Church 2007-03-17 16:48:57 UTC
The editing toolbar can already be changed via JavaScript; we provide a
straightforward array to customise it.
Comment 5 Gunter Schmidt 2007-03-17 17:51:25 UTC
Maybe it would be a good idea to document that customization procedure somewhere, otherwise it is worthless:

http://meta.wikimedia.org/wiki/Customizing:Edit_Toolbar
Comment 6 Volker Graubaum 2007-03-17 18:15:09 UTC
Hi,

I dislike both ways mentioned here

http://meta.wikimedia.org/wiki/Customizing:Edit_Toolbar

In both ways, I've to make the changes more often. (each update)
I even would prefer the hooks more than the SiteToolbar since
I don't have to reevent existings Elements, but this would be fine for me
too.

Greetings Volker
Comment 7 Chad H. 2009-04-28 02:37:50 UTC
(In reply to comment #4)
> The editing toolbar can already be changed via JavaScript; we provide a
> straightforward array to customise it.

This is how we customize the edit toolbar.  Suggest closing WONTFIX since a method of configuring this already exists.

(In reply to comment #6)
> Hi,
> 
> I dislike both ways mentioned here
> 
> http://meta.wikimedia.org/wiki/Customizing:Edit_Toolbar
> 
> In both ways, I've to make the changes more often. (each update)
> I even would prefer the hooks more than the SiteToolbar since
> I don't have to reevent existings Elements, but this would be fine for me
> too.
> 
> Greetings Volker

Nothing should ever be lost during an update. TBH, that page on meta that suggests hacking the code should be deleted.
Comment 8 Sam Reed (reedy) 2011-11-13 22:49:53 UTC
WONTFIX per chad

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links