analytics
6 years ago
data
5 years ago
dialogs
5 years ago
general
5 years ago
permissions
5 years ago
privacy
5 years ago
recaptcha
5 years ago
unsubscribe
6 years ago
tab-accessibility.php
6 years ago
tab-analytics.php
5 years ago
tab-data.php
6 years ago
tab-general.php
5 years ago
tab-metrics.php
6 years ago
tab-palettes.php
5 years ago
tab-permissions.php
6 years ago
tab-privacy.php
6 years ago
tab-recaptcha.php
6 years ago
tab-unsubscribe.php
6 years ago
tab-permissions.php
114 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Permissions tab. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.0.0 |
| 7 | */ |
| 8 | |
| 9 | $form_id = 'hustle-permissions-settings-form'; |
| 10 | $settings = Hustle_Settings_Admin::get_permissions_settings(); |
| 11 | $roles = Opt_In_Utils::get_user_roles(); |
| 12 | ?> |
| 13 | <div id="permissions-box" class="sui-box" data-tab="permissions" |
| 14 | <?php |
| 15 | if ( 'permissions' !== $section ) { |
| 16 | echo 'style="display: none;"';} |
| 17 | ?> |
| 18 | > |
| 19 | |
| 20 | <div class="sui-box-header"> |
| 21 | <h2 class="sui-box-title"><?php esc_html_e( 'Permissions', 'hustle' ); ?></h2> |
| 22 | </div> |
| 23 | |
| 24 | <div class="sui-box-body"> |
| 25 | |
| 26 | <?php |
| 27 | // SETTINGS: Create Modules. |
| 28 | $this->render( |
| 29 | 'admin/settings/permissions/permissions-row', |
| 30 | array( |
| 31 | 'roles' => $roles, |
| 32 | 'form_id' => $form_id, |
| 33 | 'label' => __( 'Create Modules', 'hustle' ), |
| 34 | 'description' => __( 'Choose the user roles which can create new modules.', 'hustle' ), |
| 35 | 'input_name' => 'create[]', |
| 36 | 'current_value' => $settings['create'], |
| 37 | ) |
| 38 | ); |
| 39 | |
| 40 | // SETTINGS: Edit Existing Modules. |
| 41 | $this->render( |
| 42 | 'admin/settings/permissions/edit-modules', |
| 43 | array( |
| 44 | 'roles' => $roles, |
| 45 | 'form_id' => $form_id, |
| 46 | ) |
| 47 | ); |
| 48 | |
| 49 | // SETTINGS: Access Email List. |
| 50 | $this->render( |
| 51 | 'admin/settings/permissions/permissions-row', |
| 52 | array( |
| 53 | 'roles' => $roles, |
| 54 | 'form_id' => $form_id, |
| 55 | 'label' => __( 'Access Email List', 'hustle' ), |
| 56 | 'description' => __( 'Choose the user roles which can access the Email List for the opt-in modules.', 'hustle' ), |
| 57 | 'input_name' => 'access_emails[]', |
| 58 | 'current_value' => $settings['access_emails'], |
| 59 | ) |
| 60 | ); |
| 61 | |
| 62 | // SETTINGS: Edit Integrations. |
| 63 | $this->render( |
| 64 | 'admin/settings/permissions/permissions-row', |
| 65 | array( |
| 66 | 'roles' => $roles, |
| 67 | 'form_id' => $form_id, |
| 68 | 'label' => __( 'Edit Integrations', 'hustle' ), |
| 69 | 'description' => __( 'Choose the user roles which can access the Integrations page and connect or disconnect Hustle to 3rd party apps.', 'hustle' ), |
| 70 | 'input_name' => 'edit_integrations[]', |
| 71 | 'current_value' => $settings['edit_integrations'], |
| 72 | ) |
| 73 | ); |
| 74 | |
| 75 | // SETTINGS: Edit Settings. |
| 76 | $this->render( |
| 77 | 'admin/settings/permissions/permissions-row', |
| 78 | array( |
| 79 | 'roles' => $roles, |
| 80 | 'form_id' => $form_id, |
| 81 | 'label' => __( 'Edit Settings', 'hustle' ), |
| 82 | 'description' => __( 'Choose the user roles which can access the Settings page and update any settings.', 'hustle' ), |
| 83 | 'input_name' => 'edit_settings[]', |
| 84 | 'current_value' => $settings['edit_settings'], |
| 85 | ) |
| 86 | ); |
| 87 | ?> |
| 88 | |
| 89 | <?php // All inputs point to this form. We can't have them nested due to the filter's form. ?> |
| 90 | <form id="<?php echo esc_attr( $form_id ); ?>"></form> |
| 91 | |
| 92 | </div> |
| 93 | |
| 94 | |
| 95 | |
| 96 | <div class="sui-box-footer"> |
| 97 | |
| 98 | <div class="sui-actions-right"> |
| 99 | |
| 100 | <button |
| 101 | class="sui-button sui-button-blue hustle-settings-save" |
| 102 | data-form-id="<?php echo esc_attr( $form_id ); ?>" |
| 103 | data-target="permissions" |
| 104 | > |
| 105 | <span class="sui-loading-text"><?php esc_html_e( 'Save Settings', 'hustle' ); ?></span> |
| 106 | <span class="sui-icon-loader sui-loading" aria-hidden="true"></span> |
| 107 | </button> |
| 108 | |
| 109 | </div> |
| 110 | |
| 111 | </div> |
| 112 | |
| 113 | </div> |
| 114 |