本文整理汇总了PHP中Check::constructTarget方法的典型用法代码示例。如果您正苦于以下问题:PHP Check::constructTarget方法的具体用法?PHP Check::constructTarget怎么用?PHP Check::constructTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Check
的用法示例。
在下文中一共展示了Check::constructTarget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
</div>
</fieldset>
</form>
</div>
<div id="check_graph" class="col-md-9">
<?php
if ($action == 'edit') {
?>
<div class="sidebar" id="sidebar">
<fieldset>
<p>Check : <?php
echo $check->prepareName();
?>
</p>
<p>Target : <?php
echo Check::constructTarget($check);
?>
</p>
<p id="graphiteGraph"><?php
echo Check::showGraph($check);
?>
</p>
<div class="row">
<div class="col-md-4">
<select id="graphiteDateRange" class="form-control">
<?php
$dateRange = array('-12hours' => '12 Hours', '-1days' => '1 Day', '-3days' => '3 Days', '-7days' => '7 Days', '-14days' => '14 Days', '-30days' => '30 Days', '-60days' => '60 Days');
foreach ($dateRange as $value => $text) {
fHTML::printOption($text, $value, '-3days');
}
?>
示例2: showGraph
/**
* Creates all Check related URLs for the site
*
* @param string $type The type of URL to make: 'list', 'add', 'edit', 'delete'
* @param Meetup $obj The Check object for the edit and delete URL types
* @return string The URL requested
*/
public static function showGraph($obj = NULL, $img = true, $sample = false, $width = false, $hideLegend = false)
{
if ($img) {
$link = '<img id="renderedGraphImage" src="';
} else {
$link = '<a href="';
}
if ($GLOBALS['PRIMARY_SOURCE'] == "GANGLIA") {
$parts = explode("_|_", $obj->prepareTarget());
$link .= $GLOBALS['GANGLIA_URL'] . "/graph.php?json=1&ce=now&c=" . $parts[0] . "&h=" . $parts[1] . "&m=" . $parts[2];
if ($sample !== False) {
$link .= '&cs=' . $sample;
} else {
$link .= '&cs=-' . $obj->prepareSample() . 'minutes';
}
} else {
$link .= $GLOBALS['GRAPHITE_URL'] . '/render/?';
$link .= 'target=legendValue(alias(' . Check::constructTarget($obj) . '%2C%22Check : ' . $obj->prepareName() . '%22),%22last%22)';
if ($sample !== False) {
$link .= '&from=' . $sample;
} else {
$link .= '&from=-' . $obj->prepareSample() . 'minutes';
}
if ($width !== false) {
$link .= '&width=' . $width;
} else {
$link .= '&width=' . $GLOBALS['GRAPH_WIDTH'];
}
$link .= '&height=' . $GLOBALS['GRAPH_HEIGHT'];
$link .= '&target=color(alias(threshold(' . $obj->getError() . ')%2C%22Error%20(' . $obj->getError() . ')%22)%2C%22' . $GLOBALS['ERROR_COLOR'] . '%22)';
$link .= '&target=color(alias(threshold(' . $obj->getWarn() . ')%2C%22Warning%20(' . $obj->getWarn() . ')%22)%2C%22' . $GLOBALS['WARN_COLOR'] . '%22)';
if ($hideLegend !== false) {
$link .= '&hideLegend=true';
}
}
if ($img) {
$link .= '" title="' . $obj->prepareName() . '" alt="' . $obj->prepareName();
$link .= '" />';
} else {
$link .= '"> ' . $obj->prepareTarget() . '</a>';
}
return $link;
}