diff options
author | Sjon Hortensius <sjon@hortensius.net> | 2015-01-10 13:52:16 +0100 |
---|---|---|
committer | Sjon Hortensius <sjon@hortensius.net> | 2015-01-10 14:02:50 +0100 |
commit | 31f03b6c1673322ae05267ab20505141b6b2230f (patch) | |
tree | 3670f2caa2d1517248195a3589822bf75f9cb57e /usr/local/www/pkg_mgr.php | |
parent | f79f949704c89f927fa3e4154211a5861a324791 (diff) | |
download | pfsense-31f03b6c1673322ae05267ab20505141b6b2230f.zip pfsense-31f03b6c1673322ae05267ab20505141b6b2230f.tar.gz |
re-added shortcuts/, global tpl updates
* merged fbegin into head.inc, rename fend to foot.inc
* consistency: head.inc now outputs '<body>'; foot outputs '</body>'
* updated pages that were already updated
* started migrating pkg_mgr
Diffstat (limited to 'usr/local/www/pkg_mgr.php')
-rw-r--r-- | usr/local/www/pkg_mgr.php | 202 |
1 files changed, 86 insertions, 116 deletions
diff --git a/usr/local/www/pkg_mgr.php b/usr/local/www/pkg_mgr.php index c51b01e..a7aab0f 100644 --- a/usr/local/www/pkg_mgr.php +++ b/usr/local/www/pkg_mgr.php @@ -2,10 +2,10 @@ /* $Id$ */ /* pkg_mgr.php - Copyright (C) 2013-2014 Electric Sheep Fencing, LP + Copyright (C) 2013-2014 Electric Sheep Fencing, LP Copyright (C) 2004-2012 Scott Ullrich <sullrich@gmail.com> Copyright (C) 2013 Marcello Coutinho - Copyright (C) 2013-2014 Electric Sheep Fencing, LP + Copyright (C) 2013-2014 Electric Sheep Fencing, LP All rights reserved. @@ -58,21 +58,11 @@ date_default_timezone_set($timezone); if(is_subsystem_dirty('packagelock')) { $pgtitle = array(gettext("System"),gettext("Package Manager")); include("head.inc"); - echo "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">\n"; - include("fbegin.inc"); - echo "Please wait while packages are reinstalled in the background."; - include("fend.inc"); - echo "</body>"; - echo "</html>"; + print_info_box_np("Please wait while packages are reinstalled in the background."); + include("foot.inc"); exit; } -function domTT_title($title_msg) { - if (!empty($title_msg)) { - $title_msg=preg_replace("/\s+/"," ",$title_msg); - $title_msg=preg_replace("/'/","\'",$title_msg); - echo "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\""; - } -} + //get_pkg_info only if cache file has more then $g[min_pkg_cache_file_time] seconds $pkg_cache_file_time=($g['min_pkg_cache_file_time'] ? $g['min_pkg_cache_file_time'] : 120); @@ -106,101 +96,85 @@ $closehead = false; $pgtitle = array(gettext("System"),gettext("Package Manager")); include("head.inc"); -?> -<script type="text/javascript" src="javascript/domTT/domLib.js"></script> -<script type="text/javascript" src="javascript/domTT/domTT.js"></script> -<script type="text/javascript" src="javascript/domTT/behaviour.js"></script> -<script type="text/javascript" src="javascript/domTT/fadomatic.js"></script> -<script type="text/javascript" src="/javascript/row_helper_dynamic.js"></script> -</head> - -<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> -<?php - include("fbegin.inc"); +/* Print package server mismatch warning. See https://redmine.pfsense.org/issues/484 */ +if (!verify_all_package_servers()) + print_info_box(package_server_mismatch_message()); - /* Print package server mismatch warning. See https://redmine.pfsense.org/issues/484 */ - if (!verify_all_package_servers()) - print_info_box(package_server_mismatch_message()); +/* Print package server SSL warning. See https://redmine.pfsense.org/issues/484 */ +if (check_package_server_ssl() === false) + print_info_box(package_server_ssl_failure_message()); - /* Print package server SSL warning. See https://redmine.pfsense.org/issues/484 */ - if (check_package_server_ssl() === false) - print_info_box(package_server_ssl_failure_message()); +if ($savemsg) + print_info_box($savemsg); - if ($savemsg) - print_info_box($savemsg); -?> -<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="package manager"> - <tr><td> -<?php - $version = rtrim(file_get_contents("/etc/version")); +$version = rtrim(file_get_contents("/etc/version")); - $tab_array = array(); - $tab_array[] = array(gettext("Available Packages"), $requested_version <> "" ? false : true, "pkg_mgr.php"); - $tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php"); - display_top_tabs($tab_array); -?> - </td></tr> - <tr><td> -<?php - $version = rtrim(file_get_contents("/etc/version")); - if($pkg_info) { - $pkg_keys = array_keys($pkg_info); - natcasesort($pkg_keys); - - //Check categories - $categories=array(); - if(is_array($pkg_keys)) { - foreach($pkg_keys as $key) { - if (!package_skip_tests($pkg_info[$key],$requested_version)) - $categories[$pkg_info[$key]['category']]++; - } - } - ksort($categories); - $cm_count=0; - $tab_array = array(); - $visible_categories=array(); - $categories_min_count=($g['pkg_categories_min_count'] ? $g['pkg_categories_min_count'] : 3); - $categories_max_display=($g['pkg_categories_max_display'] ? $g['pkg_categories_max_display'] : 6); - - /* check selected category or define default category to show */ - if (isset($_REQUEST['category'])) - $menu_category = $_REQUEST['category']; - else if (isset($g['pkg_default_category'])) - $menu_category = $g['pkg_default_category']; - else - $menu_category = "All"; - - $menu_category = (isset($_REQUEST['category']) ? $_REQUEST['category'] : "All"); - $show_category = ($menu_category == "Other" || $menu_category == "All"); - - $tab_array[] = array(gettext("All"), $menu_category=="All" ? true : false, "pkg_mgr.php?category=All"); - foreach ($categories as $category => $c_count) { - if ($c_count >= $categories_min_count && $cm_count <= $categories_max_display) { - $tab_array[] = array(gettext($category) , $menu_category==$category ? true : false, "pkg_mgr.php?category={$category}"); - $visible_categories[]=$category; - $cm_count++; +$tab_array = array(); +$tab_array[] = array(gettext("Available Packages"), $requested_version <> "" ? false : true, "pkg_mgr.php"); +$tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php"); +display_top_tabs($tab_array); + +$version = rtrim(file_get_contents("/etc/version")); +if($pkg_info) { + $pkg_keys = array_keys($pkg_info); + natcasesort($pkg_keys); + + //Check categories + $categories=array(); + if(is_array($pkg_keys)) { + foreach($pkg_keys as $key) { + if (!package_skip_tests($pkg_info[$key],$requested_version)) + $categories[$pkg_info[$key]['category']]++; } } - $tab_array[] = array(gettext("Other Categories"), $menu_category=="Other" ? true : false, "pkg_mgr.php?category=Other"); - if (count($categories) > 1) - display_top_tabs($tab_array); + ksort($categories); + $cm_count=0; + $tab_array = array(); + $visible_categories=array(); + $categories_min_count=($g['pkg_categories_min_count'] ? $g['pkg_categories_min_count'] : 3); + $categories_max_display=($g['pkg_categories_max_display'] ? $g['pkg_categories_max_display'] : 6); + + /* check selected category or define default category to show */ + if (isset($_REQUEST['category'])) + $menu_category = $_REQUEST['category']; + else if (isset($g['pkg_default_category'])) + $menu_category = $g['pkg_default_category']; + else + $menu_category = "All"; + + $menu_category = (isset($_REQUEST['category']) ? $_REQUEST['category'] : "All"); + $show_category = ($menu_category == "Other" || $menu_category == "All"); + + $tab_array[] = array(gettext("All"), $menu_category=="All" ? true : false, "pkg_mgr.php?category=All"); + foreach ($categories as $category => $c_count) { + if ($c_count >= $categories_min_count && $cm_count <= $categories_max_display) { + $tab_array[] = array(gettext($category) , $menu_category==$category ? true : false, "pkg_mgr.php?category={$category}"); + $visible_categories[]=$category; + $cm_count++; + } } + $tab_array[] = array(gettext("Other Categories"), $menu_category=="Other" ? true : false, "pkg_mgr.php?category=Other"); + if (count($categories) > 1) + display_top_tabs($tab_array); +} ?> - </td></tr> - <tr><td> - <div id="mainarea"> - <table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area"> - <tr><td width="10%" class="listhdrr"><?=gettext("Name"); ?></td> +<table class="table table-striped"> +<thead> +<tr> + <th><?=gettext("Name")?></th> <?php - if ($show_category) - print '<td width="18%" class="listhdr">'.gettext("Category").'</td>'."\n"; + if ($show_category) + print '<th>'.gettext("Category").'</th>'."\n"; ?> - <td width="<?php print $show_category ? "15%" : "20%"; ?>" class="listhdr"><?=gettext("Status"); ?></td> - <td width="<?php print $show_category ? "58%" : "70%"; ?>" class="listhdr"><?=gettext("Description"); ?></td> - <td width="17"> </td></tr> + <th><?=gettext("Status")?></th> + <th><?=gettext("Description")?></th> + <th></th> +</tr> +<thead> +<tbody> <?php if(!$pkg_info) { - echo "<tr><td colspan=\"5\"><center>" . gettext("There are currently no packages available for installation.") . "</td></tr>"; + echo "<tr><td><center>" . gettext("There are currently no packages available for installation.") . "</td></tr>"; } else { if(is_array($pkg_keys)) { foreach($pkg_keys as $key): @@ -230,16 +204,16 @@ include("head.inc"); if ($menu_category == "All" || $index['category'] == $menu_category || ($menu_category == "Other" && !in_array($index['category'],$visible_categories)) ): ?> - <tr valign="top" class="<?= $index['category'] ?>"> - <td class="listlr" <?=domTT_title(gettext("Click on package name to access its website."))?>> - <a target="_blank" href="<?= $index['website'] ?>"><?= $index['name'] ?></a> + <tr valign="top" class="<?=$index['category']?>"> + <td>> + <a target="_blank" href="<?=$index['website']?>"><?=$index['name']?></a> </td> <?php if ($show_category) - print '<td class="listr">'.gettext($index['category']).'</td>'."\n"; + print '<td>'.gettext($index['category']).'</td>'."\n"; if ($g['disablepackagehistory']) { - print '<td class="listr">'."\n"; + print '<td>'."\n"; } else { print '<td class="listr" '; domTT_title(gettext("Click ").ucfirst($index['name']).gettext(" version to check its change log.")); @@ -254,12 +228,12 @@ include("head.inc"); echo "<a target='_blank' href='{$changeloglink}'>{$index['version']}</a>"; ?> <br /> - <?=gettext("platform") .": ". $index['required_version'] ?> + <?=gettext("platform") .": ". $index['required_version']?> <br /> - <?=$index['maximum_version'] ?> + <?=$index['maximum_version']?> </td> - <td class="listbg" style="overflow:hidden; text-align:justify;" <?=domTT_title(gettext("Click package info for more details about ".ucfirst($index['name'])." package."))?>> - <?= $index['descr'] ?> + <td>> + <?=$index['descr']?> <?php if (! $g['disablepackageinfo']): ?> @@ -269,21 +243,17 @@ include("head.inc"); endif; ?> </td> - <td valign="middle" class="list nowrap" width="17"> - <a href="pkg_mgr_install.php?id=<?=$index['name'];?>"><img <?=domTT_title(gettext("Install ".ucfirst($index['name'])." package."))?> src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a> + <td> + <a href="pkg_mgr_install.php?id=<?=$index['name']?>"><img <?=domTT_title(gettext("Install ".ucfirst($index['name'])." package."))?> src="./themes/<?=$g['theme']?>/images/icons/icon_plus.gif" alt="add" /></a> </td></tr> <?php endif; endforeach; } else { - echo "<tr><td colspan='5' align='center'>" . gettext("There are currently no packages available for installation.") . "</td></tr>"; + echo "<tr><td>" . gettext("There are currently no packages available for installation.") . "</td></tr>"; } /* if(is_array($pkg_keys)) */ } /* if(!$pkg_info) */ ?> - </table> - </div> - </td></tr> +</tbody> </table> -<?php include("fend.inc"); ?> -</body> -</html> +<?php include("foot.inc");?>
\ No newline at end of file |