marinofaggiana 5 gadi atpakaļ
vecāks
revīzija
188e4da2b9

+ 1 - 1
iOSClient/Main/CCDetail.m

@@ -216,7 +216,7 @@
             return;
         }
         
-        // Direct Editing
+        // Direct Editing NextcloudText
         if ([[NCUtility sharedInstance] isDirectEditing:self.metadataDetail] != nil && appDelegate.reachability.isReachable) {
             
             NSString *editor = [[NCUtility sharedInstance] isDirectEditing:self.metadataDetail];

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadRichdocuments.swift

@@ -1,5 +1,5 @@
 //
-//  CCCreateCloud.swift
+//  NCCreateFormUploadRichdocuments.swift
 //  Nextcloud
 //
 //  Created by Marino Faggiana on 14/11/18.

+ 12 - 3
iOSClient/Main/Create cloud/NCCreateMenuAdd.swift

@@ -27,12 +27,17 @@ import Sheeeeeeeeet
 class NCCreateMenuAdd: NSObject {
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
+    var isNextcloudTextAvailable = false
     
     @objc init(viewController: UIViewController, view : UIView) {
         super.init()
-   
-        var items = [MenuItem]()
+
+        if self.appDelegate.reachability.isReachable() && NCManageDatabase.sharedInstance.getDirectEditingCreators(account: self.appDelegate.activeAccount) != nil {
+            isNextcloudTextAvailable = true
+        }
         
+        var items = [MenuItem]()
+
         ActionSheetTableView.appearance().backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         ActionSheetTableView.appearance().separatorColor = NCBrandColor.sharedInstance.separator
         ActionSheetItemCell.appearance().backgroundColor = NCBrandColor.sharedInstance.backgroundForm
@@ -46,7 +51,11 @@ class NCCreateMenuAdd: NSObject {
             items.append(MenuItem(title: NSLocalizedString("_im_create_new_file", tableName: "IMLocalizable", bundle: Bundle.main, value: "", comment: ""), value: 21, image: CCGraphics.scale(UIImage.init(named: "imagemeter"), to: CGSize(width: 25, height: 25), isAspectRation: true)))
         }
         
-        items.append(MenuItem(title: NSLocalizedString("_upload_file_text_", comment: ""), value: 30, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "file_txt"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon)))
+        if isNextcloudTextAvailable {
+            items.append(MenuItem(title: NSLocalizedString("_upload_file_nextcloudtext_", comment: ""), value: 31, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "file_txt"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon)))
+        } else {
+            items.append(MenuItem(title: NSLocalizedString("_upload_file_text_", comment: ""), value: 30, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "file_txt"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon)))
+        }
         
 #if !targetEnvironment(simulator)
         if #available(iOS 11.0, *) {

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -563,6 +563,7 @@
 "_upload_photos_videos_"            = "Upload photos or videos";
 "_upload_file_"                     = "Upload file";
 "_upload_file_text_"                = "Create text file";
+"_upload_file_nextcloudtext_"       = "Create text document";
 
 // Document Picker