function handle($args) { parent::handle($args); $auth = new ApiAuthAction(); $auth->checkBasicAuthUser(false); $this->user = $auth->auth_user; $type = $this->trimmed('type'); $hotResult = null; switch ($type) { case 'tags': $hotResult = $this->getHotTags(); break; case 'users': $hotResult = $this->getHotUsers(); break; default: $this->clientError(_('invalid type')); return; break; } $this->initDocument('json'); $this->showJsonObjects($hotResult); $this->endDocument('json'); }