/*
+-------------------------------------------------------------------------+
| Copyright (C) 2002 Ian Berry |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| cacti: the rrdtool frontend [php-auth, php-tree, php-form] |
+-------------------------------------------------------------------------+
| This code is currently maintained and debugged by Ian Berry, any |
| questions or comments regarding this code should be directed to: |
| - iberry@raxnet.net |
+-------------------------------------------------------------------------+
| - raXnet - http://www.raxnet.net/ |
+-------------------------------------------------------------------------+
*/?>
$section = "Add/Edit Graphs"; include ('include/auth.php');
header("Cache-control: no-cache");
include_once ('include/form.php');
if (isset($form[action])) { $action = $form[action]; } else { $action = $args[action]; }
if (isset($form[ID])) { $id = $form[ID]; } else { $id = $args[id]; }
function draw_main_form_select() {
global $colors, $args;?>
|
|
}
function draw_graph_form_select($main_action) {
global $colors, $args; ?>
}
switch ($action) {
case 'item_remove':
db_execute("delete from graph_templates_item where id=$args[graph_template_item_id]");
header ("Location: graphs.php?action=item&local_graph_id=$args[local_graph_id]");
break;
case 'item_save':
$save["id"] = $form["graph_template_item_id"];
$save["graph_template_id"] = $form["graph_template_id"];
$save["local_graph_id"] = $form["local_graph_id"];
$save["task_item_id"] = $form["task_item_id"];
$save["color_id"] = $form["color_id"];
$save["graph_type_id"] = $form["graph_type_id"];
$save["cdef_id"] = $form["cdef_id"];
$save["consolidation_function_id"] = $form["consolidation_function_id"];
$save["text_format"] = $form["text_format"];
$save["value"] = $form["value"];
$save["hard_return"] = $form["hard_return"];
$save["gprint_opts"] = $form["gprint_opts"];
$save["gprint_custom"] = $form["gprint_custom"];
$save["custom"] = $form["custom"];
$save["sequence"] = $form["sequence"];
$save["sequence_parent"] = $form["sequence_parent"];
$save["parent"] = $form["parent"];
$graph_template_item_id = sql_save($save, "graph_templates_item");
include_once ("include/utility_functions.php");
update_graph_item_groups($graph_template_item_id, $form[graph_template_item_id], $form[_graph_type_id], $form[_parent]);
header ("Location: graphs.php?action=item&local_graph_id=$form[local_graph_id]");
break;
case 'item_edit':
include_once ("include/top_header.php");
$title_text = "Graph Template Management [edit]";
include_once ("include/top_table_header.php");
draw_graph_form_select("?action=item&local_graph_id=$args[local_graph_id]");
new_table();
if (isset($args[graph_template_item_id])) {
$template_item = db_fetch_row("select * from graph_templates_item where id=$args[graph_template_item_id]");
}else{
unset($template_item);
}
?>