From 8e4c1ce33a46b85457aba69f5aa5ead003f36aa8 Mon Sep 17 00:00:00 2001 From: "Johan \"Papa\" Cwiklinski" Date: Sun, 30 May 2010 11:30:35 +0200 Subject: Add license ; refs #46 --- main.inc.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'main.inc.php') diff --git a/main.inc.php b/main.inc.php index a160604..e94a62b 100644 --- a/main.inc.php +++ b/main.inc.php @@ -1,4 +1,38 @@ . + * + * @category Main + * @package RPMPHP + * + * @author Johan Cwiklinski + * @copyright 2010 Remi Collet + * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version + * @link http://github.com/remicollet/rpmphp/ + * @since The begining of times. +*/ require 'config.inc.php'; require '/usr/share/php/Smarty/Smarty.class.php'; -- cgit From 816c869c3bd174d78a710f4d384442bf31a24a6d Mon Sep 17 00:00:00 2001 From: "Johan \"Papa\" Cwiklinski" Date: Sun, 30 May 2010 13:20:02 +0200 Subject: rpm.php Smarty variable assigned twice, export reposlist function so it could be used elsewhere --- main.inc.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'main.inc.php') diff --git a/main.inc.php b/main.inc.php index e94a62b..bbc300c 100644 --- a/main.inc.php +++ b/main.inc.php @@ -47,4 +47,31 @@ $ariane[] = array( 'url' => './', 'text' => 'Reports home' ); + +/** +* Get repositories list +* +* @param object $db a reference to the database +* +* @return array +*/ +function listRepos($db) +{ + $repos = array(); + $res=$db->query("SELECT * FROM repo WHERE active=1 ORDER BY ID"); + if ( $res ) { + while ($repo = $res->fetchObject()) { + $repos[$repo->main][$repo->sub]=$repo; + } + } + // echo "
"; print_r($repos);echo "
"; + foreach ( $repos as $repomain ) { + foreach ($repomain as $repo) { + $repos[$repo->main][$repo->sub] = $repo; + break; + } + } + return $repos; +} + ?> \ No newline at end of file -- cgit