WPForms_Uncanny_Automator::builder_output_after()

Output content after the main builder output.


Source Source

File: src/core/admin/class-wpforms-provider.php

	public function builder_output_after() {
		$this_form_anyone = sprintf(
			__( 'When anyone submits %s form', 'uncanny-automator' ), //phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
			sprintf( '<span class="uap-wpf-integration-trigger__field">%s</span>', __( 'this', 'uncanny-automator' ) )
		);

		$field_form_anoynone = sprintf(
			__( 'When anyone submits %1$s form with %2$s in %3$s', 'uncanny-automator' ), //phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
			sprintf( '<span class="uap-wpf-integration-trigger__field">%s</span>', __( 'this', 'uncanny-automator' ) ),
			sprintf( '<span class="uap-wpf-integration-trigger__field">%s</span>', __( 'a specific value', 'uncanny-automator' ) ),
			sprintf( '<span class="uap-wpf-integration-trigger__field">%s</span>', __( 'a specific field', 'uncanny-automator' ) )
		);

		$triggers            = array(
			'ANONWPFSUBFORM'     => $this_form_anyone,
			'ANONWPFSUBMITFIELD' => $field_form_anoynone,
		);
		$nonce               = wp_create_nonce( 'Uncanny Automator' );
		$form_id             = automator_filter_input( 'form_id' );
		$form                = wpforms()->form->get( absint( $form_id ) );
		$new_recipe_url      = admin_url( $this->config['new_recipe'] ) . '&is_anon=yes&item_code=ANONWPFSUBFORM&nonce=' . $nonce;
		$new_anon_recipe_url = admin_url( $this->config['new_recipe'] ) . '&is_anon=yes&item_code=ANONWPFSUBMITFIELD&nonce=' . $nonce;

		$new_recipe_url          .= '&optionCode=ANONWPFFORMS&optionValue=' . $form_id . '&optionValue_readable=' . rawurlencode( $form->post_title );
		$new_anon_recipe_url     .= '&optionCode=ANONWPFFORMS&optionValue=' . $form_id . '&optionValue_readable=' . rawurlencode( $form->post_title );
		$is_automator_pro_active = defined( 'AUTOMATOR_PRO_FILE' ) ? true : false;
		?>

		<div class="uap-wpf-integration">

			<img
				src="<?php echo esc_url( WPFORMS_PLUGIN_URL . 'assets/images/icon-provider-uncanny-automator.png' ); ?>"
				alt="Uncanny Automator logo"
				class="uap-wpf-integration__logo">

			<h2 class="uap-wpf-integration__title">
				<?php esc_attr_e( 'Connect Your Form to Powerful Automations', 'uncanny-automator' ); ?>
			</h2>

			<p class="uap-wpf-integration__description">
				<?php esc_attr_e( "Uncanny Automator can connect this form to your favorite WordPress plugins, sites and non-WordPress apps. Let's get started!", 'uncanny_automator' ); ?>
			</p>

			<div class="uap-wpf-integration-steps">

				<div class="uap-wpf-integration-flow-step">
					<div class="uap-wpf-integration-flow-step__left">
						<div class="uap-wpf-integration-flow-step__number">1</div>
					</div>

					<div class="uap-wpf-integration-flow-step__content">

						<div class="uap-wpf-integration-flow-step__title">
							<?php esc_attr_e( 'Choose when your recipe will run:', 'uncanny-automator' ); ?>
						</div>

						<div class="uap-wpf-integration-triggers">
							<?php
							foreach ( $triggers as $trigger_code => $trigger_sentence ) {
								$class    = ! $is_automator_pro_active && 'ANONWPFSUBMITFIELD' === $trigger_code ? ' uap-wpf-automator-pro-not-active' : '';
								$disabled = ! $is_automator_pro_active && 'ANONWPFSUBMITFIELD' === $trigger_code ? ' disabled="disabled"' : '';
								$checked  = 'ANONWPFSUBFORM' === $trigger_code ? ' checked="checked"' : '';
								?>
								<label class="uap-wpf-integration-recipe-trigger <?php echo esc_attr( $class ); ?>">
									<input type="radio" value="<?php echo $trigger_code; ?>"
										   data-target="create_<?php echo $trigger_code; ?>" class="uap-wpf-integration-recipe-trigger-radio"
										<?php echo $disabled; ?>
										<?php echo $checked; ?>
									>
									<?php echo $trigger_sentence; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

									<?php if ( $disabled ) { ?>

										<span class="uap-wpf-integration-recipe-trigger-pro">
											<i class="fa fa-lock"></i>
											<?php echo wp_kses_post( sprintf( '%1$s <strong>%2$s</strong>', __( 'Requires', 'uncanny-automator' ), 'Uncanny Automator Pro' ) ); ?>
											<a href="https://automatorplugin.com/pricing/?utm_source=wpforms&utm_medium=form_marketing&utm_content=learn_more_pro_link&utm_r=wpforms"
											   target="_blank">
												<?php esc_html_e( 'Get it now', 'uncanny-automator' ); ?>
											</a>
										</span>
									<?php } ?>
								</label>
							<?php } ?>
						</div>

					</div>
				</div>

				<div class="uap-wpf-integration-flow-step">
					<div class="uap-wpf-integration-flow-step__left">
						<div class="uap-wpf-integration-flow-step__number">2</div>
					</div>

					<div class="uap-wpf-integration-flow-step__content">
						<a data-id="ANONWPFSUBFORM" href="<?php echo esc_url_raw( $new_recipe_url ) ?>"
						   class="uap-wpf-integration-create-recipe-btn wpforms-btn wpforms-btn-md wpforms-btn-orange">
							<?php esc_attr_e( 'Create automation', 'uncanny-automator' ); ?>
						</a>
						<a data-id="ANONWPFSUBMITFIELD" href="<?php echo esc_url_raw( $new_anon_recipe_url ) ?>"
						   class="uap-wpf-integration-create-recipe-btn wpforms-btn wpforms-btn-md wpforms-btn-orange">
							<?php esc_attr_e( 'Create automation', 'uncanny-automator' ); ?>
						</a>
					</div>
				</div>

			</div>
			<?php if ( ! empty( $this->configured_recipes ) ) { ?>
				<p>&nbsp;</p>
				<p>&nbsp;</p>
				<h5 class="uap-wpf-integration__title">
					<?php echo _nx( 'Recipe using this form', 'Recipes using this form', count( $this->configured_recipes ), 'uncanny-automator' ); ?>
				</h5>
				<div class="uap-wpdf-connected-recipes">
					<ul>
						<?php foreach ( $this->configured_recipes as $recipe_id ) { ?>
							<li>
								<a href="<?php echo esc_url( get_edit_post_link( $recipe_id ) ); ?>"><?php echo esc_html( sprintf( '#%d- %s %s', $recipe_id, empty( get_the_title( $recipe_id ) ) ? __( 'no title', 'uncanny-automator' ) : get_the_title( $recipe_id ), 'draft' === get_post_status( $recipe_id ) ? __( '(Draft)', 'uncanny-automator' ) : '' ) ); ?></a>
							</li>
						<?php } ?>
					</ul>
				</div>
			<?php } ?>
		</div>

		<?php
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.