GetFirst() public method

public GetFirst ( )
Example #1
0
checkSession();
$Project = new Project();
//////////////////////////////////////////////////////////////////
// Get Current Project
//////////////////////////////////////////////////////////////////
$no_return = false;
if (isset($_GET['no_return'])) {
    $no_return = true;
}
if ($_GET['action'] == 'get_current') {
    if (!isset($_SESSION['project'])) {
        // Load default/first project
        if ($no_return) {
            $Project->no_return = true;
        }
        $Project->GetFirst();
    } else {
        // Load current
        $Project->path = $_SESSION['project'];
        $project_name = $Project->GetName();
        if (!$no_return) {
            echo formatJSEND("success", array("name" => $project_name, "path" => $_SESSION['project']));
        }
    }
}
//////////////////////////////////////////////////////////////////
// Open Project
//////////////////////////////////////////////////////////////////
if ($_GET['action'] == 'open') {
    if (!checkPath($_GET['path'])) {
        die(formatJSEND("error", "No Access"));