Browse Source

Merge branch 'develop' into newdrawer-fix

Philippe Weidmann 5 years ago
parent
commit
b4dce61581

+ 1 - 1
Cartfile

@@ -1,4 +1,4 @@
-github "nextcloud/ios-communication-library" "v0.5"
+github "nextcloud/ios-communication-library" "develop"
 github "tilltue/TLPhotoPicker" "2.0.7"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
 github "danielsaidi/Sheeeeeeeeet" "3.0.9"

+ 2 - 2
Cartfile.resolved

@@ -14,10 +14,10 @@ github "huri000/SwiftEntryKit" "1.2.3"
 github "jdg/MBProgressHUD" "1.1.0"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
 github "krzyzanowskim/OpenSSL" "1.0.218"
-github "malcommac/SwiftRichString" "3.6.1"
+github "malcommac/SwiftRichString" "3.7.1"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/FastScroll" "81967c2309d29bc2c330d422da612160a30bade8"
-github "nextcloud/ios-communication-library" "v0.5"
+github "nextcloud/ios-communication-library" "860e39ac5fb7955ad3f3dfd185060ead600d301d"
 github "realm/realm-cocoa" "v4.1.1"
 github "rechsteiner/Parchment" "v1.7.0"
 github "scenee/FloatingPanel" "v1.7.1"

+ 4 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -14,7 +14,7 @@
 		3781B9B023DB2B7E006B4B1D /* AppDelegate+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */; };
 		3781B9B223DB2B9F006B4B1D /* CCMain+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9B123DB2B9F006B4B1D /* CCMain+Menu.swift */; };
 		3781B9B423DB2BC9006B4B1D /* CCFavorites+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9B323DB2BC9006B4B1D /* CCFavorites+Menu.swift */; };
-		37ECC83B23D0C7410082EFA2 /* MenuAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37ECC83A23D0C7400082EFA2 /* MenuAction.swift */; };
+		37ECC83B23D0C7410082EFA2 /* NCMenuAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37ECC83A23D0C7400082EFA2 /* NCMenuAction.swift */; };
 		F700222C1EC479840080073F /* Custom.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F700222B1EC479840080073F /* Custom.xcassets */; };
 		F700222D1EC479840080073F /* Custom.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F700222B1EC479840080073F /* Custom.xcassets */; };
 		F70022B31EC4C9100080073F /* OCActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022671EC4C9100080073F /* OCActivity.m */; };
@@ -673,7 +673,7 @@
 		3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Menu.swift"; sourceTree = "<group>"; };
 		3781B9B123DB2B9F006B4B1D /* CCMain+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CCMain+Menu.swift"; sourceTree = "<group>"; };
 		3781B9B323DB2BC9006B4B1D /* CCFavorites+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CCFavorites+Menu.swift"; sourceTree = "<group>"; };
-		37ECC83A23D0C7400082EFA2 /* MenuAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuAction.swift; sourceTree = "<group>"; };
+		37ECC83A23D0C7400082EFA2 /* NCMenuAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMenuAction.swift; sourceTree = "<group>"; };
 		F700222B1EC479840080073F /* Custom.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Custom.xcassets; sourceTree = "<group>"; };
 		F70022661EC4C9100080073F /* OCActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCActivity.h; sourceTree = "<group>"; };
 		F70022671EC4C9100080073F /* OCActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCActivity.m; sourceTree = "<group>"; };
@@ -1508,7 +1508,7 @@
 				3781B9B123DB2B9F006B4B1D /* CCMain+Menu.swift */,
 				3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */,
 				3757A35423D9D76300EC369E /* NCMenuPanelController.swift */,
-				37ECC83A23D0C7400082EFA2 /* MenuAction.swift */,
+				37ECC83A23D0C7400082EFA2 /* NCMenuAction.swift */,
 				3704EB2923D5A58400455C5B /* NCMenu.storyboard */,
 			);
 			path = Menu;
@@ -3496,7 +3496,7 @@
 				F754EECA21772B6100BB1CDF /* DropUpMenu.swift in Sources */,
 				F77B0E041D118A16002130FE /* UIImage+animatedGIF.m in Sources */,
 				F7D423881F0596C6009C9782 /* ReaderThumbView.m in Sources */,
