function create() { $types = Event::getTypes(); RoutingEngine::getSmarty()->assign("event_types", $types); if (isset($_GET["eid"])) { $eid = $_GET["eid"]; $event = Event::find($eid); if ($event->uid == User::$current_user->uid) { RoutingEngine::getSmarty()->assign("event", $event); } } }