summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2010-07-11 18:43:12 +0200
committerRemi Collet <fedora@famillecollet.com>2010-07-11 18:43:12 +0200
commite6b48f0d645a72b2b4898f3ddc90fc8437f9b1e2 (patch)
treeb19e07dda8f252b997190fefeeb222e807b88cc6
parent50f2de59ed8ea3f41530fc4f06c12ae1613416ab (diff)
add PkdDb link on zoom page, solves #58
-rw-r--r--class/FedoraClient.php2
-rw-r--r--class/FedoraPkgdb.php10
-rw-r--r--smarty/templates/rpmphp/zoom.tpl2
-rw-r--r--zoom.php2
4 files changed, 13 insertions, 3 deletions
diff --git a/class/FedoraClient.php b/class/FedoraClient.php
index ed29f54..c1a10c5 100644
--- a/class/FedoraClient.php
+++ b/class/FedoraClient.php
@@ -44,7 +44,7 @@ require_once 'Cache/Lite.php';
abstract class FedoraClient
{
- private $url;
+ protected $url;
private $agent;
private $debug = 0;
protected $cache;
diff --git a/class/FedoraPkgdb.php b/class/FedoraPkgdb.php
index ee54119..9f2a094 100644
--- a/class/FedoraPkgdb.php
+++ b/class/FedoraPkgdb.php
@@ -37,10 +37,13 @@
class FedoraPkgdb extends FedoraClient
{
+ private $suburl;
function __construct (array $options=array())
{
parent::__construct('https://admin.fedoraproject.org/pkgdb/', $options);
+ $this->suburl = 'acls/name/';
+
$this->logDebug(
3,
__CLASS__."::".__FUNCTION__
@@ -75,9 +78,14 @@ class FedoraPkgdb extends FedoraClient
return $branches;
}
+ function getPackageURL($name)
+ {
+ return $this->url.$this->suburl.urlencode($name);
+ }
+
function getPackageInfo($name, $refresh=false)
{
- $url="acls/name/".urlencode($name);
+ $url=$this->suburl.urlencode($name);
$rep = ($refresh ? false : $this->cache->get($url, __CLASS__));
if ($rep) {
$this->logDebug(
diff --git a/smarty/templates/rpmphp/zoom.tpl b/smarty/templates/rpmphp/zoom.tpl
index 704c6b7..bcbb222 100644
--- a/smarty/templates/rpmphp/zoom.tpl
+++ b/smarty/templates/rpmphp/zoom.tpl
@@ -43,7 +43,7 @@
<td{if $k eq 'Description'} id="{$name}_desc"{/if}>
{if $k eq 'Bugzilla'}
<a href="{$v}">Active bugs</a>
- {elseif $k eq 'URL' or $k eq 'ViewVC'}
+ {elseif $k eq 'URL' or $k eq 'ViewVC' or $k eq 'PkgDB'}
<a href="{$v}">{$v}</a>
{else}
{$v}
diff --git a/zoom.php b/zoom.php
index 45a4830..a7ec090 100644
--- a/zoom.php
+++ b/zoom.php
@@ -167,6 +167,8 @@ if ( !isset($name) || !$name ) {
$summary['ViewVC'] = 'http://cvs.fedoraproject.org/viewvc/rpms/' .
$name . '/';
+ $summary['PkgDB'] = $fedcli->getPackageURL($name);
+
if (isset($_GET['pkgdb'])) {
$fedpkg = $fedcli->getPackageInfo($name);
} else {