|
@@ -30,13 +30,61 @@ import Queuer
|
|
|
|
|
|
extension NCCollectionViewCommon {
|
|
|
|
|
|
- func toggleMenu(metadata: tableMetadata, imageIcon: UIImage?) {
|
|
|
+ func toggleMenau(account: String, image: UIImage?) {
|
|
|
+ let personHeader = NCMenuAction(
|
|
|
+ title: account,
|
|
|
+ icon: image ?? NCUtility.shared.loadImage(named: "person.crop.circle"),
|
|
|
+ action: nil)
|
|
|
+
|
|
|
+ let profileAction =
|
|
|
+ NCMenuAction(
|
|
|
+ title: NSLocalizedString("_profile_", comment: ""),
|
|
|
+ icon: NCUtility.shared.loadImage(named: "globe"),
|
|
|
+ action: { menuAction in
|
|
|
+
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ let mailAction = NCMenuAction(
|
|
|
+ title: NSLocalizedString("_mail_", comment: ""),
|
|
|
+ icon: NCUtility.shared.loadImage(named: "envelope"),
|
|
|
+ action: { menuAction in
|
|
|
+
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ let talkAction =
|
|
|
+ NCMenuAction(
|
|
|
+ title: NSLocalizedString("_talk_", comment: ""),
|
|
|
+ icon: NCUtility.shared.loadImage(named: "talk-icon"),
|
|
|
+ action: { menuAction in
|
|
|
+
|
|
|
+ }
|
|
|
+ )
|
|
|
|
|
|
+ let actions = [personHeader, profileAction, mailAction, talkAction]
|
|
|
+ presentMenu(with: actions)
|
|
|
+ }
|
|
|
+
|
|
|
+ fileprivate func presentMenu(with actions: [NCMenuAction]) {
|
|
|
let menuViewController = UIStoryboard.init(name: "NCMenu", bundle: nil).instantiateInitialViewController() as! NCMenu
|
|
|
+ menuViewController.actions = actions
|
|
|
+
|
|
|
+ let menuPanelController = NCMenuPanelController()
|
|
|
+ menuPanelController.parentPresenter = self
|
|
|
+ menuPanelController.delegate = menuViewController
|
|
|
+ menuPanelController.set(contentViewController: menuViewController)
|
|
|
+ menuPanelController.track(scrollView: menuViewController.tableView)
|
|
|
+
|
|
|
+ present(menuPanelController, animated: true, completion: nil)
|
|
|
+ }
|
|
|
+
|
|
|
+ func toggleMenu(metadata: tableMetadata, imageIcon: UIImage?) {
|
|
|
+
|
|
|
var actions = [NCMenuAction]()
|
|
|
|
|
|
guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(metadata.ocId) else { return }
|
|
|
- let serverUrl = metadata.serverUrl+"/"+metadata.fileName
|
|
|
+ let serverUrl = metadata.serverUrl + "/" + metadata.fileName
|
|
|
let isFolderEncrypted = CCUtility.isFolderEncrypted(metadata.serverUrl, e2eEncrypted: metadata.e2eEncrypted, account: metadata.account, urlBase: metadata.urlBase)
|
|
|
let serverUrlHome = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
|
|
|
var isOffline = false
|
|
@@ -448,15 +496,7 @@ extension NCCollectionViewCommon {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
- menuViewController.actions = actions
|
|
|
-
|
|
|
- let menuPanelController = NCMenuPanelController()
|
|
|
- menuPanelController.parentPresenter = self
|
|
|
- menuPanelController.delegate = menuViewController
|
|
|
- menuPanelController.set(contentViewController: menuViewController)
|
|
|
- menuPanelController.track(scrollView: menuViewController.tableView)
|
|
|
-
|
|
|
- present(menuPanelController, animated: true, completion: nil)
|
|
|
+ presentMenu(with: actions)
|
|
|
}
|
|
|
|
|
|
func toggleMenuSelect() {
|