Mollywhite has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74518


Change subject: Change NS_MAIN to $wgContentNamespaces.
......................................................................

Change NS_MAIN to $wgContentNamespaces.

Per suggestion from helder.wiki, check that the navigation bars
are being added to a namespace in $wgContentNamespaces, instead
of just checking that it's NS_MAIN.

Change-Id: If8c8bb21536ae64765b056fb685ad23b1909c2df
---
M BookManagerv2.hooks.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BookManagerv2 
refs/changes/18/74518/1

diff --git a/BookManagerv2.hooks.php b/BookManagerv2.hooks.php
index e0a12e6..69a32be 100644
--- a/BookManagerv2.hooks.php
+++ b/BookManagerv2.hooks.php
@@ -306,7 +306,8 @@
         */
        public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
                // Check that the navigation bar is only added to mainspace 
pages.
-               if ( $out->getTitle()->getNamespace() === NS_MAIN ) {
+               global $wgContentNamespaces;
+               if ( in_array( $out->getTitle()->getNamespace(), 
$wgContentNamespaces ) ) {
                        if ( $out->getRevisionId() !== null ) {
                                global $wgContLang, 
$wgBookManagerv2ExampleNavigation;
                                $categories = $out->getCategories();

-- 
To view, visit https://gerrit.wikimedia.org/r/74518
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8c8bb21536ae64765b056fb685ad23b1909c2df
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BookManagerv2
Gerrit-Branch: master
Gerrit-Owner: Mollywhite <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to