Matěj Grabovský has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/135003

Change subject: Use references when traversing in Vector.php
......................................................................

Use references when traversing in Vector.php

This is used elsewhere (e.g., in SkinTemplate.php) and makes the code
shorter and clearer.

Change-Id: Ia44b0163d67f1a204d385a831deaa263df8f2d8c
---
M skins/Vector.php
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/135003/1

diff --git a/skins/Vector.php b/skins/Vector.php
index 35861c2..c938fc5 100644
--- a/skins/Vector.php
+++ b/skins/Vector.php
@@ -118,25 +118,25 @@
                }
 
                $xmlID = '';
-               foreach ( $nav as $section => $links ) {
-                       foreach ( $links as $key => $link ) {
+               foreach ( $nav as $section => &$links ) {
+                       foreach ( $links as $key => &$link ) {
                                if ( $section == 'views' && !( isset( 
$link['primary'] ) && $link['primary'] ) ) {
                                        $link['class'] = rtrim( 'collapsible ' 
. $link['class'], ' ' );
                                }
 
                                $xmlID = isset( $link['id'] ) ? $link['id'] : 
'ca-' . $xmlID;
-                               $nav[$section][$key]['attributes'] =
+                               $link['attributes'] =
                                        ' id="' . Sanitizer::escapeId( $xmlID ) 
. '"';
                                if ( $link['class'] ) {
-                                       $nav[$section][$key]['attributes'] .=
+                                       $link['attributes'] .=
                                                ' class="' . htmlspecialchars( 
$link['class'] ) . '"';
-                                       unset( $nav[$section][$key]['class'] );
+                                       unset( $link['class'] );
                                }
                                if ( isset( $link['tooltiponly'] ) && 
$link['tooltiponly'] ) {
-                                       $nav[$section][$key]['key'] =
+                                       $link['key'] =
                                                Linker::tooltip( $xmlID );
                                } else {
-                                       $nav[$section][$key]['key'] =
+                                       $link['key'] =
                                                Xml::expandAttributes( 
Linker::tooltipAndAccesskeyAttribs( $xmlID ) );
                                }
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/135003
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia44b0163d67f1a204d385a831deaa263df8f2d8c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Grabovský <mgrabov...@yahoo.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to