PUM_Admin_Templates::cookies_editor()
Description Description
Source Source
File: classes/Admin/Templates.php
public static function cookies_editor() { ?> <script type="text/html" id="tmpl-pum-field-cookies"> <# print(PUM_Admin.cookies.template.editor({cookies: data.value, name: data.name})); #> </script> <script type="text/html" id="tmpl-pum-cookie-editor"> <div class="pum-popup-cookie-editor <# if (data.cookies && data.cookies.length) { print('has-list-items'); } #>" data-field_name="{{data.name}}"> <button type="button" class="button button-primary pum-add-new no-button"><?php _e( 'Add New Cookie', 'popup-maker' ); ?></button> <p> <strong> <?php _e( 'Cookies control the repeat display of a popup.', 'popup-maker' ); ?> <a href="<?php echo esc_url( 'https://docs.wppopupmaker.com/article/358-popup-settings-box-cookies-option-settings?utm_campaign=contextual-help&utm_medium=inline-doclink&utm_source=plugin-popup-editor&utm_content=cookies-option-settings' ); ?>" target="_blank" class="pum-doclink dashicons dashicons-editor-help" title="<?php esc_attr_e( sprintf( __( 'Learn more about %s', 'popup-maker' ), __( 'Cookies', 'popup-maker' ) ) ); ?>"></a> </strong> </p> <table class="list-table form-table"> <thead> <tr> <th><?php _e( 'Event', 'popup-maker' ); ?></th> <th><?php _e( 'Name', 'popup-maker' ); ?></th> <th><?php _e( 'Settings', 'popup-maker' ); ?></th> <th><?php _e( 'Actions', 'popup-maker' ); ?></th> </tr> </thead> <tbody> <# _.each(data.cookies, function (cookie, index) { print(PUM_Admin.cookies.template.row({ index: index, event: cookie.event, name: data.name, settings: cookie.settings || {} })); }); #> </tbody> </table> <!-- <div class="no-cookies no-list-items">--> <!-- <div class="pum-field pum-field-select pum-field-select2">--> <!-- <label for="pum-first-cookie">--><?php //_e( 'Choose when you want to set a cookie to get started.', 'popup-maker' ); ?><!--</label>--> <!-- <# print(PUM_Admin.cookies.template.selectbox({id: 'pum-first-cookie', name: "", placeholder: "--><?php //_e( 'Select an event.', 'popup-maker' ); ?><!--"})); #>--> <!-- </div>--> <!-- </div>--> </div> </script> <script type="text/html" id="tmpl-pum-cookie-row"> <tr data-index="{{data.index}}"> <td class="event-column"> <button type="button" class="edit no-button link-button" aria-label="<?php _e( 'Edit this cookie', 'popup-maker' ); ?>">{{PUM_Admin.cookies.getLabel(data.event)}}</button> <input class="popup_cookies_field_event" type="hidden" name="{{data.name}}[{{data.index}}][event]" value="{{data.event}}"/> <input class="popup_cookies_field_settings" type="hidden" name="{{data.name}}[{{data.index}}][settings]" value="{{JSON.stringify(data.settings)}}"/> </td> <td class="name-column"> <code>{{data.settings.name}}</code> </td> <td class="settings-column">{{{PUM_Admin.cookies.getSettingsDesc(data.event, data.settings)}}}</td> <td class="list-item-actions"> <button type="button" class="edit dashicons dashicons-edit no-button" aria-label="<?php _e( 'Edit this cookie', 'popup-maker' ); ?>"></button> <button type="button" class="remove dashicons dashicons-no no-button" aria-label="<?php _e( 'Delete this cookie', 'popup-maker' ); ?>"></button> </td> </tr> </script> <script type="text/html" id="tmpl-pum-cookie-add-event"> <# print(PUM_Admin.templates.modal({ id: 'pum_cookie_add_event_modal', title: '<?php _e( 'When should your cookie be created?', 'popup-maker' ); ?>', content: PUM_Admin.cookies.template.selectbox({id: 'popup_cookie_add_event', name: "", placeholder: "<?php _e( 'Select a cookie type.', 'popup-maker' ); ?>"}), save_button: pum_admin_vars.I10n.add || '<?php __( 'Add', 'popup-maker' ); ?>' })); #> </script> <script type="text/html" id="tmpl-pum-field-cookie_key"> <div class="cookie-key"> <button type="button" class="reset dashicons-before dashicons-image-rotate" title="<?php _e( 'Reset Cookie Key', 'popup-maker' ); ?>"></button> <input type="text" placeholder="{{data.placeholder}}" class="{{data.size}}-text dashicons-before dashicons-image-rotate" id="{{data.id}}" name="{{data.name}}" value="{{data.value}}" {{{data.meta}}}/> </div> </script> <?php }
Expand full source code Collapse full source code View on Trac