暫無描述

global-settings.php 4.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. defined('ABSPATH') || die();
  3. /** @var $view string */
  4. $allowedSubviews = array(
  5. 'general',
  6. 'privacy',
  7. 'login-form',
  8. 'comment',
  9. 'custom-actions',
  10. 'woocommerce',
  11. 'buddypress',
  12. 'memberpress',
  13. 'userpro',
  14. 'ultimate-member',
  15. 'easy-digital-downloads'
  16. );
  17. $subview = (!empty($_GET['subview']) && in_array($_GET['subview'], $allowedSubviews)) ? $_GET['subview'] : 'general';
  18. $settings = NextendSocialLogin::$settings;
  19. $proBadge = '';
  20. if (!NextendSocialLoginAdmin::isPro()) {
  21. $proBadge = '<span class="nsl-pro-badge">Pro</span>';
  22. }
  23. ?>
  24. <div class="nsl-admin-content">
  25. <h1><?php _e('Global Settings', 'nextend-facebook-connect'); ?></h1>
  26. <div class="nsl-admin-sub-nav-bar">
  27. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('general'); ?>"
  28. class="nsl-admin-nav-tab<?php if ($subview === 'general'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('General', 'nextend-facebook-connect'); ?></a>
  29. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('privacy'); ?>"
  30. class="nsl-admin-nav-tab<?php if ($subview === 'privacy'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('Privacy', 'nextend-facebook-connect'); ?></a>
  31. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('login-form'); ?>"
  32. class="nsl-admin-nav-tab<?php if ($subview === 'login-form'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('Login Form', 'nextend-facebook-connect'); ?></a>
  33. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('comment'); ?>"
  34. class="nsl-admin-nav-tab<?php if ($subview === 'comment'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('Comment', 'nextend-facebook-connect'); ?><?php echo $proBadge; ?></a>
  35. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('woocommerce'); ?>"
  36. class="nsl-admin-nav-tab<?php if ($subview === 'woocommerce'): ?> nsl-admin-nav-tab-active<?php endif; ?>">WooCommerce<?php echo $proBadge; ?></a>
  37. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('buddypress'); ?>"
  38. class="nsl-admin-nav-tab<?php if ($subview === 'buddypress'): ?> nsl-admin-nav-tab-active<?php endif; ?>">BuddyPress<?php echo $proBadge; ?></a>
  39. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('memberpress'); ?>"
  40. class="nsl-admin-nav-tab<?php if ($subview === 'memberpress'): ?> nsl-admin-nav-tab-active<?php endif; ?>">MemberPress<?php echo $proBadge; ?></a>
  41. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('userpro'); ?>"
  42. class="nsl-admin-nav-tab<?php if ($subview === 'userpro'): ?> nsl-admin-nav-tab-active<?php endif; ?>">UserPro<?php echo $proBadge; ?></a>
  43. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('ultimate-member'); ?>"
  44. class="nsl-admin-nav-tab<?php if ($subview === 'ultimate-member'): ?> nsl-admin-nav-tab-active<?php endif; ?>">Ultimate
  45. Member<?php echo $proBadge; ?></a>
  46. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('easy-digital-downloads'); ?>"
  47. class="nsl-admin-nav-tab<?php if ($subview === 'easy-digital-downloads'): ?> nsl-admin-nav-tab-active<?php endif; ?>">Easy
  48. Digital Downloads<?php echo $proBadge; ?></a>
  49. <a href="<?php echo NextendSocialLoginAdmin::getAdminSettingsUrl('custom-actions'); ?>"
  50. class="nsl-admin-nav-tab<?php if ($subview === 'custom-actions'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('Custom Actions', 'nextend-facebook-connect'); ?><?php echo $proBadge; ?></a>
  51. </div>
  52. <form method="post" action="<?php echo admin_url('admin-post.php'); ?>" novalidate="novalidate">
  53. <?php wp_nonce_field('nextend-social-login'); ?>
  54. <input type="hidden" name="action" value="nextend-social-login"/>
  55. <input type="hidden" name="view" value="<?php echo esc_attr($view); ?>"/>
  56. <input type="hidden" name="subview" value="<?php echo esc_attr($subview); ?>"/>
  57. <input type="hidden" name="settings_saved" value="1"/>
  58. <?php
  59. include(dirname(__FILE__) . '/settings/' . $subview . '.php');
  60. ?>
  61. </form>
  62. </div>