Loading Dockerfile +1 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,7 @@ RUN patch -u ${BASE_DIR}/apps/dav/lib/HookManager.php -i ${TMP_PATCH_DIR}/028-de RUN patch -u ${BASE_DIR}/apps/provisioning_api/lib/Controller/UsersController.php -i ${TMP_PATCH_DIR}/029-restrict-user-to-change-primary-email.patch RUN patch -u ${BASE_DIR}/lib/private/Security/VerificationToken/VerificationToken.php -i ${TMP_PATCH_DIR}/033-verification-token-private.patch RUN patch -u ${BASE_DIR}/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php -i ${TMP_PATCH_DIR}/034-oidc-bearer-token-auth.patch RUN patch -u ${BASE_DIR}/custom_apps/onlyoffice/lib/Controller/EditorController.php -i ${TMP_PATCH_DIR}/037-onlyoffice-active-appicon.patch RUN rm -rf ${TMP_PATCH_DIR} Loading patches/037-onlyoffice-active-appicon.patch 0 → 100644 +26 −0 Original line number Diff line number Diff line --- ./lib/Controller/EditorController.php 2024-07-22 22:58:03 +++ ./lib/Controller/EditorController-new.php 2024-07-22 23:01:12 @@ -1282,10 +1282,21 @@ $csp->addAllowedFrameDomain("'self'"); } $response->setContentSecurityPolicy($csp); - + $app = $this->appName.'_'.$this->getExt($fileId); + \OC::$server->getNavigationManager()->setActiveEntry($app); return $response; } - + private function getExt($fileId){ + $user = $this->userSession->getUser(); + $userId = null; + if (!empty($user)) { + $userId = $user->getUID(); + } + list ($file, $error, $share) = $this->getFile($userId, $fileId); + $fileName = $file->getName(); + $ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION)); + return $ext; + } /** * Print public editor section * Loading
Dockerfile +1 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,7 @@ RUN patch -u ${BASE_DIR}/apps/dav/lib/HookManager.php -i ${TMP_PATCH_DIR}/028-de RUN patch -u ${BASE_DIR}/apps/provisioning_api/lib/Controller/UsersController.php -i ${TMP_PATCH_DIR}/029-restrict-user-to-change-primary-email.patch RUN patch -u ${BASE_DIR}/lib/private/Security/VerificationToken/VerificationToken.php -i ${TMP_PATCH_DIR}/033-verification-token-private.patch RUN patch -u ${BASE_DIR}/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php -i ${TMP_PATCH_DIR}/034-oidc-bearer-token-auth.patch RUN patch -u ${BASE_DIR}/custom_apps/onlyoffice/lib/Controller/EditorController.php -i ${TMP_PATCH_DIR}/037-onlyoffice-active-appicon.patch RUN rm -rf ${TMP_PATCH_DIR} Loading
patches/037-onlyoffice-active-appicon.patch 0 → 100644 +26 −0 Original line number Diff line number Diff line --- ./lib/Controller/EditorController.php 2024-07-22 22:58:03 +++ ./lib/Controller/EditorController-new.php 2024-07-22 23:01:12 @@ -1282,10 +1282,21 @@ $csp->addAllowedFrameDomain("'self'"); } $response->setContentSecurityPolicy($csp); - + $app = $this->appName.'_'.$this->getExt($fileId); + \OC::$server->getNavigationManager()->setActiveEntry($app); return $response; } - + private function getExt($fileId){ + $user = $this->userSession->getUser(); + $userId = null; + if (!empty($user)) { + $userId = $user->getUID(); + } + list ($file, $error, $share) = $this->getFile($userId, $fileId); + $fileName = $file->getName(); + $ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION)); + return $ext; + } /** * Print public editor section *