PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.3
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
profile-builder / admin / setup-wizard / view-tab-general.php

view-tab-general.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 4.0.3, at admin/setup-wizard/view-tab-general.php

161 lines 9.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
3 <?php
4 $content_restriction_activated = 'no';
5 if ( ! empty( $this->content_restriction_settings['contentRestriction'] ) ) {
6 $content_restriction_activated = $this->content_restriction_settings['contentRestriction'];
7 } elseif ( ! empty( $this->general_settings['contentRestriction'] ) ) {
8 $content_restriction_activated = $this->general_settings['contentRestriction'];
9 }
10
11 $roles_editor_available = file_exists( WPPB_PLUGIN_DIR . '/features/roles-editor/roles-editor.php' );
12 $admin_approval_available = defined( 'WPPB_PAID_PLUGIN_DIR' );
13
14 $login_registration_fields = array(
15 array(
16 'name' => 'automaticallyLogIn',
17 'id' => 'wppb_settings_automatically_log_in',
18 'value' => 'Yes',
19 'checked' => ! empty( $this->general_settings['automaticallyLogIn'] ) && $this->general_settings['automaticallyLogIn'] === 'Yes',
20 'label' => __( 'Automatically log users in after registration', 'profile-builder' ),
21 'desc' => __( 'Log users in right after they register.', 'profile-builder' ),
22 'icon' => '<path d="M10 17L15 12L10 7" stroke="#1E1E1E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 12H4" stroke="#1E1E1E" stroke-width="1.5" stroke-linecap="round"/><path d="M14 4H18C19.1046 4 20 4.89543 20 6V18C20 19.1046 19.1046 20 18 20H14" stroke="#1E1E1E" stroke-width="1.5" stroke-linecap="round"/>',
23 ),
24 array(
25 'name' => 'emailConfirmation',
26 'id' => 'emailConfirmation',
27 'value' => 'yes',
28 'checked' => ! empty( $this->general_settings['emailConfirmation'] ) && $this->general_settings['emailConfirmation'] === 'yes',
29 'label' => __( 'Verify email addresses', 'profile-builder' ),
30 'desc' => __( 'Ask users to confirm their email before they can sign in.', 'profile-builder' ),
31 'icon' => '<path d="M4 6.5C4 5.67157 4.67157 5 5.5 5H18.5C19.3284 5 20 5.67157 20 6.5V17.5C20 18.3284 19.3284 19 18.5 19H5.5C4.67157 19 4 18.3284 4 17.5V6.5Z" stroke="#1E1E1E" stroke-width="1.5"/><path d="M5 7L12 12L19 7" stroke="#1E1E1E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>',
32 ),
33 array(
34 'name' => 'hide_admin_bar_for_subscriber',
35 'id' => 'hide_admin_bar_for_subscriber',
36 'value' => 'Yes',
37 'checked' => ! empty( $this->general_settings['hide_admin_bar_for'] ) && in_array( 'Subscriber', $this->general_settings['hide_admin_bar_for'], true ),
38 'label' => __( 'Hide the admin bar for the subscriber role', 'profile-builder' ),
39 'desc' => __( 'Hide the WordPress admin bar for Subscribers on the front end.', 'profile-builder' ),
40 'title' => __( 'You can modify each role individually in the settings', 'profile-builder' ),
41 'icon' => '<path d="M4 7H20" stroke="#1E1E1E" stroke-width="1.5" stroke-linecap="round"/><path d="M4 12H14" stroke="#1E1E1E" stroke-width="1.5" stroke-linecap="round"/><path d="M4 17H10" stroke="#1E1E1E" stroke-width="1.5" stroke-linecap="round"/><path d="M16.5 14.5L18 16L21 12.5" stroke="#1E1E1E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>',
42 ),
43 array(
44 'name' => 'adminApproval',
45 'id' => 'adminApproval',
46 'value' => 'yes',
47 'checked' => $admin_approval_available && ! empty( $this->general_settings['adminApproval'] ) && $this->general_settings['adminApproval'] === 'yes',
48 'disabled' => ! $admin_approval_available,
49 'label' => __( 'Admin Approval for new users', 'profile-builder' ),
50 'desc' => __( 'Hold new accounts until an admin approves them.', 'profile-builder' ),
51 'title' => ! $admin_approval_available ? __( 'Available in the Pro version', 'profile-builder' ) : '',
52 'icon' => '<circle cx="12" cy="12" r="8" stroke="#1E1E1E" stroke-width="1.5"/><path d="M8.5 12.5L11 15L15.5 9.5" stroke="#1E1E1E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>',
53 ),
54 );
55
56 $feature_fields = array(
57 array(
58 'name' => 'contentRestriction',
59 'id' => 'contentRestriction',
60 'value' => 'yes',
61 'checked' => $content_restriction_activated === 'yes',
62 'label' => __( 'Content Restriction', 'profile-builder' ),
63 'desc' => __( 'Restrict posts and pages by logged-in status or role.', 'profile-builder' ),
64 'icon' => '<g clip-path="url(#wppb-setup-cr-clip)"><mask id="wppb-setup-cr-mask" fill="white"><rect x="6" y="10" width="12" height="10" rx="1"/></mask><rect x="6" y="10" width="12" height="10" rx="1" stroke="#1E1E1E" stroke-width="3" mask="url(#wppb-setup-cr-mask)"/><path d="M15 10V7C15 5.34315 13.6569 4 12 4V4C10.3431 4 9 5.34315 9 7V10" stroke="#1E1E1E" stroke-width="1.5"/></g><defs><clipPath id="wppb-setup-cr-clip"><rect width="24" height="24" fill="white"/></clipPath></defs>',
65 ),
66 );
67
68 if ( $roles_editor_available ) {
69 $feature_fields[] = array(
70 'name' => 'rolesEditor',
71 'id' => 'rolesEditor',
72 'value' => 'yes',
73 'checked' => ! empty( $this->general_settings['rolesEditor'] ) && $this->general_settings['rolesEditor'] === 'yes',
74 'label' => __( 'Roles Editor', 'profile-builder' ),
75 'desc' => __( 'Create and edit custom roles and capabilities.', 'profile-builder' ),
76 'icon' => '<path fill-rule="evenodd" clip-rule="evenodd" d="M15.5 9.5C16.0523 9.5 16.5 9.05228 16.5 8.5C16.5 7.94772 16.0523 7.5 15.5 7.5C14.9477 7.5 14.5 7.94772 14.5 8.5C14.5 9.05228 14.9477 9.5 15.5 9.5ZM15.5 11C16.8807 11 18 9.88071 18 8.5C18 7.11929 16.8807 6 15.5 6C14.1193 6 13 7.11929 13 8.5C13 9.88071 14.1193 11 15.5 11ZM13.25 17V15C13.25 13.4812 12.0188 12.25 10.5 12.25H6.5C4.98122 12.25 3.75 13.4812 3.75 15V17H5.25V15C5.25 14.3096 5.80964 13.75 6.5 13.75H10.5C11.1904 13.75 11.75 14.3096 11.75 15V17H13.25ZM20.25 15V17H18.75V15C18.75 14.3096 18.1904 13.75 17.5 13.75H15V12.25H17.5C19.0188 12.25 20.25 13.4812 20.25 15ZM9.5 8.5C9.5 9.05228 9.05228 9.5 8.5 9.5C7.94772 9.5 7.5 9.05228 7.5 8.5C7.5 7.94772 7.94772 7.5 8.5 7.5C9.05228 7.5 9.5 7.94772 9.5 8.5ZM11 8.5C11 9.88071 9.88071 11 8.5 11C7.11929 11 6 9.88071 6 8.5C6 7.11929 7.11929 6 8.5 6C9.88071 6 11 7.11929 11 8.5Z" fill="#1E1E1E"/>',
77 );
78 }
79
80 /**
81 * Render a setup wizard toggle field row.
82 *
83 * @param array $field Field definition.
84 */
85 $render_setup_field = static function ( $field ) {
86 $disabled = ! empty( $field['disabled'] );
87 $title = ! empty( $field['title'] ) ? $field['title'] : '';
88 ?>
89 <div class="wppb-setup-field">
90 <div class="wppb-setup-field__icon">
91 <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
92 <?php echo $field['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static SVG markup. ?>
93 </svg>
94 </div>
95
96 <div class="wppb-setup-field__title">
97 <h4>
98 <?php if ( $disabled ) : ?>
99 <span<?php echo $title ? ' title="' . esc_attr( $title ) . '"' : ''; ?>><?php echo esc_html( $field['label'] ); ?></span>
100 <?php else : ?>
101 <label for="<?php echo esc_attr( $field['id'] ); ?>"<?php echo $title ? ' title="' . esc_attr( $title ) . '"' : ''; ?>><?php echo esc_html( $field['label'] ); ?></label>
102 <?php endif; ?>
103 </h4>
104 <p><?php echo esc_html( $field['desc'] ); ?></p>
105 </div>
106
107 <div class="cozmoslabs-toggle-switch"<?php echo ( $disabled && $title ) ? ' title="' . esc_attr( $title ) . '"' : ''; ?>>
108 <div class="cozmoslabs-toggle-container">
109 <input
110 type="checkbox"
111 id="<?php echo esc_attr( $field['id'] ); ?>"
112 <?php echo $disabled ? '' : 'name="' . esc_attr( $field['name'] ) . '"'; ?>
113 value="<?php echo esc_attr( $field['value'] ); ?>"
114 <?php checked( ! empty( $field['checked'] ) ); ?>
115 <?php disabled( $disabled ); ?>
116 >
117 <label class="cozmoslabs-toggle-track" for="<?php echo esc_attr( $field['id'] ); ?>"></label>
118 </div>
119 </div>
120 </div>
121 <?php
122 };
123 ?>
124
125 <h3><?php esc_html_e( 'Login & registration settings', 'profile-builder' ); ?></h3>
126 <p class="cozmoslabs-description"><?php esc_html_e( 'Set how users register, sign in, and use key site features.', 'profile-builder' ); ?></p>
127
128 <form class="wppb-setup-form wppb-setup-form-fields" method="post">
129
130 <?php if ( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists( WPPB_PAID_PLUGIN_DIR . '/features/form-designs/form-designs.php' ) ) : ?>
131 <div class="wppb-setup-form-styles">
132 <?php echo wppb_render_forms_design_selector(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
133 <p class="info">
134 <?php esc_html_e( 'Choose a style that better suits your website.', 'profile-builder' ); ?>
135 <br>
136 <?php esc_html_e( 'The default style is there to let you customize the CSS and in general will receive the look and feel from your own themes styling. ', 'profile-builder' ); ?>
137 <br>
138 <?php esc_html_e( 'The extra styles can be customized to your liking through extra settings. ', 'profile-builder' ); ?>
139 </p>
140 </div>
141 <?php endif; ?>
142
143 <strong class="wppb-setup-fields__heading"><?php esc_html_e( 'Login and registration', 'profile-builder' ); ?></strong>
144
145 <?php foreach ( $login_registration_fields as $field ) {
146 $render_setup_field( $field );
147 } ?>
148
149 <strong class="wppb-setup-fields__heading"><?php esc_html_e( 'Additional modules', 'profile-builder' ); ?></strong>
150
151 <?php foreach ( $feature_fields as $field ) {
152 $render_setup_field( $field );
153 } ?>
154
155 <div class="wppb-setup-form-button">
156 <input type="submit" class="button primary button-primary button-hero" value="<?php esc_html_e( 'Continue', 'profile-builder' ); ?>" />
157 </div>
158
159 <?php wp_nonce_field( 'wppb-setup-wizard-nonce', 'wppb_setup_wizard_nonce' ); ?>
160 </form>
161