本文整理汇总了PHP中Graph::getDashboardId方法的典型用法代码示例。如果您正苦于以下问题:PHP Graph::getDashboardId方法的具体用法?PHP Graph::getDashboardId怎么用?PHP Graph::getDashboardId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph::getDashboardId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
}
}
}
} else {
$skip_next = false;
}
}
} else {
// In this case the user has used the drag and drop functionnality
$array_of_weights = explode(",", $drag_order);
$graphs_in_dashboard = array();
foreach ($array_of_weights as $new_weight) {
$expl = explode(":", $new_weight);
$current_graph = new Graph($expl[0]);
if (!isset($dashboard_id)) {
$dashboard_id = $current_graph->getDashboardId();
} else {
// Check if all the graphs are in the same dashboard
if ($dashboard_id != $current_graph->getDashboardId()) {
$error = true;
break;
}
}
$current_graph->setWeight($expl[1]);
$graphs_in_dashboard[] = $current_graph;
}
}
if (!$error) {
foreach ($graphs_in_dashboard as $graph_to_store) {
$graph_to_store->store();
}
示例2: dirname
<?php
include dirname(__FILE__) . '/inc/init.php';
fAuthorization::requireLoggedIn();
fRequest::overrideAction();
$action = fRequest::getValid('action', array('list', 'add', 'edit', 'delete', 'view'));
$dashboard_id = fRequest::get('dashboard_id');
$graph_id = fRequest::get('graph_id');
$manage_url = $_SERVER['SCRIPT_NAME'];
// --------------------------------- //
if ('edit' == $action) {
try {
$graph = new Graph($graph_id);
$dashboard = new Dashboard($graph->getDashboardId());
$lines = Line::findAll($graph_id);
if (fRequest::isPost()) {
$graph->populate();
fRequest::validateCSRFToken(fRequest::get('token'));
$graph->store();
fMessaging::create('affected', fURL::get(), $graph->getName());
fMessaging::create('success', fURL::getWithQueryString(), 'The Graph ' . $graph->getName() . ' was successfully updated');
//fURL::redirect($manage_url);
}
} catch (fNotFoundException $e) {
fMessaging::create('error', $manage_url, 'The Graph requested, ' . fHTML::encode($graph_id) . ', could not be found');
fURL::redirect($manage_url);
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
include VIEW_PATH . '/add_edit_graph.php';
// --------------------------------- //
示例3: catch
$graph->populate();
fRequest::validateCSRFToken(fRequest::get('token'));
$graph->store();
fMessaging::create('affected', $manage_url, $graph->getName());
fMessaging::create('success', $manage_url, 'The Graph ' . $graph->getName() . ' was successfully created');
fURL::redirect(Graph::makeUrl('edit', $graph));
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
}
include VIEW_PATH . '/add_edit_graph.php';
} elseif ('delete' == $action) {
$class_name = 'Graph';
try {
$obj = new Graph($graph_id);
$dashboard = new Dashboard($obj->getDashboardId());
$delete_text = 'Are you sure you want to delete the graph : <strong>' . $obj->getName() . '</strong>?';
if (fRequest::isPost()) {
fRequest::validateCSRFToken(fRequest::get('token'));
$obj->delete();
$lines = Line::findAll($graph_id);
foreach ($lines as $line) {
$line->delete();
}
fMessaging::create('success', Dashboard::makeUrl('edit', $dashboard), 'The graph for ' . $dashboard->getName() . ' was successfully deleted');
fURL::redirect(Dashboard::makeUrl('edit', $dashboard));
}
} catch (fNotFoundException $e) {
fMessaging::create('error', Dashboard::makeUrl('edit', $dashboard), 'The line requested could not be found');
fURL::redirect(Dashboard::makeUrl('edit', $dashboard));
} catch (fExpectedException $e) {
示例4: cloneGraph
public static function cloneGraph($graph_id, $dashboard_id = NULL)
{
$graph_to_clone = new Graph($graph_id);
if (empty($dashboard_id)) {
$dashboard_id = $graph_to_clone->getDashboardId();
}
$graph = new Graph();
$clone_name = 'Clone of ' . $graph_to_clone->getName();
// If it's too long, we truncate
if (strlen($clone_name) > 255) {
$clone_name = substr($clone_name, 0, 255);
}
$graph->setName($clone_name);
$graph->setArea($graph_to_clone->getArea());
$graph->setVtitle($graph_to_clone->getVtitle());
$graph->setDescription($graph_to_clone->getDescription());
$graph->setDashboardId($dashboard_id);
$graph->setWeight($graph_to_clone->getWeight());
$graph->setTimeValue($graph_to_clone->getTimeValue());
$graph->setUnit($graph_to_clone->getUnit());
$graph->setCustomOpts($graph_to_clone->getCustomOpts());
$graph->setStartsAtMidnight($graph_to_clone->getStartsAtMidnight());
$graph->store();
// Clone of the lines
$lines = Line::findAll($graph_id);
foreach ($lines as $line_to_clone) {
Line::cloneLine($line_to_clone->getLineId(), TRUE, $graph->getGraphId());
}
}