user = $user; $this->mchat = $mchat; $this->request = $request; } /** * Controller for mChat * * @param string $page The page to render, one of custom|archive|rules|whois * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object */ public function page($page) { $this->user->add_lang_ext('dmzx/mchat', 'mchat'); return call_user_func(array($this->mchat, 'page_' . $page)); } /** * Controller for mChat actions called with Ajax requests * * @param string $action The action to perform, one of add|edit|del|refresh|whois * @return A Symfony JsonResponse object. */ public function action($action) { if (!$this->request->is_ajax()) { throw new \phpbb\exception\http_exception(403, 'NO_AUTH_OPERATION'); } // Fix avatars & smilies if (!defined('PHPBB_USE_BOARD_URL_PATH')) { define('PHPBB_USE_BOARD_URL_PATH', true); } $this->user->add_lang_ext('dmzx/mchat', 'mchat'); $data = call_user_func(array($this->mchat, 'action_' . $action)); return new JsonResponse($data); } }