From 8aa3adeb74d3aba8f7cd9498870cd63d87aefd75 Mon Sep 17 00:00:00 2001 From: "Johan \"Papa\" Cwiklinski" Date: Sat, 29 May 2010 17:22:42 +0200 Subject: Use of ajax to load additionnal informations from pkgdb ; closes #45 --- zoom.php | 81 ++++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 25 deletions(-) (limited to 'zoom.php') diff --git a/zoom.php b/zoom.php index 09f37f4..f96f96e 100644 --- a/zoom.php +++ b/zoom.php @@ -1,14 +1,11 @@ (wit for ajax or reload with pkgdb)'; ?> @@ -18,6 +15,21 @@ $name = $_GET['rpm']; + + + + + @@ -36,8 +48,15 @@ include '_header.php'; Enter a package name\n"; +if ( !isset($name) || !$name ) { +?> +

Missing package name

+
+

You have not specified any package name.

+

+
+ +$name not found\n"; } else { - + echo "

Package: $name

\n"; - + if (isset($_GET['pkgdb'])) { $fedpkg = $fedcli->getPackageInfo($name); - echo "

Hide pkgdb informations

"; + echo "

Hide pkgdb informations

"; } else { $fedpkg = false; - echo "

Show more informations from pkgdb

"; + echo "

Show more informations from pkgdb

"; } echo "\n"; echo "\n"; $i=0; if ($rpm->summary) { - echo "\n"; } else if ($owner->summary) { - echo "\n"; } - if (isset($fedpkg['devel']['package']['description'])) { - echo "\n"; - } + + echo "\n"; + if ($rpm->url) { - echo "\n"; } if ($up && $up->type) { - echo "\n"; } if ($up && $up->channel) { - echo "\n"; } if ($up && $up->stable) { - echo "\n"; } if ($up && $up->unstable && $up->stable!=$up->unstable) { - echo "\n"; } if ($owner && $owner->owner) { - echo "\n"; } - echo ""; $i++; + echo ""; $i++; echo "\n"; @@ -142,14 +161,26 @@ if (!$name) { $comaint = ''; if ($people) foreach ($people as $user) { if (isset($user['aclOrder']['commit']['statuscode']) && $user['aclOrder']['commit']['statuscode']==3) { + if ( $comaint !== '' ) { + $comaint .= ', '; + } $comaint .= $user['username']; } } echo ""; $i++; - echo ""; + echo ""; echo ""; echo ""; - echo "\n"; + $id = 'pkgdb_' . $rpm->repo_main; + if ( $rpm->repo_main != $prev ) { + echo "\n"; + } else { + echo ''; + } + if( $rpm->repo_main != $prev ) { + $prev = $rpm->repo_main; + } + } while ($rpm = $resrpm->fetchObject()); echo "
Upstream info
"; $i++; + echo "
"; $i++; echo "Summary: ". $rpm->summary . "
"; $i++; + echo "
"; $i++; echo "Summary: ". $owner->summary . "
"; $i++; - echo "Description: ".$fedpkg['devel']['package']['description']."
"; $i++; + echo "Description: " . ((isset($fedpkg['devel']['package']['description'])) ? $fedpkg['devel']['package']['description'] : $ajax_infos) . "
"; $i++; + echo "
"; $i++; echo "URL: ". $rpm->url . "
"; $i++; + echo "
"; $i++; echo "Type: ". $up->type . "
"; $i++; + echo "
"; $i++; echo "Channel: ". $up->channel . "
"; $i++; + echo "
"; $i++; echo "Stable version: ". $up->stable . "
"; $i++; + echo "
"; $i++; echo "Unstable version: ". $up->unstable . ""; if ($up->state) { echo " (". $up->state . ")\n"; @@ -111,14 +130,14 @@ if (!$name) { echo "
"; $i++; + echo "
"; $i++; echo "Owner: ". $owner->owner . ""; if ($owner->cc) { echo " (". $owner->cc . ")\n"; } echo "
ViewVC:
ViewVC: http://cvs.fedoraproject.org/viewvc/rpms/$name/"; echo "
".($rpm->repo_main==$prev ? " " : $prev=$rpm->repo_main)."".($rpm->repo_main==$prev ? " " : $rpm->repo_main)."".$rpm->repo_sub."".($rpm->epoch ? $rpm->epoch.":" : "").$rpm->ver."-".$rpm->rel."$owner$comaint
" . (($fedpkg) ? $owner : $ajax_infos) . "" . (($fedpkg) ? $comaint : $ajax_infos) . "
  
"; } -- cgit