PluginProbe
HurryTimer – An Scarcity and Urgency Countdown Timer for WordPress & WooCommerce / 2.6.2
HurryTimer – An Scarcity and Urgency Countdown Timer for WordPress & WooCommerce v2.6.2
2.15.0 trunk 1.0.0 1.0.1 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1.2 2.1.3 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 All 62 releases
hurrytimer / includes / Utils / Form.php

Form.php in HurryTimer – An Scarcity and Urgency Countdown Timer for WordPress & WooCommerce 2.6.2, at includes/Utils/Form.php

49 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Hurrytimer\Utils;
4
5 class Form
6 {
7
8 static function toggle($name, $value, $id, $small = false, $attrs = '')
9 {
10 ?>
11 <input type="hidden"
12 name="<?php echo $name ?>"
13 value="no"
14 >
15
16 <input type="checkbox"
17 name="<?php echo $name ?>"
18 id="<?php echo $id ?>"
19 class="hurryt-input-toggle <?php echo $small ? 'is-small' : '' ?>"
20 value="yes"
21 <?php echo $attrs ?>
22 <?php
23 echo filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 'checked' :'' ;
24 ?>
25 />
26 <?php
27 }
28
29 /**
30 * @param $name
31 * @param $value
32 *
33 * @return string
34 */
35 static function colorInput($name, $value)
36 {
37 ?>
38 <span class="hurrytimer-color-preview"></span>
39 <input
40 type="text"
41 name="<?php echo $name ?>"
42 placeholder="Select color"
43 autocomplete="off"
44 class="hurrytimer-color-input"
45 value="<?php echo $value ?>" />
46 <span class="dashicons dashicons-no-alt hurrytimer-color-clear"></span>
47 <?php
48 }
49 }