diff options
Diffstat (limited to 'web/template/pkg_details.php')
-rw-r--r-- | web/template/pkg_details.php | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 7f01d2f5..d09b3d86 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -29,7 +29,31 @@ $grps = pkg_groups($row["ID"]); $deps = pkg_dependencies($row["ID"]); $requiredby = pkg_required($row["Name"]); +usort($deps, function($x, $y) { + if ($x[1] != $y[1]) { + if ($x[1] == "depends") { + return -1; + } elseif ($y[1] == "depends") { + return 1; + } + return strcmp($x[1], $y[1]); + } elseif ($x[3] != $y[3]) { + return strcmp($x[3], $y[3]); + } else { + return strcmp($x[0], $y[0]); + } +}); + $rels = pkg_relations($row["ID"]); + +usort($rels, function($x, $y) { + if ($x[3] != $y[3]) { + return strcmp($x[3], $y[3]); + } else { + return strcmp($x[0], $y[0]); + } +}); + $rels_c = $rels_p = $rels_r = array(); foreach ($rels as $rel) { switch ($rel[1]) { @@ -211,9 +235,9 @@ if (has_credential(CRED_PKGBASE_CHANGE_CATEGORY, array($row["MaintainerUID"]))): <?php foreach($rels_c as $rarr): ?> <span class="related"> <?php if ($rarr !== end($rels_c)): ?> - <?= htmlspecialchars($rarr[0] . $rarr[2]) ?>, + <?= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?>, <?php else: ?> - <?= htmlspecialchars($rarr[0] . $rarr[2]) ?> + <?= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?> <?php endif; ?> </span> <?php endforeach; ?> @@ -227,9 +251,9 @@ if (has_credential(CRED_PKGBASE_CHANGE_CATEGORY, array($row["MaintainerUID"]))): <?php foreach($rels_p as $rarr): ?> <span class="related"> <?php if ($rarr !== end($rels_p)): ?> - <?= htmlspecialchars($rarr[0] . $rarr[2]) ?>, + <?= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?>, <?php else: ?> - <?= htmlspecialchars($rarr[0] . $rarr[2]) ?> + <?= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?> <?php endif; ?> </span> <?php endforeach; ?> @@ -243,9 +267,9 @@ if (has_credential(CRED_PKGBASE_CHANGE_CATEGORY, array($row["MaintainerUID"]))): <?php foreach($rels_r as $rarr): ?> <span class="related"> <?php if ($rarr !== end($rels_r)): ?> - <?= htmlspecialchars($rarr[0] . $rarr[2]) ?>, + <?= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?>, <?php else: ?> - <?= htmlspecialchars($rarr[0] . $rarr[2]) ?> + <?= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?> <?php endif; ?> </span> <?php endforeach; ?> @@ -334,7 +358,7 @@ if ($row["PackagerUID"]): <?php if (count($deps) > 0): ?> <ul id="pkgdepslist"> <?php while (list($k, $darr) = each($deps)): ?> - <li><?= pkg_depend_link($darr[0], $darr[1], $darr[2], $darr[3]); ?></li> + <li><?= pkg_depend_link($darr[0], $darr[1], $darr[2], $darr[3], $darr[4]); ?></li> <?php endwhile; ?> </ul> <?php endif; ?> @@ -355,28 +379,14 @@ if ($row["PackagerUID"]): <div id="pkgfiles" class="listing"> <h3><?= __('Sources') ?></h3> </div> -<?php if (count($sources) > 0): ?> + <?php if (count($sources) > 0): ?> <div> <ul id="pkgsrcslist"> -<?php - while (list($k, $src) = each($sources)): - $src = explode('::', $src); - $parsed_url = parse_url($src[0]); - - # It is an external source - if (isset($parsed_url['scheme']) || isset($src[1])): -?> - <li><a href="<?= htmlspecialchars((isset($src[1]) ? $src[1] : $src[0]), ENT_QUOTES) ?>"><?= htmlspecialchars($src[0]) ?> </a></li> -<?php - else: - # It is presumably an internal source - $src = $src[0]; -?> - <li><?= htmlspecialchars($src) ?></li> - <?php endif; ?> - <?php endwhile; ?> + <?php while (list($k, $src) = each($sources)): ?> + <li><?= pkg_source_link($src[0], $src[1]) ?></li> + <?php endwhile; ?> </ul> </div> -<?php endif; ?> + <?php endif; ?> </div> </div> |