예제 #1
0
function popup()
{
    $tpl = new templates();
    $title = strip_tags($tpl->_ENGINE_parse_body('{APP_MAILGRAPH}'));
    $sock = new sockets();
    $MailGraphEnabled = $sock->GET_INFO('MailGraphEnabled');
    $enable = Paragraphe_switch_img('{enable}', '{enable_mailgraph_text}', 'MailGraphEnabled', $MailGraphEnabled, null, 285);
    $status = MailGraphStatus();
    $html = "\n\t<H1>{$title}</H1>\n\t<table style=width:100%'>\n\t<tr>\n\t\t<td valign='top'><img src='img/statistics-128.png'></td>\n\t\t<td valign='top'>\n\t\t<table style='with:100%'>\n\t\t<tr>\n\t\t<td valign='top'>\n\t\t\t<p class=caption>{APP_MAILGRAPH_TEXT}</p>\t\t\n\t\t\t<div id='EnableMailGraphDiv'>\n\t\t\t{$enable}\n\t\t\t<hr>\n\t\t\t<div style='width:100%;text-align:right'>\n\t\t\t<input type='button' OnClick=\"javascript:EnableMailGraph()\" value='{edit}&nbsp;&raquo;'>\n\t\t\t</div>\n\t\t</td>\n\t\t<td valign='top'><div id='mailgraph-status'>{$status}</div>\n\t\t\t\n\t\t</div>\n\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t</tr>\n\t</table>\n\t" . RoundedLightWhite("<div id='mailgraphs' style='width:100%;height:350px;overflow:auto'>" . getGraphs() . "</div>") . "\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html, 'postfix.index.php');
}
예제 #2
0
				echo __("Try php -q device_list.php") . "\n";
				exit(1);
			}

			/* form a valid sql statement for device_id */
			$selection = "WHERE " . str_replace("id", "device_id", array_to_sql_or($devices, "id")) . " ";
		}


		if (isset($graph_template_id) && !($graph_template_id === 0) && (db_fetch_cell("SELECT id FROM graph_templates WHERE id=$graph_template_id"))) {
			/* form a valid sql statement for device_id */
			$selection .= (strlen($selection) ? " AND " : " WHERE ") . " graph_templates.id=" . $graph_template_id;
		}

		$columns = array();
		$graphs = getGraphs($selection, $columns);
		$title = __("List of existing graphs for given device selection");
		/* display matching devices */
		displayGenericArray($graphs, $columns, $title, $quietMode);
	}


} else {
	display_help($me);
	exit(1);
}

function display_help($me) {
	echo "List Graphs Script 1.0" . ", " . __("Copyright 2004-2010 - The Cacti Group") . "\n";
	echo __("A simple command line utility to list graphs in Cacti") . "\n\n";
	echo __("usage: ") . $me . " --device-id=[ID] --graph-template-id=[ID] [--graph-id=]\n\n";
                $options['graphs'] = "http://bio2rdf.org/{$name}" . "_resource:bio2rdf.dataset.{$name}.R{$version}";
                $options['quad_uri'] = $options['graphs'] . ".statistics";
                $options['dataset_uri'] = $options['graphs'];
                break;
            }
        }
    }
    fclose($fp);
}
if (strstr($options['graphs'], "list|all")) {
    echo "set graphs argument to 'all' or 'list' or 'graphname' or , or + separated list of graph names." . PHP_EOL;
    exit;
}
if ($options['graphs'] == 'list' or $options['graphs'] == 'all') {
    try {
        $graphs = getGraphs();
    } catch (Exception $e) {
        trigger_error("Error in getting graphs from endpoint. {$e}");
        exit;
    }
    if ($options['graphs'] == 'list') {
        echo "graphs:" . PHP_EOL;
        foreach ($graphs as $g) {
            echo " " . $g . PHP_EOL;
        }
        exit;
    }
    $options['graphs'] = $graphs;
} else {
    $plusgraphs = explode("+", $options['graphs']);
    if (count($plusgraphs) >= 2) {