r61237 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61236‎ | r61237 | r61238 >
Date:03:57, 19 January 2010
Author:nad
Status:deferred
Tags:
Comment:
fixed groupby in renderRecords()
Modified paths:
  • /trunk/extensions/RecordAdmin/RecordAdmin.php (modified) (history)
  • /trunk/extensions/RecordAdmin/RecordAdmin_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php
@@ -396,11 +396,12 @@
397397 $tmp = array();
398398 foreach ( $records as $r ) {
399399 $v0 = $r[$groupby[0]];
 400+ if ( !isset( $tmp[$v0] ) || !is_array( $tmp[$v0] ) ) $tmp[$v0] = array();
400401 if ( isset( $groupby[1] ) ) {
401402 $v1 = $r[$groupby[1]];
402 - if ( !isset( $tmp[$v0] ) || !is_array( $tmp[$v0] ) ) $tmp[$v0] = array();
403 - $tmp[$v0][$v1] = $r;
404 - } else $tmp[$v0] = $r;
 403+ if ( !isset( $tmp[$v0][$v1] ) || !is_array( $tmp[$v0][$v1] ) ) $tmp[$v0][$v1] = array();
 404+ $tmp[$v0][$v1][] = $r;
 405+ } else $tmp[$v0][] = $r;
405406 }
406407 $records = $tmp;
407408 }
@@ -489,7 +490,9 @@
490491 foreach( $records as $k1 => $v1 ) {
491492 if ( empty( $k1 ) ) $k1 = wfMsg( 'recordadmin-notset', $groupby[0] );
492493 $tmp[] = "$td<h2>$k1</h2></td>\n";
 494+ print "---->$k1<br>";
493495 foreach( $v1 as $k2 => $v2 ) {
 496+ print "-------->$k2:$v2<br>";
494497 if ( isset( $groupby[1] ) ) {
495498 if ( empty( $k2 ) ) $k2 = wfMsg( 'recordadmin-notset', $groupby[1] );
496499 $tmp[] = "$td<h3>$k2</h3></td>\n";
Index: trunk/extensions/RecordAdmin/RecordAdmin.php
@@ -11,7 +11,7 @@
1212 * @licence GNU General Public Licence 2.0 or later
1313 */
1414
15 -define( 'RECORDADMIN_VERSION', '0.10.0, 2010-01-18' );
 15+define( 'RECORDADMIN_VERSION', '0.10.1, 2010-01-19' );
1616
1717 $wgRecordAdminUseNamespaces = false; # Whether record articles should be in a namespace of the same name as their type
1818 $wgRecordAdminCategory = 'Records'; # Category containing record types

Status & tagging log