public function create() { SC::loginRequired(); global $current_user; switch ($_GET["__content_type"]) { case "json": $api = new SCApi(); $thread = $api->boards_threads_create(); $output = array("transfer" => SCRoutes::set("threads", "show", array("boardid" => $thread->boardid, "threadid" => $thread->messageid))); echo SC::jsonify($output); break; case "html": default: try { $api = new SCApi(); $thread = $api->boards_threads_create(); SC::transfer(SCRoutes::set("threads", "show", array("boardid" => $thread->boardid, "threadid" => $thread->messageid))); } catch (Exception $ex) { SC::setFlashMessage($ex->getMessage(), "error"); $this->_new(); } } }