PluginProbe
HTML Forms – Simple WordPress Forms Plugin / 1.3.30
HTML Forms – Simple WordPress Forms Plugin v1.3.30
1.7.0 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.3.0 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.16 All 67 releases
html-forms / views / tab-actions.php

tab-actions.php in HTML Forms – Simple WordPress Forms Plugin 1.3.30, at views/tab-actions.php

69 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 $available_actions = $this->get_available_form_actions();
3 ?>
4
5 <div>
6 <h2><?php echo __( 'Form Actions', 'html-forms' ); ?></h2>
7
8 <div id="hf-form-actions">
9 <?php
10 if( ! empty( $form->settings['actions'] ) ) {
11 $index = 0;
12 foreach ($form->settings['actions'] as $action_settings ) {
13 // skip invalid options (eg from deleted actions)
14 if( empty( $available_actions[ $action_settings['type'] ] ) ) {
15 continue;
16 }
17
18 ?>
19 <div class="hf-action-settings" data-title="<?php echo esc_attr( $available_actions[ $action_settings['type'] ] ); ?>">
20 <?php
21
22 /**
23 * Output setting fields for a registered action
24 *
25 * @param array $action_settings
26 * @param int $index
27 */
28 do_action( 'hf_output_form_action_' . $action_settings['type'] . '_settings', $action_settings, $index++ );
29
30 /**
31 * Deprecated action hook. Use the above action (hf_output_form_action_...) instead.
32 */
33 do_action( 'hf_render_form_action_' . $action_settings['type'] . '_settings', $action_settings, $index++ ); ?>
34 </div>
35 <?php
36 }
37 }
38
39 echo '<p id="hf-form-actions-empty">' . __( 'No form actions configured for this form.', 'html-forms' ) . '</p>';
40 ?>
41 </div>
42 </div>
43
44 <div class="hf-medium-margin">
45 <h3><?php echo __( 'Add form action', 'html-forms' ); ?></h3>
46 <p><?php _e( 'Use the below button(s) to configure and perform an action whenever this form is successfully submitted.', 'html-forms' ); ?></p>
47 <p id="hf-available-form-actions">
48 <?php
49 foreach( $available_actions as $type => $label ) {
50 echo sprintf( '<input type="button" value="%s" data-action-type="%s" class="button" />', esc_html( $label ), esc_attr( $type ) ) . ' &nbsp;';
51 };
52 ?>
53 </p>
54 </div>
55
56 <div>
57 <?php submit_button(); ?>
58 </div>
59
60 <div style="display: none;" id="hf-form-action-templates">
61 <?php
62 foreach( $available_actions as $type => $label ) {
63 echo sprintf( '<script type="text/x-template" id="hf-action-type-%s-template">', $type );
64 do_action( 'hf_output_form_action_' . $type . '_settings', array(), '$index' );
65 echo '</script>';
66 }
67 ?>
68 </div>
69