[emt] r221 committed - The new emt_view -l format showed duplicate sub fields when multiple i...

2 views
Skip to first unread message

e...@googlecode.com

unread,
Jan 9, 2012, 11:18:32 PM1/9/12
to emt...@googlegroups.com
Revision: 221
Author: eric.bergen
Date: Mon Jan 9 20:17:52 2012
Log: The new emt_view -l format showed duplicate sub fields when
multiple instances have the same subfields. This changes dedupes them. I
think it makes sense to add instances into emt_view -l but I'm not sure how
to format it yet.

http://code.google.com/p/emt/source/detail?r=221

Modified:
/trunk/base/emt_read.php

=======================================
--- /trunk/base/emt_read.php Mon Aug 16 21:49:09 2010
+++ /trunk/base/emt_read.php Mon Jan 9 20:17:52 2012
@@ -328,9 +328,14 @@
print "\n ";
print $f->description . "\n";

+ $sub_fields = array();
for ($i = 0; isset($records[$i]); $i++)
if ($records[$i]->name == $field_name &&
$records[$i]->sub_field)
- print " " . $records[$i]->sub_field . "\n";
+ $sub_fields[] = $records[$i]->sub_field;
+
+ $sub_fields = array_unique($sub_fields);
+ for ($i = 0; isset($sub_fields[$i]); $i++)
+ print " " . $sub_fields[$i] . "\n";

print "\n";
}

Reply all
Reply to author
Forward
0 new messages