r55842 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55841‎ | r55842 | r55843 >
Date:23:18, 4 September 2009
Author:nimishg
Status:reverted (Comments)
Tags:
Comment:
Can now pass in element attributes other than just id to buildTable functions
Modified paths:
  • /trunk/phase3/includes/Xml.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Xml.php
@@ -696,12 +696,14 @@
697697 foreach( $headers as $id => $header ) {
698698 $attribs = array();
699699 if ( is_string( $id ) ) $attribs['id'] = $id;
 700+ if ( is_array( $id ) ) $attribs = $id;
700701 $s .= Xml::element( 'th', $attribs, $header );
701702 }
702703 }
703704 foreach( $rows as $id => $row ) {
704705 $attribs = array();
705706 if ( is_string( $id ) ) $attribs['id'] = $id;
 707+ if ( is_array( $id ) ) $attribs = $id;
706708 $s .= Xml::buildTableRow( $attribs, $row );
707709 }
708710 $s .= Xml::closeElement( 'table' );
@@ -718,6 +720,7 @@
719721 foreach( $cells as $id => $cell ) {
720722 $attribs = array();
721723 if ( is_string( $id ) ) $attribs['id'] = $id;
 724+ if ( is_array( $id ) ) $attribs = $id;
722725 $s .= Xml::element( 'td', $attribs, $cell );
723726 }
724727 $s .= Xml::closeElement( 'tr' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r56047Revert r55842 "Can now pass in element attributes other than just id to build...brion17:42, 8 September 2009

Comments

#Comment by Catrope (talk | contribs)   08:34, 5 September 2009

Since $id is an array key and keys cannot be arrays, is_array($id) will always be false, so this revision has no effect whatsoever.

Status & tagging log