diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-08-20 23:30:47 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-08-20 23:30:47 +0000 |
commit | 61a48553f2397799c8792c65ca2ae7c0eaf2a866 (patch) | |
tree | 0ae010937646b2f5ce7ef9694d15cfe2cf73f8f0 /usr/local/www | |
parent | ea0805c10586f99f76274bdf21c3c409ff5973b6 (diff) | |
download | pfsense-61a48553f2397799c8792c65ca2ae7c0eaf2a866.zip pfsense-61a48553f2397799c8792c65ca2ae7c0eaf2a866.tar.gz |
MFC package changes to show information better such as HEAD only packages,
etc.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/pkg_mgr.php | 32 | ||||
-rwxr-xr-x | usr/local/www/pkg_mgr_install.php | 11 | ||||
-rwxr-xr-x | usr/local/www/pkg_mgr_installed.php | 7 |
3 files changed, 38 insertions, 12 deletions
diff --git a/usr/local/www/pkg_mgr.php b/usr/local/www/pkg_mgr.php index 227c353..837e338 100755 --- a/usr/local/www/pkg_mgr.php +++ b/usr/local/www/pkg_mgr.php @@ -30,7 +30,7 @@ require_once("guiconfig.inc"); require_once("pkg-utils.inc"); -$pkg_info = get_pkg_info('all', array('name', 'category', 'website', 'version', 'status', 'descr', 'maintainer')); +$pkg_info = get_pkg_info('all', array('name', 'category', 'website', 'version', 'status', 'descr', 'maintainer', 'required_version')); if($pkg_info) { $fout = fopen("{$g['tmp_path']}/pkg_info.cache", "w"); fwrite($fout, serialize($pkg_info)); @@ -46,6 +46,12 @@ if($pkg_info) { } } +if (! empty($_GET)) { + if (isset($_GET['ver'])) { + $requested_version = $_GET['ver']; + } +} + $pgtitle = "System: Package Manager"; include("head.inc"); @@ -63,9 +69,12 @@ include("fbegin.inc"); <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php + $version = file_get_contents("/etc/version"); $tab_array = array(); - $tab_array[0] = array("Available Packages", true, "pkg_mgr.php"); - $tab_array[1] = array("Installed Packages", false, "pkg_mgr_installed.php"); + $tab_array[] = array("Available {$version} Packages", $requested_version <> "" ? false : true, "pkg_mgr.php"); + $tab_array[] = array("Packages with a different Version", $requested_version == "other" ? true : false, "pkg_mgr.php?ver=other"); + $tab_array[] = array("Packages with no version info", $requested_version == "none" ? true : false, "pkg_mgr.php?ver=none"); + $tab_array[] = array("Installed Packages", false, "pkg_mgr_installed.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -102,10 +111,20 @@ include("fbegin.inc"); foreach($pkg_keys as $key) { $index = &$pkg_info[$key]; if(in_array($index['name'], $instpkgs)) continue; + /* do not display packages with no version info if not explicitely requested */ + if (empty($index['required_version']) && + $requested_version <> "none") { continue; } + /* do not display packages for a different platform info if not explicitely requested */ + if($index['required_version'] <> $version && + $requested_version <> "other") { continue; } + if (isset($index['required_version']) && + $requested_version == "none") { continue; } + if($index['required_version'] == $version && + $requested_version == "other") { continue; } ?> <tr valign="top"> <td class="listlr"> - <A target="_new" href="<?= $index['website'] ?>"><?= $index['name'] ?></a> + <A target="_blank" href="<?= $index['website'] ?>"><?= $index['name'] ?></a> </td> <td class="listlr"> <?= $index['category'] ?> @@ -128,6 +147,8 @@ include("fbegin.inc"); <?= $index['status'] ?> <br> <?= $index['version'] ?> + <br /> + platform: <?= $index['required_version'] ?> </td> <td class="listlr"> <?php @@ -138,8 +159,7 @@ include("fbegin.inc"); } ?> </td> - <td class="listbg"> - <font color="#ffffff"> + <td class="listbg" class="listbg" style="color: #FFFFFF; overflow: hidden;"> <?= $index['descr'] ?> </td> <td valign="middle" class="list" nowrap> diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php index 94dab3b..709275b 100755 --- a/usr/local/www/pkg_mgr_install.php +++ b/usr/local/www/pkg_mgr_install.php @@ -53,10 +53,13 @@ include("head.inc"); <div id="mainareapkg"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php + $version = file_get_contents("/etc/version"); $tab_array = array(); - $tab_array[0] = array("Available Packages", false, "pkg_mgr.php"); - $tab_array[1] = array("Installed Packages", false, "pkg_mgr_installed.php"); - $tab_array[2] = array("Package Installer", true, ""); + $tab_array[] = array("Available {$version} Packages", false, "pkg_mgr.php"); + $tab_array[] = array("Packages with a different Version", false, "pkg_mgr.php?ver=other"); + $tab_array[] = array("Packages with no version info", false, "pkg_mgr.php?ver=none"); + $tab_array[] = array("Installed Packages", false, "pkg_mgr_installed.php"); + $tab_array[] = array("Package Installer", true, ""); display_top_tabs($tab_array); ?> </td></tr> @@ -177,4 +180,4 @@ conf_mount_ro(); if($fd_log) fclose($fd_log); -?>
\ No newline at end of file +?> diff --git a/usr/local/www/pkg_mgr_installed.php b/usr/local/www/pkg_mgr_installed.php index a900bbd..cde8631 100755 --- a/usr/local/www/pkg_mgr_installed.php +++ b/usr/local/www/pkg_mgr_installed.php @@ -48,9 +48,12 @@ include("head.inc"); <?php if ($savemsg) print_info_box($savemsg); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php + $version = file_get_contents("/etc/version"); $tab_array = array(); - $tab_array[0] = array("Available Packages", false, "pkg_mgr.php"); - $tab_array[1] = array("Installed Packages", true, "pkg_mgr_installed.php"); + $tab_array[] = array("Available {$version} Packages", false, "pkg_mgr.php"); + $tab_array[] = array("Packages with a different Version", false, "pkg_mgr.php?ver=other"); + $tab_array[] = array("Packages with no version info", false, "pkg_mgr.php?ver=none"); + $tab_array[] = array("Installed Packages", true, "pkg_mgr_installed.php"); display_top_tabs($tab_array); ?> </td></tr> |