|
@@ -535,19 +535,19 @@ import SVGKit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- func openSelectView(items: [Any]) {
|
|
|
|
|
|
+ func openSelectView(items: [tableMetadata]) {
|
|
|
|
|
|
let navigationController = UIStoryboard(name: "NCSelect", bundle: nil).instantiateInitialViewController() as! UINavigationController
|
|
let navigationController = UIStoryboard(name: "NCSelect", bundle: nil).instantiateInitialViewController() as! UINavigationController
|
|
let topViewController = navigationController.topViewController as! NCSelect
|
|
let topViewController = navigationController.topViewController as! NCSelect
|
|
var listViewController = [NCSelect]()
|
|
var listViewController = [NCSelect]()
|
|
|
|
|
|
- var copyItems: [Any] = []
|
|
|
|
|
|
+ var copyItems: [tableMetadata] = []
|
|
for item in items {
|
|
for item in items {
|
|
copyItems.append(item)
|
|
copyItems.append(item)
|
|
}
|
|
}
|
|
|
|
|
|
let homeUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
|
|
let homeUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
|
|
- var serverUrl = (copyItems[0] as! Nextcloud.tableMetadata).serverUrl
|
|
|
|
|
|
+ var serverUrl = copyItems[0].serverUrl
|
|
|
|
|
|
// Setup view controllers such that the current view is of the same directory the items to be copied are in
|
|
// Setup view controllers such that the current view is of the same directory the items to be copied are in
|
|
while true {
|
|
while true {
|
|
@@ -616,7 +616,8 @@ import SVGKit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
let titleOffline = isOffline ? NSLocalizedString("_remove_available_offline_", comment: "") : NSLocalizedString("_set_available_offline_", comment: "")
|
|
let titleOffline = isOffline ? NSLocalizedString("_remove_available_offline_", comment: "") : NSLocalizedString("_set_available_offline_", comment: "")
|
|
-
|
|
|
|
|
|
+ let titleLock = metadata.lock ? NSLocalizedString("_unlock_file_", comment: "") : NSLocalizedString("_lock_file_", comment: "")
|
|
|
|
+ let iconLock = metadata.lock ? "lock.open" : "lock"
|
|
let copy = UIAction(title: NSLocalizedString("_copy_file_", comment: ""), image: UIImage(systemName: "doc.on.doc")) { _ in
|
|
let copy = UIAction(title: NSLocalizedString("_copy_file_", comment: ""), image: UIImage(systemName: "doc.on.doc")) { _ in
|
|
self.copyPasteboard(pasteboardOcIds: [metadata.ocId], hudView: viewController.view)
|
|
self.copyPasteboard(pasteboardOcIds: [metadata.ocId], hudView: viewController.view)
|
|
}
|
|
}
|
|
@@ -637,7 +638,10 @@ import SVGKit
|
|
viewController.reloadDataSource()
|
|
viewController.reloadDataSource()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ let lockUnlock = UIAction(title: titleLock, image: UIImage(systemName: iconLock)) { _ in
|
|
|
|
+ NCNetworking.shared.lockUnlockFile(metadata, shoulLock: !metadata.lock)
|
|
|
|
+ }
|
|
let save = UIAction(title: titleSave, image: UIImage(systemName: "square.and.arrow.down")) { _ in
|
|
let save = UIAction(title: titleSave, image: UIImage(systemName: "square.and.arrow.down")) { _ in
|
|
if metadataMOV != nil {
|
|
if metadataMOV != nil {
|
|
self.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV!)
|
|
self.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV!)
|
|
@@ -741,7 +745,21 @@ import SVGKit
|
|
|
|
|
|
// FILE
|
|
// FILE
|
|
|
|
|
|
- var children: [UIMenuElement] = [favorite, offline, openIn, rename, moveCopy, copy, copyPath, delete]
|
|
|
|
|
|
+ var children: [UIMenuElement] = [offline, openIn, moveCopy, copy, copyPath]
|
|
|
|
+
|
|
|
|
+ if !metadata.lock {
|
|
|
|
+ // Workaround: PROPPATCH doesn't work (favorite)
|
|
|
|
+ // https://github.com/nextcloud/files_lock/issues/68
|
|
|
|
+ children.insert(favorite, at: 0)
|
|
|
|
+ children.append(delete)
|
|
|
|
+ children.insert(rename, at: 3)
|
|
|
|
+ } else if enableDeleteLocal {
|
|
|
|
+ children.append(deleteConfirmLocal)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if NCManageDatabase.shared.getCapabilitiesServerInt(account: appDelegate.account, elements: NCElementsJSON.shared.capabilitiesFilesLockVersion) >= 1, metadata.canUnlock(as: appDelegate.userId) {
|
|
|
|
+ children.insert(lockUnlock, at: metadata.lock ? 0 : 1)
|
|
|
|
+ }
|
|
|
|
|
|
if (metadata.contentType != "image/svg+xml") && (metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue) {
|
|
if (metadata.contentType != "image/svg+xml") && (metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue) {
|
|
children.insert(save, at: 2)
|
|
children.insert(save, at: 2)
|
|
@@ -756,18 +774,18 @@ import SVGKit
|
|
}
|
|
}
|
|
|
|
|
|
if enableViewInFolder {
|
|
if enableViewInFolder {
|
|
- children.insert(viewInFolder, at: children.count-1)
|
|
|
|
|
|
+ children.insert(viewInFolder, at: children.count - 1)
|
|
}
|
|
}
|
|
|
|
|
|
if (!isFolderEncrypted && metadata.contentType != "image/gif" && metadata.contentType != "image/svg+xml") && (metadata.contentType == "com.adobe.pdf" || metadata.contentType == "application/pdf" || metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue) {
|
|
if (!isFolderEncrypted && metadata.contentType != "image/gif" && metadata.contentType != "image/svg+xml") && (metadata.contentType == "com.adobe.pdf" || metadata.contentType == "application/pdf" || metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue) {
|
|
- children.insert(modify, at: children.count-1)
|
|
|
|
|
|
+ children.insert(modify, at: children.count - 1)
|
|
}
|
|
}
|
|
|
|
|
|
if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue && viewController is NCCollectionViewCommon && !NCBrandOptions.shared.disable_background_image {
|
|
if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue && viewController is NCCollectionViewCommon && !NCBrandOptions.shared.disable_background_image {
|
|
let viewController: NCCollectionViewCommon = viewController as! NCCollectionViewCommon
|
|
let viewController: NCCollectionViewCommon = viewController as! NCCollectionViewCommon
|
|
let layoutKey = viewController.layoutKey
|
|
let layoutKey = viewController.layoutKey
|
|
if layoutKey == NCGlobal.shared.layoutViewFiles {
|
|
if layoutKey == NCGlobal.shared.layoutViewFiles {
|
|
- children.insert(saveBackground, at: children.count-1)
|
|
|
|
|
|
+ children.insert(saveBackground, at: children.count - 1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|