本文整理汇总了PHP中fixifName函数的典型用法代码示例。如果您正苦于以下问题:PHP fixifName函数的具体用法?PHP fixifName怎么用?PHP fixifName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fixifName函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: makeshortif
function makeshortif($if)
{
global $rewrite_shortif;
$if = fixifName($if);
$if = strtolower($if);
$if = array_str_replace($rewrite_shortif, $if);
return $if;
}
开发者ID:arrmo,项目名称:librenms,代码行数:8,代码来源:rewrites.php
示例2: generate_ap_link
function generate_ap_link($args, $text = null, $type = null)
{
global $config;
$args = ifNameDescr($args);
if (!$text) {
$text = fixIfName($args['label']);
}
if ($type) {
$args['graph_type'] = $type;
}
if (!isset($args['graph_type'])) {
$args['graph_type'] = 'port_bits';
}
if (!isset($args['hostname'])) {
$args = array_merge($args, device_by_id_cache($args['device_id']));
}
$content = '<div class=list-large>' . $args['text'] . ' - ' . fixifName($args['label']) . '</div>';
if ($args['ifAlias']) {
$content .= $args['ifAlias'] . '<br />';
}
$content .= "<div style=\\'width: 850px\\'>";
$graph_array = array();
$graph_array['type'] = $args['graph_type'];
$graph_array['legend'] = 'yes';
$graph_array['height'] = '100';
$graph_array['width'] = '340';
$graph_array['to'] = $config['time']['now'];
$graph_array['from'] = $config['time']['day'];
$graph_array['id'] = $args['accesspoint_id'];
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $config['time']['week'];
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $config['time']['month'];
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $config['time']['year'];
$content .= generate_graph_tag($graph_array);
$content .= '</div>';
$url = generate_ap_url($args);
if (port_permitted($args['interface_id'], $args['device_id'])) {
return overlib_link($url, $text, $content, null);
} else {
return fixifName($text);
}
}
开发者ID:RobsanInc,项目名称:librenms,代码行数:44,代码来源:functions.inc.php
示例3: fixifName
$ifalias = $interface['name'];
if ($interface['ifPhysAddress']) {
$mac = "{$interface['ifPhysAddress']}";
}
$color = "black";
if ($interface['ifAdminStatus'] == "down") {
$status = "<span class='grey'>Disabled</span>";
}
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") {
$status = "<span class='red'>Enabled / Disconnected</span>";
}
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") {
$status = "<span class='green'>Enabled / Connected</span>";
}
$i = 1;
$inf = fixifName($ifname);
$bg = "#ffffff";
$show_all = 1;
echo "<div class=ifcell style='margin: 0px;'><table width=100% cellpadding=10 cellspacing=0>";
include "includes/print-interface.inc.php";
echo "</table></div>";
$pos = strpos(strtolower($ifname), "vlan");
if ($pos !== false) {
$broke = yes;
}
$pos = strpos(strtolower($ifname), "loopback");
if ($pos !== false) {
$broke = yes;
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ports` WHERE `pagpGroupIfIndex` = '" . $interface['ifIndex'] . "' and `device_id` = '" . $device['device_id'] . "'"), 0)) {
$pagp = " | <a href='" . $config['base_url'] . "/device/" . $device['device_id'] . "/interface/" . $interface['interface_id'] . "/pagp/'>PAgP</a>";
开发者ID:kyrisu,项目名称:observernms,代码行数:31,代码来源:interface.inc.php
示例4: fixifName
$this_hostname = $new['hostname'];
$this_ifname = fixifName($new['label']);
$int_links[$this_ifid] = $this_ifid;
$int_links_v4[$this_ifid] = 1;
}
}
foreach (dbFetchRows("SELECT ipv6_network_id FROM ipv6_addresses WHERE port_id = ?", array($port['port_id'])) as $net) {
$ipv6_network_id = $net['ipv6_network_id'];
$sql = "SELECT I.port_id FROM ipv6_addresses AS A, ports AS I, devices AS D\n WHERE A.port_id = I.port_id\n AND A.ipv6_network_id = ? AND D.device_id = I.device_id\n AND D.device_id != ? AND A.ipv6_origin != 'linklayer' AND A.ipv6_origin != 'wellknown'";
$array = array($net['ipv6_network_id'], $device['device_id']);
foreach (dbFetchRows($sql, $array) as $new) {
echo $new['ipv6_network_id'];
$this_ifid = $new['port_id'];
$this_hostid = $new['device_id'];
$this_hostname = $new['hostname'];
$this_ifname = fixifName($new['label']);
$int_links[$this_ifid] = $this_ifid;
$int_links_v6[$this_ifid] = 1;
}
}
}
if ($port_details && $config['enable_port_relationship'] === TRUE) {
foreach ($int_links as $int_link) {
$link_if = dbFetchRow("SELECT * from ports AS I, devices AS D WHERE I.device_id = D.device_id and I.port_id = ?", array($int_link));
echo "{$br}";
if ($int_links_phys[$int_link]) {
echo "<img align=absmiddle src='images/16/connect.png'> ";
} else {
echo "<img align=absmiddle src='images/16/bullet_go.png'> ";
}
echo "<b>" . generate_port_link($link_if, makeshortif($link_if['label'])) . " on " . generate_device_link($link_if, shorthost($link_if['hostname']));
开发者ID:REAP720801,项目名称:librenms,代码行数:31,代码来源:print-interface.inc.php
示例5: generateiflink
function generateiflink($interface, $text = 0, $type = NULL)
{
global $twoday;
global $now;
global $config;
global $day;
global $month;
$interface = ifNameDescr($interface);
if (!$text) {
$text = fixIfName($interface['label']);
}
if (isset($type)) {
$interface['graph_type'] = $type;
} else {
$interface['graph_type'] = 'port_bits';
}
if (!isset($interface['hostname'])) {
$interface = array_merge($interface, device_by_id_cache($interface['device_id']));
}
$class = ifclass($interface['ifOperStatus'], $interface['ifAdminStatus']);
$graph_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&from={$day}&to={$now}&width=400&height=100&type=" . $interface['graph_type'];
$graph_url_month = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&from={$month}&to={$now}&width=400&height=100&type=" . $interface['graph_type'];
$device_id = getifhost($interface['interface_id']);
$url = $config['base_url'] . "/device/{$device_id}/interface/" . $interface['interface_id'] . "/";
$contents = "<div class=list-large>" . $interface['hostname'] . " - " . fixifName($interface['label']) . "</div>";
if ($interface['ifAlias']) {
$contents .= htmlentities($interface['ifAlias'] . "<br />");
}
$contents .= "<img src=\\'{$graph_url}\\'><br /><img src=\\'{$graph_url_month}\\'>";
$link = overlib_link($url, $text, $contents, $class);
return $link;
}
开发者ID:kyrisu,项目名称:observernms_clean,代码行数:32,代码来源:functions.php
示例6: generate_ap_link
function generate_ap_link($args, $text = NULL, $type = NULL)
{
global $config;
if (isset($args['humanized']) == false) {
humanize_port($args);
}
if (!$text) {
$text = fixIfName($args['label']);
}
if ($type) {
$args['graph_type'] = $type;
}
if (!isset($args['graph_type'])) {
$args['graph_type'] = 'port_bits';
}
if (!isset($args['hostname'])) {
$args = array_merge($args, device_by_id_cache($args['device_id']));
}
$content = "<div class=entity-title>" . $args['text'] . " - " . fixifName($args['label']) . "</div>";
if ($args['ifAlias']) {
$content .= $args['ifAlias'] . "<br />";
}
$content .= "<div style=\\'width: 850px\\'>";
$graph_array['type'] = $args['graph_type'];
$graph_array['legend'] = "yes";
$graph_array['height'] = "100";
$graph_array['width'] = "340";
$graph_array['to'] = $config['time']['now'];
$graph_array['from'] = $config['time']['day'];
$graph_array['id'] = $args['accesspoint_id'];
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $config['time']['week'];
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $config['time']['month'];
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $config['time']['year'];
$content .= generate_graph_tag($graph_array);
$content .= "</div>";
$url = generate_ap_url($args);
if (port_permitted($args['interface_id'], $args['device_id'])) {
return overlib_link($url, $text, $content, $class);
} else {
return fixifName($text);
}
}
开发者ID:RomanBogachev,项目名称:observium,代码行数:45,代码来源:functions.inc.php
示例7: foreach
$interface_added = 0;
foreach (explode("\n", $ports) as $entry) {
$entry = trim($entry);
list($ifIndex, $ifDescr) = explode("||", $entry);
if (!strstr($entry, "irtual")) {
$if = trim(strtolower($ifDescr));
$nullintf = 0;
foreach ($config['bad_if'] as $bi) {
if (strstr($if, $bi)) {
$nullintf = 1;
}
}
if ($device['os'] == "catos" && strstr($if, "vlan")) {
$nullintf = 1;
}
$ifDescr = fixifName($ifDescr);
if (preg_match('/serial[0-9]:/', $if)) {
$nullintf = 1;
}
if (isset($config['allow_ng']) && !$config['allow_ng']) {
if (preg_match('/ng[0-9]+$/', $if)) {
$nullintf = 1;
}
}
if ($debug) {
echo "\n {$if} ";
}
if ($nullintf == 0) {
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ports` WHERE `device_id` = '" . $device['device_id'] . "' AND `ifIndex` = '{$ifIndex}'"), 0) == '0') {
mysql_query("INSERT INTO `ports` (`device_id`,`ifIndex`,`ifDescr`) VALUES ('" . $device['device_id'] . "','{$ifIndex}','{$ifDescr}')");
# Add Interface
开发者ID:kyrisu,项目名称:observernms,代码行数:31,代码来源:ports.inc.php
注:本文中的fixifName函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论