Merge "RCFilters: Fix live update"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 13 Dec 2017 18:28:30 +0000 (18:28 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 13 Dec 2017 18:28:30 +0000 (18:28 +0000)
includes/skins/SkinTemplate.php
resources/src/mediawiki.rcfilters/mw.rcfilters.init.js

index 532ee51..badd7a2 100644 (file)
@@ -524,15 +524,48 @@ class SkinTemplate extends Skin {
         * @return string
         */
        public function getPersonalToolsList() {
+               return $this->makePersonalToolsList();
+       }
+
+       /**
+        * Get the HTML for the personal tools list
+        *
+        * @since 1.31
+        *
+        * @param array $personalTools
+        * @param array $options
+        * @return string
+        */
+       public function makePersonalToolsList( $personalTools = null, $options = [] ) {
                $tpl = $this->setupTemplateForOutput();
                $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
                $html = '';
-               foreach ( $tpl->getPersonalTools() as $key => $item ) {
-                       $html .= $tpl->makeListItem( $key, $item );
+
+               if ( $personalTools === null ) {
+                       $personalTools = $tpl->getPersonalTools();
+               }
+
+               foreach ( $personalTools as $key => $item ) {
+                       $html .= $tpl->makeListItem( $key, $item, $options );
                }
+
                return $html;
        }
 
+       /**
+        * Get personal tools for the user
+        *
+        * @since 1.31
+        *
+        * @return array Array of personal tools
+        */
+       public function getStructuredPersonalTools() {
+               $tpl = $this->setupTemplateForOutput();
+               $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
+
+               return $tpl->getPersonalTools();
+       }
+
        /**
         * Format language name for use in sidebar interlanguage links list.
         * By default it is capitalized.
index 565ac0a..100fa0b 100644 (file)
@@ -95,7 +95,7 @@
                        controller.initialize(
                                mw.config.get( 'wgStructuredChangeFilters' ),
                                // All namespaces without Media namespace
-                               this.getNamespaces( [ 'Media' ] ),
+                               rcfilters.getNamespaces( [ 'Media' ] ),
                                mw.config.get( 'wgRCFiltersChangeTags' ),
                                conditionalViews
                        );