diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-26 13:17:28 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-26 13:34:17 +0200 |
commit | 3720bdf6b264cb4bb603e4199f2758598c260ed4 (patch) | |
tree | 9dee586a6aace9e5f1b4e02838aee91a7e1f14f9 /web/template/pkg_details.php | |
parent | 92812050a059a651357f772b58e967154ea8428c (diff) |
Display package relations on the details page
This adds information from the following three fields to the package
details page:
* conflicts
* provides
* replaces
If either of these fields is empty, it is not displayed.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/template/pkg_details.php')
-rw-r--r-- | web/template/pkg_details.php | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index f0bfa0b..da90c9d 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -25,6 +25,22 @@ $urlpath = URL_DIR . substr($row['BaseName'], 0, 2) . "/" . $row['BaseName']; $deps = pkg_dependencies($row["ID"]); $requiredby = pkg_required($row["Name"]); +$rels = pkg_relations($row["ID"]); +$rels_c = $rels_p = $rels_r = array(); +foreach ($rels as $rel) { + switch ($rel[1]) { + case "conflicts": + $rels_c[] = $rel; + break; + case "provides": + $rels_p[] = $rel; + break; + case "replaces": + $rels_r[] = $rel; + break; + } +} + # $sources[0] = 'src'; $sources = pkg_sources($row["ID"]); ?> @@ -156,6 +172,54 @@ if ($SID && ($uid == $row["MaintainerUID"] || <th><?= __('License') . ': ' ?></th> <td><?= htmlspecialchars($license) ?></td> </tr> + <?php if (count($rels_c) > 0): ?> + <tr> + <th><?= __('Conflicts') . ': ' ?></th> + <td class="wrap relatedto"> + <?php foreach($rels_c as $rarr): ?> + <span class="related"> + <?php if ($rarr !== end($rels_c)): ?> + <?= htmlspecialchars($rarr[0]) ?>, + <?php else: ?> + <?= htmlspecialchars($rarr[0]) ?> + <?php endif; ?> + </span> + <?php endforeach; ?> + </td> + </tr> + <?php endif; ?> + <?php if (count($rels_p) > 0): ?> + <tr> + <th><?= __('Provides') . ': ' ?></th> + <td class="wrap relatedto"> + <?php foreach($rels_p as $rarr): ?> + <span class="related"> + <?php if ($rarr !== end($rels_p)): ?> + <?= htmlspecialchars($rarr[0]) ?>, + <?php else: ?> + <?= htmlspecialchars($rarr[0]) ?> + <?php endif; ?> + </span> + <?php endforeach; ?> + </td> + </tr> + <?php endif; ?> + <?php if (count($rels_r) > 0): ?> + <tr> + <th><?= __('Replaces') . ': ' ?></th> + <td class="wrap relatedto"> + <?php foreach($rels_r as $rarr): ?> + <span class="related"> + <?php if ($rarr !== end($rels_r)): ?> + <?= htmlspecialchars($rarr[0]) ?>, + <?php else: ?> + <?= htmlspecialchars($rarr[0]) ?> + <?php endif; ?> + </span> + <?php endforeach; ?> + </td> + </tr> + <?php endif; ?> <tr> <th><?= __('Submitter') .': ' ?></th> <?php |