aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/mailreport/mail_reports.inc18
-rw-r--r--config/mailreport/status_mail_report_add_graph.php13
-rw-r--r--config/mailreport/status_mail_report_edit.php12
3 files changed, 23 insertions, 20 deletions
diff --git a/config/mailreport/mail_reports.inc b/config/mailreport/mail_reports.inc
index dc8026cc..d94631cc 100644
--- a/config/mailreport/mail_reports.inc
+++ b/config/mailreport/mail_reports.inc
@@ -301,16 +301,14 @@ function mail_report_generate_graph($database, $style, $graph, $start, $end) {
// log_error("start $start, end $end, archivestart $archivestart, average $average, scale $scale, seconds $seconds");
/* Deduce a interface if possible and use the description */
- $curif = split("-", $curdatabase);
- $curif = "$curif[0]";
- $friendly = convert_friendly_interface_to_friendly_descr(strtolower($curif));
- if($friendly == "") {
- $friendly = $curif;
+ $curif = explode("-", $curdatabase);
+ $curif[1] = str_replace(".rrd", "", $curif[1]);
+ $friendly = convert_friendly_interface_to_friendly_descr(strtolower($curif[0]));
+ if(!empty($friendly)) {
+ $curif[0] = $friendly;
}
- $search = array("-", ".rrd", $curif);
- $replace = array(" :: ", "", $friendly);
- $prettydb = ucwords(str_replace($search, $replace, $curdatabase));
-
+ $prettydb = ucwords(implode(" :: ", $curif));
+ $curif = $curif[0];
$rrddbpath = "/var/db/rrd/";
$rrdtmppath = "/tmp/";
@@ -1200,4 +1198,4 @@ function timeDiff($time, $opt = array()) {
return $str;
}
-?> \ No newline at end of file
+?>
diff --git a/config/mailreport/status_mail_report_add_graph.php b/config/mailreport/status_mail_report_add_graph.php
index 17d7731c..c0287367 100644
--- a/config/mailreport/status_mail_report_add_graph.php
+++ b/config/mailreport/status_mail_report_add_graph.php
@@ -183,12 +183,15 @@ include("head.inc");
<select name="graph" class="formselect" style="z-index: -10;">
<?php
foreach ($custom_databases as $db => $database) {
- $optionc = split("-", $database);
- $search = array("-", ".rrd", $optionc);
- $replace = array(" :: ", "", $friendly);
+ $optionc = explode("-", $database);
+ $optionc[1] = str_replace(".rrd", "", $optionc[1]);
+ $friendly = convert_friendly_interface_to_friendly_descr(strtolower($optionc[0]));
+ if(!empty($friendly)) {
+ $optionc[0] = $friendly;
+ }
+ $prettyprint = ucwords(implode(" :: ", $optionc));
echo "<option value=\"{$database}\"";
- $prettyprint = ucwords(str_replace($search, $replace, $database));
- if($pconfig['graph'] == $database) {
+ if ($pconfig['graph'] == $database) {
echo " selected";
}
echo ">" . htmlspecialchars($prettyprint) . "</option>\n";
diff --git a/config/mailreport/status_mail_report_edit.php b/config/mailreport/status_mail_report_edit.php
index fe9a5194..3102e958 100644
--- a/config/mailreport/status_mail_report_edit.php
+++ b/config/mailreport/status_mail_report_edit.php
@@ -138,7 +138,6 @@ if ($_POST) {
set_mail_report_cron_jobs($a_mailreports);
write_config();
configure_cron();
-
header("Location: status_mail_report.php");
exit;
}
@@ -239,10 +238,13 @@ include("head.inc");
<?php endif; ?>
</tr>
<?php $i = 0; foreach ($a_graphs as $graph):
- $optionc = split("-", $graph['graph']);
- $search = array("-", ".rrd", $optionc);
- $replace = array(" :: ", "", $friendly);
- $prettyprint = ucwords(str_replace($search, $replace, $graph['graph']));
+ $optionc = explode("-", $graph['graph']);
+ $optionc[1] = str_replace(".rrd", "", $optionc[1]);
+ $friendly = convert_friendly_interface_to_friendly_descr(strtolower($optionc[0]));
+ if(!empty($friendly)) {
+ $optionc[0] = $friendly;
+ }
+ $prettyprint = ucwords(implode(" :: ", $optionc));
?>
<tr ondblclick="document.location='status_mail_report_edit.php?id=<?=$i;?>'">
<td class="listlr"><?php echo $prettyprint; ?></td>