commons
5 years ago
dashboard
5 years ago
dialogs
5 years ago
email-lists
5 years ago
embedded
5 years ago
footer
5 years ago
global
5 years ago
integrations
5 years ago
integrations-page
5 years ago
popup
5 years ago
settings
5 years ago
slidein
5 years ago
sshare
5 years ago
dashboard.php
5 years ago
entries.php
5 years ago
integrations.php
5 years ago
settings.php
5 years ago
upsell.php
5 years ago
widget-analytics.php
5 years ago
entries.php
171 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Main wrapper for the Email lists (entries/form submissions) page. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.0.0 |
| 7 | */ |
| 8 | |
| 9 | // Email Lists: Images. |
| 10 | $empty_image = self::$plugin_url . 'assets/images/hustle-empty-message'; |
| 11 | $choose_image = self::$plugin_url . 'assets/images/hustle-email-lists'; |
| 12 | ?> |
| 13 | |
| 14 | <div class="sui-header"> |
| 15 | <h1 class="sui-header-title"><?php esc_html_e( 'Email Lists', 'hustle' ); ?></h1> |
| 16 | <?php $this->render( 'admin/commons/view-documentation', array( 'docs_section' => 'email-lists' ) ); ?> |
| 17 | </div> |
| 18 | |
| 19 | <div id="hustle-floating-notifications-wrapper" class="sui-floating-notices"></div> |
| 20 | |
| 21 | <?php |
| 22 | // Search Bar. |
| 23 | $this->render( |
| 24 | 'admin/email-lists/search-bar', |
| 25 | array( |
| 26 | 'has_entries' => ( $is_module_selected && ! empty( $entries ) ), |
| 27 | 'module' => $module, |
| 28 | ) |
| 29 | ); |
| 30 | ?> |
| 31 | |
| 32 | <?php |
| 33 | // If a module is selected, get its entries. Show a placeholder message otherwise. |
| 34 | if ( $is_module_selected ) : |
| 35 | |
| 36 | $integrations_url = add_query_arg( |
| 37 | array( |
| 38 | 'page' => $module->get_wizard_page(), |
| 39 | 'id' => $module->id, |
| 40 | 'section' => 'integrations', |
| 41 | ), |
| 42 | get_admin_url( get_current_blog_id(), 'admin.php' ) |
| 43 | ); |
| 44 | |
| 45 | $add_local_list = sprintf( |
| 46 | /* translators: 1: module name, 2: opening 'a' tag with the module's edit integrations url, 3: closing 'a' tag */ |
| 47 | esc_html__( 'Hustle\'s Local List is inactive for this %1$s. %2$sActivate Local List%3$s integration for this module to store the submissions in your database and see those submissions here.', 'hustle' ), |
| 48 | esc_html( $module_name ), |
| 49 | '<a href="' . esc_url( $integrations_url ) . '" target="_blank">', |
| 50 | '</a>' |
| 51 | ); |
| 52 | |
| 53 | // If there are entries, show them. Show a placeholder message otherwise. |
| 54 | if ( ! empty( $entries ) || $is_filtered ) : |
| 55 | |
| 56 | // List Emails. |
| 57 | $this->render( |
| 58 | 'admin/email-lists/emails-list', |
| 59 | array( |
| 60 | 'module' => $module, |
| 61 | 'no_local_list' => $no_local_list, |
| 62 | 'add_local_list' => $add_local_list, |
| 63 | 'wizard_page' => add_query_arg( |
| 64 | array( |
| 65 | 'page' => $module->get_wizard_page(), |
| 66 | 'id' => $module->module_id, |
| 67 | 'section' => 'integrations', |
| 68 | ), |
| 69 | 'admin.php' |
| 70 | ), |
| 71 | 'form_fields' => $module->get_form_fields(), |
| 72 | ) |
| 73 | ); |
| 74 | ?> |
| 75 | |
| 76 | <?php elseif ( $no_local_list ) : ?> |
| 77 | |
| 78 | <div class="sui-box sui-message"> |
| 79 | |
| 80 | <?php $this->hustle_image( $empty_image, 'png', '', true ); ?> |
| 81 | |
| 82 | <div class="sui-message-content"> |
| 83 | |
| 84 | <h2><?php esc_html_e( 'Local List is Inactive!', 'hustle' ); ?></h2> |
| 85 | |
| 86 | <p><?php echo $add_local_list; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> |
| 87 | |
| 88 | </div> |
| 89 | |
| 90 | </div> |
| 91 | |
| 92 | <?php else : ?> |
| 93 | |
| 94 | <div class="sui-box sui-message"> |
| 95 | |
| 96 | <?php $this->hustle_image( $empty_image, 'png', '', true ); ?> |
| 97 | |
| 98 | <div class="sui-message-content"> |
| 99 | |
| 100 | <h2><?php esc_html_e( 'No Emails Collected!', 'hustle' ); ?></h2> |
| 101 | |
| 102 | <?php /* translators: module name */ ?> |
| 103 | <p><?php printf( esc_html__( "Your %s hasn't collected any emails yet. When it starts converting, you'll be able to view the collected emails here.", 'hustle' ), esc_html( $module_name ) ); ?></p> |
| 104 | |
| 105 | </div> |
| 106 | |
| 107 | </div> |
| 108 | |
| 109 | <?php endif; ?> |
| 110 | |
| 111 | <?php else : ?> |
| 112 | |
| 113 | <?php if ( 0 === $global_entries ) { ?> |
| 114 | |
| 115 | <div class="sui-box sui-message"> |
| 116 | |
| 117 | <?php $this->hustle_image( $empty_image, 'png', '', true ); ?> |
| 118 | |
| 119 | <div class="sui-message-content"> |
| 120 | |
| 121 | <h2><?php esc_html_e( 'Email Lists', 'hustle' ); ?></h2> |
| 122 | |
| 123 | <p><?php esc_html_e( "You haven't yet collected emails through email opt-ins inside any of your popup, slide-in or embed. When you do, you'll be able to view the email list here.", 'hustle' ); ?></p> |
| 124 | |
| 125 | </div> |
| 126 | |
| 127 | </div> |
| 128 | |
| 129 | <?php } else { ?> |
| 130 | |
| 131 | <div class="sui-box sui-message"> |
| 132 | |
| 133 | <?php $this->hustle_image( $choose_image, 'png', '', true ); ?> |
| 134 | |
| 135 | <div class="sui-message-content"> |
| 136 | |
| 137 | <h2><?php esc_html_e( 'Almost there!', 'hustle' ); ?></h2> |
| 138 | |
| 139 | <p><?php esc_html_e( 'Select the popup, slide-in or embed to view the corresponding email list.', 'hustle' ); ?></p> |
| 140 | |
| 141 | </div> |
| 142 | |
| 143 | </div> |
| 144 | |
| 145 | <?php } ?> |
| 146 | |
| 147 | <?php endif; ?> |
| 148 | |
| 149 | <?php |
| 150 | // Global Footer. |
| 151 | $this->render( 'admin/footer/footer' ); |
| 152 | ?> |
| 153 | |
| 154 | <?php |
| 155 | // DIALOG: Dialog Filter for MOBILE. |
| 156 | $this->render( |
| 157 | 'admin/email-lists/dialog-filter', |
| 158 | array( 'module' => $module ) |
| 159 | ); |
| 160 | ?> |
| 161 | |
| 162 | <?php |
| 163 | // DIALOG: Delete Email. |
| 164 | $this->render( 'admin/commons/sui-listing/dialogs/delete-module', array() ); |
| 165 | |
| 166 | // DIALOG: Dissmiss migrate tracking notice modal confirmation. |
| 167 | if ( Hustle_Notifications::is_show_migrate_tracking_notice() ) { |
| 168 | $this->render( 'admin/dialogs/migrate-dismiss-confirmation' ); |
| 169 | } |
| 170 | ?> |
| 171 |