-				37ECC83B23D0C7410082EFA2 /* MenuAction.swift in Sources */,
+				37ECC83B23D0C7410082EFA2 /* NCMenuAction.swift in Sources */,
 				F73B4EFE1F470D9100BBEE4B /* LangHungarianModel.cpp in Sources */,
 				F7D4238A1F0596C6009C9782 /* ThumbsMainToolbar.m in Sources */,
 				F769454022E9F077000A798A /* NCSharePaging.swift in Sources */,

+ 15 - 5
iOSClient/CCGlobal.h

@@ -274,13 +274,9 @@
 // Toolbar Detail
 #define k_detail_Toolbar_Height                         49
 
-// Template Rich document
-#define k_richdocument_document                         @"document"
-#define k_richdocument_spreadsheet                      @"spreadsheet"
-#define k_richdocument_presentation                     @"presentation"
 
 // Template Nextcloud Text
-#define k_nextcloudtext_document                        @"textdocument"
+
 
 // Layout
 #define k_layout_list                                   @"typeLayoutList"
@@ -294,6 +290,20 @@
 // Rich Workspace
 #define k_fileNameRichWorkspace                         @"Readme.md"
 
+// Text -  OnlyOffice - Collabora
+#define k_editor_text                                   @"text"
+#define k_editor_onlyoffice                             @"onlyoffice"
+#define k_editor_collabora                              @"collabora"
+
+#define k_onlyoffice_docx                               @"onlyoffice_docx"
+#define k_onlyoffice_xlsx                               @"onlyoffice_xlsx"
+#define k_onlyoffice_pptx                               @"onlyoffice_pptx"
+
+// Template
+#define k_template_document                             @"document"
+#define k_template_spreadsheet                          @"spreadsheet"
+#define k_template_presentation                         @"presentation"
+
 // Nextcloud unsupported
 #define k_nextcloud_unsupported                         13
 

+ 21 - 9
iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

@@ -28,6 +28,8 @@ import NCCommunication
 
 class NCCreateFormUploadDocuments: XLFormViewController, NCSelectDelegate, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {
     
+    var editorId = ""
+    var creatorId = ""
     var typeTemplate = ""
     var serverUrl = ""
     var fileNameFolder = ""
@@ -265,9 +267,9 @@ class NCCreateFormUploadDocuments: XLFormViewController, NCSelectDelegate, UICol
             fileName = CCUtility.returnFileNamePath(fromFileName: fileName, serverUrl: serverUrl, activeUrl: appDelegate.activeUrl)
         }
             
