html-gdpr.php
6 years ago
html-licenses.php
7 years ago
html-main-edd.php
6 years ago
html-main-events-edit.php
5 years ago
html-main-events.php
7 years ago
html-main-general.php
5 years ago
html-main-woo.php
5 years ago
html-popovers.php
7 years ago
html-report.php
7 years ago
html-reset.php
7 years ago
html-wrapper-main.php
7 years ago
html-main-events.php
171 lines
| 1 | <?php |
| 2 | |
| 3 | namespace PixelYourSite; |
| 4 | |
| 5 | if ( ! defined( 'ABSPATH' ) ) { |
| 6 | exit; // Exit if accessed directly. |
| 7 | } |
| 8 | |
| 9 | $new_event_url = buildAdminUrl( 'pixelyoursite', 'events', 'edit' ); |
| 10 | |
| 11 | ?> |
| 12 | |
| 13 | <div class="panel"> |
| 14 | <div class="row"> |
| 15 | <div class="col"> |
| 16 | <div class="d-flex justify-content-between"> |
| 17 | <span class="mt-2">With the pro version, you can fire events on clicks, mouse over and page |
| 18 | scroll:</span> |
| 19 | <a target="_blank" class="btn btn-sm btn-primary float-right" href="https://www.pixelyoursite.com/facebook-pixel-plugin/buy-pixelyoursite-pro?utm_source=pixelyoursite-free-plugin&utm_medium=plugin&utm_campaign=free-plugin-upgrade-blue">UPGRADE</a> |
| 20 | </div> |
| 21 | </div> |
| 22 | </div> |
| 23 | </div> |
| 24 | |
| 25 | <input type="hidden" name="pys[bulk_event_action_nonce]" value="<?php echo wp_create_nonce( 'bulk_event_action' ); ?>"> |
| 26 | |
| 27 | <h2 class="section-title">User Defined Events</h2> |
| 28 | |
| 29 | <div class="card card-static"> |
| 30 | <div class="card-header"> |
| 31 | General |
| 32 | </div> |
| 33 | <div class="card-body"> |
| 34 | <?php PYS()->render_switcher_input( 'custom_events_enabled' ); ?> |
| 35 | <h4 class="switcher-label">Enable Events</h4> |
| 36 | </div> |
| 37 | </div> |
| 38 | |
| 39 | <div class="card card-static"> |
| 40 | <div class="card-header"> |
| 41 | Events List |
| 42 | </div> |
| 43 | <div class="card-body"> |
| 44 | <div class="row mb-3"> |
| 45 | <div class="col"> |
| 46 | <a href="<?php echo esc_url( $new_event_url ); ?>" class="btn btn-sm btn-primary mr-3">Add</a> |
| 47 | <button class="btn btn-sm btn-light" name="pys[bulk_event_action]" value="enable" type="submit">Enable</button> |
| 48 | <button class="btn btn-sm btn-light" name="pys[bulk_event_action]" value="disable" type="submit">Disable</button> |
| 49 | <button class="btn btn-sm btn-light" name="pys[bulk_event_action]" value="clone" type="submit">Duplicate</button> |
| 50 | <button class="btn btn-sm btn-danger ml-3" name="pys[bulk_event_action]" value="delete" type="submit">Delete</button> |
| 51 | </div> |
| 52 | </div> |
| 53 | <div class="row"> |
| 54 | <div class="col"> |
| 55 | <table class="table mb-0" id="table-custom-events"> |
| 56 | <thead> |
| 57 | <tr> |
| 58 | <th style="width: 45px;"> |
| 59 | <label class="custom-control custom-checkbox"> |
| 60 | <input type="checkbox" id="pys_select_all_events" value="1" class="custom-control-input"> |
| 61 | <span class="custom-control-indicator"></span> |
| 62 | </label> |
| 63 | </th> |
| 64 | <th>Name</th> |
| 65 | <th>Trigger</th> |
| 66 | <th>Networks</th> |
| 67 | </tr> |
| 68 | </thead> |
| 69 | <tbody> |
| 70 | |
| 71 | <?php foreach ( CustomEventFactory::get() as $event ) : ?> |
| 72 | |
| 73 | <?php |
| 74 | |
| 75 | /** @var CustomEvent $event */ |
| 76 | |
| 77 | $event_edit_url = buildAdminUrl( 'pixelyoursite', 'events', 'edit', array( |
| 78 | 'id' => $event->getPostId() |
| 79 | ) ); |
| 80 | |
| 81 | $event_enable_url = buildAdminUrl( 'pixelyoursite', 'events', 'enable', array( |
| 82 | 'pys' => array( |
| 83 | 'event' => array( |
| 84 | 'post_id' => $event->getPostId(), |
| 85 | ) |
| 86 | ), |
| 87 | '_wpnonce' => wp_create_nonce( 'pys_enable_event' ), |
| 88 | ) ); |
| 89 | |
| 90 | $event_disable_url = buildAdminUrl( 'pixelyoursite', 'events', 'disable', array( |
| 91 | 'pys' => array( |
| 92 | 'event' => array( |
| 93 | 'post_id' => $event->getPostId(), |
| 94 | ) |
| 95 | ), |
| 96 | '_wpnonce' => wp_create_nonce( 'pys_disable_event' ), |
| 97 | ) ); |
| 98 | |
| 99 | $event_remove_url = buildAdminUrl( 'pixelyoursite', 'events', 'remove', array( |
| 100 | 'pys' => array( |
| 101 | 'event' => array( |
| 102 | 'post_id' => $event->getPostId(), |
| 103 | ) |
| 104 | ), |
| 105 | '_wpnonce' => wp_create_nonce( 'pys_remove_event' ), |
| 106 | ) ); |
| 107 | |
| 108 | ?> |
| 109 | |
| 110 | <tr data-post_id="<?php esc_attr_e( $event->getPostId() ); ?>" |
| 111 | class="<?php echo $event->isEnabled() ? '' : 'disabled'; ?>"> |
| 112 | <td> |
| 113 | <label class="custom-control custom-checkbox"> |
| 114 | <input type="checkbox" name="pys[selected_events][]" |
| 115 | value="<?php esc_attr_e( $event->getPostId() ); ?>" |
| 116 | class="custom-control-input pys-select-event"> |
| 117 | <span class="custom-control-indicator"></span> |
| 118 | </label> |
| 119 | </td> |
| 120 | <td> |
| 121 | <a href="<?php echo esc_url( $event_edit_url ); ?>"><?php esc_html_e( $event->getTitle() ); ?></a> |
| 122 | <span class="event-actions"> |
| 123 | <?php if ( $event->isEnabled() ) : ?> |
| 124 | <a href="<?php echo esc_url( $event_disable_url ); ?>">Disable</a> |
| 125 | <?php else : ?> |
| 126 | <a href="<?php echo esc_url( $event_enable_url ); ?>">Enable</a> |
| 127 | <?php endif; ?> |
| 128 | | |
| 129 | <a href="<?php echo esc_url( $event_remove_url ); ?>" class=" |
| 130 | text-danger">Remove</a> |
| 131 | </span> |
| 132 | </td> |
| 133 | <td>Page Visit</td> |
| 134 | <td class="networks"> |
| 135 | <?php if ( Facebook()->enabled() && $event->isFacebookEnabled() ) : ?> |
| 136 | <i class="fa fa-facebook-square"></i> |
| 137 | <?php else : ?> |
| 138 | <i class="fa fa-facebook-square" style="opacity: .25;"></i> |
| 139 | <?php endif; ?> |
| 140 | |
| 141 | <?php if ( GA()->enabled() && $event->isGoogleAnalyticsEnabled() ) : ?> |
| 142 | <i class="fa fa-area-chart"></i> |
| 143 | <?php else : ?> |
| 144 | <i class="fa fa-area-chart" style="opacity: .25;"></i> |
| 145 | <?php endif; ?> |
| 146 | |
| 147 | <i class="fa fa-google" style="opacity: .25;"></i> |
| 148 | |
| 149 | <?php if ( Pinterest()->enabled() && $event->isPinterestEnabled() ) : ?> |
| 150 | <i class="fa fa-pinterest-square"></i> |
| 151 | <?php else : ?> |
| 152 | <i class="fa fa-pinterest-square" style="opacity: .25;"></i> |
| 153 | <?php endif; ?> |
| 154 | </td> |
| 155 | </tr> |
| 156 | |
| 157 | <?php endforeach; ?> |
| 158 | |
| 159 | </tbody> |
| 160 | </table> |
| 161 | </div> |
| 162 | </div> |
| 163 | </div> |
| 164 | </div> |
| 165 | |
| 166 | <hr> |
| 167 | <div class="row justify-content-center"> |
| 168 | <div class="col-4"> |
| 169 | <button class="btn btn-block btn-save">Save Settings</button> |
| 170 | </div> |
| 171 | </div> |