diff --git a/doc/Support/Configuration.md b/doc/Support/Configuration.md index 4ef27c2c0..99d0eac66 100644 --- a/doc/Support/Configuration.md +++ b/doc/Support/Configuration.md @@ -126,6 +126,10 @@ $config['show_locations_dropdown'] = 1; # Enable Locations dropdown on menu $config['show_services'] = 0; # Enable Services on menu $config['int_customers'] = 1; # Enable Customer Port Parsing $config['customers_descr'] = 'cust'; // The description to look for in ifDescr. Can be an array as well array('cust','cid'); +$config['transit_descr'] = ""; // Add custom transit descriptions (can be an array) +$config['peering_descr'] = ""; // Add custom peering descriptions (can be an array) +$config['core_descr'] = ""; // Add custom core descriptions (can be an array) +$config['custom_descr'] = ""; // Add custom interface descriptions (can be an array) $config['int_transit'] = 1; # Enable Transit Types $config['int_peering'] = 1; # Enable Peering Types $config['int_core'] = 1; # Enable Core Port Types diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index b3cd1787b..fca63777b 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -235,6 +235,15 @@ if ($_SESSION['userlevel'] >= '5') if ($config['int_peering']) { echo('
  • Peering
  • '); $ifbreak = 1; } if ($config['int_peering'] && $config['int_transit']) { echo('
  • Peering + Transit
  • '); $ifbreak = 1; } if ($config['int_core']) { echo('
  • Core
  • '); $ifbreak = 1; } + if (is_array($config['custom_descr']) === FALSE) { + $config['custom_descr'] = array($config['custom_descr']); + } + foreach ($config['custom_descr'] as $custom_type) { + if (!empty($custom_type)) { + echo '
  • ' . ucfirst($custom_type) . '
  • '; + $ifbreak = 1; + } + } } if ($ifbreak) { diff --git a/html/pages/iftype.inc.php b/html/pages/iftype.inc.php index 3935e7105..ba48f6cd1 100644 --- a/html/pages/iftype.inc.php +++ b/html/pages/iftype.inc.php @@ -7,6 +7,16 @@ if ($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg = "#ffffff"; } $type_where = " ("; foreach (explode(",", $vars['type']) as $type) { + if (is_array($config[$type."_descr"]) === FALSE) { + $config[$type."_descr"] = array($config[$type."_descr"]); + } + foreach ($config[$type."_descr"] as $additional_type) { + if(!empty($additional_type)) { + $type_where .= " $or `port_descr_type` = ?"; + $or = "OR"; + $type_param[] = $additional_type; + } + } $type_where .= " $or `port_descr_type` = ?"; $or = "OR"; $type_param[] = $type; diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index fc56cb2aa..7e633a08e 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -129,6 +129,10 @@ $config['old_graphs'] = 1; // RRDfiles from before the great rra r $config['int_customers'] = 1; # Enable Customer Port Parsing $config['customers_descr'] = 'cust'; +$config['transit_descr'] = ""; // Add custom transit descriptions (can be an array) +$config['peering_descr'] = ""; // Add custom peering descriptions (can be an array) +$config['core_descr'] = ""; // Add custom core descriptions (can be an array) +$config['custom_descr'] = ""; // Add custom interface descriptions (can be an array) $config['int_transit'] = 1; # Enable Transit Types $config['int_peering'] = 1; # Enable Peering Types $config['int_core'] = 1; # Enable Core Port Types