PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 2.0.1
JetFormBuilder — Dynamic Blocks Form Builder v2.0.1
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 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.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / includes / admin / buttons / base-vui-button.php
jetformbuilder / includes / admin / buttons Last commit date
base-vui-button.php 4 years ago
base-vui-button.php
110 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Admin\Buttons;
5
6 use Jet_Form_Builder\Classes\Arrayable\Arrayable;
7
8 class Base_Vui_Button implements Arrayable {
9
10 const STYLE_ACCENT = 'accent';
11 const STYLE_DEFAULT = 'default';
12 const STYLE_LINK_ACCENT = 'link-accent';
13 const STYLE_LINK_ERROR = 'link-error';
14 const STYLE_ACCENT_BORDER = 'accent-border';
15 const STYLE_DEFAULT_BORDER = 'default-border';
16
17 const TYPE_BUTTON = 'button';
18 const TYPE_SUBMIT = 'submit';
19 const TYPE_RESET = 'reset';
20
21 const SIZE_DEFAULT = 'default';
22 const SIZE_MINI = 'mini';
23 const SIZE_LINK = 'link';
24
25 protected $slug = 'default';
26 protected $url = '';
27 protected $style = self::STYLE_ACCENT;
28 protected $type = self::TYPE_BUTTON;
29 protected $size = self::SIZE_DEFAULT;
30 protected $label = '';
31
32 public function __construct( string $slug ) {
33 $this->slug = $slug;
34 }
35
36 /** Getters */
37
38 public function get_slug(): string {
39 return $this->slug;
40 }
41
42 public function get_style(): string {
43 return $this->style;
44 }
45
46 public function get_type(): string {
47 return $this->type;
48 }
49
50 public function get_size(): string {
51 return $this->size;
52 }
53
54 public function get_url(): string {
55 return $this->url;
56 }
57
58 public function get_label(): string {
59 return $this->label;
60 }
61
62 /** Setters */
63
64 public function set_style( string $style ): Base_Vui_Button {
65 $this->style = $style;
66
67 return $this;
68 }
69
70 public function set_type( string $type ): Base_Vui_Button {
71 $this->type = $type;
72
73 return $this;
74 }
75
76 public function set_size( string $size ): Base_Vui_Button {
77 $this->size = $size;
78
79 return $this;
80 }
81
82 public function set_url( string $url ): Base_Vui_Button {
83 $this->url = $url;
84
85 return $this;
86 }
87
88 public function set_label( string $label ): Base_Vui_Button {
89 $this->label = $label;
90
91 return $this;
92 }
93
94 /**
95 * Get the instance as an array.
96 *
97 * @return array
98 */
99 public function to_array(): array {
100 return array(
101 'slug' => $this->get_slug(),
102 'size' => $this->get_size(),
103 'style' => $this->get_style(),
104 'type' => $this->get_type(),
105 'url' => $this->get_url(),
106 'label' => $this->get_label(),
107 );
108 }
109 }
110