Add page title changing infrastructure, do it for device tabs already

git-svn-id: http://www.observium.org/svn/observer/trunk@2690 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-10-18 14:27:21 +00:00
parent b08d6377fa
commit ab2668981c
22 changed files with 53 additions and 1 deletions
+10
View File
@@ -312,7 +312,17 @@ $('INPUT.auto-hint, TEXTAREA.auto-hint').focus(function() {
$(this).removeClass('auto-hint');
}
});
</script>
<?php
if (is_array($pagetitle))
{
array_unshift($pagetitle,$config['page_title']);
$title = join(" - ",$pagetitle);
echo("<script type=\"text/javascript\">\ndocument.title = '$title';\n</script>");
}
?>
</body>
</html>
+2
View File
@@ -22,6 +22,8 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
$device = device_by_id_cache($vars['device']);
$attribs = get_dev_attribs($device['device_id']);
$pagetitle[] = $device['hostname'];
if ($config['os'][$device['os']]['group']) { $device['os_group'] = $config['os'][$device['os']]['group']; }
echo('<table style="margin: 0px 7px 7px 7px;" cellspacing="0" class="devicetable" width="99%">');
+2
View File
@@ -37,4 +37,6 @@ if (is_file("pages/device/apps/".mres($vars['app']).".inc.php"))
include("pages/device/apps/".mres($vars['app']).".inc.php");
}
$pagetitle[] = "Apps";
?>
+1
View File
@@ -108,4 +108,5 @@ print_optionbar_end();
}
$pagetitle[] = "CollectD";
?>
+2
View File
@@ -53,4 +53,6 @@ if ($_SESSION['userlevel'] < '7')
}
}
$pagetitle[] = "Settings";
?>
+1 -1
View File
@@ -13,7 +13,7 @@ if ($_POST['editing'])
#FIXME needs more sanity checking! and better feedback
$update = array('community' => $_POST['community'], 'snmpver' => $_POST['snmpver'], 'port' => $_POST['port']);
if ($_POST['timeout']) { $update['timeout'] = $_POST['timeout']; } else { $update['timeout'] = array('NULL'); }
if ($_POST['retries']) { $update['retries'] = $_POST['retries']; } else { $update['retries'] = array('NULL'); }
if ($_POST['retries']) { $update['retries'] = $_POST['retries']; } else { $update['retries'] = array('NULL'); }
$rows_updated = dbUpdate($update, 'devices', '`device_id` = ?',array($device['device_id']));
+2
View File
@@ -87,4 +87,6 @@ $ent['entPhysicalIndex'] = "0";
printEntPhysical($ent['entPhysicalIndex'], $level, "liOpen");
echo("</ul></div>");
$pagetitle = "Inventory";
?>
+2
View File
@@ -10,4 +10,6 @@ foreach ($entries as $entry)
echo('</table>');
$pagetitle[] = "Events";
?>
+2
View File
@@ -60,4 +60,6 @@ foreach ($config['graph_types']['device'] as $graph => $entry)
}
}
$pagetitle[] = "Graphs";
?>
+2
View File
@@ -79,4 +79,6 @@ if (is_file("pages/device/health/".mres($vars['metric']).".inc.php"))
}
}
$pagetitle[] = "Health";
?>
+2
View File
@@ -63,4 +63,6 @@ foreach (dbFetchRows("SELECT * FROM `hrDevice` WHERE `device_id` = ? ORDER BY `h
echo('</table>');
$pagetitle[] = "Inventory";
?>
+2
View File
@@ -56,4 +56,6 @@ if($vars['view'] == "incoming")
}
$pagetitle[] = "Latency";
?>
+4
View File
@@ -2,3 +2,7 @@
<object data="map.php?device=<?php echo($device['device_id']); ?>&format=svg" type="image/svg+xml" style="width: 100%; height:100%">
</object>
</center>
<?php
$pagetitle[] = "Map";
?>
+2
View File
@@ -13,4 +13,6 @@ foreach ($datas as $name=>$type)
include("includes/print-device-graph.php");
}
$pagetitle[] = "Netflow";
?>
+2
View File
@@ -113,4 +113,6 @@ if ($vars['view'] == 'minigraphs')
echo("</table></div>");
}
$pagetitle[] = "Ports";
?>
+2
View File
@@ -13,6 +13,8 @@ $type_text['vrf'] = "VRFs";
print_optionbar_start();
$pagetitle[] = "Routing";
echo("<span style='font-weight: bold;'>Routing</span> &#187; ");
unset($sep);
+2
View File
@@ -62,4 +62,6 @@ else
echo("No Services");
}
$pagetitle[] = "Services";
?>
+3
View File
@@ -86,4 +86,7 @@ if ($_SESSION['userlevel'] >= "7")
#$geshi->set_line_style('color: #999999');
echo($geshi->parse_code());
}
$pagetitle[] = "Config";
?>
+2
View File
@@ -49,4 +49,6 @@ echo("<table cellspacing=0 cellpadding=2 width=100%>");
foreach (dbFetchRows($sql, $param) as $entry) { include("includes/print-syslog.inc.php"); }
echo("</table>");
$pagetitle[] = "Syslog";
?>
+2
View File
@@ -4,5 +4,7 @@ $graph_title = "Toner";
$graph_type = "device_toner";
include("includes/print-device-graph.php");
$pagetitle[] = "Toner";
?>
+2
View File
@@ -68,4 +68,6 @@ foreach (dbFetchRows("SELECT * FROM `vlans` WHERE `device_id` = ? ORDER BY 'vlan
echo("</table>");
$pagetitle[] = "VLANs";
?>
+2
View File
@@ -12,4 +12,6 @@ foreach (dbFetchRows("SELECT * FROM vminfo WHERE device_id = ? ORDER BY vmwVmDis
echo("</table>");
$pagetitle[] = "Virtual Machines";
?>