diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fe4aad5..ca4e2b4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 2.0.2 +## Changed +- deleted unsupported methods + ## 1.4.0 ## Added - transition from the editor to the list of files in the same tab diff --git a/README.md b/README.md index 7e2378cb..b7c42d4a 100644 --- a/README.md +++ b/README.md @@ -1,69 +1,91 @@ -# ![](screenshots/icon.png) ownCloud/Nextcloud ONLYOFFICE integration app +# ![](screenshots/icon.png) Nextcloud ONLYOFFICE integration app -This app enables users to edit office documents from [ownCloud](https://owncloud.com)/[Nextcloud](https://nextcloud.com) using ONLYOFFICE Document Server. Currently the following document formats can be edited with this app: DOCX, XLSX, PPTX, TXT, CSV. The above mentioned formats are also available for viewing together with PDF. The edited files of the corresponding type can be converted into the Office Open XML formats: ODT, ODS, ODP, DOC, XLS, PPT, PPS, EPUB, RTF, HTML, HTM. +This app enables users to edit office documents from [Nextcloud](https://nextcloud.com) using ONLYOFFICE Document Server. +Currently the following document formats can be edited with this app: csv, docx, pptx, txt, xlsx. +The above mentioned formats are also available for viewing together with pdf. +The edited files of the corresponding type can be converted into the Office Open XML formats: doc, docm, dot, dotx, epub, htm, html, odp, odt, pot, potm, potx, pps, ppsm, ppsx, ppt, pptm, rtf, xls, xlsm, xlsx, xlt, xltm, xltx. -The app will create an item in the `new` (+) menu to create **Document**, **Spreadsheet**, **Presentation**. It will also create a new **Open in ONLYOFFICE** menu option within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to ownCloud/Nextcloud. +The app will create an item in the `new` (+) menu to create **Document**, **Spreadsheet**, **Presentation**. +It will also create a new **Open in ONLYOFFICE** menu option within the document library for Office documents. +This allows multiple users to collaborate in real time and to save back those changes to Nextcloud. -You can also use our **[Docker installation](https://github.com/ONLYOFFICE/docker-onlyoffice-owncloud)** to get installed and configured Document Server and ownCloud installation with a couple of commands. +You can also use our **[Docker installation](https://github.com/ONLYOFFICE/docker-onlyoffice-nextcloud)** to get installed and configured Document Server and Nextcloud installation with a couple of commands. ## Installing ONLYOFFICE Document Server -You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from ownCloud/Nextcloud and any end clients (version 4.2.7 and later are supported for use with the app). If that is not the case, use the official ONLYOFFICE Document Server documentation page: [Document Server for Linux](http://helpcenter.onlyoffice.com/server/linux/document/linux-installation.aspx). ONLYOFFICE Document Server must also be able to POST to ownCloud/Nextcloud directly. +You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from Nextcloud and any end clients (version 4.2.7 and later are supported for use with the app). +If that is not the case, use the official ONLYOFFICE Document Server documentation page: [Document Server for Linux](https://helpcenter.onlyoffice.com/server/linux/document/linux-installation.aspx). ONLYOFFICE Document Server must also be able to POST to Nextcloud directly. + +Starting with version 4.3.0, ONLYOFFICE Document Server and Nextcloud can be installed either on different computers, or on the same machine. +In case you select the latter variant, you will need to set up a custom port for Document Server as by default both ONLYOFFICE Document Server and Nextcloud work on port 80. +Or you can use Document Server behind a proxy, please refer to [this article](https://helpcenter.onlyoffice.com/server/document/document-server-proxy.aspx) to learn how you can configure it. The easiest way to start an instance of ONLYOFFICE Document Server is to use [Docker](https://github.com/ONLYOFFICE/Docker-DocumentServer). -## Installing ownCloud/Nextcloud ONLYOFFICE integration app +## Installing Nextcloud ONLYOFFICE integration app -To start using ONLYOFFICE Document Server with ownCloud/Nextcloud, the following steps must be performed: +The Nextcloud administrator can install the integration app from the in-built application market. +For that go to the user name and select **Apps**. +After that find **ONLYOFFICE** in the list of available applications and install it. -1. Go to the ownCloud/Nextcloud server _apps/_ directory (or some other directory [used](https://doc.owncloud.org/server/9.0/admin_manual/installation/apps_management_installation.html#using-custom-app-directories)): -``` -cd apps/ -``` +If the server with the Nextcloud installed does not have an Internet access, or if you need it for some other reason, the administrator can install the application manually. +To start using ONLYOFFICE Document Server with Nextcloud, the following steps must be performed: + +1. Go to the Nextcloud server _apps/_ directory (or some other directory [used](https://docs.nextcloud.com/server/13/admin_manual/installation/apps_management_installation.html#using-custom-app-directories)): + ``` + cd apps/ + ``` -2. Get the ownCloud/Nextcloud ONLYOFFICE integration app. There are several ways to do that: +2. Get the Nextcloud ONLYOFFICE integration app. +There are several ways to do that: - a. Download the latest signed version from the official store for [ownCloud 9](https://apps.owncloud.com/content/show.php?content=174798), [ownCloud 10](https://marketplace.owncloud.com/apps/onlyoffice) or [Nextcloud](https://apps.nextcloud.com/apps/onlyoffice). + a. Download the latest signed version from the official store for [Nextcloud](https://apps.nextcloud.com/apps/onlyoffice). - b. Or you can download the latest signed version from the application [release page](https://github.com/ONLYOFFICE/onlyoffice-owncloud/releases) on GitHub. + b. Or you can download the latest signed version from the application [release page](https://github.com/ONLYOFFICE/onlyoffice-nextcloud/releases) on GitHub. c. Or you can clone the application source code and compile it yourself: ``` - git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice + git clone https://github.com/ONLYOFFICE/onlyoffice-nextcloud.git onlyoffice ``` -> ownCloud version 10 does not work with unsigned applications giving an alert, so you will need to use either option **a** or **b** to get the application. - -2. Change the owner to update the application right from ownCloud/Nextcloud web interface: -``` -chown -R www-data:www-data onlyoffice -``` +2. Change the owner to update the application right from Nextcloud web interface: + ``` + chown -R www-data:www-data onlyoffice + ``` -3. In ownCloud/Nextcloud open the `~/index.php/settings/apps?category=disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application. +3. In Nextcloud open the `~/index.php/settings/apps?category=disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application. -## Configuring ownCloud/Nextcloud ONLYOFFICE integration app +## Configuring Nextcloud ONLYOFFICE integration app -In ownCloud/Nextcloud open the `~/index.php/settings/admin#onlyoffice` page with administrative settings for **ONLYOFFICE** section. Enter the following address to connect ONLYOFFICE Document Server: +In Nextcloud open the `~/index.php/settings/admin/onlyoffice` page with administrative settings for **ONLYOFFICE** section. +Enter the following address to connect ONLYOFFICE Document Server: ``` https:/// ``` -Where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed. The address must be accessible for the user browser and from the ownCloud/Nextcloud server. The ownCloud/Nextcloud server address must also be accessible from ONLYOFFICE Document Server for correct work. +Where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed. +The address must be accessible for the user browser and from the Nextcloud server. +The Nextcloud server address must also be accessible from ONLYOFFICE Document Server for correct work. -Sometimes your network configuration might not allow the requests between installed ownCloud/Nextcloud and ONLYOFFICE Document Server using the public addresses. The _Advanced server settings_ allows to set the ONLYOFFICE Document Server address for internal requests from ownCloud/Nextcloud server and the returning ownCloud/Nextcloud address for the internal requests from ONLYOFFICE Document Server. You need to enter them in the appropriate fields. +Sometimes your network configuration might not allow the requests between installed Nextcloud and ONLYOFFICE Document Server using the public addresses. +The _Advanced server settings_ allows to set the ONLYOFFICE Document Server address for internal requests from Nextcloud server and the returning Nextcloud address for the internal requests from ONLYOFFICE Document Server. +You need to enter them in the appropriate fields. -To restrict the access to ONLYOFFICE Document Server and for security reasons and data integrity the encrypted signature is used. Specify the _Secret key_ in the ownCloud/Nextcloud administrative configuration. In the ONLYOFFICE Document Server [config file](https://api.onlyoffice.com/editors/signature/) specify the same secret key and enable the validation. +To restrict the access to ONLYOFFICE Document Server and for security reasons and data integrity the encrypted signature is used. +Specify the _Secret key_ in the Nextcloud administrative configuration. +In the ONLYOFFICE Document Server [config file](https://api.onlyoffice.com/editors/signature/) specify the same secret key and enable the validation. Enable or disable the _Open file in the same tab_ setting. -The **Open in ONLYOFFICE** action will be added to the file context menu. You can specify this action as default and it will be used when the file name is clicked for the selected file types. +The **Open in ONLYOFFICE** action will be added to the file context menu. +You can specify this action as default and it will be used when the file name is clicked for the selected file types. @@ -71,11 +93,12 @@ The **Open in ONLYOFFICE** action will be added to the file context menu. You ca The ONLYOFFICE integration follows the API documented here https://api.onlyoffice.com/editors/basic: -* When creating a new file, the user navigates to a document folder within ownCloud/Nextcloud and clicks the **Document**, **Spreadsheet** or **Presentation** item in the _new_ (+) menu. +* When creating a new file, the user navigates to a document folder within Nextcloud and clicks the **Document**, **Spreadsheet** or **Presentation** item in the _new_ (+) menu. -* The browser invokes the `create` method in the `/lib/Controller/EditorController.php` controller. This method adds the copy of the file from the assets folder to the folder the user is currently in. +* The browser invokes the `create` method in the `/lib/Controller/EditorController.php` controller. +This method adds the copy of the file from the assets folder to the folder the user is currently in. -* Or, when opening an existing file, the user navigates to it within ownCloud/Nextcloud and selects the **Open in ONLYOFFICE** menu option. +* Or, when opening an existing file, the user navigates to it within Nextcloud and selects the **Open in ONLYOFFICE** menu option. * A new browser tab is opened and the `index` method of the `/lib/Controller/EditorController.php` controller is invoked. @@ -83,32 +106,40 @@ The ONLYOFFICE integration follows the API documented here https://api.onlyoffic * **url** - the URL that ONLYOFFICE Document Server uses to download the document; * **callback** - the URL that ONLYOFFICE Document Server informs about status of the document editing; - * **documentServerUrl** - the URL that the client needs to reply to ONLYOFFICE Document Server (can be set at the administrative settings page); + * **documentServerUrl** - the URL that the client needs to respond to ONLYOFFICE Document Server (can be set at the administrative settings page); * **key** - the UUID+Modified Timestamp to instruct ONLYOFFICE Document Server whether to download the document again or not; * **fileName** - the document Title (name); * **userId** - the identification of the user; * **userName** - the name of the user. -* ownCloud/Nextcloud takes this object and constructs a page from `templates/editor.php` template, filling in all of those values so that the client browser can load up the editor. +* Nextcloud takes this object and constructs a page from `templates/editor.php` template, filling in all of those values so that the client browser can load up the editor. * The client browser makes a request for the javascript library from ONLYOFFICE Document Server and sends ONLYOFFICE Document Server the DocEditor configuration with the above properties. -* Then ONLYOFFICE Document Server downloads the document from ownCloud/Nextcloud and the user begins editing. +* Then ONLYOFFICE Document Server downloads the document from Nextcloud and the user begins editing. -* ONLYOFFICE Document Server sends a POST request to the _callback_ URL to inform ownCloud/Nextcloud that a user is editing the document. +* ONLYOFFICE Document Server sends a POST request to the _callback_ URL to inform Nextcloud that a user is editing the document. * When all users and client browsers are done with editing, they close the editing window. -* After 10 seconds of inactivity, ONLYOFFICE Document Server sends a POST to the _callback_ URL letting ownCloud/Nextcloud know that the clients have finished editing the document and closed it. +* After [10 seconds](https://api.onlyoffice.com/editors/save#savedelay) of inactivity, ONLYOFFICE Document Server sends a POST to the _callback_ URL letting Nextcloud know that the clients have finished editing the document and closed it. -* ownCloud/Nextcloud downloads the new version of the document, replacing the old one. +* Nextcloud downloads the new version of the document, replacing the old one. ## Known issues -* If the document is shared using the **Federated Cloud Sharing** app, the co-editing among the servers will not be avaialble. The users from one and the same server can edit the document in the co-editing mode, but the users from two (or more) different servers will not be able to collaborate on the same document in real time. +* If the document is shared using the **Federated Cloud Sharing** app, the co-editing among the servers will not be avaialble. +The users from one and the same server can edit the document in the co-editing mode, but the users from two (or more) different servers will not be able to collaborate on the same document in real time. -* Adding the storage using the **External storages** app has issues with the co-editing in some cases. If the connection is made using the same authorization keys (the _Username and password_ or _Global credentials_ authentication type is selected), then the co-editing is available for the users. If different authorization keys are used (_Log-in credentials, save in database_ or _User entered, store in database_ authentication options), the co-editing is not available. When the _Log-in credentials, save in session_ authentication type is used, the files cannot be opened in the editor. +* Adding the storage using the **External storages** app has issues with the co-editing in some cases. +If the connection is made using the same authorization keys (the _Username and password_ or _Global credentials_ authentication type is selected), then the co-editing is available for the users. +If different authorization keys are used (_Log-in credentials, save in database_ or _User entered, store in database_ authentication options), the co-editing is not available. +When the _Log-in credentials, save in session_ authentication type is used, the files cannot be opened in the editor. -* ownCloud/Nextcloud provides an option to encrypt the file storage. But if the encryption with the _per-user encryption keys_ (used by default in ownCloud/Nextcloud **Default encryption module** app) is enabled, ONLYOFFICE Document Server cannot open the encrypted files for editing and save them after the editing. The ONLYOFFICE section of the administrative settings page will display a notification about it. However if you set the encryption with the _master key_, ONLYOFFICE application will work as intended. The instruction on enabling _master key_ based encryption is available in the official documentation on [ownCloud](https://doc.owncloud.org/server/latest/admin_manual/configuration_files/encryption_configuration.html#enabling-master-key-based-encryption)/[Nextcloud](https://docs.nextcloud.com/server/12/admin_manual/configuration_files/encryption_configuration.html#occ-encryption-commands) websites. +* Nextcloud provides an option to encrypt the file storage. +But if the encryption with the _per-user encryption keys_ (used by default in Nextcloud **Default encryption module** app) is enabled, ONLYOFFICE Document Server cannot open the encrypted files for editing and save them after the editing. +The ONLYOFFICE section of the administrative settings page will display a notification about it. +However if you set the encryption with the _master key_, ONLYOFFICE application will work as intended. +The instruction on enabling _master key_ based encryption is available in the official documentation on [Nextcloud](https://docs.nextcloud.com/server/13/admin_manual/configuration_files/encryption_configuration.html#occ-encryption-commands) websites. diff --git a/appinfo/app.php b/appinfo/app.php index 7ddc0624..e39c69a6 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -29,11 +29,4 @@ namespace OCA\Onlyoffice\AppInfo; -use OCP\App; - -/** - * Administration settings - */ -App::registerAdmin("onlyoffice", "settings"); - $app = new Application(); diff --git a/appinfo/application.php b/appinfo/application.php index 85897576..b13b7f32 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -38,7 +38,6 @@ use OCA\Onlyoffice\Controller\EditorController; use OCA\Onlyoffice\Controller\SettingsController; use OCA\Onlyoffice\Crypt; -use OCA\Onlyoffice\Hookhandler; class Application extends App { @@ -74,7 +73,13 @@ function() { } }); - Util::connectHook("OCP\Share", "share_link_access", Hookhandler::class, "PublicPage"); + $eventDispatcher->addListener("OCA\Files_Sharing::loadAdditionalScripts", + function() { + if (!empty($this->appConfig->GetDocumentServerUrl()) && $this->appConfig->SettingsAreSuccessful()) { + Util::addScript("onlyoffice", "main"); + Util::addStyle("onlyoffice", "main"); + } + }); require_once __DIR__ . "/../3rdparty/jwt/BeforeValidException.php"; require_once __DIR__ . "/../3rdparty/jwt/ExpiredException.php"; diff --git a/appinfo/info.xml b/appinfo/info.xml index 8c41b309..e0529960 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -6,16 +6,16 @@ ONLYOFFICE connector ONLYOFFICE connector enables you to edit Office documents within ONLYOFFICE from the familiar web interface. This will create a new Open in ONLYOFFICE action within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to your file storage. agpl - Ascensio System SIA - 1.4.0 + Ascensio System SIA + 2.0.2 Onlyoffice - https://api.onlyoffice.com/editors/owncloud - https://api.onlyoffice.com/editors/owncloud - https://api.onlyoffice.com/editors/owncloud + https://api.onlyoffice.com/editors/nextcloud + https://api.onlyoffice.com/editors/nextcloud + https://api.onlyoffice.com/editors/nextcloud files integration @@ -23,13 +23,14 @@ organization tools https://www.onlyoffice.com - https://github.com/ONLYOFFICE/onlyoffice-owncloud/issues - https://github.com/ONLYOFFICE/onlyoffice-owncloud.git - https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-owncloud/master/screenshots/main.png - https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-owncloud/master/screenshots/settings.png + https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues + https://github.com/ONLYOFFICE/onlyoffice-nextcloud.git + https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/main.png + https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/settings.png + https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/new.png + https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/open.png - - + OCA\Onlyoffice\AdminSettings diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php index 39d3621b..44a78f62 100644 --- a/controller/settingscontroller.php +++ b/controller/settingscontroller.php @@ -130,8 +130,8 @@ public function index() { * Save app settings * * @param string $documentserver - document service address - * @param string $documentserverInternal - document service address available from ownCloud - * @param string $storageUrl - ownCloud address available from document server + * @param string $documentserverInternal - document service address available from Nextcloud + * @param string $storageUrl - Nextcloud address available from document server * @param string $secret - secret key for signature * @param string $defFormats - formats array with default action * @@ -179,7 +179,6 @@ public function SaveSettings($documentserver, * @return array * * @NoAdminRequired - * @NoCSRFRequired * @PublicPage */ public function GetSettings() { diff --git a/css/editor.css b/css/editor.css index 7d74b5ca..1525dfd1 100644 --- a/css/editor.css +++ b/css/editor.css @@ -26,7 +26,11 @@ * */ -#app > iframe { +#content.app-onlyoffice { + min-height: calc(100% - 50px); +} + + #app > iframe { position: absolute; vertical-align: top; } diff --git a/css/main.css b/css/main.css index 40cbb0cc..87df0ff5 100644 --- a/css/main.css +++ b/css/main.css @@ -34,4 +34,8 @@ } .icon-onlyoffice-new-pptx { background-image: url("../img/new-pptx.svg"); +} +.icon-onlyoffice-open, +.icon-onlyoffice-convert { + background-image: url("../img/app-dark.svg"); } \ No newline at end of file diff --git a/img/new-docx.svg b/img/new-docx.svg index 449c626d..20a4d2cd 100644 --- a/img/new-docx.svg +++ b/img/new-docx.svg @@ -1,7 +1,7 @@ - ownCloud-icon-doc-16x16 + Nextcloud-icon-doc-16x16 Created with Sketch. diff --git a/img/new-pptx.svg b/img/new-pptx.svg index 15f7ded1..b818a8d2 100644 --- a/img/new-pptx.svg +++ b/img/new-pptx.svg @@ -1,7 +1,7 @@ - ownCloud-icon-pres-16x16 + Nextcloud-icon-pres-16x16 Created with Sketch. diff --git a/img/new-xlsx.svg b/img/new-xlsx.svg index fecfcf49..5da580f4 100644 --- a/img/new-xlsx.svg +++ b/img/new-xlsx.svg @@ -1,7 +1,7 @@ - ownCloud-icon-ss-16x16 + Nextcloud-icon-ss-16x16 Created with Sketch. diff --git a/js/main.js b/js/main.js index e87de710..e02aa93a 100644 --- a/js/main.js +++ b/js/main.js @@ -153,17 +153,18 @@ } var register = function() { - var mimes = OCA.Onlyoffice.setting.formats; + var formats = OCA.Onlyoffice.setting.formats; - $.each(mimes, function (ext, attr) { + $.each(formats, function (ext, attr) { + if (!attr.mime) { + return true; + } fileList.fileActions.registerAction({ name: "onlyofficeOpen", displayName: t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE"), mime: attr.mime, permissions: OC.PERMISSION_READ, - icon: function () { - return OC.imagePath(OCA.Onlyoffice.AppName, "app-dark"); - }, + iconClass: "icon-onlyoffice-open", actionHandler: OCA.Onlyoffice.FileClick }); @@ -177,9 +178,7 @@ displayName: t(OCA.Onlyoffice.AppName, "Convert with ONLYOFFICE"), mime: attr.mime, permissions: OC.PERMISSION_READ, - icon: function () { - return OC.imagePath(OCA.Onlyoffice.AppName, "app-dark"); - }, + iconClass: "icon-onlyoffice-convert", actionHandler: OCA.Onlyoffice.FileConvertClick }); } @@ -239,9 +238,9 @@ var extension = fileName.substr(fileName.lastIndexOf(".") + 1).toLowerCase(); var initSharedButton = function() { - var mimes = OCA.Onlyoffice.setting.formats; + var formats = OCA.Onlyoffice.setting.formats; - var conf = mimes[extension]; + var conf = formats[extension]; if (conf) { var button = document.createElement("a"); button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val())); diff --git a/lib/adminsettings.php b/lib/adminsettings.php index 9f96d864..e0376d41 100644 --- a/lib/adminsettings.php +++ b/lib/adminsettings.php @@ -43,25 +43,7 @@ public function __construct() { } /** - * Print config section (ownCloud 10) - * - * @return TemplateResponse - */ - public function getPanel() { - return $this->getForm(); - } - - /** - * Get section ID (ownCloud 10) - * - * @return string - */ - public function getSectionID() { - return "general"; - } - - /** - * Print config section (Nextcloud) + * Print config section * * @return TemplateResponse */ @@ -73,7 +55,7 @@ public function getForm() { } /** - * Get section ID (Nextcloud) + * Get section ID * * @return string */ diff --git a/lib/appconfig.php b/lib/appconfig.php index 07df837a..c585ec8f 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -68,14 +68,14 @@ class AppConfig { private $_documentserver = "DocumentServerUrl"; /** - * The config key for the document server address available from ownCloud + * The config key for the document server address available from Nextcloud * * @var string */ private $_documentserverInternal = "DocumentServerInternalUrl"; /** - * The config key for the ownCloud address available from document server + * The config key for the Nextcloud address available from document server * * @var string */ @@ -230,7 +230,7 @@ public function GetDocumentServerUrl() { } /** - * Save the document service address available from ownCloud to the application configuration + * Save the document service address available from Nextcloud to the application configuration * * @param string $documentServer - document service address */ @@ -249,7 +249,7 @@ public function SetDocumentServerInternalUrl($documentServerInternal) { } /** - * Get the document service address available from ownCloud from the application configuration + * Get the document service address available from Nextcloud from the application configuration * * @return string */ @@ -265,7 +265,7 @@ public function GetDocumentServerInternalUrl($origin) { } /** - * Save the ownCloud address available from document server to the application configuration + * Save the Nextcloud address available from document server to the application configuration * * @param string $documentServer - document service address */ @@ -284,7 +284,7 @@ public function SetStorageUrl($storageUrl) { } /** - * Get the ownCloud address available from document server from the application configuration + * Get the Nextcloud address available from document server from the application configuration * * @return string */ @@ -439,33 +439,24 @@ public function SettingsAreSuccessful() { */ public $formats = [ "csv" => [ "mime" => "text/csv", "type" => "spreadsheet", "edit" => true ], - "djvu" => [ "mime" => "image/vnd.djvu", "type" => "text" ], "doc" => [ "mime" => "application/msword", "type" => "text", "conv" => true ], "docm" => [ "mime" => "application/vnd.ms-word.document.macroEnabled.12", "type" => "text", "conv" => true ], "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true ], - "dot" => [ "mime" => "application/msword", "type" => "text", "conv" => true ], - "dotm" => [ "mime" => "application/vnd.ms-word.template.macroEnabled.12", "type" => "text", "conv" => true ], + "dot" => [ "type" => "text", "conv" => true ], "dotx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "type" => "text", "conv" => true ], "epub" => [ "mime" => "application/epub+zip", "type" => "text", "conv" => true ], - "fodp" => [ "mime" => "application/vnd.oasis.opendocument.presentation", "type" => "presentation", "conv" => true ], - "fods" => [ "mime" => "application/vnd.oasis.opendocument.spreadsheet", "type" => "spreadsheet", "conv" => true ], - "fodt" => [ "mime" => "application/vnd.oasis.opendocument.text", "type" => "text", "conv" => true ], - "htm" => [ "mime" => "text/html", "type" => "text", "conv" => true ], + "htm" => [ "type" => "text", "conv" => true ], "html" => [ "mime" => "text/html", "type" => "text", "conv" => true ], - "mht" => [ "mime" => "message/rfc822", "conv" => true ], "odp" => [ "mime" => "application/vnd.oasis.opendocument.presentation", "type" => "presentation", "conv" => true ], "ods" => [ "mime" => "application/vnd.oasis.opendocument.spreadsheet", "type" => "spreadsheet", "conv" => true ], "odt" => [ "mime" => "application/vnd.oasis.opendocument.text", "type" => "text", "conv" => true ], - "otp" => [ "mime" => "application/vnd.oasis.opendocument.presentation-template", "type" => "presentation", "conv" => true ], - "ots" => [ "mime" => "application/vnd.oasis.opendocument.spreadsheet-template", "type" => "spreadsheet", "conv" => true ], - "ott" => [ "mime" => "application/vnd.oasis.opendocument.text-template", "type" => "text", "conv" => true ], "pdf" => [ "mime" => "application/pdf", "type" => "text" ], - "pot" => [ "mime" => "application/mspowerpoint", "type" => "presentation", "conv" => true ], + "pot" => [ "type" => "presentation", "conv" => true ], "potm" => [ "mime" => "application/vnd.ms-powerpoint.template.macroEnabled.12", "type" => "presentation", "conv" => true ], "potx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.template", "type" => "presentation", "conv" => true ], - "pps" => [ "mime" => "application/vnd.ms-powerpoint", "type" => "presentation", "conv" => true ], + "pps" => [ "type" => "presentation", "conv" => true ], "ppsm" => [ "mime" => "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", "type" => "presentation", "conv" => true ], - "ppsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "type" => "presentation", "edit" => true, "def" => true ], + "ppsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "type" => "presentation", "conv" => true ], "ppt" => [ "mime" => "application/vnd.ms-powerpoint", "type" => "presentation", "conv" => true ], "pptm" => [ "mime" => "application/vnd.ms-powerpoint.presentation.macroEnabled.12", "type" => "presentation", "conv" => true ], "pptx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "presentation", "edit" => true, "def" => true ], @@ -474,9 +465,8 @@ public function SettingsAreSuccessful() { "xls" => [ "mime" => "application/vnd.ms-excel", "type" => "spreadsheet", "conv" => true ], "xlsm" => [ "mime" => "application/vnd.ms-excel.sheet.macroEnabled.12", "type" => "spreadsheet", "conv" => true ], "xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "spreadsheet", "edit" => true, "def" => true ], - "xlt" => [ "mime" => "application/excel", "type" => "spreadsheet", "conv" => true ], + "xlt" => [ "type" => "spreadsheet", "conv" => true ], "xltm" => [ "mime" => "application/vnd.ms-excel.template.macroEnabled.12", "type" => "spreadsheet", "conv" => true ], - "xltx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "type" => "spreadsheet", "conv" => true ], - "xps" => [ "mime" => "application/vnd.ms-xpsdocument", "type" => "text" ] + "xltx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "type" => "spreadsheet", "conv" => true ] ]; } diff --git a/lib/hookhandler.php b/lib/hookhandler.php deleted file mode 100644 index d61a3b83..00000000 --- a/lib/hookhandler.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * @copyright Copyright (c) 2018, ownCloud GmbH - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -namespace OCA\Onlyoffice; - -use OCP\Util; - -use OCA\Onlyoffice\AppConfig; - -/** - * Class HookHandler - * - * handles hooks - * - * @package OCA\Onlyoffice - */ -class HookHandler { - - public static function PublicPage() { - $appName = "onlyoffice"; - - $appConfig = new AppConfig($appName); - - if (!empty($appConfig->GetDocumentServerUrl()) && $appConfig->SettingsAreSuccessful()) { - Util::addScript("onlyoffice", "main"); - Util::addStyle("onlyoffice", "main"); - } - } -} diff --git a/screenshots/main.png b/screenshots/main.png index d7f7c189..5b1ea55b 100644 Binary files a/screenshots/main.png and b/screenshots/main.png differ diff --git a/screenshots/main_small.png b/screenshots/main_small.png index c80dfe20..3c9d25d6 100644 Binary files a/screenshots/main_small.png and b/screenshots/main_small.png differ diff --git a/screenshots/new.png b/screenshots/new.png new file mode 100644 index 00000000..28e6dab9 Binary files /dev/null and b/screenshots/new.png differ diff --git a/screenshots/open.png b/screenshots/open.png new file mode 100644 index 00000000..de46454b Binary files /dev/null and b/screenshots/open.png differ diff --git a/screenshots/settings.png b/screenshots/settings.png index 2dc9f499..de805138 100644 Binary files a/screenshots/settings.png and b/screenshots/settings.png differ diff --git a/templates/settings.php b/templates/settings.php index f9e99ec4..650ddd89 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -32,14 +32,14 @@ ?>

ONLYOFFICE

- "> + ">

t("ONLYOFFICE Document Service Location specifies the address of the server with the document services installed. Please change the '' for the server address in the below line.")) ?>

t("Encryption App is enabled, the application cannot work. You can continue working with the application if you enable master key.")) ?> - +

@@ -68,7 +68,8 @@

t("The default application for opening the format")) ?>

- $setting) { ?> + $setting) { + if (array_key_exists("mime", $setting)) { ?>
checked="checked" />
- +
t("Save")) ?>