Example #1
0
            Graph::cloneGraph($graph_id);
            fMessaging::create('affected', fURL::get(), $graph_to_clone->getName());
            fMessaging::create('success', fURL::get(), 'The Graph ' . $graph_to_clone->getName() . ' was successfully cloned');
            fURL::redirect(Dashboard::makeURL('edit', $dashboard));
        } catch (fExpectedException $e) {
            fMessaging::create('error', fURL::get(), $e->getMessage());
        }
    }
    include VIEW_PATH . '/add_edit_dashboard.php';
} elseif ('clone_into' == $action) {
    if (fRequest::isPost()) {
        $graph_to_clone = new Graph($graph_id);
        $dashboard = new Dashboard($dashboard_dest_id);
        try {
            fRequest::validateCSRFToken(fRequest::get('token'));
            Graph::cloneGraph($graph_id, $dashboard_dest_id);
            $url_redirect = Dashboard::makeURL('list');
            fMessaging::create('affected', $url_redirect, $graph_to_clone->getName());
            fMessaging::create('success', "/" . $url_redirect, 'The Graph "' . $graph_to_clone->getName() . '" was successfully cloned into the Dashboard "' . $dashboard->getName() . '"');
            fURL::redirect($url_redirect);
        } catch (fExpectedException $e) {
            fMessaging::create('error', fURL::get(), $e->getMessage());
        }
    }
    include VIEW_PATH . '/list_dashboards.php';
} elseif ('reorder' == $action) {
    $drag_order = fRequest::get('drag_order');
    $error = false;
    if (empty($drag_order)) {
        // In this case, the user clicks on the arrow
        $move = fRequest::getValid('move', array('previous', 'next'));