pkg_search_results.php 5.65 KB
Newer Older
1
<?php if (!$result) { ?>
2
	<div class='pgboxbody'><?php print __("Error retrieving package list.") ?></div>
3
<?php } elseif ($total == 0) { ?>
4
	<div class='pgboxbody'><?php print __("No packages matched your search criteria.") ?></div>
5
<?php } else { ?>
6
7
	<form action='packages.php?<?php echo htmlentities($_SERVER['QUERY_STRING']) ?>' method='post'>
		<div class="pgbox">
8
			<h2><?php print __("Package Listing") ?></h2>
9
10
11



12

13
<table class='results'>
14
15
<tr>
	<?php if ($SID): ?>
16
	<th class='header'>&nbsp;</th>
17
	<?php endif; ?>
18

19
	<th class='header'><span class='f2'>
20
		<a href='?<?php print mkurl('SB=c&SO=' . $SO_next) ?>'><?php print __("Category") ?></a>
21
	</span></th>
22
	<th class='header'><span class='f2'>
23
		<a href='?<?php print mkurl('SB=n&SO=' . $SO_next) ?>'><?php print __("Name") ?></a>
24
	</span></th>
25
	<th class='header'><span class='f2'>
26
		<a href='?<?php print mkurl('SB=v&SO=' . $SO_next) ?>'><?php print __("Votes") ?></a>
27
	</span></th>
28

29
	<?php if ($SID): ?>
30
	<th class='header'><span class='f2'>
31
32
		<a href='?<?php print mkurl('SB=w&SO=' . $SO_next) ?>'><?php print __("Voted") ?></a>
	</span></th>
33
	<th class='header'><span class='f2'>
34
35
		<a href='?<?php print mkurl('SB=o&SO=' . $SO_next) ?>'><?php print __("Notify") ?></a>
	</span></th>
36
	<?php endif; ?>
37
38
	<th class='header'><span class='f2'><?php print __("Description") ?></span></th>
	<th class='header'><span class='f2'>
39
		<a href='?<?php print mkurl('SB=m&SO=' . $SO_next) ?>'><?php print __("Maintainer") ?></a>
40
41
42
	</span></th>
</tr>

43
<?php
Dan McGee's avatar
Dan McGee committed
44
45
46
47
48
if (isset($_COOKIE['AURSID'])) {
	$atype = account_from_sid($_COOKIE['AURSID']);
} else {
	$atype = "";
}
49
50
for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {
	(($i % 2) == 0) ? $c = "data1" : $c = "data2";
51
	if ($row["OutOfDateTS"] !== NULL): $c = "outofdate"; endif;
52
?>
53
<tr>
54
	<?php if ($SID): ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
55
	<td class='<?php print $c ?>'><input type='checkbox' name='IDs[<?php print $row["ID"] ?>]' value='1' /></td>
56
	<?php endif; ?>
57
58
	<td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print htmlspecialchars($row["Category"]) ?></span></span></td>
	<td class='<?php print $c ?>'><span class='f4'><a href='packages.php?ID=<?php print $row["ID"] ?>'><span class='black'><?php print htmlspecialchars($row["Name"]) ?> <?php print htmlspecialchars($row["Version"]) ?></span></a></span></td>
59
	<td class='<?php print $c ?>' style="text-align: right"><span class='f5'><span class='blue'><?php print $row["NumVotes"] ?></span></span></td>
60
61
62
	<?php if ($SID): ?>
	<td class='<?php print $c ?>'><span class='f5'><span class='blue'>
	<?php if (isset($row["Voted"])): ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
63
	<?php print __("Yes") ?></span></span></td>
64
	<?php else: ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
65
	</span></span></td>
66
67
68
	<?php endif; ?>
	<td class='<?php print $c ?>'><span class='f5'><span class='blue'>
	<?php if (isset($row["Notify"])): ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
69
	<?php print __("Yes") ?></span></span></td>
70
	<?php else: ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
71
	</span></span></td>
72
73
74
	<?php endif; ?>
	<?php endif; ?>
	<td class='<?php print $c ?>'><span class='f4'><span class='blue'>
75
	<?php print htmlspecialchars($row['Description'], ENT_QUOTES); ?></span></span></td>
76
77
	<td class='<?php print $c ?>'><span class='f5'><span class='blue'>
	<?php if (isset($row["Maintainer"])): ?>
78
	<a href='packages.php?K=<?php print htmlspecialchars($row['Maintainer'], ENT_QUOTES) ?>&amp;SeB=m'><?php print htmlspecialchars($row['Maintainer']) ?></a>
79
80
81
82
83
84
85
	<?php else: ?>
	<span style='color: blue; font-style: italic;'><?php print __("orphan") ?></span>
	<?php endif; ?>
	</span></span></td>
</tr>
<?php } ?>

86
	</table>
87
</div> <!-- .pgbox ??! -->
88

89

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
		<div class="pgbox pkg_search_results_footer">
			<div class="legend_and_actions">
				<div class="legend">
					<span class='f3'><?php echo __('Legend') ?></span>
					<span class="outofdate"><?php print __('Out of Date') ?></span>
				</div>
				<?php if ($SID): ?>
					<div>
						<select name='action'>
							<option><?php print __("Actions") ?></option>
							<option value='do_Flag'><?php print __("Flag Out-of-date") ?></option>
							<option value='do_UnFlag'><?php print __("Unflag Out-of-date") ?></option>
							<option value='do_Adopt'><?php print __("Adopt Packages") ?></option>
							<option value='do_Disown'><?php print __("Disown Packages") ?></option>
							<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
							<option value='do_Delete'><?php print __("Delete Packages") ?></option>
							<?php endif; ?>
							<option value='do_Notify'><?php print __("Notify") ?></option>
							<option value='do_UnNotify'><?php print __("UnNotify") ?></option>
						</select>
						<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
111
112
							<label for='merge_Into'><?php print __("Merge into") ?></label>
							<input type='text' id='merge_Into' name='merge_Into' />
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
							<input type='checkbox' name='confirm_Delete' value='1' /> <?php print __("Confirm") ?>
						<?php endif; ?>
						<input type='submit' class='button' style='width: 80px' value='<?php print __("Go") ?>' />
					</div>
				<?php endif; # if ($SID) ?>
			</div> <!-- .legend_and_actions -->
			<div class="page_links">
				<div class="f4 blue">
					<?php print __("Showing results %s - %s of %s", $first, $last, $total) ?>
				</div>
				<div class="page_nav">
					<?php foreach($templ_pages as $pagenr => $pagestart) { ?>
						<?php if ($pagestart === false) { ?>
							<?php echo $pagenr ?>
						<?php } else if ($pagestart + 1 == $first) { ?>
							<span class="page_sel"><?php echo $pagenr ?></span>
						<?php } else { ?>
							<a class="page_num" href="packages.php?<?php print mkurl('O=' . (	$pagestart)) ?>"><?php echo $pagenr ?></a>
						<?php } ?>
132
					<?php } ?>
133
134
135
136
137
				</div>
			</div> <!-- .page_links -->
		</div> <!-- .pgbox .pkg_search_results_footer -->
	</form>
<?php } # search was successful and returned multiple results ?>