Skip to content

Commit 8b08f85

Browse files
committed
Change how packet used by is shown
1 parent 3e11916 commit 8b08f85

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/templates/Packet/View.phtml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,17 @@ require("./header.inc.phtml");
6565
if (count($products) == 1) {
6666
echo htmlspecialchars($products[0]->getLabel(), ENT_HTML5, "UTF-8");
6767
} else {
68-
echo "<ul>";
69-
foreach ($this->getContext()->used_by as $product) {
70-
echo "<li>" . htmlspecialchars($product->getLabel(), ENT_HTML5, "UTF-8") . "</li>";
68+
$j = count($this->getContext()->used_by);
69+
for ($i = 0; $i < $j; ++$i) {
70+
echo htmlspecialchars($this->getContext()->used_by[$i]->getLabel(), ENT_HTML5, "UTF-8");
71+
if ($i + 1 < $j) {
72+
++$i;
73+
echo ", ";
74+
echo htmlspecialchars($this->getContext()->used_by[$i]->getLabel(), ENT_HTML5, "UTF-8") . "<br/>";
75+
} else {
76+
echo "<br/>";
77+
}
7178
}
72-
echo "</ul>";
7379
}
7480
?></td></tr>
7581
<tr><th>Format:</th><td><p><pre><code><?php echo $object->getPacketFormat(); ?></code></pre></p></td></tr>
@@ -80,7 +86,9 @@ require("./header.inc.phtml");
8086
<?php echo $object->getPacketRemarks(true); ?>
8187
</section>
8288
<footer>
89+
<?php if ($user_id !== null) { ?>
8390
<span class="float-left"><a href="<?php echo $user_url; ?>"><img class="avatar" src="<?php echo $user_avatar; ?>"/> <?php echo htmlspecialchars($user_name, ENT_HTML5, "UTF-8"); ?></a></span>
91+
<?php } ?>
8492
<?php if ($object->getEditedDateTime() !== null) { ?>
8593
<span class="float-right"><?php echo $object->getCreatedDateTime()->format("l, F j, Y"); ?> | Edited: <?php echo $object->getEditedDateTime()->format("l, F j, Y"); ?></span>
8694
<?php } else { ?>

0 commit comments

Comments
 (0)