integration-row.php
5 years ago
page-table-connected.php
5 years ago
page-table-not-connected.php
6 years ago
wizard-table-connected.php
5 years ago
wizard-table-not-connected.php
5 years ago
wizard-table-not-connected.php
68 lines
| 1 | <?php |
| 2 | /** |
| 3 | * List of available integrations (already connected globally) to connect the module to. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.0.0 |
| 7 | */ |
| 8 | |
| 9 | if ( 0 === count( $providers ) ) : |
| 10 | |
| 11 | $module_type = Hustle_Module_Model::get_module_type_by_module_id( $module_id ); |
| 12 | $display_type_name = Opt_In_Utils::get_module_type_display_name( $module_type ); |
| 13 | |
| 14 | if ( current_user_can( 'hustle_edit_integrations' ) ) { |
| 15 | $integrations_url = add_query_arg( 'page', Hustle_Data::INTEGRATIONS_PAGE, 'admin.php' ); |
| 16 | $empty_providers_msg = sprintf( |
| 17 | /* translators: 1. opening 'a' tag to the global integrations page, 2. closing 'a' tag */ |
| 18 | esc_html__( 'Connect to more third party apps via %1$sIntegrations%2$s page and activate them to collect the data of this %3$s here.', 'hustle' ), |
| 19 | '<a href="' . esc_url( $integrations_url ) . '">', |
| 20 | '</a>', |
| 21 | esc_html( $display_type_name ) |
| 22 | ); |
| 23 | } else { |
| 24 | $empty_providers_msg = sprintf( |
| 25 | /* translators: module type in small caps and singular */ |
| 26 | esc_html__( 'Ask your site admin to connect more third-party apps to activate them for this %s', 'hustle' ), |
| 27 | esc_html( $display_type_name ) |
| 28 | ); |
| 29 | } |
| 30 | |
| 31 | $notice_options = array( |
| 32 | array( |
| 33 | 'type' => 'inline_notice', |
| 34 | 'icon' => 'info', |
| 35 | 'value' => $empty_providers_msg, |
| 36 | ), |
| 37 | ); |
| 38 | $this->get_html_for_options( $notice_options ); |
| 39 | |
| 40 | else : |
| 41 | ?> |
| 42 | |
| 43 | <table class="sui-table hui-table--apps" style="margin-bottom: 10px;"> |
| 44 | |
| 45 | <tbody> |
| 46 | |
| 47 | <?php foreach ( $providers as $provider ) : ?> |
| 48 | |
| 49 | <?php |
| 50 | $this->render( |
| 51 | 'admin/integrations/integration-row', |
| 52 | array( |
| 53 | 'provider' => $provider, |
| 54 | 'module_id' => $module_id, |
| 55 | ) |
| 56 | ); |
| 57 | ?> |
| 58 | |
| 59 | <?php endforeach; ?> |
| 60 | |
| 61 | </tbody> |
| 62 | |
| 63 | </table> |
| 64 | |
| 65 | <span class="sui-description"><?php esc_html_e( 'You are connected to these applications via their APIs.', 'hustle' ); ?></span> |
| 66 | |
| 67 | <?php endif; ?> |
| 68 |