2 ===================================================================
3 --- graph.php (wersja 4583)
4 +++ graph.php (wersja 4584)
7 $graph_height = $graph["height"];
8 $graph_width = $graph["width"];
9 - if ((read_config_option("rrdtool_version")) == "rrd-1.2.x") {
10 + if ((read_config_option("rrdtool_version")) != "rrd-1.0.x") {
11 if (read_graph_config_option("title_font") == "") {
12 if (read_config_option("title_font") == "") {
13 $title_font_size = 10;
15 ===================================================================
16 --- lib/rrd.php (wersja 4583)
17 +++ lib/rrd.php (wersja 4584)
21 case "3": /* autoscale-min, accepts a given upper limit */
22 - if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
23 + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
24 $scale = "--alt-autoscale-min" . RRD_NL;
25 if ( is_numeric($graph["upper_limit"])) {
26 $scale .= "--upper-limit=" . $graph["upper_limit"] . RRD_NL;
30 if (!empty($graph["unit_value"])) {
31 - if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
32 + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
33 $unit_value = "--y-grid=" . $graph["unit_value"] . RRD_NL;
35 $unit_value = "--unit=" . $graph["unit_value"] . RRD_NL;
37 /* display the timespan for zoomed graphs */
38 if ((isset($graph_data_array["graph_start"])) && (isset($graph_data_array["graph_end"]))) {
39 if (($graph_data_array["graph_start"] < 0) && ($graph_data_array["graph_end"] < 0)) {
40 - if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
41 + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
42 $graph_legend .= "COMMENT:\"From " . str_replace(":", "\:", date($graph_date, time()+$graph_data_array["graph_start"])) . " To " . str_replace(":", "\:", date($graph_date, time()+$graph_data_array["graph_end"])) . "\\c\"" . RRD_NL . "COMMENT:\" \\n\"" . RRD_NL;
44 $graph_legend .= "COMMENT:\"From " . date($graph_date, time()+$graph_data_array["graph_start"]) . " To " . date($graph_date, time()+$graph_data_array["graph_end"]) . "\\c\"" . RRD_NL . "COMMENT:\" \\n\"" . RRD_NL;
46 }else if (($graph_data_array["graph_start"] >= 0) && ($graph_data_array["graph_end"] >= 0)) {
47 - if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
48 + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
49 $graph_legend .= "COMMENT:\"From " . str_replace(":", "\:", date($graph_date, $graph_data_array["graph_start"])) . " To " . str_replace(":", "\:", date($graph_date, $graph_data_array["graph_end"])) . "\\c\"" . RRD_NL . "COMMENT:\" \\n\"" . RRD_NL;
51 $graph_legend .= "COMMENT:\"From " . date($graph_date, $graph_data_array["graph_start"]) . " To " . date($graph_date, $graph_data_array["graph_end"]) . "\\c\"" . RRD_NL . "COMMENT:\" \\n\"" . RRD_NL;
53 "--vertical-label=\"" . $graph["vertical_label"] . "\"" . RRD_NL;
55 /* rrdtool 1.2.x does not provide smooth lines, let's force it */
56 - if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
57 + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
58 if ($graph["slope_mode"] == "on") {
59 $graph_opts .= "--slope-mode" . RRD_NL;
63 /* rrdtool 1.2 font options */
64 - if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
65 + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
67 $graph_opts .= rrdtool_set_font("title", ((!empty($graph_data_array["graph_nolegend"])) ? $graph_data_array["graph_nolegend"] : ""));
72 if ($graph_item_types{$graph_item["graph_type_id"]} == "COMMENT") {
73 - if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
74 + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
75 $comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":\"" . str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]) . $hardreturn[$graph_item_id] . "\" ";
76 if (trim($comment_string) != "COMMENT:\"\"") {
77 $txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item);
79 $graph_item_color_code = "";
81 $graph_item_color_code = "#" . $graph_item["hex"];
82 - if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
83 + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
84 $graph_item_color_code .= $graph_item["alpha"];
88 $graph_variables["text_format"][$graph_item_id] = str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]); /* escape colons */
89 $txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":" . $data_source_name . $graph_item_color_code . ":" . "\"" . $graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id] . "\" ";
90 }elseif ($graph_item_types{$graph_item["graph_type_id"]} == "STACK") {
91 - if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
92 + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
93 $graph_variables["text_format"][$graph_item_id] = str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]); /* escape colons */
94 $txt_graph_items .= $graph_item_stack_type . ":" . $data_source_name . $graph_item_color_code . ":" . "\"" . $graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id] . "\":STACK";
97 ===================================================================
98 --- utilities.php (wersja 4583)
99 +++ utilities.php (wersja 4584)
101 exec(read_config_option("path_rrdtool"), $out_array);
103 if (sizeof($out_array) > 0) {
104 - if (ereg("^RRDtool 1\.2", $out_array[0])) {
105 + if (ereg("^RRDtool 1\.3", $out_array[0])) {
106 + $rrdtool_version = "rrd-1.3.x";
107 + }else if (ereg("^RRDtool 1\.2\.", $out_array[0])) {
108 $rrdtool_version = "rrd-1.2.x";
109 }else if (ereg("^RRDtool 1\.0\.", $out_array[0])) {
110 $rrdtool_version = "rrd-1.0.x";
112 $rrdtool_error .= "<br><font color='red'>ERROR: Installed RRDTool version does not match configured version.<br>Please visit the <a href='settings.php?tab=general'>Configuration Settings</a> and select the correct RRDTool Utility Version.</font><br>";
114 $graph_gif_count = db_fetch_cell("SELECT COUNT(*) FROM graph_templates_graph WHERE image_format_id = 2");
115 - if (($graph_gif_count > 0) && (read_config_option("rrdtool_version") == "rrd-1.2.x")) {
116 + if (($graph_gif_count > 0) && (read_config_option("rrdtool_version") != "rrd-1.0.x")) {
117 $rrdtool_error .= "<br><font color='red'>ERROR: RRDTool 1.2.x does not support the GIF images format, but " . $graph_gif_count . " graph(s) and/or templates have GIF set as the image format.</font><br>";
120 Index: install/index.php
121 ===================================================================
122 --- install/index.php (wersja 4583)
123 +++ install/index.php (wersja 4584)
125 exec($input["path_rrdtool"]["default"], $out_array);
127 if (sizeof($out_array) > 0) {
128 - if (ereg("^RRDtool 1\.2", $out_array[0])) {
129 + if (ereg("^RRDtool 1\.3", $out_array[0])) {
130 + $input["rrdtool_version"]["default"] = "rrd-1.3.x";
131 + }else if (ereg("^RRDtool 1\.2\.", $out_array[0])) {
132 $input["rrdtool_version"]["default"] = "rrd-1.2.x";
133 }else if (ereg("^RRDtool 1\.0\.", $out_array[0])) {
134 $input["rrdtool_version"]["default"] = "rrd-1.0.x";
135 Index: include/global_arrays.php
136 ===================================================================
137 --- include/global_arrays.php (wersja 4581)
138 +++ include/global_arrays.php (wersja 4582)
141 $rrdtool_versions = array(
142 "rrd-1.0.x" => "RRDTool 1.0.x",
143 - "rrd-1.2.x" => "RRDTool 1.2.x");
144 + "rrd-1.2.x" => "RRDTool 1.2.x",
145 + "rrd-1.3.x" => "RRDTool 1.3.x");
147 $cdef_item_types = array(