PluginProbe ʕ •ᴥ•ʔ
WP Job Manager / 2.4.6
WP Job Manager v2.4.6
2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.1.3 1.10.0 1.11.0 1.11.1 1.12.0 1.12.1 1.13.0 1.14.0 1.15.0 1.16.0 1.16.1 1.17.0 1.18.0 1.19.0 1.2.0 1.20.0 1.20.1 1.21.0 1.21.1 1.21.2 1.21.3 1.21.4 1.22.0 1.22.1 1.22.2 1.22.3 1.23.0 1.23.1 1.23.10 1.23.11 1.23.12 1.23.13 1.23.2 1.23.3 1.23.4 1.23.5 1.23.6 1.23.7 1.23.8 1.23.9 1.24.0 1.24.0.1 1.25.0 1.25.0.1 1.25.1 1.25.1.1 1.25.2 1.25.2.1 1.25.3 1.25.3.1 1.26.0 1.26.0.1 1.26.1 1.26.1.1 1.26.2 1.26.2.1 1.27.0 1.27.0.1 1.28.0 1.28.0.1 1.29.0 1.29.0.1 1.29.1 1.29.1.1 1.29.2 1.29.2.1 1.29.3 1.29.3.1 1.3.0 1.3.1 1.30.0 1.30.0.1 1.30.1 1.30.1.1 1.30.2 1.30.2.1 1.31.0 1.31.0.1 1.31.1 1.31.1.1 1.31.2 1.31.3 1.32.0 1.32.1 1.32.2 1.32.3 1.33.0 1.33.1 1.33.2 1.33.3 1.33.4 1.33.5 1.34.0 1.34.1 1.34.2 1.34.3 1.34.4 1.34.5 1.35.0 1.35.1 1.35.2 1.35.3 1.36.0 1.36.1 1.36.2 1.37.0 1.38.0 1.38.1 1.39.0 1.4.0 1.40.0 1.40.1 1.40.2 1.41.0 1.42.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.7.1 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 1.9.1 1.9.2 1.9.3 2.0.0 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.4.1
wp-job-manager / includes / ui / class-ui-settings.php
wp-job-manager / includes / ui Last commit date
class-modal-dialog.php 2 years ago class-notice.php 2 years ago class-redirect-message.php 2 years ago class-ui-elements.php 2 weeks ago class-ui-settings.php 2 years ago class-ui.php 2 years ago
class-ui-settings.php
333 lines
1 <?php
2 /**
3 * Preview and settings for UI elements.
4 *
5 * @package wp-job-manager
6 * @since 2.2.0
7 */
8
9 namespace WP_Job_Manager\UI;
10
11 use WP_Job_Manager\Singleton;
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit; // Exit if accessed directly.
15 }
16
17 /**
18 * Preview and settings for UI elements.
19 *
20 * @access private
21 *
22 * @internal
23 */
24 class UI_Settings {
25
26 use Singleton;
27
28 /**
29 * Instance constructor
30 */
31 private function __construct() {
32 add_shortcode( 'job_manager_ui_test', [ $this, 'preview_ui_elements' ] );
33
34 }
35
36 /**
37 * Output previews of UI elements in various scenarios.
38 *
39 * @access private
40 *
41 * @return string Generated HTML of UI elements.
42 */
43 public function preview_ui_elements() {
44 $elements = [];
45
46 $modal = new Modal_Dialog();
47 $modal_content = Notice::render(
48 [
49 'title' => 'Test Modal Dialog',
50 'message' => 'This is a test dialog message.',
51 'buttons' => [
52 [
53 'label' => 'Primary Button',
54 'url' => '/',
55 ],
56 ],
57 'links' => [
58 [
59 'label' => 'Close',
60 'onclick' => '{close}',
61 ],
62 ],
63 ]
64 );
65
66 $elements[] = '<h2>Modal Dialog</h2>';
67
68 $elements[] = Notice::dialog(
69 [
70 'message' => 'Test opening a modal dialog from here.',
71 'buttons' => [
72 [
73 'label' => 'Open Modal',
74 'onclick' => $modal->open(),
75 ],
76 ],
77 ]
78 );
79
80 $elements[] = $modal->render( $modal_content );
81
82 $elements[] = '<h2>Notices</h2>';
83
84 $elements[] = Notice::success( 'Notice rendered successfully.' );
85 $elements[] = Notice::error( 'Invalid notice message.' );
86 $elements[] = Notice::error(
87 [
88 'classes' => [ 'actions-right' ],
89 'message' => 'A user account already exists for this e-mail.',
90 'buttons' => [
91 [
92 'url' => '/',
93 'label' => 'Sign in',
94 ],
95 ],
96 ]
97 );
98
99 $elements[] = Notice::render(
100 [
101 'title' => 'Job listing active',
102 'icon' => 'info',
103 'classes' => [ 'color-strong', 'message-icon' ],
104 'message' => 'Expires in 25 days.',
105 ]
106 );
107
108 $elements[] = Notice::render(
109 [
110 'message' => 'This is a test notice message with a checkmark.',
111 'icon' => 'check',
112 ]
113 );
114
115 $elements[] = Notice::render(
116 [
117 'message' => 'This is a test notice message.',
118 ]
119 );
120
121 $elements[] = Notice::render(
122 [
123 'classes' => [ 'type-hint' ],
124 'message' => 'Already have an account?',
125 'buttons' => [
126 [
127 'label' => 'Sign In',
128 'url' => '/',
129 ],
130 ],
131 ]
132 );
133
134 $elements[] = Notice::dialog(
135 [
136 'message' => __( 'Sign in or create an account to manage your listings.', 'wp-job-manager' ),
137 'buttons' => [
138 [
139 'url' => '/',
140 'label' => 'Sign in',
141 ],
142 [
143 'url' => '/',
144 'label' => 'Create Account',
145 ],
146 ],
147 ]
148 );
149
150 $elements[] = Notice::render(
151 [
152 'classes' => [ 'color-error' ],
153 'message' => 'This is a test notice message with an alert icon and red colors.',
154 'icon' => 'alert',
155 ]
156 );
157
158 $elements[] = Notice::render(
159 [
160 'classes' => [ 'color-success' ],
161 'message' => 'This is a super green test notice message.',
162 'icon' => 'check',
163 ]
164 );
165
166 $elements[] = Notice::render(
167 [
168 'classes' => [ 'color-info' ],
169 'message' => 'This is an informational blue message.',
170 'icon' => 'info',
171 ]
172 );
173
174 $elements[] = Notice::render(
175 [
176 'title' => 'Custom SVG Icon',
177 'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
178 <path stroke="#1E1E1E" stroke-width="1.5" d="M19.25 19.25v-9.5H4.75v9.5z"/>
179 <path fill="#1E1E1E" fill-rule="evenodd" d="M13 19V9h-1.5v10H13Z" clip-rule="evenodd"/>
180 <path stroke="#1E1E1E" stroke-width="1.5" d="M16.5 6.5c0 .97-.78 1.75-1.75 1.75H13V6.5a1.75 1.75 0 1 1 3.5 0ZM8 6.5c0 .97.78 1.75 1.75 1.75h1.75V6.5a1.75 1.75 0 1 0-3.5 0Z"/>
181 </svg>
182 ',
183 ]
184 );
185
186 $elements[] = Notice::render(
187 [
188 'title' => 'Test Notice Created',
189 'icon' => 'check',
190 'message' => 'This is a test Job Manager notice. Should be large with a checkmark.',
191 'buttons' => [
192 [
193 'label' => 'Primary Button',
194 'url' => '/',
195 ],
196 [
197 'label' => 'Secondary Button',
198 'url' => '/',
199 ],
200 ],
201 'links' => [
202 [
203 'label' => 'Action',
204 'url' => '/',
205 ],
206 [
207 'label' => 'Action',
208 'url' => '/',
209 ],
210 ],
211 ]
212 );
213
214 $elements[] = Notice::render(
215 [
216 'title' => 'Test Notice Created',
217 'message' => 'This is a test Job Manager notice. Should be large with a checkmark.',
218 'buttons' => [
219 [
220 'label' => 'Light Button',
221 'url' => '/',
222 'primary' => false,
223 ],
224 ],
225 'links' => [
226 [
227 'label' => 'Action',
228 'url' => '/',
229 ],
230 ],
231 ]
232 );
233
234 $elements[] = Notice::render(
235 [
236 'title' => 'Test Notice Created',
237 'message' => 'This is a test Job Manager notice.',
238 'links' => [
239 [
240 'label' => 'Action',
241 'url' => '/',
242 ],
243 [
244 'label' => 'Action',
245 'url' => '/',
246 ],
247 ],
248 ]
249 );
250
251 $elements[] = Notice::render(
252 [
253 'title' => 'Test Notice Created',
254 'icon' => 'check',
255 'message' => 'This is a test Job Manager notice. Should be large with a checkmark.',
256 'buttons' => [
257 [
258 'label' => 'Primary Button',
259 'url' => '/',
260 ],
261 ],
262 ]
263 );
264
265 $elements[] = Notice::render(
266 [
267 'icon' => 'check',
268 'message' => 'This is a test Job Manager notice, with an icon, message and an action.',
269 'links' => [
270 [
271 'label' => 'Action',
272 'url' => '/',
273 ],
274 ],
275 ]
276 );
277
278 $elements[] = Notice::render(
279 [
280 'icon' => 'check',
281 'classes' => [ 'alignwide' ],
282 'message' => 'This is a wide Job Manager notice, with an icon, message and an action. Actions are on the side.',
283 'links' => [
284 [
285 'label' => 'Action',
286 'url' => '/',
287 ],
288 ],
289 ]
290 );
291
292 $elements[] = Notice::render(
293 [
294 'message' => 'This is a test Job Manager notice, with only a message and an action.',
295 'links' => [
296 [
297 'label' => 'Action',
298 'url' => '/',
299 ],
300 ],
301 ]
302 );
303
304 $elements[] = Notice::render(
305 [
306 'message' => 'This is a test Job Manager notice.',
307 'buttons' => [
308 [
309 'label' => 'Primary Button',
310 'url' => '/',
311 ],
312 ],
313 ]
314 );
315
316 $elements[] = Notice::render(
317 [
318 'message' => 'This is a test Job Manager notice.',
319 'buttons' => [
320 [
321 'label' => 'Outlined Button',
322 'url' => '/',
323 'primary' => false,
324 ],
325 ],
326 ]
327 );
328
329 return implode( '', $elements );
330
331 }
332 }
333