* (bug 17160) Gender specific display text for User namespace
[lhc/web/wiklou.git] / includes / LinkBatch.php
index 77c4edd..9486815 100644 (file)
@@ -94,6 +94,7 @@ class LinkBatch {
                wfProfileIn( __METHOD__ );
                $res = $this->doQuery();
                $ids = $this->addResultToCache( $cache, $res );
+               $this->doGenderQuery();
                wfProfileOut( __METHOD__ );
                return $ids;
        }
@@ -157,6 +158,20 @@ class LinkBatch {
                return $res;
        }
 
+       public function doGenderQuery() {
+               if ( $this->isEmpty() ) {
+                       return false;
+               }
+
+               global $wgContLang;
+               if ( !$wgContLang->needsGenderDistinction() ) {
+                       return false;
+               }
+
+               $genderCache = GenderCache::singleton();
+               $genderCache->dolinkBatch( $this->data, $this->caller );
+       }
+
        /**
         * Construct a WHERE clause which will match all the given titles.
         *