Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/style.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-18 20:47:42 +0100
committerErich Eckner <git@eckner.net>2019-02-18 20:47:42 +0100
commitad8b318c1eaddbc2043b9a7cbaa6332177db491c (patch)
tree818610f636b74df5b72414677569073601b66ad4 /lib/style.php
parent83be298ae3123e724a64da98a5ee2a7d3f52fcec (diff)
move array of columns from packages/index.php to lib/style.php
Diffstat (limited to 'lib/style.php')
-rw-r--r--lib/style.php50
1 files changed, 47 insertions, 3 deletions
diff --git a/lib/style.php b/lib/style.php
index 051a0a5..ff2d364 100644
--- a/lib/style.php
+++ b/lib/style.php
@@ -1,6 +1,6 @@
<?php
-if (function_exists("print_header"))
+if (isset($pkglist_sorts))
return;
require_once BASE . "/lib/mysql.php";
@@ -81,6 +81,49 @@ function print_footer() {
* *
**********************************************************************/
+$pkglist_sorts = array(
+ "arch" => array(
+ "title" => "architecture",
+ "label" => "Arch",
+ "mysql" => "`architectures`.`name`"
+ ),
+ "repo" => array(
+ "title" => "repository",
+ "label" => "Repo",
+ "mysql" => "CONCAT(`r_a`.`name`,\"/\",`repositories`.`name`)"
+ ),
+ "pkgname" => array(
+ "title" => "package name",
+ "label" => "Name",
+ "mysql" => "`binary_packages`.`pkgname`"
+ ),
+ "pkgver" => array(
+ "title" => "package version",
+ "label" => "Version",
+ "mysql" => mysql_query_package_version("binary_packages")
+ ),
+ "bugs" => array(
+ "title" => "bug status",
+ "label" => "Bugs",
+ "mysql" => "NOT `binary_packages`.`has_issues`"
+ ),
+ "build_date" => array(
+ "title" => "build date",
+ "label" => "Build Date",
+ "mysql" => "IFNULL(`build_assignments`.`return_date`,\"00-00-0000 00:00:00\")"
+ ),
+ "move_date" => array(
+ "title" => "last update",
+ "label" => "Last Updated",
+ "mysql" => "IFNULL(`binary_packages_in_repositories`.`last_moved`,\"00-00-0000 00:00:00\")"
+ ),
+ "del" => array(
+ "title" => "to be deleted",
+ "label" => "Delete",
+ "mysql" => "`binary_packages_in_repositories`.`is_to_be_deleted`"
+ )
+);
+
function query_package_listing($filter_and_order, $float_columns, $count_only) {
if ($count_only)
$columns = "COUNT(DISTINCT `binary_packages`.`id`)";
@@ -124,13 +167,14 @@ function query_package_listing($filter_and_order, $float_columns, $count_only) {
}
}
-function print_package_listing($list, $sorts, $print_order_links) {
+function print_package_listing($list, $print_order_links) {
+ global $pkglist_sorts;
print " <table class=\"results\">\n";
print " <thead>\n";
print " <tr>\n";
- foreach ($sorts as $get => $sort) {
+ foreach ($pkglist_sorts as $get => $sort) {
print " <th>\n";
if ($print_order_links) {
print " <a href=\"?";