|
@@ -21,17 +21,6 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
var switchSaveToGallery = UISwitch()
|
|
|
var switchAutoDownload = UISwitch()
|
|
|
|
|
|
- let separatorBackupRestore = UIView()
|
|
|
- let separatorNotifPersonal = UIView()
|
|
|
- let separatorAutoDownload = UIView()
|
|
|
- let separatorVersion = UIView()
|
|
|
- let separatorLogin = UIView()
|
|
|
- let separatorCFBTop = UIView()
|
|
|
- let separatorCFBBot = UIView()
|
|
|
- let separatorCYATop = UIView()
|
|
|
- let separatorCYABot = UIView()
|
|
|
- let separatorBCABot = UIView()
|
|
|
-
|
|
|
@IBOutlet weak var tableView: UITableView!
|
|
|
@IBOutlet weak var backgroundImage: UIImageView!
|
|
|
|
|
@@ -90,16 +79,6 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
}
|
|
|
|
|
|
public override func viewWillDisappear(_ animated: Bool) {
|
|
|
- separatorBackupRestore.removeFromSuperview()
|
|
|
- separatorNotifPersonal.removeFromSuperview()
|
|
|
- separatorAutoDownload.removeFromSuperview()
|
|
|
- separatorVersion.removeFromSuperview()
|
|
|
- separatorLogin.removeFromSuperview()
|
|
|
- separatorCFBTop.removeFromSuperview()
|
|
|
- separatorCFBBot.removeFromSuperview()
|
|
|
- separatorCYATop.removeFromSuperview()
|
|
|
- separatorCYABot.removeFromSuperview()
|
|
|
- separatorBCABot.removeFromSuperview()
|
|
|
if ViewController.isExpandButton {
|
|
|
ViewController.expandButton()
|
|
|
}
|
|
@@ -189,8 +168,12 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
if !isChangeProfile {
|
|
|
Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "arrow.up.and.person.rectangle.portrait"), title: "Sign-Up/Sign-In".localized()))
|
|
|
} else if isChangeProfile {
|
|
|
- Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "arrow.clockwise.icloud"), title: "Backup & Restore".localized()))
|
|
|
- Item.menus["Personal"]?.insert(Item(icon: UIImage(systemName: "lessthan.circle"), title: "Validation Transaction Limit".localized()), at: 1)
|
|
|
+ if Nexilis.checkingAccess(key: "backup_restore") {
|
|
|
+ Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "arrow.clockwise.icloud"), title: "Backup & Restore".localized()))
|
|
|
+ }
|
|
|
+ if Utils.getLimitValidTrans() == "1" {
|
|
|
+ Item.menus["Personal"]?.insert(Item(icon: UIImage(systemName: "lessthan.circle"), title: "Validation Transaction Limit".localized()), at: 1)
|
|
|
+ }
|
|
|
}
|
|
|
let image = cursorUser.string(forColumnIndex: 1)
|
|
|
if image != nil {
|
|
@@ -302,7 +285,9 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
Item(icon: UIImage(named: "pb_powered_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), title: "Powered by Nexilis".localized()),
|
|
|
]
|
|
|
if isChangeProfile {
|
|
|
- Item.menus["Version"]?.insert(Item(icon: UIImage(systemName: "rectangle.portrait.and.arrow.right"), title: "Sign-Out".localized()), at: 0)
|
|
|
+ if Nexilis.checkingAccess(key: "logout"){
|
|
|
+ Item.menus["Version"]?.insert(Item(icon: UIImage(systemName: "rectangle.portrait.and.arrow.right"), title: "Sign-Out".localized()), at: 0)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -463,10 +448,6 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
return Item.sections.count
|
|
|
}
|
|
|
|
|
|
- public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
|
|
|
- return 1
|
|
|
- }
|
|
|
-
|
|
|
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
|
|
return Item.menuFor(section: section).count
|
|
|
}
|
|
@@ -498,42 +479,18 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
case "Sign-Up/Sign-In".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
- separatorLogin.removeFromSuperview()
|
|
|
- cell.addBottomBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorLogin)
|
|
|
case "Configure Floating Button".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
- if !isChangeProfile || Utils.getEnableMobileBuilder() != "1" {
|
|
|
- separatorCFBTop.removeFromSuperview()
|
|
|
- cell.addTopBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorCFBTop)
|
|
|
- }
|
|
|
- separatorCFBBot.removeFromSuperview()
|
|
|
- cell.addBottomBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorCFBBot)
|
|
|
case "Notification Message(s)".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
- separatorNotifPersonal.removeFromSuperview()
|
|
|
- cell.addTopBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorNotifPersonal)
|
|
|
case "Backup & Restore".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
- separatorBackupRestore.removeFromSuperview()
|
|
|
- cell.addBottomBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorBackupRestore)
|
|
|
case "Validation Transaction Limit".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
case "Create Your Own App".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
- separatorCYATop.removeFromSuperview()
|
|
|
- cell.addTopBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorCYATop)
|
|
|
- if !Nexilis.showButtonFB && !Utils.getIsLoadThemeFromOther() {
|
|
|
- separatorCYABot.removeFromSuperview()
|
|
|
- cell.addBottomBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorCYABot)
|
|
|
- }
|
|
|
- case "Back to Company App".localized():
|
|
|
- if !Nexilis.showButtonFB {
|
|
|
- separatorBCABot.removeFromSuperview()
|
|
|
- cell.addBottomBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorBCABot)
|
|
|
- }
|
|
|
case "Notification Message(s) Group".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
-// case "Logout".localized():
|
|
|
case "Change Admin / Internal Password".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
case "Change Language".localized():
|
|
@@ -551,21 +508,12 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
accessoryButton.frame = CGRect(x: 0, y: 0, width: 100, height: 40)
|
|
|
accessoryButton.contentMode = .scaleAspectFit
|
|
|
cell.accessoryView = accessoryButton as UIView
|
|
|
- if !isChangeProfile {
|
|
|
- separatorVersion.removeFromSuperview()
|
|
|
- cell.addTopBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorVersion)
|
|
|
- }
|
|
|
case "Vibrate Mode".localized():
|
|
|
cell.accessoryView = switchVibrateMode
|
|
|
case "Save to Gallery".localized():
|
|
|
cell.accessoryView = switchSaveToGallery
|
|
|
case "Auto Download".localized():
|
|
|
cell.accessoryView = switchAutoDownload
|
|
|
- separatorAutoDownload.removeFromSuperview()
|
|
|
- cell.addBottomBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorAutoDownload)
|
|
|
- case "Sign-Out".localized():
|
|
|
- separatorVersion.removeFromSuperview()
|
|
|
- cell.addTopBorder(with: .lightGray.withAlphaComponent(0.5), andWidth: 1, view: separatorVersion)
|
|
|
default:
|
|
|
content.secondaryText = nil
|
|
|
}
|
|
@@ -574,6 +522,53 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
return cell
|
|
|
}
|
|
|
|
|
|
+ public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
|
|
|
+ let footerView = UIView()
|
|
|
+ if section != 3 {
|
|
|
+ footerView.backgroundColor = .clear
|
|
|
+
|
|
|
+ let lineView = UIView()
|
|
|
+ lineView.backgroundColor = .gray
|
|
|
+ lineView.translatesAutoresizingMaskIntoConstraints = false
|
|
|
+ footerView.addSubview(lineView)
|
|
|
+
|
|
|
+ NSLayoutConstraint.activate([
|
|
|
+ lineView.leadingAnchor.constraint(equalTo: footerView.leadingAnchor),
|
|
|
+ lineView.trailingAnchor.constraint(equalTo: footerView.trailingAnchor),
|
|
|
+ lineView.heightAnchor.constraint(equalToConstant: 1),
|
|
|
+ lineView.bottomAnchor.constraint(equalTo: footerView.bottomAnchor)
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ return footerView
|
|
|
+ }
|
|
|
+
|
|
|
+ public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
|
|
+ let headerView = UIView()
|
|
|
+ if (section == 2 && Item.menus["Config"]!.count > 0) || section == 3 {
|
|
|
+ headerView.backgroundColor = .clear
|
|
|
+
|
|
|
+ let lineView = UIView()
|
|
|
+ lineView.backgroundColor = .gray
|
|
|
+ lineView.translatesAutoresizingMaskIntoConstraints = false
|
|
|
+ headerView.addSubview(lineView)
|
|
|
+
|
|
|
+ NSLayoutConstraint.activate([
|
|
|
+ lineView.leadingAnchor.constraint(equalTo: headerView.leadingAnchor),
|
|
|
+ lineView.trailingAnchor.constraint(equalTo: headerView.trailingAnchor),
|
|
|
+ lineView.heightAnchor.constraint(equalToConstant: 1),
|
|
|
+ lineView.bottomAnchor.constraint(equalTo: headerView.bottomAnchor)
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ return headerView
|
|
|
+ }
|
|
|
+
|
|
|
+ public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
|
|
|
+ if section == 2 || section == 3 {
|
|
|
+ return 6
|
|
|
+ }
|
|
|
+ return 1
|
|
|
+ }
|
|
|
+
|
|
|
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
|
let item = Item.menuFor(section: indexPath.section)[indexPath.row]
|
|
|
if item.title == "Personal Information".localized() {
|