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 being to only
add my tab if I discover Special:WhatLinksHere is the page being
viewed.
Unfortunately I can't quite figure out how to identify the page being
accessed. I am using $wgTitle->getNamespace() and aborting if it's not
NS_SPECIAL, which leaves just the root of the title to check.
I was going to compare $wgTitle->getRootTitle() against "WhatLinksHere"
but there seems to be a bug in Title::getRootTitle() for Special
pages, and it returns the same value as Title::getText(), namely
"WhatLinksHere/SomePage", instead of chopping off the "/SomePage". But
I think this is a moot point, because I just discovered that non-English
wikis seem to have localised names for the special pages, so checking
against "WhatLinksHere" won't work on non-English wikis.
Does anyone know how I might go about discovering whether I'm viewing
Special:WhatLinksHere from within a SkinTemplateNavigation hook? I'll
also need the name of the page being investigated ("SomePage" in the
above example) so I can use it in a URL.
Any suggestions would be gratefully appreciated!
Many thanks,
Adam.