PluginProbe
Elementor Website Builder – more than just a page builder / 3.26.4
Elementor Website Builder – more than just a page builder v3.26.4
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | core/role-manager/role-manager.php +31 -30 4.1.0-beta13.26.4 View file →
@@ -1,9 +1,9 @@
1 1 <?php
2 2 namespace Elementor\Core\RoleManager;
3 3
4 +use Elementor\Core\Admin\Menu\Admin_Menu_Manager;
4 5 use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
5 -use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
6 6 use Elementor\Plugin;
7 7 use Elementor\Settings;
8 8 use Elementor\Settings_Page;
9 9
@@ -51,8 +51,16 @@
51 51 }
52 52
53 53 /**
54 54 * @since 2.0.0
55 + * @access public
56 + */
57 + public function register_admin_menu( Admin_Menu_Manager $admin_menu ) {
58 + $admin_menu->register( static::PAGE_ID, new Role_Manager_Menu_Item( $this ) );
59 + }
60 +
61 + /**
62 + * @since 2.0.0
55 63 * @access protected
56 64 */
57 65 protected function create_tabs() {
58 66 $validation_class = 'Elementor\Settings_Validations';
@@ -101,25 +109,23 @@
101 109 ?>
102 110 <div class="wrap">
103 111 <h1 class="wp-heading-inline"><?php echo esc_html( $this->get_page_title() ); ?></h1>
104 112
105 - <div>
106 - <div id="elementor-role-manager">
107 - <h3><?php echo esc_html__( 'Manage What Your Users Can Edit In Elementor', 'elementor' ); ?></h3>
108 - <form id="elementor-settings-form" method="post" action="options.php">
109 - <?php
110 - settings_fields( static::PAGE_ID );
111 - echo '<div class="elementor-settings-form-page elementor-active">';
112 - foreach ( get_editable_roles() as $role_slug => $role_data ) {
113 - if ( 'administrator' === $role_slug ) {
114 - continue;
115 - }
116 - $this->display_role_controls( $role_slug, $role_data );
113 + <div id="elementor-role-manager">
114 + <h3><?php echo esc_html__( 'Manage What Your Users Can Edit In Elementor', 'elementor' ); ?></h3>
115 + <form id="elementor-settings-form" method="post" action="options.php">
116 + <?php
117 + settings_fields( static::PAGE_ID );
118 + echo '<div class="elementor-settings-form-page elementor-active">';
119 + foreach ( get_editable_roles() as $role_slug => $role_data ) {
120 + if ( 'administrator' === $role_slug ) {
121 + continue;
117 122 }
118 - submit_button( __( 'Save Changes', 'elementor' ), 'primary', 'submit', true, [ 'data-id' => 'elementor-role-manager-button-save-changes' ] );
119 - ?>
120 - </form>
121 - </div>
123 + $this->display_role_controls( $role_slug, $role_data );
124 + }
125 + submit_button();
126 + ?>
127 + </form>
122 128 </div>
123 129 </div><!-- /.wrap -->
124 130 <?php
125 131 }
@@ -136,16 +142,14 @@
136 142 if ( false === $excluded_options ) {
137 143 $excluded_options = $this->get_role_manager_options();
138 144 }
139 145
140 - $row_classes = 'elementor-role-row ' . esc_attr( $role_slug ) . ' e-editor-one';
141 -
142 146 ?>
143 - <div class="<?php echo esc_attr( $row_classes ); ?>">
147 + <div class="elementor-role-row <?php echo esc_attr( $role_slug ); ?>">
144 148 <div class="elementor-role-label">
145 149 <span class="elementor-role-name"><?php echo esc_html( translate_user_role( $role_data['name'] ) ); ?></span>
146 150 <span data-excluded-label="<?php esc_attr_e( 'Role Excluded', 'elementor' ); ?>" class="elementor-role-excluded-indicator"></span>
147 - <span class="elementor-role-toggle" data-id="<?php echo esc_attr( $role_slug ); ?>-toggle"><span class="dashicons dashicons-arrow-down"></span></span>
151 + <span class="elementor-role-toggle"><span class="dashicons dashicons-arrow-down"></span></span>
148 152 </div>
149 153 <div class="elementor-role-controls hidden">
150 154 <div class="elementor-role-control">
151 155 <label>
@@ -186,9 +190,9 @@
186 190 $checked = isset( $advanced_options[ $role_slug ] ) ? $advanced_options[ $role_slug ] : [];
187 191 ?>
188 192 <div class="elementor-role-control">
189 193 <label for="<?php echo esc_attr( $id ); ?>">
190 - <input type="checkbox" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $id ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php checked( in_array( $value, $checked, true ), true ); ?>>
194 + <input type="checkbox" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $id ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php checked( in_array( $value, $checked ), true ); ?>>
191 195 <?php echo esc_html__( 'Enable the option to upload JSON files', 'elementor' ); ?>
192 196 </label>
193 197 <p class="elementor-role-control-warning"><strong><?php echo esc_html__( 'Heads up', 'elementor' ); ?>:</strong> <?php echo esc_html__( 'Giving broad access to upload JSON files can pose a security risk to your website because such files may contain malicious scripts, etc.', 'elementor' ); ?></p>
194 198 </div>
@@ -204,9 +208,9 @@
204 208 $checked = isset( $advanced_options[ $role_slug ] ) ? $advanced_options[ $role_slug ] : [];
205 209 ?>
206 210 <div class="elementor-role-control">
207 211 <label for="<?php echo esc_attr( $id ); ?>">
208 - <input type="checkbox" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $id ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php checked( in_array( $value, $checked, true ), true ); ?>>
212 + <input type="checkbox" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $id ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php checked( in_array( $value, $checked ), true ); ?>>
209 213 <?php echo esc_html__( 'Enable the option to use the HTML widget', 'elementor' ); ?>
210 214 </label>
211 215 <p class="elementor-role-control-warning"><strong><?php echo esc_html__( 'Heads up', 'elementor' ); ?>:</strong> <?php echo esc_html__( 'Giving broad access to edit the HTML widget can pose a security risk to your website because it enables users to run malicious scripts, etc.', 'elementor' ); ?></p>
212 216 </div>
@@ -237,8 +241,9 @@
237 241 'upgrade_text' => esc_html__( 'Upgrade', 'elementor' ),
238 242 ];
239 243
240 244 return Filtered_Promotions_Manager::get_filtered_promotion_data( $promotion, 'elementor/role/custom_promotion', 'upgrade_url' );
245 +
241 246 }
242 247
243 248 /**
244 249 * @since 2.0.0
@@ -302,12 +307,8 @@
302 307
303 308 return true;
304 309 }
305 310
306 - private function register_editor_one_menu( Menu_Data_Provider $menu_data_provider ) {
307 - $menu_data_provider->register_menu( new Editor_One_Role_Manager_Menu() );
308 - }
309 -
310 311 /**
311 312 * @since 2.0.0
312 313 * @access public
313 314 */
@@ -313,11 +314,11 @@
313 314 */
314 315 public function __construct() {
315 316 parent::__construct();
316 317
317 - add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
318 - $this->register_editor_one_menu( $menu_data_provider );
319 - } );
318 + add_action( 'elementor/admin/menu/register', function ( Admin_Menu_Manager $admin_menu ) {
319 + $this->register_admin_menu( $admin_menu );
320 + }, Settings::ADMIN_MENU_PRIORITY + 10 );
320 321
321 322 add_action( 'elementor/role/restrictions/controls', [ $this, 'add_json_enable_control' ] );
322 323 add_action( 'elementor/role/restrictions/controls', [ $this, 'add_custom_html_enable_control' ] );
323 324 add_action( 'elementor/role/restrictions/controls', [ $this, 'get_go_pro_link_html' ] );