/** * Returns detailed information on one activity * @since 0.0.6 */ public function actionActivity() { $data = $this->parseRequest(['id' => 0]); $activity = Activity::getValidActivityWithId($data['id']); if ($data['id'] > 0 && $activity != null) { $activityInfo = Activity::getFormattedData($activity); $response = $activityInfo; } else { $response['error'] = $this->getJSONError(1, 'The supplied id is invalid!'); } echo json_encode($response); }