Ejemplo n.º 1
0
function draw_nontemplated_fields_graph($graph_template_id, &$values_array, $field_name_format = "|field|", $display_template_name = true) {
	global $colors;

	require_once(CACTI_BASE_PATH . "/lib/graph/graph_form.php");

	if (empty($graph_template_id)) {
		return;
	}

	$num_draw_fields = 0;

	/* fetch information about the graph template */
	$graph_template = db_fetch_row("select * from graph_template where id = $graph_template_id");

	if ($graph_template["t_title"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__title(str_replace("|field|", "title", $field_name_format), false, 0);
	}

	if ($graph_template["t_vertical_label"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__vertical_label(str_replace("|field|", "vertical_label", $field_name_format), false, $values_array["vertical_label"], 0);
	}

	if ($graph_template["t_image_format"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__image_format(str_replace("|field|", "image_format", $field_name_format), false, $values_array["image_format"], 0);
	}

	if ($graph_template["t_vertical_label"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__vertical_label(str_replace("|field|", "vertical_label", $field_name_format), false, $values_array["vertical_label"], 0);
	}

	if ($graph_template["t_export"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__export(str_replace("|field|", "export", $field_name_format), false, $values_array["export"], 0);
	}

	if ($graph_template["t_force_rules_legend"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__force_rules_legend(str_replace("|field|", "force_rules_legend", $field_name_format), false, $values_array["force_rules_legend"], 0);
	}

	if ($graph_template["t_vertical_label"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__vertical_label(str_replace("|field|", "vertical_label", $field_name_format), false, $values_array["vertical_label"], 0);
	}

	if ($graph_template["t_height"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__height(str_replace("|field|", "height", $field_name_format), false, $values_array["height"], 0);
	}

	if ($graph_template["t_vertical_label"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__vertical_label(str_replace("|field|", "vertical_label", $field_name_format), false, $values_array["vertical_label"], 0);
	}

	if ($graph_template["t_width"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__width(str_replace("|field|", "width", $field_name_format), false, $values_array["width"], 0);
	}

	if ($graph_template["t_x_grid"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__x_grid(str_replace("|field|", "x_grid", $field_name_format), false, $values_array["x_grid"], 0);
	}

	if ($graph_template["t_y_grid"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__y_grid(str_replace("|field|", "y_grid", $field_name_format), false, $values_array["y_grid"], 0);
	}

	if ($graph_template["t_y_grid_alt"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__y_grid_alt(str_replace("|field|", "y_grid_alt", $field_name_format), false, $values_array["y_grid_alt"], 0);
	}

	if ($graph_template["t_no_minor"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__no_minor(str_replace("|field|", "no_minor", $field_name_format), false, $values_array["no_minor"], 0);
	}

	if ($graph_template["t_auto_scale"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__auto_scale(str_replace("|field|", "auto_scale", $field_name_format), false, $values_array["auto_scale"], 0);
	}

	if ($graph_template["t_auto_scale_opts"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__auto_scale_opts(str_replace("|field|", "auto_scale_opts", $field_name_format), false, $values_array["auto_scale_opts"], 0);
	}

	if ($graph_template["t_auto_scale_log"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__auto_scale_log(str_replace("|field|", "auto_scale_log", $field_name_format), false, $values_array["auto_scale_log"], 0);
	}

	if ($graph_template["t_auto_scale_rigid"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__auto_scale_rigid(str_replace("|field|", "auto_scale_rigid", $field_name_format), false, $values_array["auto_scale_rigid"], 0);
	}

	if ($graph_template["t_auto_padding"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__auto_padding(str_replace("|field|", "auto_padding", $field_name_format), false, $values_array["auto_padding"], 0);
	}

	if ($graph_template["t_upper_limit"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__upper_limit(str_replace("|field|", "upper_limit", $field_name_format), false, $values_array["upper_limit"], 0);
	}

	if ($graph_template["t_lower_limit"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__lower_limit(str_replace("|field|", "lower_limit", $field_name_format), false, $values_array["lower_limit"], 0);
	}

	if ($graph_template["t_base_value"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__base_value(str_replace("|field|", "base_value", $field_name_format), false, $values_array["base_value"], 0);
	}

	if ($graph_template["t_unit_value"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__unit_value(str_replace("|field|", "unit_value", $field_name_format), false, $values_array["unit_value"], 0);
	}

	if ($graph_template["t_unit_length"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__unit_length(str_replace("|field|", "unit_length", $field_name_format), false, $values_array["unit_length"], 0);
	}

	if ($graph_template["t_unit_exponent_value"] == "1") {
		$num_draw_fields = template_form_header_precheck($num_draw_fields, "<strong>" . _("Graph") . "</strong>", ($display_template_name == true ? $graph_template["template_name"] : ""));
		_graph_field__unit_exponent_value(str_replace("|field|", "unit_exponent_value", $field_name_format), false, $values_array["unit_exponent_value"], 0);
	}

	return $num_draw_fields;
}
Ejemplo n.º 2
0
function graph_edit()
{
    global $colors;
    if (!empty($_GET["id"])) {
        $graph = db_fetch_row("select * from graph where id=" . $_GET["id"]);
        if (!empty($graph["graph_template_id"])) {
            $graph_template = db_fetch_row("select * from graph_template where id=" . $graph["graph_template_id"]);
        }
        $header_label = _("[edit: ") . $graph["title_cache"] . "]";
    } else {
        $header_label = _("[new]");
    }
    /* handle debug mode */
    if (isset($_GET["debug"])) {
        if ($_GET["debug"] == "0") {
            kill_session_var("graph_debug_mode");
        } elseif ($_GET["debug"] == "1") {
            $_SESSION["graph_debug_mode"] = true;
        }
    }
    if (!empty($_GET["id"])) {
        ?>
		<table width="98%" align="center">
			<tr>
				<td class="textInfo" colspan="2" valign="top">
					<?php 
        echo $graph["title_cache"];
        ?>
				</td>
				<td class="textInfo" align="right" valign="top">
					<span style="color: #c16921;">*<a href='graphs.php?action=edit&id=<?php 
        print isset($_GET["id"]) ? $_GET["id"] : 0;
        ?>
&debug=<?php 
        print isset($_SESSION["graph_debug_mode"]) ? "0" : "1";
        ?>
'>Turn <strong><?php 
        print isset($_SESSION["graph_debug_mode"]) ? "Off" : "On";
        ?>
</strong> Graph Debug Mode.</a>
				</td>
			</tr>
		</table>
		<br>
		<?php 
    }
    /* ==================== Box: Device/Template Selection ==================== */
    $form_array = array("graph_template_id" => array("method" => "drop_sql", "friendly_name" => _("Selected Graph Template"), "description" => _("Choose a graph template to apply to this graph. Please note that graph data may be lost if you change the graph template after one is already applied."), "value" => isset($graph) ? $graph["graph_template_id"] : "0", "none_value" => _("None"), "sql" => "select graph_template.id,graph_template.template_name as name from graph_template order by template_name"), "host_id" => array("method" => "drop_sql", "friendly_name" => _("Host"), "description" => _("Choose the host that this graph belongs to."), "value" => isset($_GET["host_id"]) ? $_GET["host_id"] : $graph["host_id"], "none_value" => _("None"), "sql" => "select id,CONCAT_WS('',description,' (',hostname,')') as name from host order by description,hostname"), "id" => array("method" => "hidden", "value" => isset($graph) ? $graph["id"] : "0"));
    html_start_box("<strong>" . _("Device/Template Selection") . "</strong> {$header_label}", "98%", $colors["header_background"], "3", "center", "");
    draw_edit_form(array("config" => array(), "fields" => $form_array));
    html_end_box();
    /* ==================== Box: Supplemental Template Data ==================== */
    /* only display the "inputs" area if we are using a graph template for this graph */
    if (!empty($graph["graph_template_id"])) {
        ob_start();
        html_start_box("<strong>" . _("Supplemental Template Data") . "</strong>", "98%", $colors["header_background"], "3", "center", "");
        $num_output_fields = draw_nontemplated_fields_graph($graph["graph_template_id"], $graph, "g||field|", "<strong>" . _("Graph Fields") . "</strong>", true);
        $num_output_fields += draw_nontemplated_fields_graph_item($graph["graph_template_id"], array_rekey(db_fetch_assoc("select * from graph_item where graph_id = " . $graph["id"]), "graph_template_item_id", array("id", "data_source_item_id", "color", "graph_item_type", "cdef", "consolidation_function", "gprint_format", "legend_format", "legend_value", "hard_return")), "gip||field|||id|", "<strong>" . _("Graph Item Fields") . "</strong>", true);
        html_end_box();
        if ($num_output_fields == 0) {
            ob_end_clean();
        } else {
            ob_end_flush();
        }
    }
    /* graph item list goes here */
    if (!empty($_GET["id"]) && empty($graph["graph_template_id"])) {
        $graph_items = db_fetch_assoc("select\n\t\t\tgraph_item.id\n\t\t\tfrom graph_item\n\t\t\twhere graph_item.graph_id = " . $_GET["id"] . "\n\t\t\torder by graph_item.sequence");
        /* ==================== Box: Graph Items ==================== */
        html_start_box("<strong>" . _("Graph Items") . "</strong>", "98%", $colors["header_background"], "3", "center", "graphs_items.php?action=edit&graph_id=" . $_GET["id"]);
        draw_graph_item_editor($_GET["id"], "graph", false);
        html_end_box();
    }
    /* display sample graph, or graph source in debug mode */
    if (!empty($_GET["id"])) {
        ?>
		<table width="98%" align="center">
			<tr>
				<td align="center" class="textInfo" colspan="2">
					<img src="graph_image.php?graph_id=<?php 
        print $_GET["id"];
        ?>
&rra_id=1" alt="">
				</td>
				<?php 
        if (isset($_SESSION["graph_debug_mode"]) && isset($_GET["id"])) {
            $graph_data_array["output_flag"] = RRDTOOL_OUTPUT_STDERR;
            ?>
					<td>
						<span class="textInfo"><?php 
            echo _("RRDTool Says:");
            ?>
</span><br>
						<pre><?php 
            print rrdtool_function_graph($_GET["id"], 1, $graph_data_array);
            ?>
</pre>
					</td>
					<?php 
        }
        ?>
			</tr>
		</table>
		<br>
		<?php 
    }
    if (empty($graph["graph_template_id"]) && (isset($_GET["id"]) && is_numeric($_GET["id"]) || isset($_GET["host_id"]) && isset($_GET["graph_template_id"]))) {
        /* ==================== Box: Graph ==================== */
        html_start_box("<strong>" . _("Graph") . "</strong>", "98%", $colors["header_background"], "3", "center", "");
        field_row_header("General Options");
        _graph_field__title("g|title", false, empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__vertical_label("g|vertical_label", false, isset($graph["vertical_label"]) ? $graph["vertical_label"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__image_format("g|image_format", false, isset($graph["image_format"]) ? $graph["image_format"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__export("g|export", false, isset($graph["export"]) ? $graph["export"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__force_rules_legend("g|force_rules_legend", false, isset($graph["force_rules_legend"]) ? $graph["force_rules_legend"] : "");
        field_row_header("Image Size Options");
        _graph_field__height("g|height", false, isset($graph["height"]) ? $graph["height"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__width("g|width", false, isset($graph["width"]) ? $graph["width"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        field_row_header("Grid Options");
        _graph_field__x_grid("g|x_grid", false, isset($graph["x_grid"]) ? $graph["x_grid"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__y_grid("g|y_grid", false, isset($graph["y_grid"]) ? $graph["y_grid"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__y_grid_alt("g|y_grid_alt", false, isset($graph["y_grid_alt"]) ? $graph["y_grid_alt"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__no_minor("g|no_minor", false, isset($graph["no_minor"]) ? $graph["no_minor"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        field_row_header("Auto Scaling Options");
        _graph_field__auto_scale("g|auto_scale", false, isset($graph["auto_scale"]) ? $graph["auto_scale"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__auto_scale_opts("g|auto_scale_opts", false, isset($graph["auto_scale_opts"]) ? $graph["auto_scale_opts"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__auto_scale_log("g|auto_scale_log", false, isset($graph["auto_scale_log"]) ? $graph["auto_scale_log"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__auto_scale_rigid("g|auto_scale_rigid", false, isset($graph["auto_scale_rigid"]) ? $graph["auto_scale_rigid"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        _graph_field__auto_padding("g|auto_padding", false, isset($graph["auto_padding"]) ? $graph["auto_padding"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_auto_padding");
        field_row_header("Fixed Scaling Options");
        _graph_field__upper_limit("g|upper_limit", false, isset($graph["upper_limit"]) ? $graph["upper_limit"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_upper_limit");
        _graph_field__lower_limit("g|lower_limit", false, isset($graph["lower_limit"]) ? $graph["lower_limit"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_lower_limit");
        _graph_field__base_value("g|base_value", false, isset($graph["base_value"]) ? $graph["base_value"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_base_value");
        field_row_header("Units Display Options");
        _graph_field__unit_value("g|unit_value", false, isset($graph["unit_value"]) ? $graph["unit_value"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_unit_value");
        _graph_field__unit_length("g|unit_length", false, isset($graph["unit_length"]) ? $graph["unit_length"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_unit_length");
        _graph_field__unit_exponent_value("g|unit_exponent_value", false, isset($graph["unit_exponent_value"]) ? $graph["unit_exponent_value"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
        html_end_box();
    }
    form_hidden_box("action_post", "graph_edit");
    form_save_button("graphs.php");
}
Ejemplo n.º 3
0
function template_edit()
{
    global $colors;
    if (!empty($_GET["id"])) {
        $graph_template = db_fetch_row("select * from graph_template where id=" . $_GET["id"]);
        $header_label = _("[edit: ") . $graph_template["template_name"] . "]";
    } else {
        $header_label = _("[new]");
    }
    form_start("graph_templates.php", "form_graph_template");
    /* ==================== Box: Graph Template ==================== */
    html_start_box("<strong>" . _("Graph Template") . "</strong> {$header_label}", "98%", $colors["header_background"], "3", "center", "");
    _graph_template_field__template_name("template_name", isset($graph_template) ? $graph_template["template_name"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
    html_end_box();
    /* graph item list goes here */
    if (!empty($_GET["id"])) {
        /* ==================== Box: Graph Items ==================== */
        html_start_box("<strong>" . _("Graph Items") . "</strong>", "98%", $colors["header_background"], "3", "center", "graph_templates_items.php?action=edit&graph_template_id=" . $_GET["id"]);
        draw_graph_item_editor($_GET["id"], "graph_template", false);
        html_end_box();
        /* ==================== Box: Graph Item Inputs ==================== */
        html_start_box("<strong>" . _("Graph Item Inputs") . "</strong>", "98%", $colors["header_background"], "3", "center", "graph_templates_inputs.php?action=edit&graph_template_id=" . $_GET["id"]);
        $display_text = array("name" => array(_("Name"), "ASC"));
        html_header_sort($display_text, $sort_column, $sort_direction, 2);
        $template_item_list = db_fetch_assoc("select id,name from graph_template_item_input where graph_template_id=" . $_GET["id"] . " order by name");
        $i = 0;
        if (sizeof($template_item_list) > 0) {
            foreach ($template_item_list as $item) {
                form_alternate_row_color($colors["form_alternate1"], $colors["form_alternate2"], $i);
                $i++;
                ?>
					<td>
						<a class="linkEditMain" href="graph_templates_inputs.php?action=edit&id=<?php 
                print $item["id"];
                ?>
&graph_template_id=<?php 
                print $_GET["id"];
                ?>
"><?php 
                print $item["name"];
                ?>
</a>
					</td>
					<td align="right">
						<a href="graph_templates_inputs.php?action=remove&id=<?php 
                print $item["id"];
                ?>
&graph_template_id=<?php 
                print $_GET["id"];
                ?>
"><img src="<?php 
                print html_get_theme_images_path('delete_icon.gif');
                ?>
" width="10" height="10" border="0" alt="Delete"></a>
					</td>
				</tr>
				<?php 
            }
        } else {
            print "<tr bgcolor='#" . $colors["form_alternate2"] . "'><td colspan='2'><em>" . _("No Inputs") . "</em></td></tr>";
        }
        html_end_box();
    }
    /* ==================== Box: Graph ==================== */
    /* the user clicked the "add item" link. we need to make sure they get redirected back to
     * this page if an error occurs */
    if ($_GET["action"] == "sv_add") {
        form_hidden_box("redirect_sv_add", "x", "");
    }
    html_start_box("<strong>" . _("Graph") . "</strong>", "98%", $colors["header_background"], "3", "center", "");
    field_row_header("General Options");
    _graph_field__title("title", true, empty($_GET["id"]) ? 0 : $_GET["id"], "t_title", isset($graph_template["t_title"]) ? $graph_template["t_title"] : "");
    _graph_field__vertical_label("vertical_label", true, isset($graph_template["vertical_label"]) ? $graph_template["vertical_label"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_vertical_label", isset($graph_template["t_vertical_label"]) ? $graph_template["t_vertical_label"] : "");
    _graph_field__image_format("image_format", isset($graph_template["image_format"]) ? $graph_template["image_format"] : "", true, empty($_GET["id"]) ? 0 : $_GET["id"], "t_image_format", isset($graph_template["t_image_format"]) ? $graph_template["t_image_format"] : "");
    _graph_field__export("export", true, isset($graph_template["export"]) ? $graph_template["export"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_export", isset($graph_template["t_export"]) ? $graph_template["t_export"] : "");
    _graph_field__force_rules_legend("force_rules_legend", true, isset($graph_template["force_rules_legend"]) ? $graph_template["force_rules_legend"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_force_rules_legend", isset($graph_template["t_force_rules_legend"]) ? $graph_template["t_force_rules_legend"] : "");
    field_row_header("Image Size Options");
    _graph_field__height("height", true, isset($graph_template["height"]) ? $graph_template["height"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_height", isset($graph_template["t_height"]) ? $graph_template["t_height"] : "");
    _graph_field__width("width", true, isset($graph_template["width"]) ? $graph_template["width"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_width", isset($graph_template["t_width"]) ? $graph_template["t_width"] : "");
    field_row_header("Grid Options");
    _graph_field__x_grid("x_grid", true, isset($graph_template["x_grid"]) ? $graph_template["x_grid"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_x_grid", isset($graph_template["t_x_grid"]) ? $graph_template["t_x_grid"] : "");
    _graph_field__y_grid("y_grid", true, isset($graph_template["y_grid"]) ? $graph_template["y_grid"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_y_grid", isset($graph_template["t_y_grid"]) ? $graph_template["t_y_grid"] : "");
    _graph_field__y_grid_alt("y_grid_alt", true, isset($graph_template["y_grid_alt"]) ? $graph_template["y_grid_alt"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_y_grid_alt", isset($graph_template["t_y_grid_alt"]) ? $graph_template["t_y_grid_alt"] : "");
    _graph_field__no_minor("no_minor", true, isset($graph_template["no_minor"]) ? $graph_template["no_minor"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_no_minor", isset($graph_template["t_no_minor"]) ? $graph_template["t_no_minor"] : "");
    field_row_header("Auto Scaling Options");
    _graph_field__auto_scale("auto_scale", true, isset($graph_template["auto_scale"]) ? $graph_template["auto_scale"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_auto_scale", isset($graph_template["t_auto_scale"]) ? $graph_template["t_auto_scale"] : "");
    _graph_field__auto_scale_opts("auto_scale_opts", true, isset($graph_template["auto_scale_opts"]) ? $graph_template["auto_scale_opts"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_auto_scale_opts", isset($graph_template["t_auto_scale_opts"]) ? $graph_template["t_auto_scale_opts"] : "");
    _graph_field__auto_scale_log("auto_scale_log", true, isset($graph_template["auto_scale_log"]) ? $graph_template["auto_scale_log"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_auto_scale_log", isset($graph_template["t_auto_scale_log"]) ? $graph_template["t_auto_scale_log"] : "");
    _graph_field__auto_scale_rigid("auto_scale_rigid", true, isset($graph_template["auto_scale_rigid"]) ? $graph_template["auto_scale_rigid"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_auto_scale_rigid", isset($graph_template["t_auto_scale_rigid"]) ? $graph_template["t_auto_scale_rigid"] : "");
    _graph_field__auto_padding("auto_padding", true, isset($graph_template["auto_padding"]) ? $graph_template["auto_padding"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_auto_padding", isset($graph_template["t_auto_padding"]) ? $graph_template["t_auto_padding"] : "");
    field_row_header("Fixed Scaling Options");
    _graph_field__upper_limit("upper_limit", true, isset($graph_template["upper_limit"]) ? $graph_template["upper_limit"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_upper_limit", isset($graph_template["t_upper_limit"]) ? $graph_template["t_upper_limit"] : "");
    _graph_field__lower_limit("lower_limit", true, isset($graph_template["lower_limit"]) ? $graph_template["lower_limit"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_lower_limit", isset($graph_template["t_lower_limit"]) ? $graph_template["t_lower_limit"] : "");
    _graph_field__base_value("base_value", true, isset($graph_template["base_value"]) ? $graph_template["base_value"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_base_value", isset($graph_template["t_base_value"]) ? $graph_template["t_base_value"] : "");
    field_row_header("Units Display Options");
    _graph_field__unit_value("unit_value", true, isset($graph_template["unit_value"]) ? $graph_template["unit_value"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_unit_value", isset($graph_template["t_unit_value"]) ? $graph_template["t_unit_value"] : "");
    _graph_field__unit_length("unit_length", true, isset($graph_template["unit_length"]) ? $graph_template["unit_length"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_unit_length", isset($graph_template["t_unit_length"]) ? $graph_template["t_unit_length"] : "");
    _graph_field__unit_exponent_value("unit_exponent_value", true, isset($graph_template["unit_exponent_value"]) ? $graph_template["unit_exponent_value"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_unit_exponent_value", isset($graph_template["t_unit_exponent_value"]) ? $graph_template["t_unit_exponent_value"] : "");
    html_end_box();
    form_hidden_box("graph_template_id", empty($_GET["id"]) ? 0 : $_GET["id"], "");
    form_hidden_box("action_post", "graph_template_edit");
    form_save_button("graph_templates.php");
}