| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
// Client Access Settings |
| 5 |
|
| 6 |
add_action( 'ucd_settings_content', 'ucd_client_access_page' ); |
| 7 |
function ucd_client_access_page() { |
| 8 |
global $ucd_active_tab; |
| 9 |
if ( 'client-access' != $ucd_active_tab ) { |
| 10 |
return; |
| 11 |
} |
| 12 |
?> |
| 13 |
|
| 14 |
<h3><?php _e( 'Assign Client Capabilities', 'ultimate-client-dash' ); ?></h3> |
| 15 |
|
| 16 |
<!-- Begin settings form --> |
| 17 |
<form action="options.php" method="post"> |
| 18 |
<?php |
| 19 |
settings_fields( 'ultimate-client-dash-client' ); |
| 20 |
do_settings_sections( 'ultimate-client-dash-client' ); |
| 21 |
?> |
| 22 |
|
| 23 |
<!-- Client Option Section --> |
| 24 |
|
| 25 |
<div class="ucd-inner-wrapper settings-client-access"> |
| 26 |
<p class="ucd-settings-desc" style="padding-bottom: 6px;">Limiting user or client capabilities on a WordPress website can be very useful. To limit a clients capabilities, assign their account to the new role "Client" and select the options below. Clients will no longer be able to access or see these features and menu items. Select which capabilities you would like to give your client. To learn more view our online <a href="https://ultimateclientdash.com/client-access/" target="_blank">documentation</a>.</p> |
| 27 |
|
| 28 |
<div class="ucd-form-message"><?php settings_errors( 'ucd-notices' ); ?></div> |
| 29 |
|
| 30 |
<table class="form-table"> |
| 31 |
<tbody> |
| 32 |
|
| 33 |
<div class="ucd-dynamic-item"> |
| 34 |
<div class="ucd-item-name"><?php _e( 'Appearance', 'ultimate-client-dash' ); ?></div> |
| 35 |
<div class="ucd-item-capabilities"> |
| 36 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_appearance" value="ucd_role_apperearance" <?php checked( 'ucd_role_apperearance', get_option( 'ucd_client_appearance' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 37 |
</div> |
| 38 |
</div> |
| 39 |
|
| 40 |
<div class="ucd-dynamic-item ucd-dynamic-pro"> |
| 41 |
<div class="ucd-item-name"><?php _e( 'Settings', 'ultimate-client-dash' ); ?></div> |
| 42 |
<div class="ucd-item-capabilities"> |
| 43 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_settings" value="ucd_client_settings" <?php checked( 'ucd_client_settings', get_option( 'ucd_client_settings' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 44 |
</div> |
| 45 |
</div> |
| 46 |
|
| 47 |
<div class="ucd-dynamic-item ui-state-default top-menu"> |
| 48 |
<a class="ucd-item-toggle" href="#"></a> |
| 49 |
<div class="ucd-item-name"><?php _e( 'Manage Users', 'ultimate-client-dash' ); ?></div> |
| 50 |
<div class="ucd-item-capabilities"> |
| 51 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_manage_users" value="ucd_client_manage_users" <?php checked( 'ucd_client_manage_users', get_option( 'ucd_client_manage_users' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 52 |
</div> |
| 53 |
</div> |
| 54 |
|
| 55 |
<div class="ucd-dynamic-subitems-wrap ucd-dynamic-capabilities ucd-item-hidden"> |
| 56 |
<div class="ucd-dynamic-subitems-flex"> |
| 57 |
<div class="ucd-dynamic-item ui-state-default submenu"> |
| 58 |
<div class="ucd-item-name"><?php _e( 'Manage Administrators', 'ultimate-client-dash' ); ?><span style="opacity: 0.45; font-size: 12px; padding-left: 7px"> - Manage users must be enabled</span></div> |
| 59 |
<div class="ucd-item-capabilities"> |
| 60 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_manage_administrators" value="ucd_client_manage_administrators" <?php checked( 'ucd_client_manage_administrators', get_option( 'ucd_client_manage_administrators' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 61 |
</div> |
| 62 |
</div> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
|
| 66 |
<div class="ucd-dynamic-item"> |
| 67 |
<div class="ucd-item-name"><?php _e( 'Manage Plugins', 'ultimate-client-dash' ); ?></div> |
| 68 |
<div class="ucd-item-capabilities"> |
| 69 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_manage_plugins" value="ucd_client_manage_plugins" <?php checked( 'ucd_client_manage_plugins', get_option( 'ucd_client_manage_plugins' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 70 |
</div> |
| 71 |
</div> |
| 72 |
|
| 73 |
<div class="ucd-dynamic-item"> |
| 74 |
<div class="ucd-item-name"><?php _e( 'Manage Themes', 'ultimate-client-dash' ); ?></div> |
| 75 |
<div class="ucd-item-capabilities"> |
| 76 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_manage_themes" value="ucd_client_manage_themes" <?php checked( 'ucd_client_manage_themes', get_option( 'ucd_client_manage_themes' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 77 |
</div> |
| 78 |
</div> |
| 79 |
|
| 80 |
<div class="ucd-dynamic-item"> |
| 81 |
<div class="ucd-item-name"><?php _e( 'Update WordPress', 'ultimate-client-dash' ); ?></div> |
| 82 |
<div class="ucd-item-capabilities"> |
| 83 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_update_capability" value="ucd_client_update_capability" <?php checked( 'ucd_client_update_capability', get_option( 'ucd_client_update_capability' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 84 |
</div> |
| 85 |
</div> |
| 86 |
|
| 87 |
<div class="ucd-dynamic-item"> |
| 88 |
<div class="ucd-item-name"><?php _e( 'Edit Code Files', 'ultimate-client-dash' ); ?></div> |
| 89 |
<div class="ucd-item-capabilities"> |
| 90 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_edit_files" value="ucd_client_edit_files" <?php checked( 'ucd_client_edit_files', get_option( 'ucd_client_edit_files' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 91 |
</div> |
| 92 |
</div> |
| 93 |
|
| 94 |
<div class="ucd-dynamic-item"> |
| 95 |
<div class="ucd-item-name"><?php _e( 'Import', 'ultimate-client-dash' ); ?></div> |
| 96 |
<div class="ucd-item-capabilities"> |
| 97 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_import" value="ucd_client_import" <?php checked( 'ucd_client_import', get_option( 'ucd_client_import' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 98 |
</div> |
| 99 |
</div> |
| 100 |
|
| 101 |
<div class="ucd-dynamic-item"> |
| 102 |
<div class="ucd-item-name"><?php _e( 'Export', 'ultimate-client-dash' ); ?></div> |
| 103 |
<div class="ucd-item-capabilities"> |
| 104 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_export" value="ucd_client_export" <?php checked( 'ucd_client_export', get_option( 'ucd_client_export' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 105 |
</div> |
| 106 |
</div> |
| 107 |
|
| 108 |
<?php if ( is_plugin_active( 'gravityforms/gravityforms.php' ) ) { ?> |
| 109 |
<div class="ucd-dynamic-item ucd-dynamic-pro"> |
| 110 |
<div class="ucd-item-name"><?php _e( 'Gravity Forms', 'ultimate-client-dash' ); ?></div> |
| 111 |
<div class="ucd-item-capabilities"> |
| 112 |
<div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_client_gravity_forms" value="ucd_client_gravity_forms" <?php checked( 'ucd_client_gravity_forms', get_option( 'ucd_client_gravity_forms' ) ); ?> /><span class="ucd-slider round"></span></label>Authorize</div> |
| 113 |
</div> |
| 114 |
</div> |
| 115 |
<?php } ?> |
| 116 |
|
| 117 |
<!-- Add foreach plugin capability items here --> |
| 118 |
<?php |
| 119 |
if ( class_exists( 'UCDProCapabilities' ) ) : |
| 120 |
global $ucd_capabilities; |
| 121 |
echo $ucd_capabilities->getSettingsMarkup(); |
| 122 |
else : ?> |
| 123 |
|
| 124 |
<p style="padding-top: 10px; padding-bottom: 5px;">Below is an example of the pro feature <strong>Extend Client Capabitilies</strong>. This feature will dynamically populate all WordPress core, theme, and plugin capabilities and allow you to assign them to the user role 'Client'. <strong><a href="admin.php?page=ultimate-client-dash&tab=upgrade">Purchase Pro version to unlock this feature.</a></strong></p> |
| 125 |
|
| 126 |
<div class="ucd-dynamic-item ucd-dynamic-pro ui-state-default"> |
| 127 |
<a class="ucd-item-toggle" href="#"></a> <!-- Display Toggle if menu item has submenu --> |
| 128 |
<span class="ucd-item-name"><?php _e( 'Extend Client Capabilities', 'ultimate-client-dash' ) ?></span> |
| 129 |
<span class="ucd-item-capabilities"></span> |
| 130 |
</div> |
| 131 |
|
| 132 |
<img class="ucd-pro-extend-cap-screenshot" src="<?php echo plugins_url( 'assets/Ultimate-Client-Dash-Pro-Extend-Capabilities.jpeg', __FILE__ ); ?>" alt="Ultimate Client Dash" height="auto" width="" /> |
| 133 |
|
| 134 |
<?php endif; ?> |
| 135 |
|
| 136 |
<!-- End foreach menu item here --> |
| 137 |
|
| 138 |
<tr class="ucd-float-option"> |
| 139 |
<th class="ucd-save-section dashboard"> |
| 140 |
<?php submit_button(); ?> |
| 141 |
</th> |
| 142 |
</tr> |
| 143 |
|
| 144 |
</tbody> |
| 145 |
</table> |
| 146 |
</div> |
| 147 |
</form> |
| 148 |
<?php |
| 149 |
} |
| 150 |
|