SOURCES: cacti-plugin-0.8.6j.diff (NEW)

grzegorz grzegorz at pld-linux.org
Mon Feb 12 00:58:06 CET 2007


Author: grzegorz                     Date: Sun Feb 11 23:58:06 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:


---- Files affected:
SOURCES:
   cacti-plugin-0.8.6j.diff (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/cacti-plugin-0.8.6j.diff
diff -u /dev/null SOURCES/cacti-plugin-0.8.6j.diff:1.1
--- /dev/null	Mon Feb 12 00:58:06 2007
+++ SOURCES/cacti-plugin-0.8.6j.diff	Mon Feb 12 00:58:01 2007
@@ -0,0 +1,1108 @@
+diff -Naur cacti-0.8.6j-old/auth_login.php cacti-0.8.6j/auth_login.php
+--- cacti-0.8.6j-old/auth_login.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/auth_login.php	2007-01-23 21:02:52.000000000 -0600
+@@ -111,9 +111,16 @@
+ 'Location' does not work. This seems to fix the bug for me at least... -->
+ <form name="login" method="post" action="<?php print basename($_SERVER["PHP_SELF"]);?>">
+ 
++<?php do_hook("login_before");
++
++$cacti_logo = $config['url_path'] . 'images/auth_login.gif';
++$cacti_logo = do_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
+ 	if ($_REQUEST["action"] == "login") {?>
+@@ -155,6 +162,8 @@
+ 
+ <input type="hidden" name="action" value="login">
+ 
++<?php do_hook("login_after"); ?>
++
+ </form>
+ 
+ </body>
+diff -Naur cacti-0.8.6j-old/data_sources.php cacti-0.8.6j/data_sources.php
+--- cacti-0.8.6j-old/data_sources.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/data_sources.php	2007-01-23 21:02:52.000000000 -0600
+@@ -1072,18 +1072,25 @@
+ 		foreach ($data_sources as $data_source) {
+ 			$data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
+ 			form_alternate_row_color($colors["alternate"],$colors["light"],$i); $i++;
++
++			$ds_table['data_source'] = $data_source;
++			$ds_table['data_input_name'] = $data_source['data_input_name'];
++			$ds_table['active'] = (($data_source["active"] == "on") ? "Yes" : "<span style='color: red;'>No</span>");
++			$ds_table['template_name'] = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
++			$ds_table = do_hook_function("data_sources_table", $ds_table);
++
+ 				?>
+ 				<td>
+ 					<a class='linkEditMain' href='data_sources.php?action=ds_edit&id=<?php print $data_source["local_data_id"];?>' title='<?php print $data_source["name_cache"];?>'><?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", title_trim($data_source["name_cache"], read_config_option("max_title_data_source"))); }else{ print title_trim($data_source["name_cache"], read_config_option("max_title_data_source")); } ?></a>
+ 				</td>
+ 				<td>
+-					<?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $data_source["data_input_name"]); }else{ print $data_source["data_input_name"]; } ?></a>
++					<?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $ds_table['data_input_name']); }else{ print $ds_table['data_input_name']; } ?></a>
+ 				</td>
+ 				<td>
+-					<?php print (($data_source["active"] == "on") ? "Yes" : "<span style='color: red;'>No</span>");?>
++					<?php print $ds_table['active']; ?>
+ 				</td>
+ 				<td>
+-					<?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $data_template_name); }else{ print $data_template_name; } ?></a>
++					<?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $ds_table['template_name']); }else{ print $ds_table['template_name']; } ?></a>
+ 				</td>
+ 				<td style="<?php print get_checkbox_style();?>" width="1%" align="right">
+ 					<input type='checkbox' style='margin: 0px;' name='chk_<?php print $data_source["local_data_id"];?>' title="<?php print $data_source["name_cache"];?>">
+diff -Naur cacti-0.8.6j-old/graph_image.php cacti-0.8.6j/graph_image.php
+--- cacti-0.8.6j-old/graph_image.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/graph_image.php	2007-01-23 21:02:52.000000000 -0600
+@@ -46,6 +46,8 @@
+ /* flush the headers now */
+ ob_end_flush();
+ 
++do_hook_function('graph_image');
++
+ session_write_close();
+ 
+ $graph_data_array = array();
+diff -Naur cacti-0.8.6j-old/graph.php cacti-0.8.6j/graph.php
+--- cacti-0.8.6j-old/graph.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/graph.php	2007-01-23 14:54:36.000000000 -0600
+@@ -94,6 +94,7 @@
+ 						<td valign='top' style='padding: 3px;' class='noprint'>
+ 							<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.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 do_hook('graph_buttons', array('hook' => 'view', 'local_graph_id' => $_GET["local_graph_id"], 'rra' => $rra["id"], 'view_type' => $_REQUEST["view_type"])); ?>
+ 						</td>
+ 					</tr>
+ 					<tr>
+@@ -208,6 +209,7 @@
+ 					</td>
+ 					<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>
++						<?php do_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>
+@@ -239,6 +241,7 @@
+ 					</td>
+ 					<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>
++						<?php do_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>
+@@ -259,4 +262,4 @@
+ 
+ include_once("./include/bottom_footer.php");
+ 
+-?>
++?>
+\ No newline at end of file
+diff -Naur cacti-0.8.6j-old/graphs_new.php cacti-0.8.6j/graphs_new.php
+--- cacti-0.8.6j-old/graphs_new.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/graphs_new.php	2007-01-23 21:02:52.000000000 -0600
+@@ -405,7 +405,8 @@
+ 			</td>
+ 			<td class="textInfo" rowspan="2" valign="top">
+ 				<span style="color: #c16921;">*</span><a href="host.php?action=edit&id=<?php print $_REQUEST["host_id"];?>">Edit this Host</a><br>
+-				<span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a>
++				<span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a><br>
++				<?php do_hook("graphs_new_top_links"); ?>
+ 			</td>
+ 		</tr>
+ 			<td>
+diff -Naur cacti-0.8.6j-old/graphs.php cacti-0.8.6j/graphs.php
+--- cacti-0.8.6j-old/graphs.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/graphs.php	2007-01-23 21:02:52.000000000 -0600
+@@ -47,6 +47,8 @@
+ 	4 => "Convert to Graph Template"
+ 	);
+ 
++$graph_actions = do_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 {
++			do_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;
++		do_hook_function('graphs_action_prepare', $save);
+ 	}
+ 
+ 	if (!isset($graph_array)) {
+@@ -1149,4 +1158,4 @@
+ 	print "</form>\n";
+ }
+ 
+-?>
++?>
+\ No newline at end of file
+diff -Naur cacti-0.8.6j-old/host.php cacti-0.8.6j/host.php
+--- cacti-0.8.6j-old/host.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/host.php	2007-01-23 21:02:52.000000000 -0600
+@@ -44,6 +44,8 @@
+ 	5 => "Clear Statistics"
+ 	);
+ 
++$device_actions = do_hook_function('device_action_array', $device_actions);
++
+ /* set default action */
+ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
+ 
+@@ -280,6 +282,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 {
++			do_hook_function('device_action_execute', $_POST['drp_action']); 
+ 		}
+ 
+ 		header("Location: host.php");
+@@ -385,6 +389,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());
++		do_hook_function('device_action_prepare', $save);
+ 	}
+ 
+ 	if (!isset($host_array)) {
+diff -Naur cacti-0.8.6j-old/include/auth.php cacti-0.8.6j/include/auth.php
+--- cacti-0.8.6j-old/include/auth.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/include/auth.php	2007-01-23 21:02:52.000000000 -0600
+@@ -77,7 +77,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>
+ 
+@@ -85,7 +85,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>
+@@ -93,7 +93,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='logout.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']; ?>logout.php'>Login</a> )</td>
+ 				</tr>
+ 			</table>
+ 
+diff -Naur cacti-0.8.6j-old/include/config_arrays.php cacti-0.8.6j/include/config_arrays.php
+--- cacti-0.8.6j-old/include/config_arrays.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/include/config_arrays.php	2007-01-23 21:02:52.000000000 -0600
+@@ -24,6 +24,8 @@
+  +-------------------------------------------------------------------------+
+ */
+ 
++global $menu;
++
+ $messages = array(
+ 	1  => array(
+ 		"message" => 'Save Successful.',
+@@ -452,4 +454,10 @@
+ 	GDC_SLASH => "/"
+ 	);
+ 
+-?>
++$plugin_architecture = array(
++	"version" => '1.1'
++	);
++
++do_hook("config_arrays");
++
++?>
+\ No newline at end of file
+diff -Naur cacti-0.8.6j-old/include/config_form.php cacti-0.8.6j/include/config_form.php
+--- cacti-0.8.6j-old/include/config_form.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/include/config_form.php	2007-01-23 21:02:52.000000000 -0600
+@@ -25,7 +25,8 @@
+ */
+ 
+ if (!defined("VALID_HOST_FIELDS")) {
+-	define("VALID_HOST_FIELDS", "(hostname|snmp_community|snmp_username|snmp_password|snmp_version|snmp_port|snmp_timeout)");
++	$string = do_hook_function('valid_host_fields', '(hostname|snmp_community|snmp_username|snmp_password|snmp_version|snmp_port|snmp_timeout)');
++	define("VALID_HOST_FIELDS", $string);
+ }
+ 
+ /* file: cdef.php, action: edit */
+@@ -1000,4 +1001,6 @@
+ 		)
+ 	);
+ 
+-?>
++do_hook("config_form");
++
++?>
+\ No newline at end of file
+diff -Naur cacti-0.8.6j-old/include/config.php cacti-0.8.6j/include/config.php
+--- cacti-0.8.6j-old/include/config.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/include/config.php	2007-01-23 21:02:52.000000000 -0600
+@@ -32,6 +32,22 @@
+ $database_password = "cactiuser";
+ $database_port = "3306";
+ 
++$plugins = array();
++//$plugins[] = 'thold';
++
++/* Do not edit this line */
++$config = array();
++
++
++/*
++ This is full URL Path to the Cacti installation 
++   For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/'
++   as the url path.  For just http://server/ use '/'
++*/
++
++$config['url_path'] = '/';
++
++
+ /* ----- you probably do not need to change anything below this line ----- */
+ 
+ /* Files that do not need http header information - Command line scripts */
+@@ -52,7 +68,7 @@
+ 	"ss_sql.php"
+ );
+ 
+-$config = array();
++
+ $colors = array();
+ 
+ /* this should be auto-detected, set it manually if needed */
+@@ -66,6 +82,13 @@
+ $config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__));
+ $config["include_path"] = dirname(__FILE__);
+ 
++define('URL_PATH', $config['url_path']);
++
++/* include the plugin function, we do this before everything else,
++   incase we want to add hooks to change config options */
++
++include_once($config["include_path"] . "/plugins.php");
++
+ /* colors */
+ $colors["dark_outline"] = "454E53";
+ $colors["dark_bar"] = "AEB4B7";
+@@ -169,4 +192,4 @@
+ /* current cacti version */
+ $config["cacti_version"] = "0.8.6j";
+ 
+-?>
++?>
+\ No newline at end of file
+diff -Naur cacti-0.8.6j-old/include/config_settings.php cacti-0.8.6j/include/config_settings.php
+--- cacti-0.8.6j-old/include/config_settings.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/include/config_settings.php	2007-01-23 21:02:52.000000000 -0600
+@@ -928,4 +928,6 @@
+ 		)
+ 	);
+ 
+-?>
++do_hook("config_settings");
++
++?>
+\ No newline at end of file
+diff -Naur cacti-0.8.6j-old/include/plugins.php cacti-0.8.6j/include/plugins.php
+--- cacti-0.8.6j-old/include/plugins.php	1969-12-31 17:00:00.000000000 -0700
++++ cacti-0.8.6j/include/plugins.php	2007-01-23 21:02:52.000000000 -0600
+@@ -0,0 +1,70 @@
++<?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
++ */
++function do_hook ($name) {
++    global $plugin_hooks;
++    $data = func_get_args();
++    $ret = '';
++
++    if (isset($plugin_hooks[$name]) && is_array($plugin_hooks[$name])) {
++        foreach ($plugin_hooks[$name] as $function) {
++            if (function_exists($function)) {
++                $function($data);
++            }
++        }
++    }
++
++    /* Variable-length argument lists have a slight problem when */
++    /* passing values by reference. Pity. This is a workaround.  */
++    return $data;
++}
++
++function do_hook_function($name,$parm=NULL) {
++    global $plugin_hooks;
++    $ret = $parm;
++
++    if (isset($plugin_hooks[$name])
++          && is_array($plugin_hooks[$name])) {
++        foreach ($plugin_hooks[$name] as $function) {
++            if (function_exists($function)) {
++                $ret = $function($ret);
++            }
++        }
++    }
++
++    /* Variable-length argument lists have a slight problem when */
++    /* passing values by reference. Pity. This is a workaround.  */
++    return $ret;
++}
++
++/* On startup, register all plugins configured for use. */
++if (isset($plugins) && is_array($plugins)) {
++    foreach ($plugins as $name) {
++        use_plugin($name);
++    }
++}
++
++?>
+\ No newline at end of file
+diff -Naur cacti-0.8.6j-old/include/top_graph_header.php cacti-0.8.6j/include/top_graph_header.php
+--- cacti-0.8.6j-old/include/top_graph_header.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/include/top_graph_header.php	2007-01-23 21:02:52.000000000 -0600
+@@ -97,17 +97,18 @@
+ 		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 = do_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="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
+ 
+-	<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>
++	<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>
+ </head>
+ 
+ <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
+@@ -118,13 +119,14 @@
+ 			<table width="100%" cellspacing="0" cellpadding="0">
+ 				<tr>
+ 					<td nowrap>
+-						&nbsp;<?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.gif" alt="Graphs" align="absmiddle" border="0"></a>&nbsp;
+-					</td>
++						&nbsp;<?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.gif" alt="Graphs" align="absmiddle" border="0"></a><?php
++						do_hook("top_graph_header_tabs");
++					?>&nbsp;					</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>';}?>&nbsp;&nbsp;<?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 }?>&nbsp;<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>';}?>&nbsp;&nbsp;<?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 ($_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="<?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 }?>&nbsp;<br>
+ 					</td>
+ 				</tr>
+ 			</table>
+@@ -132,7 +134,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">
+@@ -144,7 +146,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>)&nbsp;
++						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>)&nbsp;
+ 						<?php } ?>
+ 					</td>
+ 				</tr>
+@@ -152,10 +154,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>
+@@ -203,4 +205,4 @@
+ 			<?php } ?>
+ 		</td>
+ 		<?php } ?>
+-		<td valign="top">
++		<td valign="top">
+\ No newline at end of file
+diff -Naur cacti-0.8.6j-old/include/top_header.php cacti-0.8.6j/include/top_header.php
+--- cacti-0.8.6j-old/include/top_header.php	2007-01-23 21:01:57.000000000 -0600
++++ cacti-0.8.6j/include/top_header.php	2007-01-23 21:02:52.000000000 -0600
+@@ -24,20 +24,20 @@
+  +-------------------------------------------------------------------------+
+ */
+ 
+-global $colors;
++global $colors, $config;
+ ?>
+ <html>
+ <head>
+ 	<title>cacti</title>
+-	<link href="include/main.css" rel="stylesheet">
+-	<script type="text/javascript" src="include/layout.js"></script>
++	<link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
++	<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"] . "'\">";
+ 	}?>
+ </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">
+@@ -45,10 +45,11 @@
+ 			<table width="100%" cellspacing="0" cellpadding="0">
+ 				<tr>
+ 					<td valign="bottom">
+-						&nbsp;<a href="index.php"><img src="images/tab_console.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>
++						&nbsp;<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><a href="<?php echo $config['url_path']; ?>graph_view.php"><img src="<?php echo $config['url_path']; ?>images/tab_graphs.gif" alt="Console" align="absmiddle" border="0"></a><?php
++						do_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>
+@@ -56,7 +57,7 @@
+ 	</tr>
+ 	<tr height="2" bgcolor="#183c8f">
+ 		<td colspan="3">
+-			<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">
+@@ -68,7 +69,7 @@
+ 					</td>
+ 					<td align="right">
+ 						<?php if (read_config_option("global_auth") == "on") { ?>
+-						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>)&nbsp;
++						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>)&nbsp;
+ 						<?php } ?>
+ 					</td>
+ 				</tr>
+@@ -76,10 +77,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>
+@@ -89,9 +90,9 @@
+ 				<?php draw_menu();?>
+ 			</table>
+ 
+-			<img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
+-			<p align="center"><a href='about.php'><img src="images/cacti_logo.gif" border="0"></a></p>
+-			<img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
++			<img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
++			<p align="center"><a href='<?php echo $config['url_path']; ?>about.php'><img src="<?php echo $config['url_path']; ?>images/cacti_logo.gif" border="0"></a></p>
++			<img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
+ 		</td>
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list