| @@ -2,11 +2,42 @@ | ||
| 2 | 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | 3 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -FrmAppHelper::print_admin_banner( ! $has_nav && empty( $atts['switcher'] ) ); | |
| 6 | +if ( current_user_can( 'administrator' ) && ! FrmAppHelper::pro_is_installed() && ! $has_nav && empty( $atts['switcher'] ) ) { | |
| 7 | + ?> | |
| 8 | + <div class="frm-upgrade-bar"> | |
| 9 | + <span>You're using Formidable Forms Lite. To unlock more features consider</span> | |
| 10 | + <a href="<?php echo esc_url( FrmAppHelper::admin_upgrade_link( 'top-bar' ) ); ?>" target="_blank" rel="noopener">upgrading to Pro</a>. | |
| 11 | + </div> | |
| 12 | + <?php | |
| 13 | +} | |
| 14 | +FrmInbox::maybe_show_banner(); | |
| 7 | 15 | ?> |
| 8 | -<div id="frm_top_bar" class="<?php echo esc_attr( 'frm_nav_bar' ); ?>"> | |
| 16 | +<div id="frm_top_bar"> | |
| 17 | + <?php if ( FrmAppHelper::is_full_screen() ) { ?> | |
| 18 | + <div class="frm-full-close"> | |
| 19 | + <a href="<?php echo esc_attr( $atts['close'] ); ?>" aria-label="<?php esc_attr_e( 'Close', 'formidable' ); ?>"> | |
| 20 | + <?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon', array( 'aria-label' => 'Dismiss' ) ); ?> | |
| 21 | + </a> | |
| 22 | + </div> | |
| 23 | + <?php } ?> | |
| 24 | + <?php | |
| 25 | + if ( isset( $atts['publish'] ) ) { | |
| 26 | + echo '<div id="frm-publishing">'; | |
| 27 | + call_user_func( $atts['publish'][0], $atts['publish'][1] ); | |
| 28 | + echo '</div>'; | |
| 29 | + } elseif ( ! FrmAppHelper::pro_is_installed() ) { | |
| 30 | + ?> | |
| 31 | + <div id="frm-publishing"> | |
| 32 | + <a href="<?php echo esc_url( FrmAppHelper::admin_upgrade_link( 'header' ) ); ?>" class="button button-secondary frm-button-secondary"> | |
| 33 | + <?php esc_html_e( 'Upgrade', 'formidable' ); ?> | |
| 34 | + </a> | |
| 35 | + </div> | |
| 36 | + <?php | |
| 37 | + } | |
| 38 | + ?> | |
| 39 | + | |
| 9 | 40 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable' ) ); ?>" class="frm-header-logo"> |
| 10 | 41 | <?php FrmAppHelper::show_header_logo(); ?> |
| 11 | 42 | </a> |
| 12 | 43 | |
| @@ -18,25 +49,24 @@ | ||
| 18 | 49 | call_user_func( $atts['switcher'][0], $atts['switcher'][1] ); |
| 19 | 50 | } else { |
| 20 | 51 | // Used when no form is currently selected. |
| 21 | 52 | ?> |
| 22 | - <div class="frm_top_left"> | |
| 53 | + <div class="frm_top_left <?php echo esc_attr( $atts['import_link'] ? 'frm_top_wide' : '' ); ?>"> | |
| 23 | 54 | <h1> |
| 24 | - <?php | |
| 25 | - echo esc_html( $atts['label'] ); | |
| 26 | - FrmAppHelper::add_new_item_link( $atts ); | |
| 27 | - | |
| 28 | - if ( isset( $atts['cancel_link'] ) ) { | |
| 29 | - ?> | |
| 30 | - <a href="<?php echo esc_url( $atts['cancel_link'] ); ?>" class="button frm-button-secondary frm_animate_bg"> | |
| 55 | + <?php echo esc_html( $atts['label'] ); ?> | |
| 56 | + <?php FrmAppHelper::add_new_item_link( $atts ); ?> | |
| 57 | + <?php if ( $atts['import_link'] ) { ?> | |
| 58 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-import' ) ); ?>" class="button button-secondary frm-button-secondary frm_animate_bg"> | |
| 59 | + <?php esc_html_e( 'Import', 'formidable' ); ?> | |
| 60 | + </a> | |
| 61 | + <?php } ?> | |
| 62 | + <?php if ( isset( $atts['cancel_link'] ) ) { ?> | |
| 63 | + <a href="<?php echo esc_url( $atts['cancel_link'] ); ?>" class="button button-secondary frm-button-secondary frm_animate_bg"> | |
| 31 | 64 | <?php esc_html_e( 'Cancel', 'formidable' ); ?> |
| 32 | 65 | </a> |
| 33 | - <?php | |
| 34 | - } | |
| 35 | - ?> | |
| 66 | + <?php } ?> | |
| 36 | 67 | </h1> |
| 37 | 68 | </div> |
| 38 | - <ul class="frm_form_nav"></ul> | |
| 39 | 69 | <?php |
| 40 | 70 | } |
| 41 | 71 | |
| 42 | 72 | if ( isset( $atts['nav'] ) ) { |
| @@ -41,35 +71,7 @@ | ||
| 41 | 71 | |
| 42 | 72 | if ( isset( $atts['nav'] ) ) { |
| 43 | 73 | echo FrmAppHelper::kses( $atts['nav'], 'all' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 44 | 74 | } |
| 45 | - | |
| 46 | - echo '<div id="frm-publishing">'; | |
| 47 | - if ( ! empty( $atts['publish'] ) || ! empty( $atts['import_link'] ) ) { | |
| 48 | - $btn_type = 'primary'; | |
| 49 | - if ( isset( $atts['publish'] ) && is_array( $atts['publish'] ) ) { | |
| 50 | - call_user_func( $atts['publish'][0], $atts['publish'][1] ); | |
| 51 | - $btn_type = 'secondary'; | |
| 52 | - } | |
| 53 | - | |
| 54 | - if ( $atts['import_link'] ) { | |
| 55 | - // Use primary style if it's the only button. | |
| 56 | - FrmAppHelper::import_link( $btn_type ); | |
| 57 | - } | |
| 58 | - } elseif ( ! FrmAppHelper::pro_is_installed() ) { | |
| 59 | - ?> | |
| 60 | - <a href="<?php echo esc_url( FrmAppHelper::admin_upgrade_link( 'header' ) ); ?>" class="button button-secondary frm-button-secondary"> | |
| 61 | - <?php esc_html_e( 'Upgrade', 'formidable' ); ?> | |
| 62 | - </a> | |
| 63 | - <?php | |
| 64 | - } | |
| 65 | - echo '</div>'; | |
| 66 | - | |
| 67 | - if ( FrmAppHelper::is_full_screen() ) { | |
| 68 | - ?> | |
| 69 | - <div class="frm-full-close"> | |
| 70 | - <a href="<?php echo esc_attr( $atts['close'] ); ?>" aria-label="<?php esc_attr_e( 'Close', 'formidable' ); ?>"> | |
| 71 | - <?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon', array( 'aria-label' => 'Dismiss' ) ); ?> | |
| 72 | - </a> | |
| 73 | - </div> | |
| 74 | - <?php } ?> | |
| 75 | + ?> | |
| 76 | + <div style="clear:right;"></div> | |
| 75 | 77 | </div> |