create-module
2 years ago
create-module.php
5 years ago
delete-module.php
6 years ago
import-module-settings-section.php
6 years ago
import-module.php
5 months ago
manage-tracking.php
6 years ago
manage-tracking.php
98 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Modal for toggling tracking for Ssharing and Embed modules' display types. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.0.0 |
| 7 | */ |
| 8 | |
| 9 | $attributes = array( |
| 10 | 'modal_id' => 'manage-tracking', |
| 11 | 'has_description' => true, |
| 12 | 'modal_size' => 'sm', |
| 13 | 'sui_box_tag' => 'form', |
| 14 | 'sui_box_id' => 'hustle-manage-tracking-form', |
| 15 | |
| 16 | 'header' => array( |
| 17 | 'classes' => 'sui-flatten sui-content-center sui-spacing-top--60', |
| 18 | 'title' => __( 'Manage Tracking', 'hustle' ), |
| 19 | 'title_classes' => 'sui-lg', |
| 20 | 'description' => __( 'Manage the conversion tracking for all the display options of this module.', 'hustle' ), |
| 21 | ), |
| 22 | 'body' => array( |
| 23 | 'content' => '<div id="hustle-manage-tracking-form-container"></div>', |
| 24 | ), |
| 25 | 'footer' => array( |
| 26 | 'classes' => 'sui-flatten sui-content-separated sui-spacing-top--0', |
| 27 | 'buttons' => array( |
| 28 | array( |
| 29 | 'classes' => 'sui-button-ghost', |
| 30 | 'text' => __( 'Cancel', 'hustle' ), |
| 31 | 'is_close' => true, |
| 32 | ), |
| 33 | array( |
| 34 | 'id' => 'hustle-button-toggle-tracking-types', |
| 35 | 'classes' => 'hustle-single-module-button-action', |
| 36 | 'has_load' => true, |
| 37 | 'text' => __( 'Update', 'hustle' ), |
| 38 | 'attributes' => array( |
| 39 | 'data-hustle-action' => 'toggle-tracking', |
| 40 | 'data-form-id' => 'hustle-manage-tracking-form', |
| 41 | ), |
| 42 | ), |
| 43 | ), |
| 44 | ), |
| 45 | ); |
| 46 | |
| 47 | $this->render_modal( $attributes ); |
| 48 | ?> |
| 49 | |
| 50 | <script id="hustle-manage-tracking-form-tpl" type="text/template"> |
| 51 | |
| 52 | <table class="sui-table"> |
| 53 | |
| 54 | <tbody> |
| 55 | |
| 56 | <?php foreach ( $multiple_charts as $chart_key => $chart ) : ?> |
| 57 | |
| 58 | <tr id="hustle-subtype-row-<?php echo esc_attr( $chart_key ); ?>"> |
| 59 | |
| 60 | <th><?php echo esc_html( $chart ); ?></th> |
| 61 | |
| 62 | <td style="text-align: right;"> |
| 63 | |
| 64 | <div class="sui-form-field" style="display: inline-block;"> |
| 65 | |
| 66 | <label |
| 67 | for="hustle-module-tracking--<?php echo esc_attr( $chart_key ); ?>" |
| 68 | class="sui-toggle" |
| 69 | style="margin: 0;" |
| 70 | > |
| 71 | <input |
| 72 | type="checkbox" |
| 73 | name="tracking_sub_types[]" |
| 74 | value="<?php echo esc_attr( $chart_key ); ?>" |
| 75 | id="hustle-module-tracking--<?php echo esc_attr( $chart_key ); ?>" |
| 76 | {{ _.checked( _.contains( enabledTrackings, '<?php echo esc_attr( $chart_key ); ?>' ), true ) }} |
| 77 | aria-labelledby="hustle-module-tracking--<?php echo esc_attr( $chart_key ); ?>-label" |
| 78 | /> |
| 79 | <span aria-hidden="true" class="sui-toggle-slider" aria-hidden="true"></span> |
| 80 | |
| 81 | <?php /* translators: display type in small caps and in singular. */ ?> |
| 82 | <span id="hustle-module-tracking--<?php echo esc_attr( $chart_key ); ?>-label" class="sui-screen-reader-text"><?php printf( esc_html__( 'Enable %s tracking', 'hustle' ), esc_html( $chart ) ); ?></span> |
| 83 | </label> |
| 84 | |
| 85 | </div> |
| 86 | |
| 87 | </td> |
| 88 | |
| 89 | </tr> |
| 90 | |
| 91 | <?php endforeach; ?> |
| 92 | |
| 93 | </tbody> |
| 94 | |
| 95 | </table> |
| 96 | |
| 97 | </script> |
| 98 |