Bez popisu

general-pro.php 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. defined('ABSPATH') || die();
  3. $isPRO = NextendSocialLoginAdmin::isPro();
  4. if (!$isPRO):
  5. ?>
  6. <p class="submit">
  7. <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save Changes'); ?>">
  8. </p>
  9. <hr/>
  10. <h1><?php _e('PRO settings', 'nextend-facebook-connect'); ?></h1>
  11. <?php
  12. endif;
  13. $attr = '';
  14. if (!$isPRO) {
  15. $attr = ' disabled ';
  16. }
  17. $settings = NextendSocialLogin::$settings;
  18. NextendSocialLoginAdmin::showProBox();
  19. ?>
  20. <table class="form-table">
  21. <tbody>
  22. <tr>
  23. <th scope="row"><?php _e('Target window', 'nextend-facebook-connect'); ?></th>
  24. <td>
  25. <fieldset>
  26. <label><input type="radio" name="target"
  27. value="prefer-popup" <?php if ($settings->get('target') == 'prefer-popup') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
  28. <span><?php _e('Prefer popup', 'nextend-facebook-connect'); ?></span></label><br>
  29. <label><input type="radio" name="target"
  30. value="prefer-new-tab" <?php if ($settings->get('target') == 'prefer-new-tab') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
  31. <span><?php _e('Prefer new tab', 'nextend-facebook-connect'); ?></span></label><br>
  32. <label><input type="radio" name="target"
  33. value="prefer-same-window" <?php if ($settings->get('target') == 'prefer-same-window') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
  34. <span><?php _e('Prefer same window', 'nextend-facebook-connect'); ?></span></label><br>
  35. </fieldset>
  36. </td>
  37. </tr>
  38. <tr>
  39. <th scope="row"><?php _e('Registration notification sent to', 'nextend-facebook-connect'); ?></th>
  40. <td>
  41. <fieldset>
  42. <label><input type="radio" name="registration_notification_notify"
  43. value="0" <?php if ($settings->get('registration_notification_notify') == '0') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
  44. <span><?php _e('WordPress default', 'nextend-facebook-connect'); ?></span></label><br>
  45. <label><input type="radio" name="registration_notification_notify"
  46. value="nobody" <?php if ($settings->get('registration_notification_notify') == 'nobody') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
  47. <span><?php _e('Nobody', 'nextend-facebook-connect'); ?></span></label><br>
  48. <label><input type="radio" name="registration_notification_notify"
  49. value="user" <?php if ($settings->get('registration_notification_notify') == 'user') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
  50. <span><?php _e('User', 'nextend-facebook-connect'); ?></span></label><br>
  51. <label><input type="radio" name="registration_notification_notify"
  52. value="admin" <?php if ($settings->get('registration_notification_notify') == 'admin') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
  53. <span><?php _e('Admin', 'nextend-facebook-connect'); ?></span></label><br>
  54. <label><input type="radio" name="registration_notification_notify"
  55. value="both" <?php if ($settings->get('registration_notification_notify') == 'both') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
  56. <span><?php _e('User and Admin', 'nextend-facebook-connect'); ?></span></label><br>
  57. </fieldset>
  58. </td>
  59. </tr>
  60. <tr>
  61. <th scope="row"><?php _e('Unlink', 'nextend-facebook-connect'); ?></th>
  62. <td>
  63. <fieldset>
  64. <label>
  65. <input type='hidden' name='allow_unlink' value='0'>
  66. <input type="checkbox" name="allow_unlink" value="1" <?php if ($settings->get('allow_unlink') != '0') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
  67. <span><?php _e('Allow Social account unlink', 'nextend-facebook-connect'); ?></span></label><br>
  68. </fieldset>
  69. </td>
  70. </tr>
  71. <tr>
  72. <th scope="row"><?php _e('Show linked providers', 'nextend-facebook-connect'); ?></th>
  73. <td>
  74. <fieldset>
  75. <label><input type="radio" name="show_linked_providers"
  76. value="0" <?php if ($settings->get('show_linked_providers') == '0') : ?> checked="checked" <?php endif; ?> <?php echo $attr; ?>>
  77. <span><?php _e('Disabled', 'nextend-facebook-connect'); ?></span></label><br>
  78. <label><input type="radio" name="show_linked_providers"
  79. value="1" <?php if ($settings->get('show_linked_providers') == '1') : ?> checked="checked" <?php endif; ?> <?php echo $attr; ?>>
  80. <span><?php _e('Enabled', 'nextend-facebook-connect'); ?></span></label><br>
  81. </fieldset>
  82. <p class="description" id="tagline-show-linked-providers"><?php printf(__('Providers linked to the account will appear in the %1$s.', 'nextend-facebook-connect'), ' <a href="' . admin_url('users.php') . '" target="_blank">' . __('Users table', 'nextend-facebook-connect') . '</a>') ?></p>
  83. </td>
  84. </tr>
  85. <tr>
  86. <th scope="row"><?php _e('Disable Admin bar for roles', 'nextend-facebook-connect'); ?></th>
  87. <td>
  88. <?php
  89. $wp_roles = new WP_Roles();
  90. $roles = $wp_roles->get_names();
  91. $adminbar_disabled_roles = $settings->get('admin_bar_roles');
  92. foreach ($roles AS $roleKey => $label):
  93. ?>
  94. <fieldset><label for="admin_bar_roles_<?php echo esc_attr($roleKey); ?>">
  95. <input name="admin_bar_roles[]" type="checkbox"
  96. id="admin_bar_roles_<?php echo esc_attr($roleKey); ?>"
  97. value="<?php echo esc_attr($roleKey); ?>" <?php if (in_array($roleKey, $adminbar_disabled_roles)) : ?> checked="checked" <?php endif ?> <?php echo $attr; ?> />
  98. <?php echo $label; ?></label>
  99. </fieldset>
  100. <?php endforeach; ?>
  101. <input type="hidden" name="admin_bar_roles[]" value=""/>
  102. </td>
  103. <td>
  104. <fieldset>
  105. <input type='hidden' name='admin_bar_roles[]' value='0'>
  106. </fieldset>
  107. </td>
  108. </tr>
  109. </tbody>
  110. </table>
  111. <?php if ($isPRO): ?>
  112. <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary"
  113. value="<?php _e('Save Changes'); ?>"></p>
  114. <?php endif; ?>