PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 158
Lasso Lite – Affiliate Link Manager & Product Displays v158
158 157 155 156 154 153 152 151 150 149 148 trunk 0.9.9 104 105 106 107 108 109 110 111 112 113 114 115 All 57 releases
← All changes | admin/views/header.php +54 -9 110158 View file →
@@ -4,16 +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 -use LassoLite\Classes\Lasso_DB;
13 14
14 -$available_pages = Helper::available_pages();
15 -$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 );
16 27 $should_show_import_step = Helper::should_show_import_page();
17 28 if ( $should_show_import_step ) {
18 29 $header_menu[] = Enum::PAGE_IMPORT;
19 30 }
@@ -18,9 +29,9 @@
18 29 $header_menu[] = Enum::PAGE_IMPORT;
19 30 }
20 31 $header_menu = array_merge( $header_menu, array( Enum::PAGE_OPPORTUNITIES, Enum::PAGE_GROUPS, Enum::PAGE_TABLES ) );
21 32
22 -if ( Setting::get_setting( 'general_disable_tooltip' ) ) {
33 +if ( Setting::get_setting( 'general_disable_tooltip' ) ) {
23 34 echo '
24 35 <style>
25 36 [data-tooltip]:hover:before, [data-tooltip]:hover:after {visibility: hidden;}
26 37 i.far.fa-info-circle {display: none;}
@@ -29,9 +40,17 @@
29 40 }
30 41
31 42 ?>
32 43
44 +<script src="https://kit.fontawesome.com/21b80bd767.js" crossorigin="anonymous"></script>
33 45
46 +<!-- REQUEST REVIEW -->
47 +<?php
48 +if ( Helper::show_request_review() ) {
49 + echo Helper::include_with_variables( SIMPLE_URLS_DIR . '/admin/views/notifications/request-review.php' );
50 +}
51 +?>
52 +
34 53 <!-- HEADER -->
35 54 <div class="container-fluid">
36 55 <header class="row align-items-center purple-bg p-3 shadow">
37 56
@@ -36,9 +55,9 @@
36 55 <header class="row align-items-center purple-bg p-3 shadow">
37 56
38 57 <!-- LASSO LOGO -->
39 58 <div class="col-lg-2">
40 - <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">
41 60 <img src="<?php echo SIMPLE_URLS_URL; ?>/admin/assets/images/lasso-logo.svg">
42 61 </a>
43 62 </div>
44 63
@@ -44,10 +63,10 @@
44 63
45 64 <!-- NAVIGATION -->
46 65 <div class="col-lg py-lg-0 py-3 ml-5">
47 66 <ul class="nav justify-content-center font-weight-bold">
48 - <?php foreach( $header_menu as $menu ): ?>
49 - <?php $page = $available_pages[$menu]; ?>
67 + <?php foreach ( $header_menu as $menu ) : ?>
68 + <?php $page = $available_pages[ $menu ]; ?>
50 69 <li class="nav-item mx-3">
51 70 <a class="nav-link px-0 white <?php echo $page->active_class; ?>"
52 71 href="<?php echo Page::get_page_url( $page->slug ); ?>">
53 72 <?php echo $page->title; ?>
@@ -53,15 +72,31 @@
53 72 <?php echo $page->title; ?>
54 73 </a>
55 74 </li>
56 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>
57 86 </ul>
58 87 </div>
59 88 <div class="col-lg-1 text-lg-right text-center pb-lg-0 pb-3 pl-1">
60 89 <div id="wrapper-circle"></div>
61 90 </div>
62 - <div class="col-lg-2 text-lg-right text-center pb-lg-0 pb-3 pl-1">
63 - <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">
64 99 <i class="far fa-plus-circle large-screen-only"></i> Add New Link
65 100 </button>
66 101 </div>
67 102
@@ -74,5 +109,15 @@
74 109 <!-- URL ADD MODAL -->
75 110 <?php require SIMPLE_URLS_DIR . '/admin/views/modals/url-add.php'; ?>
76 111 <!-- Enable support modal -->
77 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 + ?>
78 123 </div>