| @@ -7,13 +7,24 @@ | ||
| 7 | 7 | |
| 8 | 8 | <?php |
| 9 | 9 | if ( $has_fields ) { |
| 10 | 10 | // Add form messages. |
| 11 | - require( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' ); | |
| 11 | + require FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php'; | |
| 12 | 12 | } |
| 13 | 13 | ?> |
| 14 | 14 | |
| 15 | 15 | <div id="frm-fake-page" class="frm_hidden"> |
| 16 | + <?php | |
| 17 | + /** | |
| 18 | + * Fires before the fake page in form builder. | |
| 19 | + * | |
| 20 | + * @since 6.9 | |
| 21 | + * | |
| 22 | + * @param array $form_array Processed form array. | |
| 23 | + */ | |
| 24 | + do_action( 'frm_before_builder_fake_page', $values ); | |
| 25 | + ?> | |
| 26 | + | |
| 16 | 27 | <div class="frm-page-break"> |
| 17 | 28 | <div class="frm-collapse-page button frm-button-secondary frm-button-sm"> |
| 18 | 29 | <?php |
| 19 | 30 | /* translators: %s: The page number */ |
| @@ -21,8 +32,19 @@ | ||
| 21 | 32 | ?> |
| 22 | 33 | <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); ?> |
| 23 | 34 | </div> |
| 24 | 35 | </div> |
| 36 | + | |
| 37 | + <?php | |
| 38 | + /** | |
| 39 | + * Fires after the fake page in form builder. | |
| 40 | + * | |
| 41 | + * @since 6.9 | |
| 42 | + * | |
| 43 | + * @param array $form_array Processed form array. | |
| 44 | + */ | |
| 45 | + do_action( 'frm_after_builder_fake_page', $values ); | |
| 46 | + ?> | |
| 25 | 47 | </div> |
| 26 | 48 | |
| 27 | 49 | <ul id="frm-show-fields" class="frm_sorting inside"> |
| 28 | 50 | <?php |
| @@ -28,10 +50,11 @@ | ||
| 28 | 50 | <?php |
| 29 | 51 | if ( ! empty( $values['fields'] ) ) { |
| 30 | 52 | $grid_helper = new FrmFieldGridHelper(); |
| 31 | 53 | $values['count'] = 0; |
| 54 | + | |
| 32 | 55 | foreach ( $values['fields'] as $field ) { |
| 33 | - $values['count']++; | |
| 56 | + ++$values['count']; | |
| 34 | 57 | $grid_helper->set_field( $field ); |
| 35 | 58 | $grid_helper->maybe_begin_field_wrapper(); |
| 36 | 59 | FrmFieldsController::load_single_field( $field, $values ); |
| 37 | 60 | $grid_helper->sync_list_size(); |
| @@ -42,22 +65,22 @@ | ||
| 42 | 65 | } |
| 43 | 66 | ?> |
| 44 | 67 | </ul> |
| 45 | 68 | |
| 46 | - <p id="frm-form-button"> | |
| 47 | - <button class="frm_button_submit" disabled="disabled"> | |
| 48 | - <?php echo esc_attr( isset( $form->options['submit_value'] ) ? $form->options['submit_value'] : __( 'Submit', 'formidable' ) ); ?> | |
| 49 | - </button> | |
| 50 | - </p> | |
| 69 | + <?php if ( ! FrmAppHelper::is_admin_page() ) : ?> | |
| 70 | + <p id="frm-form-button"> | |
| 71 | + <button class="frm_button_submit" disabled="disabled"> | |
| 72 | + <?php echo esc_html( $form->options['submit_value'] ?? __( 'Submit', 'formidable' ) ); ?> | |
| 73 | + </button> | |
| 74 | + </p> | |
| 75 | + <?php endif; ?> | |
| 51 | 76 | |
| 52 | 77 | <div class="frm_no_fields"> |
| 53 | - | |
| 54 | - <div class="frm_drag_inst"> | |
| 55 | - <?php esc_html_e( 'Add Fields Here', 'formidable' ); ?> | |
| 78 | + <img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/form-empty.png' ); ?>" alt="<?php esc_attr_e( 'Start Building Your Form', 'formidable' ); ?>" /> | |
| 79 | + <div class="frm-no-fields-content"> | |
| 80 | + <h4 class="frm_drag_inst"><?php esc_html_e( 'Start Building Your Form', 'formidable' ); ?></h4> | |
| 81 | + <p><?php esc_html_e( 'Drag and drop fields from the left or click a field to add it to your form.', 'formidable' ); ?></p> | |
| 56 | 82 | </div> |
| 57 | - <p> | |
| 58 | - <?php esc_html_e( 'Click or drag a field from the sidebar to add it to your form', 'formidable' ); ?> | |
| 59 | - </p> | |
| 60 | 83 | <div class="clear"></div> |
| 61 | 84 | </div> |
| 62 | 85 | |
| 63 | 86 | <?php do_action( 'frm_page_footer', array( 'table' => 'form-builder' ) ); ?> |