SOURCES: cacti-plugin-0.8.7b.diff (NEW)
grzegorz
grzegorz at pld-linux.org
Thu Feb 14 12:23:19 CET 2008
Author: grzegorz Date: Thu Feb 14 11:23:18 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
---- Files affected:
SOURCES:
cacti-plugin-0.8.7b.diff (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/cacti-plugin-0.8.7b.diff
diff -u /dev/null SOURCES/cacti-plugin-0.8.7b.diff:1.1
--- /dev/null Thu Feb 14 12:23:18 2008
+++ SOURCES/cacti-plugin-0.8.7b.diff Thu Feb 14 12:23:13 2008
@@ -0,0 +1,1865 @@
+diff -Naur 0.8.7-old/auth_changepassword.php 0.8.7/auth_changepassword.php
+--- 0.8.7-old/auth_changepassword.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/auth_changepassword.php 2008-02-12 09:25:57.000000000 -0600
+@@ -54,6 +54,8 @@
+ header("Location: index.php"); break;
+ case '3': /* default graph page */
+ header("Location: graph_view.php"); break;
++ default:
++ api_plugin_hook_function('login_options_navigate', $user['login_opts']);
+ }
+ }else{
+ header("Location: graph_view.php");
+diff -Naur 0.8.7-old/auth_login.php 0.8.7/auth_login.php
+--- 0.8.7-old/auth_login.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/auth_login.php 2008-02-12 09:25:57.000000000 -0600
+@@ -205,6 +205,8 @@
+ header("Location: index.php"); break;
+ case '3': /* default graph page */
+ header("Location: graph_view.php"); break;
++ default:
++ api_plugin_hook_function('login_options_navigate', $user['login_opts']);
+ }
+ exit;
+
+@@ -255,9 +257,17 @@
+ <body bgcolor="#FFFFFF" onload="document.login.login_username.focus()">
+ <form name="login" method="post" action="<?php print basename($_SERVER["PHP_SELF"]);?>">
+ <input type="hidden" name="action" value="login">
++<?php
++
++api_plugin_hook("login_before");
++
++$cacti_logo = $config['url_path'] . 'images/auth_login.gif';
++$cacti_logo = api_plugin_hook_function('cacti_image', $cacti_logo);
++
++?>
+ <table align="center">
+ <tr>
+- <td colspan="2"><img src="images/auth_login.gif" border="0" alt=""></td>
++ <td colspan="2"><center><?php if ($cacti_logo != '') { ?><img src="<?php echo $cacti_logo; ?>" border="0" alt=""><?php } ?></center></td>
+ </tr>
+ <?php
+
+@@ -310,6 +320,7 @@
+ <td><input type="submit" value="Login"></td>
+ </tr>
+ </table>
++<?php api_plugin_hook('login_after'); ?>
+ </form>
+ </body>
+ </html>
+diff -Naur 0.8.7-old/data_sources.php 0.8.7/data_sources.php
+--- 0.8.7-old/data_sources.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/data_sources.php 2008-02-12 09:25:57.000000000 -0600
+@@ -1164,6 +1164,7 @@
+ $i = 0;
+ if (sizeof($data_sources) > 0) {
+ foreach ($data_sources as $data_source) {
++ $data_source = api_plugin_hook_function('data_sources_table', $data_source);
+ $data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
+ $data_input_name = ((empty($data_source["data_input_name"])) ? "<em>External</em>" : $data_source["data_input_name"]);
+ $poller_interval = ((isset($poller_intervals[$data_source["local_data_id"]])) ? $poller_intervals[$data_source["local_data_id"]] : 0);
+diff -Naur 0.8.7-old/graph_image.php 0.8.7/graph_image.php
+--- 0.8.7-old/graph_image.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/graph_image.php 2008-02-12 09:25:57.000000000 -0600
+@@ -44,6 +44,8 @@
+ /* flush the headers now */
+ ob_end_clean();
+
++api_plugin_hook_function('graph_image');
++
+ session_write_close();
+
+ $graph_data_array = array();
+diff -Naur 0.8.7-old/graph.php 0.8.7/graph.php
+--- 0.8.7-old/graph.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/graph.php 2008-02-12 09:25:57.000000000 -0600
+@@ -98,6 +98,7 @@
+ <a href='graph.php?action=zoom&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
+ <a href='graph_xport.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
+ <a href='graph.php?action=properties&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a>
++ <?php api_plugin_hook('graph_buttons', array('hook' => 'view', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $rra['id'], 'view_type' => $_REQUEST['view_type'])); ?>
+ </td>
+ </tr>
+ <tr>
+@@ -212,6 +213,7 @@
+ <td valign='top' style='padding: 3px;' class='noprint'>
+ <a href='graph.php?action=properties&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&view_type=<?php print $_REQUEST["view_type"];?>&graph_start=<?php print $graph_start;?>&graph_end=<?php print $graph_end;?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a>
+ <a href='graph_xport.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>&graph_start=<?php print $graph_start;?>&graph_end=<?php print $graph_end;?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
++ <?php api_plugin_hook('graph_buttons', array('hook' => 'zoom', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $_GET['rra_id'], 'view_type' => $_REQUEST['view_type'])); ?>
+ </td>
+ </tr>
+ <tr>
+@@ -244,6 +246,7 @@
+ <td valign='top' style='padding: 3px;'>
+ <a href='graph.php?action=zoom&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
+ <a href='graph_xport.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
++ <?php api_plugin_hook('graph_buttons', array('hook' => 'properties', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $_GET['rra_id'], 'view_type' => $_REQUEST['view_type'])); ?>
+ </td>
+ </tr>
+ <tr>
+diff -Naur 0.8.7-old/graphs_new.php 0.8.7/graphs_new.php
+--- 0.8.7-old/graphs_new.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/graphs_new.php 2008-02-12 09:25:57.000000000 -0600
+@@ -473,7 +473,8 @@
+ </td>
+ <td nowrap style='white-space: nowrap;' class="textInfo" align="center" valign="top">
+ <span style="white-space: nowrap; color: #c16921;">*</span><a href="host.php?action=edit&id=<?php print $_REQUEST["host_id"];?>">Edit this Host</a><br>
+- <span style="white-space: nowrap; color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a>
++ <span style="white-space: nowrap; color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a><br>
++ <?php api_plugin_hook('graphs_new_top_links'); ?>
+ </td>
+ </tr>
+ </table>
+diff -Naur 0.8.7-old/graphs.php 0.8.7/graphs.php
+--- 0.8.7-old/graphs.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/graphs.php 2008-02-12 09:25:57.000000000 -0600
+@@ -45,6 +45,8 @@
+ 4 => "Convert to Graph Template"
+ );
+
++$graph_actions = api_plugin_hook_function('graphs_action_array', $graph_actions);
++
+ /* set default action */
+ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
+
+@@ -357,8 +359,10 @@
+ input_validate_input_number($selected_items[$i]);
+ /* ==================================================== */
+
+- api_resize_graphs($selected_items[$i], $_POST["graph_width"], $_POST["graph_height"]);
++ api_resize_graphs($selected_items[$i], $_POST['graph_width'], $_POST['graph_height']);
+ }
++ } else {
++ api_plugin_hook_function('graphs_action_execute', $_POST['drp_action']);
+ }
+
+ header("Location: graphs.php");
+@@ -499,6 +503,11 @@
+ </td>
+ </tr>\n
+ ";
++ } else {
++ $save['drp_action'] = $_POST['drp_action'];
++ $save['graph_list'] = $graph_list;
++ $save['graph_array'] = $graph_array;
++ api_plugin_hook_function('graphs_action_prepare', $save);
+ }
+
+ if (!isset($graph_array)) {
+diff -Naur 0.8.7-old/host.php 0.8.7/host.php
+--- 0.8.7-old/host.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/host.php 2008-02-12 09:25:57.000000000 -0600
+@@ -44,6 +44,8 @@
+ 6 => "Change Availability Options"
+ );
+
++$device_actions = api_plugin_hook_function('device_action_array', $device_actions);
++
+ /* set default action */
+ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
+
+@@ -309,6 +311,8 @@
+
+ api_tree_item_save(0, $_POST["tree_id"], TREE_ITEM_TYPE_HOST, $_POST["tree_item_id"], "", 0, read_graph_config_option("default_rra_id"), $selected_items[$i], 1, 1, false);
+ }
++ } else {
++ api_plugin_hook_function('device_action_execute', $_POST['drp_action']);
+ }
+
+ header("Location: host.php");
+@@ -445,6 +449,11 @@
+ </tr>\n
+ <input type='hidden' name='tree_id' value='" . $matches[1] . "'>\n
+ ";
++ } else {
++ $save['drp_action'] = $_POST['drp_action'];
++ $save['host_list'] = $host_list;
++ $save['host_array'] = (isset($host_array)? $host_array : array());
++ api_plugin_hook_function('device_action_prepare', $save);
+ }
+
+ if (!isset($host_array)) {
+diff -Naur 0.8.7-old/include/auth.php 0.8.7/include/auth.php
+--- 0.8.7-old/include/auth.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/include/auth.php 2008-02-12 09:33:30.000000000 -0600
+@@ -31,6 +31,9 @@
+ }
+
+ if (read_config_option("auth_method") != 0) {
++ /* handle alternate authentication realms */
++ do_hook_function('auth_alternate_realms');
++
+ /* handle change password dialog */
+ if ((isset($_SESSION['sess_change_password'])) && (read_config_option("webbasic_enabled") != "on")) {
+ header ("Location: auth_changepassword.php?ref=" . (isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "index.php"));
+@@ -75,7 +78,7 @@
+ <html>
+ <head>
+ <title>Cacti</title>
+- <link href="include/main.css" rel="stylesheet">
++ <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
+ </style>
+ </head>
+
+@@ -83,7 +86,7 @@
+
+ <table width="450" align='center'>
+ <tr>
+- <td colspan='2'><img src='images/auth_deny.gif' border='0' alt='Access Denied'></td>
++ <td colspan='2'><img src='<?php echo $config['url_path']; ?>images/auth_deny.gif' border='0' alt='Access Denied'></td>
+ </tr>
+ <tr height='10'><td></td></tr>
+ <tr>
+@@ -91,7 +94,7 @@
+ need access to this particular section, please contact the Cacti administrator.</td>
+ </tr>
+ <tr>
+- <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='index.php'>Login</a> )</td>
++ <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='<?php echo $config['url_path']; ?>index.php'>Login</a> )</td>
+ </tr>
+ </table>
+
+diff -Naur 0.8.7-old/include/global_arrays.php 0.8.7/include/global_arrays.php
+--- 0.8.7-old/include/global_arrays.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/include/global_arrays.php 2008-02-12 09:25:57.000000000 -0600
+@@ -22,6 +22,8 @@
+ +-------------------------------------------------------------------------+
+ */
+
++global $menu;
++
+ $messages = array(
+ 1 => array(
+ "message" => 'Save Successful.',
+@@ -611,4 +613,10 @@
+ GDC_SLASH => "/"
+ );
+
++$plugin_architecture = array(
++ 'version' => '2.0'
++ );
++
++api_plugin_hook('config_arrays');
++
+ ?>
+diff -Naur 0.8.7-old/include/global_form.php 0.8.7/include/global_form.php
+--- 0.8.7-old/include/global_form.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/include/global_form.php 2008-02-12 09:25:57.000000000 -0600
+@@ -22,8 +22,9 @@
+ +-------------------------------------------------------------------------+
+ */
+
+-if (!defined("VALID_HOST_FIELDS")) {
+- define("VALID_HOST_FIELDS", "(hostname|snmp_community|snmp_username|snmp_password|snmp_auth_protocol|snmp_priv_passphrase|snmp_priv_protocol|snmp_context|snmp_version|snmp_port|snmp_timeout)");
++if (!defined('VALID_HOST_FIELDS')) {
++ $string = api_plugin_hook_function('valid_host_fields', '(hostname|snmp_community|snmp_username|snmp_password|snmp_auth_protocol|snmp_priv_passphrase|snmp_priv_protocol|snmp_context|snmp_version|snmp_port|snmp_timeout)');
++ define('VALID_HOST_FIELDS', $string);
+ }
+
+ /* file: cdef.php, action: edit */
+@@ -1154,4 +1155,6 @@
+ )
+ );
+
++api_plugin_hook('config_form');
++
+ ?>
+diff -Naur 0.8.7-old/include/global.php 0.8.7/include/global.php
+--- 0.8.7-old/include/global.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/include/global.php 2008-02-12 09:25:57.000000000 -0600
+@@ -41,6 +41,12 @@
+ /* Default session name - Session name must contain alpha characters */
+ $cacti_session_name = "Cacti";
+
++$plugins = array();
++//$plugins[] = 'thold';
++
++/* Do not edit this line */
++$config = array();
++
+ /* Include configuration */
+ include(dirname(__FILE__) . "/config.php");
+
+@@ -73,7 +79,6 @@
+ "rebuild_poller_cache.php"
+ );
+
+-$config = array();
+ $colors = array();
+
+ /* this should be auto-detected, set it manually if needed */
+@@ -179,18 +184,24 @@
+ /* display ALL errors */
+ error_reporting(E_ALL);
+
++/* current cacti version */
++$config["cacti_version"] = "0.8.7b";
++
+ /* include base modules */
+ include($config["library_path"] . "/adodb/adodb.inc.php");
+ include($config["library_path"] . "/database.php");
+-include_once($config["library_path"] . "/functions.php");
+-include_once($config["include_path"] . "/global_constants.php");
+-include_once($config["include_path"] . "/global_arrays.php");
+-include_once($config["include_path"] . "/global_settings.php");
+
+ /* connect to the database server */
+ db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
+
+ /* include additional modules */
++
++include_once($config["library_path"] . "/functions.php");
++include_once($config["include_path"] . "/global_constants.php");
++include_once($config["library_path"] . "/plugins.php");
++include_once($config["include_path"] . "/plugins.php");
++include_once($config["include_path"] . "/global_arrays.php");
++include_once($config["include_path"] . "/global_settings.php");
+ include_once($config["include_path"] . "/global_form.php");
+ include_once($config["library_path"] . "/html.php");
+ include_once($config["library_path"] . "/html_form.php");
+@@ -198,8 +209,6 @@
+ include_once($config["library_path"] . "/html_validate.php");
+ include_once($config["library_path"] . "/variables.php");
+ include_once($config["library_path"] . "/auth.php");
++include_once($config["library_path"] . "/auth.php");
+
+-/* current cacti version */
+-$config["cacti_version"] = "0.8.7b";
+-
+-?>
++?>
+\ No newline at end of file
+diff -Naur 0.8.7-old/include/global_settings.php 0.8.7/include/global_settings.php
+--- 0.8.7-old/include/global_settings.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/include/global_settings.php 2008-02-12 09:25:57.000000000 -0600
+@@ -1083,4 +1083,6 @@
+ )
+ );
+
++api_plugin_hook('config_settings');
++
+ ?>
+diff -Naur 0.8.7-old/include/plugins.php 0.8.7/include/plugins.php
+--- 0.8.7-old/include/plugins.php 1969-12-31 17:00:00.000000000 -0700
++++ 0.8.7/include/plugins.php 2008-02-12 09:25:57.000000000 -0600
+@@ -0,0 +1,47 @@
++<?php
++
++/*
++ * Copyright (c) 1999-2005 The SquirrelMail Project Team (http://squirrelmail.org)
++ * Licensed under the GNU GPL. For full terms see the file COPYING.
++ */
++
++global $plugin_hooks;
++$plugin_hooks = array();
++
++function use_plugin ($name) {
++ global $config;
++ if (file_exists($config['base_path'] . "/plugins/$name/setup.php")) {
++ include_once($config['base_path'] . "/plugins/$name/setup.php");
++ $function = "plugin_init_$name";
++ if (function_exists($function)) {
++ $function();
++ }
++ }
++}
++
++/**
++ * This function executes a hook.
++ * @param string $name Name of hook to fire
++ * @return mixed $data
++ */
++
++/* On startup, register all plugins configured for use. */
++if (isset($plugins) && is_array($plugins)) {
++ foreach ($plugins as $name) {
++ use_plugin($name);
++ }
++}
++
++if (isset($_SERVER['DOCUMENT_ROOT']) && isset($_SERVER['REMOTE_ADDR'])) {
++ $config['url_path'] = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']), strlen(__FILE__) - strlen($_SERVER['DOCUMENT_ROOT']) - strlen('include/plugins.php'));
++ db_execute("REPLACE INTO settings (name, value) VALUES ('url_path', '" . $config['url_path'] . "')");
++} else {
++ $config['url_path'] = db_fetch_cell("SELECT value FROM settings WHERE name = 'url_path'");
++}
++
++define('URL_PATH', $config['url_path']);
++
++
++
++
++
+diff -Naur 0.8.7-old/include/top_graph_header.php 0.8.7/include/top_graph_header.php
+--- 0.8.7-old/include/top_graph_header.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/include/top_graph_header.php 2008-02-12 09:25:57.000000000 -0600
+@@ -25,6 +25,11 @@
+ $using_guest_account = false;
+ $show_console_tab = true;
+
++$newtop = api_plugin_hook_function('top_graph_header', false);
++if ($newtop == true) {
++ return;
++}
++
+ /* ================= input validation ================= */
+ input_validate_input_number(get_request_var_request("local_graph_id"));
+ /* ==================================================== */
+@@ -92,26 +97,30 @@
+ }
+ }
+
++$page_title = api_plugin_hook_function('page_title', 'Cacti');
++
+ ?>
+ <html>
+ <head>
+- <title>Cacti</title>
++ <title><?php echo $page_title; ?></title>
+ <?php if (isset($_SESSION["custom"])) {
+ if ($_SESSION["custom"]) {
+ print "<meta http-equiv=refresh content='99999'>\r\n";
+ }else{
+- print "<meta http-equiv=refresh content='" . read_graph_config_option("page_refresh") . "'>\r\n";
++ $refresh = api_plugin_hook_function('top_graph_refresh', read_graph_config_option('page_refresh'));
++ print "<meta http-equiv=refresh content='" . $refresh . "'>\r\n";
+ }
+ }
+ ?>
+- <link href="include/main.css" rel="stylesheet">
+- <link href="images/favicon.ico" rel="shortcut icon"/>
+- <script type="text/javascript" src="include/layout.js"></script>
+- <script type="text/javascript" src="include/treeview/ua.js"></script>
+- <script type="text/javascript" src="include/treeview/ftiens4.js"></script>
+- <script type="text/javascript" src="include/jscalendar/calendar.js"></script>
+- <script type="text/javascript" src="include/jscalendar/lang/calendar-en.js"></script>
+- <script type="text/javascript" src="include/jscalendar/calendar-setup.js"></script>
++ <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
++ <link href="<?php echo $config['url_path']; ?>images/favicon.ico" rel="shortcut icon"/>
++ <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
++ <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ua.js"></script>
++ <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ftiens4.js"></script>
++ <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar.js"></script>
++ <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/lang/calendar-en.js"></script>
++ <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar-setup.js"></script>
++ <?php api_plugin_hook('page_head'); ?>
+ </head>
+
+ <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
+@@ -123,13 +132,15 @@
+ <table width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td nowrap>
+- <?php if ($show_console_tab == true) {?><a href="index.php"><img src="images/tab_console.gif" alt="Console" align="absmiddle" border="0"></a><?php }?><a href="graph_view.php"><img src="images/tab_graphs<?php if ((substr(basename($_SERVER["PHP_SELF"]),0,5) == "graph") || (basename($_SERVER["PHP_SELF"]) == "graph_settings.php")) { print "_down"; } print ".gif";?>" alt="Graphs" align="absmiddle" border="0"></a>
++ <?php if ($show_console_tab == true) {?><a href="<?php echo $config['url_path']; ?>index.php"><img src="<?php echo $config['url_path']; ?>images/tab_console.gif" alt="Console" align="absmiddle" border="0"></a><?php }?><a href="<?php echo $config['url_path']; ?>graph_view.php"><img src="<?php echo $config['url_path']; ?>images/tab_graphs<?php if ((substr(basename($_SERVER["PHP_SELF"]),0,5) == "graph") || (basename($_SERVER["PHP_SELF"]) == "graph_settings.php")) { print "_down"; } print ".gif";?>" alt="Graphs" align="absmiddle" border="0"></a><?php
++ api_plugin_hook('top_graph_header_tabs');
++ ?>
+ </td>
+ <td>
+- <img src="images/cacti_backdrop2.gif" align="absmiddle">
++ <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop2.gif" align="absmiddle">
+ </td>
+ <td align="right" nowrap>
+- <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="graph_settings.php"><img src="images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="graph_view.php?action=tree"><img src="images/tab_mode_tree<?php if ($_REQUEST["action"] == "tree") { print "_down"; }?>.gif" border="0" title="Tree View" alt="Tree View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) {?><a href="graph_view.php?action=list"><img src="images/tab_mode_list<?php if ($_REQUEST["action"] == "list") { print "_down"; }?>.gif" border="0" title="List View" alt="List View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user
["show_preview"] == "on")) {?><a href="graph_view.php?action=preview"><img src="images/tab_mode_preview<?php if ($_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a><?php }?> <br>
++ <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="' . $config['url_path'] . 'graph_settings.php"><img src="' . $config['url_path'] . 'images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=tree"><img src="<?php echo $config['url_path']; ?>images/tab_mode_tree<?php if ($_REQUEST["action"] == "tree") { print "_down"; }?>.gif" border="0" title="Tree View" alt="Tree View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=list"><img src="<?php echo $config['url_path']; ?>images/tab_mode_list<?php if ($_REQU
EST["action"] == "list") { print "_down"; }?>.gif" border="0" title="List View" alt="List View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_preview"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=preview"><img src="<?php echo $config['url_path']; ?>images/tab_mode_preview<?php if ($_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a><?php }?> <br>
+ </td>
+ </tr>
+ </table>
+@@ -137,7 +148,7 @@
+ </tr>
+ <tr height="2" colspan="2" bgcolor="#183c8f" class="noprint">
+ <td colspan="2">
+- <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
++ <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
+ </td>
+ </tr>
+ <tr height="5" bgcolor="#e9e9e9" class="noprint">
+@@ -149,7 +160,7 @@
+ </td>
+ <td align="right">
+ <?php if ((isset($_SESSION["sess_user_id"])) && ($using_guest_account == false)) { ?>
+- Logged in as <strong><?php print db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);?></strong> (<a href="logout.php">Logout</a>)
++ Logged in as <strong><?php print db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);?></strong> (<a href="<?php echo $config['url_path']; ?>logout.php">Logout</a>)
+ <?php } ?>
+ </td>
+ </tr>
+@@ -157,10 +168,10 @@
+ </td>
+ </tr>
+ <tr class="noprint">
+- <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
+- <img src="images/transparent_line.gif" width="<?php print read_graph_config_option("default_dual_pane_width");?>" height="2" border="0"><br>
++ <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
++ <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="<?php print read_graph_config_option("default_dual_pane_width");?>" height="2" border="0"><br>
+ </td>
+- <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;">
++ <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;">
+
+ </td>
+ </tr>
+diff -Naur 0.8.7-old/include/top_header.php 0.8.7/include/top_header.php
+--- 0.8.7-old/include/top_header.php 2008-02-12 08:39:56.000000000 -0600
++++ 0.8.7/include/top_header.php 2008-02-12 09:25:57.000000000 -0600
+@@ -22,21 +22,30 @@
+ +-------------------------------------------------------------------------+
+ */
+
+-global $colors;
++global $colors, $config;
++
++$newtop = api_plugin_hook_function('top_header', false);
++if ($newtop == true) {
++ return;
++}
++
++$page_title = api_plugin_hook_function('page_title', 'Cacti');
++
+ ?>
+ <html>
+ <head>
+- <title>Cacti</title>
+- <link href="include/main.css" rel="stylesheet">
+- <link href="images/favicon.ico" rel="shortcut icon"/>
+- <script type="text/javascript" src="include/layout.js"></script>
++ <title><?php echo $page_title; ?></title>
++ <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
++ <link href="<?php echo $config['url_path']; ?>images/favicon.ico" rel="shortcut icon"/>
++ <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
+ <?php if (isset($refresh)) {
+ print "<meta http-equiv=refresh content=\"" . $refresh["seconds"] . "; url='" . $refresh["page"] . "'\">";
+- }?>
++ }
++ api_plugin_hook('page_head'); ?>
+ </style>
+ </head>
+
+-<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/left_border.gif">
++<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="<?php echo $config['url_path']; ?>images/left_border.gif">
+
+ <table width="100%" cellspacing="0" cellpadding="0">
+ <tr height="37" bgcolor="#a9a9a9">
+@@ -44,10 +53,11 @@
+ <table width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td valign="bottom">
+- <a href="index.php"><img src="images/tab_console_down.gif" alt="Console" align="absmiddle" border="0"></a><a href="graph_view.php"><img src="images/tab_graphs.gif" alt="Graphs" align="absmiddle" border="0"></a>
+- </td>
++ <a href="<?php echo $config['url_path']; ?>index.php"><img src="<?php echo $config['url_path']; ?>images/tab_console_down.gif" alt="Console" align="absmiddle" border="0"></a><a href="<?php echo $config['url_path']; ?>graph_view.php"><img src="<?php echo $config['url_path']; ?>images/tab_graphs.gif" alt="Graphs" align="absmiddle" border="0"></a><?php
++ api_plugin_hook('top_header_tabs');
++ ?></td>
+ <td align="right">
+- <img src="images/cacti_backdrop.gif" align="absmiddle">
++ <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop.gif" align="absmiddle">
+ </td>
+ </tr>
+ </table>
+@@ -55,7 +65,7 @@
+ </tr>
+ <tr height="2" bgcolor="#183c8f">
+ <td colspan="3">
+- <img src="images/transparent_line.gif" height="2" border="0"><br>
++ <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" height="2" border="0"><br>
+ </td>
+ </tr>
+ <tr height="5" bgcolor="#e9e9e9">
+@@ -67,7 +77,7 @@
+ </td>
+ <td align="right">
+ <?php if (read_config_option("auth_method") != 0) { ?>
+- Logged in as <strong><?php print db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);?></strong> (<a href="logout.php">Logout</a>)
++ Logged in as <strong><?php print db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);?></strong> (<a href="<?php echo $config['url_path']; ?>logout.php">Logout</a>)
+ <?php } ?>
+ </td>
+ </tr>
+@@ -75,10 +85,10 @@
+ </td>
+ </tr>
+ <tr>
+- <td bgcolor="#f5f5f5" colspan="1" height="8" width="135" style="background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
+- <img src="images/transparent_line.gif" width="135" height="2" border="0"><br>
+- </td>
+- <td colspan="2" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
++ <td bgcolor="#f5f5f5" colspan="1" height="8" width="135" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
++ <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="2" border="0"><br>
++ </td>
++ <td colspan="2" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
+
+ </td>
+ </tr>
+@@ -88,9 +98,9 @@
<<Diff was trimmed, longer than 597 lines>>
More information about the pld-cvs-commit
mailing list