Add a wgCategories variable to the js variables so users don't need to do really...
authorDaniel Friesen <dantman@users.mediawiki.org>
Thu, 19 Nov 2009 00:37:00 +0000 (00:37 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Thu, 19 Nov 2009 00:37:00 +0000 (00:37 +0000)
includes/OutputPage.php
includes/Skin.php

index e32884e..7f1639a 100644 (file)
@@ -12,7 +12,7 @@ class OutputPage {
        var $mHTMLtitle = '', $mIsarticle = true, $mPrintable = false;
        var $mSubtitle = '', $mRedirect = '', $mStatusCode;
        var $mLastModified = '', $mETag = false;
-       var $mCategoryLinks = array(), $mLanguageLinks = array();
+       var $mCategoryLinks = array(), $mCategories = array(), $mLanguageLinks = array();
 
        var $mScriptLoaderClassList = array();
 
@@ -664,6 +664,10 @@ class OutputPage {
                return $this->mCategoryLinks;
        }
 
+       public function getCategories() {
+               return $this->mCategories;
+       }
+
        /**
         * Add an array of categories, with names in the keys
         */
@@ -713,6 +717,7 @@ class OutputPage {
                                        if ( array_key_exists( $category, $categories ) )
                                                continue;
                                $text = $wgContLang->convertHtml( $title->getText() );
+                               $this->mCategories[] = $title->getText();
                                $this->mCategoryLinks[$type][] = $sk->link( $title, $text );
                        }
                }
index 2002613..026fbd1 100644 (file)
@@ -416,6 +416,7 @@ class Skin extends Linker {
                        'wgFormattedNamespaces' => $wgContLang->getFormattedNamespaces(),
                        'wgNamespaceIds' => $wgContLang->getNamespaceIds(),
                        'wgSiteName' => $wgSitename,
+                       'wgCategories' => $wgOut->getCategories(),
                );
                if ( $wgContLang->hasVariants() ) {
                        $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();