PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 1.1.2
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v1.1.2
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
notificationx / admin / includes / fields / nx-template.php

nx-template.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 1.1.2, at admin/includes/fields/nx-template.php

67 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 $class .= ' nx-template-field';
3 if( isset( $field['variables'] ) ) :
4 $variables = $field['variables'];
5 endif;
6
7 $inner_fields = isset( $field['fields'] ) ? $field['fields'] : false;
8 $subkey = '';
9 ?>
10 <div id="<?php echo $name; ?>">
11 <?php if( $inner_fields ) :
12 $main_value = $value;
13 ?>
14 <div class="template-items">
15 <?php
16 foreach( $inner_fields as $key => $inner_field ) {
17 $main_name = $name;
18 $subkey = $key;
19 $field_id = $name . "_" . $subkey;
20 $name = $name . "[" . $subkey . "]";
21
22 $attrs = ' data-subkey="' . esc_attr( $subkey ) . '"'; // easy fix removing . before =;
23 if( isset( $inner_field['disable'] ) && $inner_field['disable'] === true ) {
24 $attrs .= ' disabled';
25 }
26 // if( isset( $inner_field['readonly'] ) && $inner_field['readonly'] === true ) {
27 // $attrs .= ' readonly="readonly"';
28 // }
29
30 $file_name = $inner_field['type'];
31 if( $file_name === 'select' ) {
32 $field['options'] = isset( $inner_field['options'] ) ? $inner_field['options'] : '';
33 }
34 $value = isset( $main_value[ $key ] ) ? $main_value[ $key ] : ( isset( $inner_field[ 'default'] ) ? $inner_field[ 'default'] : '' ) ;
35
36 if( $file_name ) {
37 include NOTIFICATIONX_ADMIN_DIR_PATH . 'includes/fields/nx-'. $file_name .'.php';
38 $subkey = '';
39 $class = 'nx-meta-field';
40 }
41 $name = $main_name;
42 }
43 ?>
44 </div>
45 <?php endif; ?>
46 <?php if( ! $inner_fields ) : ?>
47 <div contenteditable="true" class="nx-meta-template-editable">
48 <?php for( $i = 0; $i < 3; $i++ ) : ?>
49 <?php echo ! empty( $value[ $i ] ) ? $value[ $i ] . "\n<br>": "\n"; ?>
50 <?php endfor; ?>
51 </div>
52
53 <div class="nx-meta-template-hidden-field">
54 <?php for( $i = 0; $i < 3; $i++ ) : ?>
55 <input type="hidden" class="<?php echo esc_attr( $class ); ?>" name="<?php echo $name; ?>[]" value="<?php echo ! empty( $value[ $i ] ) ? $value[ $i ] : ''; ?>">
56 <?php endfor; ?>
57 </div>
58 <div class="<?php echo $name; ?>-variables">
59 <span class="<?php echo $name; ?>-variable-title"><?php _e( 'Variables: ', 'notificationx' ); ?></span>
60 <?php foreach ( $variables as $variable ) { ?>
61 <span class="nx-variable-tag"><?php echo $variable; ?></span>
62 <?php } ?>
63 </div>
64 <?php endif; ?>
65
66
67 </div>