l10n = $l10n; $this->appConfig = $appConfig; } /** * @NoAdminRequired */ public function getSupportedMimes(){ return array( 'status' => 'success', 'mimes' => Filter::getAll() ); } /** * @param string $wopi_url * @param string $doc_format * @return JSONResponse */ public function setSettings($wopi_url, $doc_format){ $message = $this->l10n->t('Saved'); if ($wopi_url !== null){ $this->appConfig->setAppValue('wopi_url', $wopi_url); $colon = strpos($wopi_url, ':', 0); if (\OC::$server->getRequest()->getServerProtocol() !== substr($wopi_url, 0, $colon)){ $message = $this->l10n->t('Saved with error: Collabora Online should use the same protocol as the server installation.'); } } if ($doc_format !== null) { $this->appConfig->setAppValue('doc_format', $doc_format); } $richMemCache = \OC::$server->getMemCacheFactory()->create('richdocuments'); $richMemCache->clear('discovery.xml'); $response = array( 'status' => 'success', 'data' => array('message' => (string) $message) ); return new JSONResponse($response); } }