-        if self.typeTemplate == k_nextcloudtext_document {
+        if self.editorId == k_editor_text || self.editorId == k_editor_onlyoffice {
                                     
-            NCCommunication.sharedInstance.NCTextCreateFile(urlString: appDelegate.activeUrl, fileNamePath: fileName, editor: "text", templateId: selectTemplate.identifier, account: self.appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
+            NCCommunication.sharedInstance.NCTextCreateFile(urlString: appDelegate.activeUrl, fileNamePath: fileName, editorId: editorId, creatorId: creatorId, templateId: selectTemplate.identifier, account: self.appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
                 
                 if errorCode == 0 && account == self.appDelegate.activeAccount {
                     
@@ -287,7 +289,9 @@ class NCCreateFormUploadDocuments: XLFormViewController, NCSelectDelegate, UICol
                 }
             }
             
-        } else {
+        }
+        
+        if self.editorId == k_editor_collabora {
             
             OCNetworking.sharedManager().createNewRichdocuments(withAccount: appDelegate.activeAccount, fileName: fileName, serverUrl: serverUrl, templateID: selectTemplate.identifier, completion: { (account, url, message, errorCode) in
                        
@@ -323,7 +327,7 @@ class NCCreateFormUploadDocuments: XLFormViewController, NCSelectDelegate, UICol
         indicator.color = NCBrandColor.sharedInstance.brand
         indicator.startAnimating()
         
-        if self.typeTemplate == k_nextcloudtext_document {
+        if self.editorId == k_editor_text || self.editorId == k_editor_onlyoffice {
             
             // default
             fileNameExtension = "md"
@@ -358,7 +362,15 @@ class NCCreateFormUploadDocuments: XLFormViewController, NCSelectDelegate, UICol
                         let temp = NCEditorTemplates()
                         
                         temp.identifier = ""
-                        temp.ext = "md"
+                        if self.editorId == k_editor_text {
+                            temp.ext = "md"
+                        } else if self.editorId == k_editor_onlyoffice && self.typeTemplate == k_template_document {
+                            temp.ext = "docx"
+                        } else if self.editorId == k_editor_onlyoffice && self.typeTemplate == k_template_spreadsheet {
+                            temp.ext = "xlsx"
+                        } else if self.editorId == k_editor_onlyoffice && self.typeTemplate == k_template_presentation {
+                            temp.ext = "pptx"
+                        }
                         temp.name = "Empty"
                         temp.preview = ""
                                                                       
@@ -378,10 +390,10 @@ class NCCreateFormUploadDocuments: XLFormViewController, NCSelectDelegate, UICol
                 }
             }
             
-        } else {
-            
-            // default
-            
+        }
+        
+        if self.editorId == k_editor_collabora  {
+                        
             OCNetworking.sharedManager().getTemplatesRichdocuments(withAccount: appDelegate.activeAccount, typeTemplate: typeTemplate, completion: { (account, templates, message, errorCode) in
                 
                 self.indicator.stopAnimating()

+ 4 - 4
iOSClient/Main/Create cloud/NCCreateMenuAdd.swift

@@ -97,7 +97,7 @@ class NCCreateMenuAdd: NSObject {
                 navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
                 
                 let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
-                viewController.typeTemplate = k_nextcloudtext_document
+                viewController.typeTemplate = k_template_document
                 viewController.serverUrl = self.appDelegate.activeMain.serverUrl
                 viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "")
                 
@@ -120,7 +120,7 @@ class NCCreateMenuAdd: NSObject {
                 navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
                 
                 let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
-                viewController.typeTemplate = k_richdocument_document
+                viewController.typeTemplate = k_template_document
                 viewController.serverUrl = self.appDelegate.activeMain.serverUrl
                 viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "")
                 
@@ -133,7 +133,7 @@ class NCCreateMenuAdd: NSObject {
                 navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
                 
                 let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
-                viewController.typeTemplate = k_richdocument_spreadsheet
+                viewController.typeTemplate = k_template_spreadsheet
                 viewController.serverUrl = self.appDelegate.activeMain.serverUrl
                 viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "")
                 
@@ -146,7 +146,7 @@ class NCCreateMenuAdd: NSObject {
                 navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
                 
                 let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
-                viewController.typeTemplate = k_richdocument_presentation
+                viewController.typeTemplate = k_template_presentation
                 viewController.serverUrl = self.appDelegate.activeMain.serverUrl
                 viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "")
                 

+ 108 - 38
iOSClient/Main/Menu/AppDelegate+Menu.swift

@@ -30,11 +30,7 @@ extension AppDelegate {
     private func initMenu() -> [NCMenuAction] {
         var actions = [NCMenuAction]()
         let appDelegate = UIApplication.shared.delegate as! AppDelegate
-        var isNextcloudTextAvailable = false
-
-        if appDelegate.reachability.isReachable() && NCBrandBeta.shared.directEditing && NCManageDatabase.sharedInstance.getDirectEditingCreators(account: appDelegate.activeAccount) != nil {
-            isNextcloudTextAvailable = true
-        }
+        let directEditingCreators = NCManageDatabase.sharedInstance.getDirectEditingCreators(account: appDelegate.activeAccount)
 
         actions.append(
             NCMenuAction(
@@ -67,41 +63,37 @@ extension AppDelegate {
                 )
             )
         }
-
-        if isNextcloudTextAvailable {
+        
+        if appDelegate.reachability.isReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == k_editor_text}) {
+            let directEditingCreator = directEditingCreators!.first(where: { $0.editor == k_editor_text})!
             actions.append(
-                NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""),
-                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "file_txt"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                    action: { menuAction in
-                        guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else {
-                            return
-                        }
-                        navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
-
-                        let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
-                        viewController.typeTemplate = k_nextcloudtext_document
-                        viewController.serverUrl = appDelegate.activeMain.serverUrl
-                        viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "")
-
-                        appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
+                NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), icon: CCGraphics.changeThemingColorImage(UIImage(named: "file_txt"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon), action: { menuAction in
+                    guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else {
+                        return
                     }
-                )
+                    navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
+                    
+                    let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
+                    viewController.editorId = k_editor_text
+                    viewController.creatorId = directEditingCreator.identifier
+                    viewController.typeTemplate = k_template_document
+                    viewController.serverUrl = appDelegate.activeMain.serverUrl
+                    viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "")
+
+                    appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
+                })
             )
         } else {
             actions.append(
-                NCMenuAction(
-                    title: NSLocalizedString("_upload_file_text_", comment: ""),
-                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "file_txt"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                    action: { menuAction in
-                        let storyboard = UIStoryboard(name: "NCText", bundle: nil)
-                        let controller = storyboard.instantiateViewController(withIdentifier: "NCText")
-                        controller.modalPresentationStyle = UIModalPresentationStyle.pageSheet
-                        appDelegate.activeMain.present(controller, animated: true, completion: nil)
-                    }
-                )
+                NCMenuAction(title: NSLocalizedString("_upload_file_text_", comment: ""), icon: CCGraphics.changeThemingColorImage(UIImage(named: "file_txt"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon), action: { menuAction in
+                    let storyboard = UIStoryboard(name: "NCText", bundle: nil)
+                    let controller = storyboard.instantiateViewController(withIdentifier: "NCText")
+                    controller.modalPresentationStyle = UIModalPresentationStyle.pageSheet
+                    appDelegate.activeMain.present(controller, animated: true, completion: nil)
+                })
             )
         }
-
+        
         #if !targetEnvironment(simulator)
             if #available(iOS 11.0, *) {
                 actions.append(
@@ -148,9 +140,84 @@ extension AppDelegate {
                 )
             }
         }
+        
+        if appDelegate.reachability.isReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == k_editor_onlyoffice && $0.identifier == k_onlyoffice_docx}) {
+            let directEditingCreator = directEditingCreators!.first(where: { $0.editor == k_editor_onlyoffice && $0.identifier == k_onlyoffice_docx})!
+            actions.append(
+                NCMenuAction(
+                    title: NSLocalizedString("_create_new_document_", comment: ""),
+                    icon: UIImage(named: "create_file_document")!,
+                    action: { menuAction in
+                        guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else {
+                            return
+                        }
+                        navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
+
+                        let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
+                        viewController.editorId = k_editor_onlyoffice
+                        viewController.creatorId = directEditingCreator.identifier
+                        viewController.typeTemplate = k_template_document
+                        viewController.serverUrl = appDelegate.activeMain.serverUrl
+                        viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "")
 
+                        appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
+                    }
+                )
+            )
+        }
+        
+        if appDelegate.reachability.isReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == k_editor_onlyoffice && $0.identifier == k_onlyoffice_xlsx}) {
+            let directEditingCreator = directEditingCreators!.first(where: { $0.editor == k_editor_onlyoffice && $0.identifier == k_onlyoffice_xlsx})!
+            actions.append(
+                NCMenuAction(
+                    title: NSLocalizedString("_create_new_spreadsheet_", comment: ""),
+                    icon: UIImage(named: "create_file_xls")!,
+                    action: { menuAction in
+                        guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else {
+                            return
+                        }
+                        navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
+
+                        let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
+                        viewController.editorId = k_editor_onlyoffice
+                        viewController.creatorId = directEditingCreator.identifier
+                        viewController.typeTemplate = k_template_spreadsheet
+                        viewController.serverUrl = appDelegate.activeMain.serverUrl
+                        viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "")
+
+                        appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
+                    }
+                )
+            )
+        }
+        
+        if appDelegate.reachability.isReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == k_editor_onlyoffice && $0.identifier == k_onlyoffice_pptx}) {
+            let directEditingCreator = directEditingCreators!.first(where: { $0.editor == k_editor_onlyoffice && $0.identifier == k_onlyoffice_pptx})!
+            actions.append(
+                NCMenuAction(
+                    title: NSLocalizedString("_create_new_presentation_", comment: ""),
+                    icon: UIImage(named: "create_file_ppt")!,
+                    action: { menuAction in
+                        guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else {
+                            return
+                        }
+                        navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
+
+                        let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
+                        viewController.editorId = k_editor_onlyoffice
+                        viewController.creatorId = directEditingCreator.identifier
+                        viewController.typeTemplate = k_template_presentation
+                        viewController.serverUrl = appDelegate.activeMain.serverUrl
+                        viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "")
+
+                        appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
+                    }
+                )
+            )
+        }
+        
         if let richdocumentsMimetypes = NCManageDatabase.sharedInstance.getRichdocumentsMimetypes(account: appDelegate.activeAccount) {
-            if richdocumentsMimetypes.count > 0 {
+            if richdocumentsMimetypes.count > 0 && appDelegate.reachability.isReachable() {
                 actions.append(
                     NCMenuAction(
                         title: NSLocalizedString("_create_new_document_", comment: ""),
@@ -162,9 +229,10 @@ extension AppDelegate {
                             navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
 
                             let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
-                            viewController.typeTemplate = k_richdocument_document
+                            viewController.editorId = k_editor_collabora
+                            viewController.typeTemplate = k_template_document
                             viewController.serverUrl = appDelegate.activeMain.serverUrl
-                            viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "")
+                            viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "")
 
                             appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
                         }
@@ -182,7 +250,8 @@ extension AppDelegate {
                             navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
 
                             let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
-                            viewController.typeTemplate = k_richdocument_spreadsheet
+                            viewController.editorId = k_editor_collabora
+                            viewController.typeTemplate = k_template_spreadsheet
                             viewController.serverUrl = appDelegate.activeMain.serverUrl
                             viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "")
 
@@ -202,7 +271,8 @@ extension AppDelegate {
                             navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
 
                             let viewController = (navigationController as! UINavigationController).topViewController as! NCCreateFormUploadDocuments
-                            viewController.typeTemplate = k_richdocument_presentation
+                            viewController.editorId = k_editor_collabora
+                            viewController.typeTemplate = k_template_presentation
                             viewController.serverUrl = appDelegate.activeMain.serverUrl
                             viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "")
 

+ 0 - 0
iOSClient/Main/Menu/MenuAction.swift → iOSClient/Main/Menu/NCMenuAction.swift


+ 1 - 1
iOSClient/RichWorkspace/NCRichWorkspaceCommon.swift

@@ -40,7 +40,7 @@ import SwiftRichString
         NCUtility.sharedInstance.startActivityIndicator(view: viewController.view, bottom: 0)
         
         let fileNamePath = CCUtility.returnFileNamePath(fromFileName: k_fileNameRichWorkspace, serverUrl: serverUrl, activeUrl: appDelegate.activeUrl)!
-        NCCommunication.sharedInstance.NCTextCreateFile(urlString: appDelegate.activeUrl, fileNamePath: fileNamePath, editor: "text", templateId: "", account: appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
+        NCCommunication.sharedInstance.NCTextCreateFile(urlString: appDelegate.activeUrl, fileNamePath: fileNamePath, editorId: "text", creatorId: "" ,templateId: "", account: appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
             
             NCUtility.sharedInstance.stopActivityIndicator()
             

+ 2 - 2
iOSClient/Utility/NCContentPresenter.swift

@@ -54,8 +54,8 @@ class NCContentPresenter: NSObject {
             case Int(CFNetworkErrors.cfurlErrorNotConnectedToInternet.rawValue):
                 let image = CCGraphics.changeThemingColorImage(UIImage(named: "networkInProgress")!, width: 40, height: 40, color: .white)
                 self.noteTop(text:  NSLocalizedString(title, comment: ""), image: image, color: .lightGray, delay: delay, name: "\(errorCode)")
-            case Int(kOCErrorServerUnauthorized), Int(kOCErrorServerForbidden):
-                break
+            //case Int(kOCErrorServerUnauthorized), Int(kOCErrorServerForbidden):
+            //    break
             default:
                 var description = description
                 if description == nil { description = "" }