Example #1
0
            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) {
        fMessaging::create('error', fURL::get(), $e->getMessage());
    }
    include VIEW_PATH . '/delete.php';
} elseif ('clone' == $action) {
Example #2
0
} elseif (isset($i_s)) {
    $any_s = $i_s;
}
if (!is_null($any_s)) {
    $g = new Graph('', $_filename, '', $_SERVER['SCRIPT_URI']);
    $r = strlen($any_s) ? $g->remove_any($any_s) : 0;
    header('Triples: ' . $r);
    if ($r) {
        $g->save();
    }
    exit;
}
if (is_dir($_filename)) {
    if ($_options->recursive) {
        rrmdir($_filename);
    } else {
        rmdir($_filename);
    }
} elseif (file_exists($_filename)) {
    unlink($_filename);
} else {
    $g = new Graph('', $_filename, '', '');
    if ($g->exists()) {
        $g->delete();
    } else {
        httpStatusExit(404, 'Not Found');
    }
}
if (file_exists($_filename)) {
    httpStatusExit(409, 'Conflict');
}