Don't change tabs on Education Program pages

Unfortunately the best way I've come up with to do this so far is
checking the namespace.

Bug: 53477
Change-Id: Ib2dbe91aff516f2d2408e07ff3f73ea861bfcbe2
This commit is contained in:
Krenair 2014-04-10 19:57:17 +01:00 committed by James D. Forrester
parent 3dc9a388a3
commit e3be4a6588
2 changed files with 12 additions and 0 deletions

View file

@ -68,6 +68,9 @@ class VisualEditorHooks {
return true;
}
$title = $skin->getRelevantTitle();
if ( defined( 'EP_NS' ) && $title->inNamespace( EP_NS ) ) {
return true;
}
// Rebuild the $links['views'] array and inject the VisualEditor tab before or after
// the edit tab as appropriate. We have to rebuild the array because PHP doesn't allow
// us to splice into the middle of an associative array.

View file

@ -155,6 +155,15 @@
},
setupTabs: function () {
// HACK: Remove this when the Education Program offers a proper way to detect and disable.
if (
mw.config.get( 'wgNamespaceIds' ).hasOwnProperty( 'education_program' ) &&
/*jshint -W069*/
mw.config.get( 'wgNamespaceIds' )['education_program'] === mw.config.get( 'wgNamespaceNumber' )
) {
return;
}
var caVeEdit,
action = pageExists ? 'edit' : 'create',
pTabsId = $( '#p-views' ).length ? 'p-views' : 'p-cactions',