From: Nimish Gautam Date: Fri, 4 Sep 2009 23:18:16 +0000 (+0000) Subject: Can now pass in element attributes other than just id to buildTable functions X-Git-Tag: 1.31.0-rc.0~39914 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=e1d42d51063f4dde8b485f7bcd5fd243d5cc15d0;p=lhc%2Fweb%2Fwiklou.git Can now pass in element attributes other than just id to buildTable functions --- diff --git a/includes/Xml.php b/includes/Xml.php index 88bbadc0bb..1540b95221 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -696,12 +696,14 @@ class Xml { foreach( $headers as $id => $header ) { $attribs = array(); if ( is_string( $id ) ) $attribs['id'] = $id; + if ( is_array( $id ) ) $attribs = $id; $s .= Xml::element( 'th', $attribs, $header ); } } foreach( $rows as $id => $row ) { $attribs = array(); if ( is_string( $id ) ) $attribs['id'] = $id; + if ( is_array( $id ) ) $attribs = $id; $s .= Xml::buildTableRow( $attribs, $row ); } $s .= Xml::closeElement( 'table' ); @@ -718,6 +720,7 @@ class Xml { foreach( $cells as $id => $cell ) { $attribs = array(); if ( is_string( $id ) ) $attribs['id'] = $id; + if ( is_array( $id ) ) $attribs = $id; $s .= Xml::element( 'td', $attribs, $cell ); } $s .= Xml::closeElement( 'tr' );