From b31b4ec03edd60820b8e4a8d596de9bc2e14d21b Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Sat, 24 Jan 2009 01:22:19 -0500 Subject: Add package details template (pkg_details.php) Signed-off-by: Loui Chang --- web/lib/pkgfuncs.inc | 182 +-------------------------------------------------- 1 file changed, 3 insertions(+), 179 deletions(-) (limited to 'web/lib') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index e328c30..b6f32e6 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -287,187 +287,11 @@ function package_details($id=0, $SID="") { if (empty($row)) { print __("Package details could not be found.")."
\n"; - } else { - - # print out package details - # - echo "
\n"; - echo "
".__("Package Details")."
\n"; - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " "; - } else { - echo $maintainer . ""; - } - } else { - $maintainer = "None"; - echo $maintainer . ""; - } - echo " \n"; - echo " \n"; - - # In case of wanting to put a custom message - $msg = __("unknown"); - $license = $row["License"] == "" ? $msg : $row["License"]; - - echo " \n"; - echo " \n"; - - # Print the timestamps for last updates - $updated_time = ($row["ModifiedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["ModifiedTS"])); - $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["SubmittedTS"])); - echo " \n"; - echo " \n"; - echo " "; - } elseif ($row["LocationID"] == 3) { - echo "CVS"; - } - echo "\n"; - if ($row["OutOfDate"] == 1) { - echo "\n"; - } - echo " \n"; - - $deps = package_dependencies($row["ID"]); # $deps[0] = array('id','name', 'dummy'); - if (count($deps) > 0) { - - echo " \n"; - echo " "; - - } - - $deps = package_required($row["ID"]); - if (count($deps) > 0) { - - echo " \n"; - - } - - $sources = package_sources($row["ID"]); # $sources[0] = 'src'; - if (count($sources) > 0) { - - echo " \n"; - - } - - echo " \n"; - echo "
"; - echo $row["Name"] . " " . $row["Version"]."
"; - echo "".$row["URL"]."
".$row["Description"]; - echo "
"; - if ($row["Location"] == "unsupported" and ( - $uid == $row["MaintainerUID"] or - ($atype == "Developer" or - $atype == "Trusted User"))) { - $edit_cat = "".$row["Category"].""; - $edit_cat .= "  ("; - $edit_cat .= __("change category").")"; - } else { - $edit_cat = $row["Category"]; - } - echo $row["Location"]." :: ".$edit_cat."
".__("Maintainer").": "; - if ($row["MaintainerUID"]) { - $maintainer = username_from_id($row["MaintainerUID"]); - if ($SID) { - echo ""; - echo $maintainer . "
".__("Votes").": "; - echo $row["NumVotes"] . "

".__("License").": ".$license; - echo "
"; - echo __("Last Updated").": ".$updated_time."
"; - echo __("First Submitted").": ".$submitted_time."
"; - if ($row["LocationID"] == 2) { - $urlpath = URL_DIR.$row["Name"]."/".$row["Name"]; - print "".__("Tarball")." :: ".__("Files")." :: PKGBUILD
"; - echo "".__("This package has been flagged out of date.")."
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
"; - echo __("Dependencies")."
"; - - while (list($k, $darr) = each($deps)) { - $url = "".$darr[1].$darr[3]."
\n"; - else echo "".$darr[1].$darr[3]."
\n"; - } - - echo "
"; - echo ""; - echo "\n"; - echo "\n"; - echo "
"; - echo __("Required by")."
"; - - while (list($k, $darr) = each($deps)) { - $url = "".$darr[1].$darr[3]."
\n"; - else print "".$darr[1].$darr[3]."
\n"; - } - - echo "
\n"; - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
"; - echo __("Sources")."
"; - - while (list($k, $src) = each($sources)) { - $parsed_url = parse_url($src); - if ($parsed_url['scheme']) - { - //It is an external source - echo "".$src."
\n"; - } - else - { - //It is presumably an internal source - if ($row["LocationID"] == 2) { - echo "".$src."
\n"; - } elseif ($row["LocationID"] == 3) { - echo ""; - echo $src."
\n"; - } - } - } - - echo "
\n"; - echo "
\n"; - echo "
\n"; - echo "
\n\n"; + } + else { + include('pkg_details.php'); # Actions Bar - # if ($SID) { include('actions_form.php'); } -- cgit v1.2.3-70-g09d2