Add a function that returns a list of categories the page is a member of
[lhc/web/wiklou.git] / includes / OutputPage.php
index 3657ac3..83a7d3f 100644 (file)
@@ -3024,6 +3024,7 @@ $templates
                        'wgCurRevisionId' => $latestRevID,
                        'wgArticleId' => $pageID,
                        'wgIsArticle' => $this->isArticle(),
+                       'wgIsRedirect' => $title->isRedirect(),
                        'wgAction' => Action::getActionName( $this->getContext() ),
                        'wgUserName' => $user->isAnon() ? null : $user->getName(),
                        'wgUserGroups' => $user->getEffectiveGroups(),
@@ -3051,6 +3052,8 @@ $templates
                if ( $wgContLang->hasVariants() ) {
                        $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
                }
+               // Same test as SkinTemplate
+               $vars['wgIsProbablyEditable'] = $title->quickUserCan( 'edit', $user ) && ( $title->exists() || $title->quickUserCan( 'create', $user ) );
                foreach ( $title->getRestrictionTypes() as $type ) {
                        $vars['wgRestriction' . ucfirst( $type )] = $title->getRestrictions( $type );
                }
@@ -3215,7 +3218,7 @@ $templates
                                        foreach ( $variants as $_v ) {
                                                $tags["variant-$_v"] = Html::element( 'link', array(
                                                        'rel' => 'alternate',
-                                                       'hreflang' => $_v,
+                                                       'hreflang' => wfBCP47( $_v ),
                                                        'href' => $this->getTitle()->getLocalURL( array( 'variant' => $_v ) ) )
                                                );
                                        }