[MediaWiki-l] How to disable Printable version link on my extension's Special page?

2013-07-06 Thread Adam Nielsen
Hi all, I'm working on an extension that uses a Preview button, the same as on edit pages. Unfortunately the shortcut key for the button conflicts with the Printable version link in the navigation bar, effectively preventing the keyboard shortcut from working at all. The edit page does not have

[MediaWiki-l] How to add a tab to Special:WhatLinksHere?

2013-07-06 Thread Adam Nielsen
Hi all, I'm trying to work out how to add another action tab to the Special:WhatLinksHere page. I am using the SkinTemplateNavigation::Universal hook, so my code gets called for all special pages. I am then examining the global $wgTitle to figure out what page is being viewed, with the idea

Re: [MediaWiki-l] How to add a tab to Special:WhatLinksHere?

2013-07-06 Thread Adam Nielsen
Does anyone know how I might go about discovering whether I'm viewing Special:WhatLinksHere from within a SkinTemplateNavigation hook? Well as usual asking the question is all you need to find the answer out yourself ;-) I found I can use Title::isSpecial() to check for a specific page. In my

Re: [MediaWiki-l] How to add a tab to Special:WhatLinksHere?

2013-07-06 Thread Schneelocke
Hi Adam, I'll also need the name of the page being investigated (SomePage in the above example) so I can use it in a URL. Unfortunately this hasn't been so easy. The docs suggest Title::getSubpageText() would almost work (it's supposed to return Baz from User:Foo/Bar/Baz which isn't

Re: [MediaWiki-l] How to disable Printable version link on my extension's Special page?

2013-07-06 Thread Benjamin Lees
$wgHooks['BaseTemplateToolbox'][] = 'eWhateverBaseTemplateToolbox'; function efWhateverBaseTemplateToolbox ( $tpl, $toolbox ) { if( //check whether it's your extension's page ) { unset($toolbox['print']); } return true; } ___

Re: [MediaWiki-l] How to add a tab to Special:WhatLinksHere?

2013-07-06 Thread Adam Nielsen
Any idea how I can get rid of WhatLinksHere from the front? preg_replace immediately comes to mind: http://php.net/manual/en/function.preg-replace.php The problem there is it's only WhatLinksHere in English. Other languages use localised versions, so it would be a massive regex very prone

Re: [MediaWiki-l] How to disable Printable version link on my extension's Special page?

2013-07-06 Thread Adam Nielsen
$wgHooks['BaseTemplateToolbox'][] = 'eWhateverBaseTemplateToolbox'; function efWhateverBaseTemplateToolbox ( $tpl, $toolbox ) { if( //check whether it's your extension's page ) { unset($toolbox['print']); } return true; } Brilliant, works like a charm! I just had to

Re: [MediaWiki-l] How to add a tab to Special:WhatLinksHere?

2013-07-06 Thread Schneelocke
Hi Adam, The problem there is it's only WhatLinksHere in English. Other languages use localised versions, so it would be a massive regex very prone to breakage... Hmm, couldn't you pull the localized name(s) from $specialPageAliases ? Check the wiki's language, find the right alias and chop

Re: [MediaWiki-l] How to add a tab to Special:WhatLinksHere?

2013-07-06 Thread Adam Nielsen
The problem there is it's only WhatLinksHere in English. Other languages use localised versions, so it would be a massive regex very prone to breakage... Hmm, couldn't you pull the localized name(s) from $specialPageAliases ? Check the wiki's language, find the right alias and chop that