| @@ -1,12 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor\Modules\ProInstall; |
| 3 | 3 | |
| 4 | +use Elementor\Core\Admin\Menu\Admin_Menu_Manager; | |
| 4 | 5 | use Elementor\Core\Common\Modules\Connect\Module as ConnectModule; |
| 5 | 6 | use Elementor\Core\Base\Module as BaseModule; |
| 6 | 7 | use Elementor\Plugin; |
| 8 | +use Elementor\Settings; | |
| 7 | 9 | use Elementor\Utils; |
| 8 | -use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider; | |
| 9 | 10 | |
| 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | 12 | exit; // Exit if accessed directly. |
| 12 | 13 | } |
| @@ -29,21 +30,14 @@ | ||
| 29 | 30 | add_action( 'elementor/connect/apps/register', function ( ConnectModule $connect_module ) { |
| 30 | 31 | $connect_module->register_app( 'pro-install', Connect::get_class_name() ); |
| 31 | 32 | } ); |
| 32 | 33 | |
| 33 | - add_action( 'elementor/editor-one/menu/excluded_level3_slugs', function ( array $excluded_slugs ): array { | |
| 34 | - $excluded_slugs[] = 'elementor-connect'; | |
| 35 | - return $excluded_slugs; | |
| 36 | - } ); | |
| 37 | - | |
| 38 | - add_action( 'elementor/editor-one/menu/register', function( Menu_Data_Provider $menu_data_provider ) { | |
| 39 | - $menu_data_provider->register_menu( | |
| 40 | - new Editor_One_Connect_Account_Menu_Item( | |
| 41 | - $this->get_connect_app(), | |
| 42 | - $this->get_pro_install_page_assets() | |
| 43 | - ) | |
| 34 | + add_action( 'elementor/admin/menu/register', function( Admin_Menu_Manager $admin_menu ) { | |
| 35 | + $admin_menu->register( | |
| 36 | + 'elementor-connect-account', | |
| 37 | + new Pro_Install_Menu_Item( $this->get_connect_app() ) | |
| 44 | 38 | ); |
| 45 | - } ); | |
| 39 | + }, 116 ); | |
| 46 | 40 | } |
| 47 | 41 | |
| 48 | 42 | private function get_connect_app(): Connect { |
| 49 | 43 | return Plugin::$instance->common->get_component( 'connect' )->get_app( 'pro-install' ); |
| @@ -70,16 +64,6 @@ | ||
| 70 | 64 | wp_die( esc_html( $response->get_error_message() ) ); |
| 71 | 65 | } |
| 72 | 66 | |
| 73 | 67 | wp_safe_redirect( admin_url( 'admin.php?page=elementor-license' ) ); |
| 74 | - } | |
| 75 | - | |
| 76 | - private function get_pro_install_page_assets(): array { | |
| 77 | - return [ | |
| 78 | - 'elementor-pro-install-events', | |
| 79 | - $this->get_js_assets_url( 'pro-install-events' ), | |
| 80 | - [ 'elementor-common' ], | |
| 81 | - ELEMENTOR_VERSION, | |
| 82 | - true, | |
| 83 | - ]; | |
| 84 | 68 | } |
| 85 | 69 | } |