Merge "ApiQuerySiteinfo: Add prop=restrictions for protection information"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 6 Feb 2014 16:26:51 +0000 (16:26 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 6 Feb 2014 16:26:51 +0000 (16:26 +0000)
RELEASE-NOTES-1.23
docs/hooks.txt
includes/SkinTemplate.php
includes/api/ApiQueryAllLinks.php

index 42fd16b..e1ceb91 100644 (file)
@@ -84,6 +84,8 @@ production.
   revision comparison pages using syntax such as [[Special:Diff/12345]],
   [[Special:Diff/12345/prev]] or [[Special:Diff/12345/98765]].
 * New user accounts' personal and talk pages are now watched by them by default.
+* Added SkinTemplateGetLanguageLink hook to allow changing the html of language
+  links.
 
 === Bug fixes in 1.23 ===
 * (bug 41759) The "updated since last visit" markers (on history pages, recent
index a638703..37ac2be 100644 (file)
@@ -2193,6 +2193,13 @@ link" tab.
 $sktemplate: SkinTemplate object
 $nav_urls: array of tabs
 
+'SkinTemplateGetLanguageLink': After building the data for a language link from
+which the actual html is constructed.
+&$languageLink: array containing data about the link. The following keys can be
+  modified: href, text, title, class, lang, hreflang. Each of them is a string.
+$languageLinkTitle: Title object belonging to the external language link
+$title: Title object of the page the link belongs to
+
 To alter the structured navigation links in SkinTemplates, there are three
 hooks called in different spots:
 
index 35183ce..7e229ee 100644 (file)
@@ -175,7 +175,7 @@ class SkinTemplate extends Skin {
                                }
 
                                $ilInterwikiCodeBCP47 = wfBCP47( $ilInterwikiCode );
-                               $languageLinks[] = array(
+                               $languageLink = array(
                                        'href' => $languageLinkTitle->getFullURL(),
                                        'text' => $ilLangName,
                                        'title' => $ilTitle,
@@ -183,6 +183,8 @@ class SkinTemplate extends Skin {
                                        'lang' => $ilInterwikiCodeBCP47,
                                        'hreflang' => $ilInterwikiCodeBCP47,
                                );
+                               wfRunHooks( 'SkinTemplateGetLanguageLink', array( &$languageLink, $languageLinkTitle, $this->getTitle() ) );
+                               $languageLinks[] = $languageLink;
                        }
                }
 
index 13f766e..bccc25f 100644 (file)
@@ -149,14 +149,14 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
 
                // 'continue' always overrides 'from'
                $from = ( $continue || $params['from'] === null ? null :
-                       $this->titlePartToKey( $params['from'], $params['namespace'] ) );
+                       $this->titlePartToKey( $params['from'], $namespace ) );
                $to = ( $params['to'] === null ? null :
-                       $this->titlePartToKey( $params['to'], $params['namespace'] ) );
+                       $this->titlePartToKey( $params['to'], $namespace ) );
                $this->addWhereRange( $pfx . $fieldTitle, 'newer', $from, $to );
 
                if ( isset( $params['prefix'] ) ) {
                        $this->addWhere( $pfx . $fieldTitle . $db->buildLike( $this->titlePartToKey(
-                               $params['prefix'], $params['namespace'] ), $db->anyString() ) );
+                               $params['prefix'], $namespace ), $db->anyString() ) );
                }
 
                $this->addFields( array( 'pl_title' => $pfx . $fieldTitle ) );