|
@@ -616,7 +616,8 @@ import SVGKit
|
|
|
}
|
|
|
}
|
|
|
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
|
|
|
self.copyPasteboard(pasteboardOcIds: [metadata.ocId], hudView: viewController.view)
|
|
|
}
|
|
@@ -637,7 +638,10 @@ import SVGKit
|
|
|
viewController.reloadDataSource()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ let lockUnlock = UIAction(title: titleLock, image: NCUtility.shared.loadImage(named: iconLock)) { _ in
|
|
|
+ NCNetworking.shared.lockUnlockFile(metadata, shoulLock: !metadata.lock)
|
|
|
+ }
|
|
|
let save = UIAction(title: titleSave, image: UIImage(systemName: "square.and.arrow.down")) { _ in
|
|
|
if metadataMOV != nil {
|
|
|
self.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV!)
|
|
@@ -741,7 +745,7 @@ import SVGKit
|
|
|
|
|
|
// FILE
|
|
|
|
|
|
- var children: [UIMenuElement] = [favorite, offline, openIn, rename, moveCopy, copy, copyPath, delete]
|
|
|
+ var children: [UIMenuElement] = [favorite, lockUnlock, offline, openIn, rename, moveCopy, copy, copyPath, delete]
|
|
|
|
|
|
if (metadata.contentType != "image/svg+xml") && (metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue) {
|
|
|
children.insert(save, at: 2)
|
|
@@ -756,18 +760,18 @@ import SVGKit
|
|
|
}
|
|
|
|
|
|
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) {
|
|
|
- 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 {
|
|
|
let viewController: NCCollectionViewCommon = viewController as! NCCollectionViewCommon
|
|
|
let layoutKey = viewController.layoutKey
|
|
|
if layoutKey == NCGlobal.shared.layoutViewFiles {
|
|
|
- children.insert(saveBackground, at: children.count-1)
|
|
|
+ children.insert(saveBackground, at: children.count - 1)
|
|
|
}
|
|
|
}
|
|
|
|