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
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
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
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
$wgHooks['BaseTemplateToolbox'][] = 'eWhateverBaseTemplateToolbox';
function efWhateverBaseTemplateToolbox ( $tpl, $toolbox ) {
if( //check whether it's your extension's page ) {
unset($toolbox['print']);
}
return true;
}
___
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
$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
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
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