PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.9
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.9
7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / views / admin / commons / modal-template.php
wordpress-popup / views / admin / commons Last commit date
sui-listing 9 months ago sui-wizard 9 months ago wizard 3 years ago modal-template.php 3 years ago options.php 3 years ago pagination.php 3 years ago view-documentation.php 5 years ago
modal-template.php
194 lines
1 <?php
2 /**
3 * Shared template for simple modals.
4 * We, markup dummies, are grateful.
5 *
6 * @package Hustle
7 * @since 4.2.0
8 */
9
10 $is_unwrapped = isset( $no_wrapper ) ? $no_wrapper : false;
11
12 $modal_id = 'hustle-dialog--' . $modal_id;
13 $modal_title_id = $modal_id . '-title';
14 $modal_description_id = $has_description ? $modal_id . '-description' : false;
15
16 $modal_claxx = 'sui-modal';
17 $modal_claxx .= in_array( $modal_size, array( 'sm', 'md', 'lg', 'xl' ), true ) ? ' sui-modal-' . $modal_size : '';
18 $modal_claxx .= ! empty( $modal_class ) ? ' ' . $modal_class : '';
19
20 $sui_box_tag = empty( $sui_box_tag ) ? 'div' : $sui_box_tag;
21 $sui_box_attr = ! empty( $sui_box_attr ) ? $sui_box_attr : false;
22
23 $header_classes = ! empty( $header['classes'] ) ? ' ' . $header['classes'] : '';
24 $header_title = ! $is_unwrapped ? $header['title'] : '';
25 $header_title_classes = ! empty( $header['title_classes'] ) ? ' ' . $header['title_classes'] : '';
26 $header_description = ! empty( $header['description'] ) ? $header['description'] : false;
27 $header_descr_class = ! isset( $header['description_classes'] ) ? 'sui-description' : $header['description_classes'];
28 $header_content = ! empty( $header['content'] ) ? $header['content'] : false;
29
30 $body_classes = ! empty( $body['classes'] ) ? ' ' . $body['classes'] : '';
31 $body_description = ! empty( $body['description'] ) && ! $header_description ? $body['description'] : false;
32 $body_descr_class = ! isset( $body['description_classes'] ) ? 'sui-description' : $body['description_classes'];
33 $body_content = ! empty( $body['content'] ) ? $body['content'] : false;
34
35 $after_body_content = ! empty( $after_body_content ) ? $after_body_content : false;
36
37 $footer_classes = ! empty( $footer['classes'] ) ? ' ' . $footer['classes'] : '';
38 $footer_content = ! empty( $footer['content'] ) ? $footer['content'] : false;
39 $footer_buttons = ! empty( $footer['buttons'] ) ? $footer['buttons'] : false;
40 ?>
41 <div class="<?php echo esc_attr( $modal_claxx ); ?>">
42
43 <div
44 class="sui-modal-content"
45 role="dialog"
46 id="<?php echo esc_attr( $modal_id ); ?>"
47 aria-labelledby="<?php echo esc_attr( $modal_title_id ); ?>"
48 <?php if ( $modal_description_id ) : ?>
49 aria-describedby="<?php echo esc_attr( $modal_description_id ); ?>"
50 <?php endif; ?>
51 >
52
53 <?php if ( $is_unwrapped ) { ?>
54
55 <?php $this->render_html( $body_content ); ?>
56
57 <?php } else { ?>
58
59 <<?php echo esc_attr( $sui_box_tag ) . ( ! empty( $sui_box_id ) ? ' id="' . esc_attr( $sui_box_id ) . '"' : '' ); ?>
60 <?php
61 if ( $sui_box_attr ) :
62 $this->render_attributes( $sui_box_attr );
63 endif;
64 ?>
65 class="sui-box"
66 >
67
68 <div class="sui-box-header<?php echo esc_attr( $header_classes ); ?>">
69
70 <button class="sui-button-icon sui-button-float--right hustle-modal-close" data-modal-close>
71 <span class="sui-icon-close sui-md" aria-hidden="true"></span>
72 <span class="sui-screen-reader-text"><?php esc_html_e( 'Close this dialog window', 'hustle' ); ?></span>
73 </button>
74
75 <h3 id="<?php echo esc_attr( $modal_id ); ?>-title" class="sui-box-title<?php echo esc_attr( $header_title_classes ); ?>">
76 <?php echo esc_html( $header_title ); ?>
77 </h3>
78
79 <?php if ( $header_description ) : ?>
80
81 <p id="<?php echo esc_attr( $modal_description_id ); ?>" <?php echo $header_descr_class ? 'class="' . esc_attr( $header_descr_class ) . '"' : ''; ?>><?php echo esc_html( $header_description ); ?></p>
82
83 <?php endif; ?>
84
85 <?php
86 if ( $header_content ) :
87 echo wp_kses_post( $header_content );
88 endif;
89 ?>
90
91 </div>
92
93 <?php if ( $body_content || $body_description ) : ?>
94
95 <div class="sui-box-body<?php echo esc_attr( $body_classes ); ?>">
96
97 <?php if ( $body_description ) : ?>
98
99 <p id="<?php echo esc_attr( $modal_description_id ); ?>" <?php echo $body_descr_class ? 'class="' . esc_attr( $body_descr_class ) . '"' : ''; ?>><?php echo esc_html( $body_description ); ?></p>
100
101 <?php endif; ?>
102
103 <?php
104 if ( $body_content ) :
105
106 $this->render_html( $body_content );
107
108 endif;
109 ?>
110
111 </div>
112
113 <?php endif; ?>
114
115 <?php
116 if ( $after_body_content ) :
117
118 $this->render_html( $after_body_content );
119
120 endif;
121 ?>
122
123 <?php if ( $footer_content || $footer_buttons ) : ?>
124
125 <div class="sui-box-footer<?php echo esc_attr( $footer_classes ); ?>">
126
127 <?php
128 if ( $footer_content ) :
129 echo wp_kses_post( $footer_content );
130
131 endif;
132
133 if ( $footer_buttons ) :
134
135 foreach ( $footer_buttons as $button ) :
136
137 $button_classes = ! empty( $button['classes'] ) ? ' ' . $button['classes'] : '';
138 $has_load = ! empty( $button['has_load'] ) ? true : false;
139 $button_attrs = ! empty( $button['attributes'] ) ? $button['attributes'] : false;
140 $button_icon = ! empty( $button['icon'] ) ? $button['icon'] : false;
141 $text = $button['text'];
142 ?>
143
144 <button
145 class="sui-button<?php echo esc_attr( $button_classes ); ?>"
146 <?php if ( ! empty( $button['id'] ) ) { ?>
147 id="<?php echo esc_attr( $button['id'] ); ?>"
148 <?php } ?>
149 <?php if ( empty( $button['is_submit'] ) ) { ?>
150 type="button"
151 <?php } ?>
152 <?php if ( ! empty( $button['is_close'] ) ) { ?>
153 data-modal-close
154 <?php } ?>
155 <?php
156 if ( $button_attrs ) :
157 $this->render_attributes( $button_attrs );
158 endif;
159 ?>
160 >
161 <?php if ( $has_load ) : ?>
162 <span class="sui-loading-text">
163 <?php endif; ?>
164
165 <?php if ( $button_icon ) : ?>
166 <span class="sui-icon-<?php echo esc_attr( $button_icon ); ?>" aria-hidden="true"></span>
167 <?php endif; ?>
168 <?php echo esc_html( $text ); ?>
169
170 <?php if ( $has_load ) : ?>
171 </span>
172 <span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
173 <?php endif; ?>
174
175 </button>
176
177 <?php
178 endforeach;
179
180 endif;
181 ?>
182
183 </div>
184
185 <?php endif; ?>
186
187 </<?php echo esc_attr( $sui_box_tag ); ?>>
188
189 <?php } ?>
190
191 </div>
192
193 </div>
194