librenms-librenms/html/pages/search.inc.php

51 lines
1.1 KiB
PHP
Raw Normal View History

<?php
2015-07-13 20:10:26 +02:00
$pagetitle[] = 'Search';
2015-07-13 20:10:26 +02:00
$sections = array(
'ipv4' => 'IPv4 Address',
'ipv6' => 'IPv6 Address',
'mac' => 'MAC Address',
'arp' => 'ARP Table',
);
2015-07-13 20:10:26 +02:00
if (dbFetchCell('SELECT 1 from `packages` LIMIT 1')) {
$sections['packages'] = 'Packages';
}
2015-07-13 20:10:26 +02:00
if (!isset($vars['search'])) {
$vars['search'] = 'ipv4';
}
print_optionbar_start('', '');
2015-07-13 20:10:26 +02:00
echo '<span style="font-weight: bold;">Search</span> &#187; ';
unset($sep);
2015-07-13 20:10:26 +02:00
foreach ($sections as $type => $texttype) {
echo $sep;
if ($vars['search'] == $type) {
echo "<span class='pagemenu-selected'>";
}
2015-07-13 20:10:26 +02:00
// echo('<a href="search/' . $type . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $texttype .'</a>');
echo generate_link($texttype, array('page' => 'search', 'search' => $type));
2015-07-13 20:10:26 +02:00
if ($vars['search'] == $type) {
echo '</span>';
}
2015-07-13 20:10:26 +02:00
$sep = ' | ';
}
2015-07-13 20:10:26 +02:00
unset($sep);
print_optionbar_end('', '');
2015-07-13 20:10:26 +02:00
if (file_exists('pages/search/'.$vars['search'].'.inc.php')) {
include 'pages/search/'.$vars['search'].'.inc.php';
}
else {
echo report_this('Unknown search type '.$vars['search']);
}