| 1 |
<?php |
| 2 |
/** |
| 3 |
* Authorizer |
| 4 |
* |
| 5 |
* @license GPL-2.0+ |
| 6 |
* @link https://github.com/uhm-coe/authorizer |
| 7 |
* @package authorizer |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace Authorizer\Options; |
| 11 |
|
| 12 |
use Authorizer\Helper; |
| 13 |
use Authorizer\Options; |
| 14 |
|
| 15 |
/** |
| 16 |
* Contains functions for rendering the External Service tab in Authorizer Settings. |
| 17 |
*/ |
| 18 |
class External extends \Authorizer\Static_Instance { |
| 19 |
|
| 20 |
/** |
| 21 |
* Settings print callback. |
| 22 |
* |
| 23 |
* @param string $args Args (e.g., multisite admin mode). |
| 24 |
* @return void |
| 25 |
*/ |
| 26 |
public function print_section_info_external( $args = '' ) { |
| 27 |
?> |
| 28 |
<div id="section_info_external" class="section_info"> |
| 29 |
<p><?php esc_html_e( 'Enter your external server settings below.', 'authorizer' ); ?></p> |
| 30 |
</div> |
| 31 |
<?php |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
/** |
| 36 |
* Settings print callback. |
| 37 |
* |
| 38 |
* @param string $args Args (e.g., multisite admin mode). |
| 39 |
* @return void |
| 40 |
*/ |
| 41 |
public function print_select_auth_access_default_role( $args = '' ) { |
| 42 |
// Get plugin option. |
| 43 |
$options = Options::get_instance(); |
| 44 |
$option = 'access_default_role'; |
| 45 |
$auth_settings_option = $options->get( $option, Helper::get_context( $args ), 'allow override', 'print overlay' ); |
| 46 |
|
| 47 |
// Print option elements. |
| 48 |
?> |
| 49 |
<select id="auth_settings_<?php echo esc_attr( $option ); ?>" name="auth_settings[<?php echo esc_attr( $option ); ?>]"> |
| 50 |
<?php wp_dropdown_roles( $auth_settings_option ); ?> |
| 51 |
<option value=""<?php selected( '' === $auth_settings_option ); ?>><?php esc_html_e( '-- None --', 'authorizer' ); ?></option> |
| 52 |
</select> |
| 53 |
<?php |
| 54 |
} |
| 55 |
|
| 56 |
} |
| 57 |
|