| @@ -4,15 +4,27 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package Header |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | +use LassoLite\Admin\Constant; | |
| 9 | + | |
| 8 | 10 | use LassoLite\Classes\Enum; |
| 9 | 11 | use LassoLite\Classes\Helper; |
| 10 | 12 | use LassoLite\Classes\Page; |
| 11 | 13 | use LassoLite\Classes\Setting; |
| 12 | 14 | |
| 13 | -$available_pages = Helper::available_pages(); | |
| 14 | -$header_menu = array( Enum::PAGE_DASHBOARD ); | |
| 15 | +$lasso_account_email = Helper::get_option( Constant::LASSO_ACCOUNT_EMAIL, '' ); | |
| 16 | +$lasso_account_user_id = intval( Helper::get_option( Constant::LASSO_ACCOUNT_USER_ID, 0 ) ); | |
| 17 | +// App account only (synced email/user from hub/signup). Excludes is_connected_aff from license API; that flag is not a Lasso app login. | |
| 18 | +$is_lasso_app_account_connected = ! empty( $lasso_account_email ) || $lasso_account_user_id > 0; | |
| 19 | + | |
| 20 | +$lasso_options_prefill = Setting::get_settings(); | |
| 21 | +$email_support_prefill = $lasso_options_prefill[ Enum::EMAIL_SUPPORT ] ?? ''; | |
| 22 | +$admin_email_prefill = get_option( 'admin_email' ); | |
| 23 | +$prefill_email_header = ! empty( $email_support_prefill ) ? $email_support_prefill : $admin_email_prefill; | |
| 24 | + | |
| 25 | +$available_pages = Helper::available_pages(); | |
| 26 | +$header_menu = array( Enum::PAGE_DASHBOARD ); | |
| 15 | 27 | $should_show_import_step = Helper::should_show_import_page(); |
| 16 | 28 | if ( $should_show_import_step ) { |
| 17 | 29 | $header_menu[] = Enum::PAGE_IMPORT; |
| 18 | 30 | } |
| @@ -17,9 +29,9 @@ | ||
| 17 | 29 | $header_menu[] = Enum::PAGE_IMPORT; |
| 18 | 30 | } |
| 19 | 31 | $header_menu = array_merge( $header_menu, array( Enum::PAGE_OPPORTUNITIES, Enum::PAGE_GROUPS, Enum::PAGE_TABLES ) ); |
| 20 | 32 | |
| 21 | -if ( Setting::get_setting( 'general_disable_tooltip' ) ) { | |
| 33 | +if ( Setting::get_setting( 'general_disable_tooltip' ) ) { | |
| 22 | 34 | echo ' |
| 23 | 35 | <style> |
| 24 | 36 | [data-tooltip]:hover:before, [data-tooltip]:hover:after {visibility: hidden;} |
| 25 | 37 | i.far.fa-info-circle {display: none;} |
| @@ -28,12 +40,14 @@ | ||
| 28 | 40 | } |
| 29 | 41 | |
| 30 | 42 | ?> |
| 31 | 43 | |
| 44 | +<script src="https://kit.fontawesome.com/21b80bd767.js" crossorigin="anonymous"></script> | |
| 45 | + | |
| 32 | 46 | <!-- REQUEST REVIEW --> |
| 33 | -<?php | |
| 47 | +<?php | |
| 34 | 48 | if ( Helper::show_request_review() ) { |
| 35 | - echo Helper::include_with_variables( SIMPLE_URLS_DIR . '/admin/views/notifications/request-review.php' ); | |
| 49 | + echo Helper::include_with_variables( SIMPLE_URLS_DIR . '/admin/views/notifications/request-review.php' ); | |
| 36 | 50 | } |
| 37 | 51 | ?> |
| 38 | 52 | |
| 39 | 53 | <!-- HEADER --> |
| @@ -41,9 +55,9 @@ | ||
| 41 | 55 | <header class="row align-items-center purple-bg p-3 shadow"> |
| 42 | 56 | |
| 43 | 57 | <!-- LASSO LOGO --> |
| 44 | 58 | <div class="col-lg-2"> |
| 45 | - <a href="<?php echo Page::get_page_url( $available_pages[Enum::PAGE_DASHBOARD]->slug ) ?>" class="logo mx-auto mx-lg-0"> | |
| 59 | + <a href="<?php echo Page::get_page_url( $available_pages[ Enum::PAGE_DASHBOARD ]->slug ); ?>" class="logo mx-auto mx-lg-0"> | |
| 46 | 60 | <img src="<?php echo SIMPLE_URLS_URL; ?>/admin/assets/images/lasso-logo.svg"> |
| 47 | 61 | </a> |
| 48 | 62 | </div> |
| 49 | 63 | |
| @@ -49,10 +63,10 @@ | ||
| 49 | 63 | |
| 50 | 64 | <!-- NAVIGATION --> |
| 51 | 65 | <div class="col-lg py-lg-0 py-3 ml-5"> |
| 52 | 66 | <ul class="nav justify-content-center font-weight-bold"> |
| 53 | - <?php foreach( $header_menu as $menu ): ?> | |
| 54 | - <?php $page = $available_pages[$menu]; ?> | |
| 67 | + <?php foreach ( $header_menu as $menu ) : ?> | |
| 68 | + <?php $page = $available_pages[ $menu ]; ?> | |
| 55 | 69 | <li class="nav-item mx-3"> |
| 56 | 70 | <a class="nav-link px-0 white <?php echo $page->active_class; ?>" |
| 57 | 71 | href="<?php echo Page::get_page_url( $page->slug ); ?>"> |
| 58 | 72 | <?php echo $page->title; ?> |
| @@ -58,15 +72,31 @@ | ||
| 58 | 72 | <?php echo $page->title; ?> |
| 59 | 73 | </a> |
| 60 | 74 | </li> |
| 61 | 75 | <?php endforeach; ?> |
| 76 | + <li class="nav-item mx-3"> | |
| 77 | + <a class="nav-link px-0 white" href="<?php echo Constant::LASSO_ANALYTICS_URL; ?>" target="_blank"> | |
| 78 | + Analytics | |
| 79 | + </a> | |
| 80 | + </li> | |
| 81 | + <li class="nav-item mx-3"> | |
| 82 | + <a class="nav-link px-0 white" href="<?php echo Constant::LASSO_AFFILIATE_PLUS_URL; ?>" target="_blank"> | |
| 83 | + Marketplace | |
| 84 | + </a> | |
| 85 | + </li> | |
| 62 | 86 | </ul> |
| 63 | 87 | </div> |
| 64 | 88 | <div class="col-lg-1 text-lg-right text-center pb-lg-0 pb-3 pl-1"> |
| 65 | 89 | <div id="wrapper-circle"></div> |
| 66 | 90 | </div> |
| 67 | - <div class="col-lg-2 text-lg-right text-center pb-lg-0 pb-3 pl-1"> | |
| 68 | - <button class="btn" data-toggle="modal" data-target="#url-add"> | |
| 91 | + <div class="col-lg-3 d-flex flex-column flex-lg-row align-items-center justify-content-lg-end justify-content-center pb-lg-0 pb-3 pl-1 lasso-header-actions"> | |
| 92 | + <?php if ( ! $is_lasso_app_account_connected ) : ?> | |
| 93 | + <button type="button" class="lasso-header-account-status lasso-header-account-status--inactive mb-2 mb-lg-0 mr-lg-3 order-lg-1 order-2" data-toggle="modal" data-target="#lasso-lite-analytics-modal" title="<?php echo esc_attr( __( 'Create your free Lasso account', 'simple-urls' ) ); ?>" aria-label="<?php echo esc_attr( __( 'Account status: inactive. Create your free Lasso account.', 'simple-urls' ) ); ?>"> | |
| 94 | + <span class="lasso-header-account-status__label"><?php echo esc_html( __( 'Account status', 'simple-urls' ) ); ?></span> | |
| 95 | + <span class="lasso-header-account-status__badge"><?php echo esc_html( __( 'Inactive', 'simple-urls' ) ); ?></span> | |
| 96 | + </button> | |
| 97 | + <?php endif; ?> | |
| 98 | + <button class="btn order-lg-2 order-1 mb-2 mb-lg-0" data-toggle="modal" data-target="#url-add"> | |
| 69 | 99 | <i class="far fa-plus-circle large-screen-only"></i> Add New Link |
| 70 | 100 | </button> |
| 71 | 101 | </div> |
| 72 | 102 | |
| @@ -79,5 +109,15 @@ | ||
| 79 | 109 | <!-- URL ADD MODAL --> |
| 80 | 110 | <?php require SIMPLE_URLS_DIR . '/admin/views/modals/url-add.php'; ?> |
| 81 | 111 | <!-- Enable support modal --> |
| 82 | 112 | <?php require SIMPLE_URLS_DIR . '/admin/views/modals/enable-support.php'; ?> |
| 113 | + <?php | |
| 114 | + if ( ! $is_lasso_app_account_connected ) { | |
| 115 | + echo Helper::include_with_variables( | |
| 116 | + SIMPLE_URLS_DIR . '/admin/views/modals/lasso-lite-analytics-modal.php', | |
| 117 | + array( | |
| 118 | + 'prefill_email_header' => $prefill_email_header, | |
| 119 | + ) | |
| 120 | + ); | |
| 121 | + } | |
| 122 | + ?> | |
| 83 | 123 | </div> |