connect = $connect;
$this->page_url = $page_url;
$this->script_config = $script_config;
}
public function render() {
if ( $this->script_config ) {
wp_enqueue_script( ...$this->script_config );
}
?>
connect->is_connected() ) {
$this->render_connect_box();
} else {
$this->render_license_box();
}
?>
connect->get_admin_url( 'authorize', [
'utm_source' => 'license-page-connect-free',
'utm_medium' => 'wp-dash',
'utm_campaign' => 'connect-and-activate-license',
'redirect_to' => $this->page_url,
] );
?>
connect->get_admin_url( 'disconnect', [
'redirect_to' => $this->page_url,
] );
$download_link = $this->connect->get_download_link();
?>
:
get_connected_account();
if ( $connected_user ) :
printf(
/* translators: %s: Connected user. */
esc_html__( 'You\'re connected as %s.', 'elementor' ),
'' . esc_html( $connected_user ) . ''
);
endif;
?>
render_promotion_box();
} else {
$this->render_install_or_activate_box();
}
}
private function get_connected_account() {
$user = $this->connect->get( 'user' );
$email = '';
if ( $user ) {
$email = $user->email;
}
return $email;
}
private function render_promotion_box() {
?>
get_cta_data();
$cta_url = wp_nonce_url( admin_url( 'admin-post.php?action=elementor_do_pro_install' ), 'elementor_do_pro_install' );
$cta_id = Utils::is_pro_installed_and_not_active() ? 'elementor-connect-activate-pro' : 'elementor-connect-install-pro';
?>
esc_html__( 'Enjoy full access to powerful design tools, advanced widgets, and everything you need to create next-level websites.', 'elementor' ),
'button_text' => Utils::is_pro_installed_and_not_active() ? esc_html__( 'Activate Elementor Pro', 'elementor' ) : esc_html__( 'Install & Activate', 'elementor' ),
];
}
private function get_license_box_classes( string $additional_classes = '' ): string {
$classes = [ 'elementor-license-box' ];
if ( $additional_classes ) {
$classes[] = $additional_classes;
}
if ( Plugin::$instance->experiments->is_feature_active( 'e_editor_one' ) ) {
$classes[] = 'e-one-section-outlined';
}
return implode( ' ', $classes );
}
}