summaryrefslogtreecommitdiff
blob: 16b07497ff72076c132be2df5279c0908336ddf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?
	
	require_once 'class.db.category.php';
	
	if($category_id) {
	
		$obj = new DBCategory($category_id);
	
		$name = $obj->name;
		$description = $obj->getDescription($lingua);
		
		$url = $base_uri."categories";
		
		echo "<h4>$name</h4>";
		
		if($description)
			echo "<div class='description'>$description</div>";

		$sql = "SELECT package_name, package, id AS ebuild FROM ebuilds WHERE category = ".$db->quote($category_id).";";
		$arr = $db->getAll($sql);
		
		foreach($arr as $row) {
			extract($row);
			$arr_packages[$package][] = $ebuild;
			$arr_name[$package] = $package_name;
		}
		
		foreach($arr_packages as $package => $arr) {
 			if(count($arr)) {
 			
 				$e = new DBEbuild(current($arr));
 				$arr_desc[$package] = $e->description;
 				
				$div_versions .= keywordsRow($arr, 'category');
 			}
		}
		
		foreach(array_keys($arr_packages) as $package) {
 			
 			$name = $arr_name[$package];
 			$desc = $arr_desc[$package];
 			
 			$div_names .= "<tr>\n";
 			$div_names .= "<td class='use' valign='top' style='white-space: nowrap;'><a href='$name/' style='color: black;'>$name</a></td>\n";
 			$div_names .= "<td class='use' valign='top'>$desc</td>\n";
 			$div_names .= "</tr>\n";
 			
		}
		
		echo "<div id='names' style='display: none;'>\n";
		echo "<table class='content centerpage'>\n";
		echo $div_names;
		echo "</table>\n";
		echo "</div>\n";
		
		echo "<div id='versions'>\n";
		echo $div_versions;
		echo "</div>\n";
		
	}

?>