mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	revert the context_name changes to snmp.inc.php and use the same method as other parts of the code
		
			
				
	
	
		
			53 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
$no_refresh = true;
 | 
						|
 | 
						|
$pagetitle[] = 'Search';
 | 
						|
 | 
						|
$sections = array(
 | 
						|
    'ipv4' => 'IPv4 Address',
 | 
						|
    'ipv6' => 'IPv6 Address',
 | 
						|
    'mac'  => 'MAC Address',
 | 
						|
    'arp'  => 'ARP Table',
 | 
						|
    'fdb'  => 'FDB Table'
 | 
						|
);
 | 
						|
 | 
						|
if (dbFetchCell('SELECT 1 from `packages` LIMIT 1')) {
 | 
						|
    $sections['packages'] = 'Packages';
 | 
						|
}
 | 
						|
 | 
						|
if (!isset($vars['search'])) {
 | 
						|
    $vars['search'] = 'ipv4';
 | 
						|
}
 | 
						|
 | 
						|
print_optionbar_start('', '');
 | 
						|
 | 
						|
echo '<span style="font-weight: bold;">Search</span> » ';
 | 
						|
 | 
						|
unset($sep);
 | 
						|
foreach ($sections as $type => $texttype) {
 | 
						|
    echo $sep;
 | 
						|
    if ($vars['search'] == $type) {
 | 
						|
        echo "<span class='pagemenu-selected'>";
 | 
						|
    }
 | 
						|
 | 
						|
    // echo('<a href="search/' . $type . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $texttype .'</a>');
 | 
						|
    echo generate_link($texttype, array('page' => 'search', 'search' => $type));
 | 
						|
 | 
						|
    if ($vars['search'] == $type) {
 | 
						|
        echo '</span>';
 | 
						|
    }
 | 
						|
 | 
						|
    $sep = ' | ';
 | 
						|
}
 | 
						|
 | 
						|
unset($sep);
 | 
						|
 | 
						|
print_optionbar_end();
 | 
						|
 | 
						|
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']);
 | 
						|
}
 |