translation_manager_records = $translation_manager_records; $this->user_factory = $user_factory; $this->activation_email = $activation_email; } public function add_hooks() { add_action( 'wpml_tm_editor_messages', array( $this, 'classic_editor_message' ) ); add_action( 'wp_ajax_' . self::ACTION, array( $this, 'handle_ajax' ) ); } public function classic_editor_message() { $main_message = esc_html__( "This site can use WPML's Advanced Translation Editor, but you did not receive permission to use it. You are still translating with WPML's classic translation editor. Please ask your site's Translation Manager to enable the Advanced Translation Editor for you.", 'wpml-translation-management' ); $learn_more = esc_html__( "Learn more about WPML's Advanced Translation Editor", 'wpml-translation-management' ); $short_message = esc_html__( 'Advanced Translation Editor is disabled.', 'wpml-translation-management' ); $more = esc_html__( 'More', 'wpml-translation-management' ); $request_activation = esc_html__( 'Request activation from', 'wpml-translation-management' ); $show_minimized = (bool) $this->user_factory->create_current()->get_option( self::USER_OPTION ); ?>
translation_manager_records->get_users_with_capability(); ?> user_factory->create_current(); switch ( $_POST['command'] ) { case 'minimize': $current_user->update_option( self::USER_OPTION, true ); wp_send_json_success( array( 'message' => '' ) ); case 'maximize': $current_user->update_option( self::USER_OPTION, false ); wp_send_json_success( array( 'message' => '' ) ); case 'requestActivation': $manager = $this->user_factory->create( (int) $_POST['manager'] ); if ( $this->activation_email->send_email( $manager, $current_user ) ) { $message = sprintf( esc_html__( 'An email has been sent to %s', 'wpml-translation-management' ), $manager->user_login ); } else { $message = sprintf( esc_html__( 'Sorry, the email could not be sent to %s for an unknown reason.', 'wpml-translation-management' ), $manager->user_login ); } wp_send_json_success( array( 'message' => $message ) ); } } } }