public function GetFirst()
{
$projects_assigned = false;
if ($this->assigned) {
foreach ($this->projects as $project => $data) {
if (in_array($data['path'], $this->assigned)) {
$this->name = $data['name'];
$this->path = $data['path'];
break;
}
}
} else {
$this->name = $this->projects[0]['name'];
$this->path = $this->projects[0]['path'];
}
// Set Sessions
$_SESSION['project'] = $this->path;
if (!$this->no_return) {
echo formatJSEND("success", array("name" => $this->name, "path" => $this->path));
}
}