Merge pull request #1125 from laf/issue-1033

Added ability to customise ports transit/peering/core/custom descr
This commit is contained in:
Daniel Preussker
2015-05-25 06:54:05 +00:00
4 changed files with 27 additions and 0 deletions
+9
View File
@@ -235,6 +235,15 @@ if ($_SESSION['userlevel'] >= '5')
if ($config['int_peering']) { echo(' <li><a href="iftype/type=peering/"><i class="fa fa-user-plus fa-fw fa-lg"></i> Peering</a></li>'); $ifbreak = 1; }
if ($config['int_peering'] && $config['int_transit']) { echo(' <li><a href="iftype/type=peering,transit/"><i class="fa fa-user-secret fa-fw fa-lg"></i> Peering + Transit</a></li>'); $ifbreak = 1; }
if ($config['int_core']) { echo(' <li><a href="iftype/type=core/"><i class="fa fa-anchor fa-fw fa-lg"></i> Core</a></li>'); $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 ' <li><a href="iftype/type=' . strtolower($custom_type) . '"><i class="fa fa-connectdevelop fa-fw fa-lg"></i> ' . ucfirst($custom_type) . '</a></li>';
$ifbreak = 1;
}
}
}
if ($ifbreak) {
+10
View File
@@ -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;