PUM_Admin_Templates::conditions_editor()
Description Description
Source Source
File: classes/Admin/Templates.php
public static function conditions_editor() { ?> <script type="text/html" id="tmpl-pum-field-conditions"> <# print(PUM_Admin.conditions.template.editor({groups: data.value})); #> </script> <script type="text/html" id="tmpl-pum-condition-editor"> <div class="facet-builder <# if (data.groups && data.groups.length) { print('has-conditions'); } #>"> <p> <strong> <?php _e( 'Conditions allow you to show your popup to a targeted segment of your sites users.', 'popup-maker' ); ?> <?php printf( '%2$s<i class="dashicons dashicons-editor-help" title="%1$s"></i>%3$s', sprintf( __( 'Learn more about %s', 'popup-maker' ), __( 'Targeting Conditions', 'popup-maker' ) ), '<a href="https://docs.wppopupmaker.com/article/351-popup-settings-box-targeting-option-settings?utm_medium=inline-doclink&utm_campaign=contextual-help&utm_source=plugin-popup-editor&utm_content=targeting-option-settings" target="_blank">', '</a>' ); ?> </strong> </p> <ul class="ul-disc"> <li><?php _e( 'By default, this popup will be loaded on every page of your site for all users.', 'popup-maker' ); ?></li> <li><?php _e( 'Target the popup to a specific segment by adding conditions below.', 'popup-maker' ); ?></li> <li><?php printf( __( 'Click the %s button for any condition to check the opposite of the chosen condition. The button will turn red %s when active.', 'popup-maker' ), '<i style="font-size: 1em; width: 1em; height: 1em; line-height:1.5em;" class="dashicons dashicons-warning"></i>', '<i style="width: 1em; height: 1em; font-size: 1em; line-height:1.5em; color:#a00;" class="dashicons dashicons-warning"></i>' ); ?></li> </ul> <section class="pum-alert-box" style="display:none"></section> <div class="facet-groups condition-groups"> <# _.each(data.groups, function (group, group_ID) { print(PUM_Admin.conditions.template.group({ index: group_ID, facets: group })); }); #> </div> <div class="no-facet-groups"> <label for="pum-first-condition"><?php _e( 'Choose a condition to target your popup to specific content or various other segments.', 'popup-maker' ); ?></label> <div class="facet-target"> <button type="button" class="pum-not-operand dashicons-before dashicons-warning no-button" aria-label="<?php _e( 'Enable the Not Operand', 'popup-maker' ); ?>"> <input type="checkbox" id="pum-first-facet-operand" value="1"/> </button> <# print(PUM_Admin.conditions.template.selectbox({id: 'pum-first-condition', name: "", placeholder: "<?php _e( 'Choose a condition', 'popup-maker' ); ?>"})); #> </div> </div> </div> </script> <script type="text/html" id="tmpl-pum-condition-group"> <div class="facet-group-wrap" data-index="{{data.index}}"> <section class="facet-group"> <div class="facet-list"> <# _.each(data.facets, function (facet) { print(PUM_Admin.conditions.template.facet(facet)); }); #> </div> <div class="add-or"> <button type="button" class="add add-facet no-button" aria-label="<?php _ex( 'Add another OR condition', 'aria-label for add new OR condition button', 'popup-maker' ); ?>"><?php _e( 'or', 'popup-maker' ); ?></button> </div> </section> <p class="and"> <button type="button" class="add-facet no-button" aria-label="<?php _ex( 'Add another AND condition group', 'aria-label for add new AND condition button', 'popup-maker' ); ?>"><?php _e( 'and', 'popup-maker' ); ?></button> </p> </div> </script> <script type="text/html" id="tmpl-pum-condition-facet"> <div class="facet" data-index="{{data.index}}" data-target="{{data.target}}"> <i class="or"><?php _e( 'or', 'popup-maker' ); ?></i> <div class="facet-col facet-target <# if (typeof data.not_operand !== 'undefined' && data.not_operand == '1') print('not-operand-checked'); #>"> <button type="button" class="pum-not-operand dashicons-before dashicons-warning no-button" aria-label="<?php _e( 'Enable the Not Operand', 'popup-maker' ); ?>"> <input type="checkbox" name="popup_settings[conditions][{{data.group}}][{{data.index}}][not_operand]" value="1" <# if (typeof data.not_operand !== 'undefined') print(PUM_Admin.utils.checked(data.not_operand, true, true)); #> /> </button> <# print(PUM_Admin.conditions.template.selectbox({index: data.index, group: data.group, value: data.target, placeholder: "<?php _e( 'Choose a condition', 'popup-maker' ); ?>"})); #> </div> <div class="facet-settings facet-col"> <# print(PUM_Admin.conditions.template.settings(data, data.settings)); #> </div> <div class="facet-actions"> <button type="button" class="remove remove-facet dashicons dashicons-dismiss no-button" aria-label="<?php _e( 'Remove Condition', 'popup-maker' ); ?>"></button> </div> </div> </script> <?php }
Expand full source code Collapse full source code View on Trac