1 | <?php |
||
9 | class Button extends Fluent implements Arrayable |
||
10 | { |
||
11 | /** |
||
12 | * Flag to check if user is authorized to use the button. |
||
13 | * |
||
14 | * @var bool |
||
15 | */ |
||
16 | protected $authorized = true; |
||
17 | |||
18 | /** |
||
19 | * Make a button if condition is true. |
||
20 | * |
||
21 | * @param bool|callable $condition |
||
22 | * @param string|array $options |
||
23 | * @return Button |
||
24 | */ |
||
25 | public static function makeIf($condition, $options) |
||
33 | |||
34 | /** |
||
35 | * Make a new button instance. |
||
36 | * |
||
37 | * @param string|array $options |
||
38 | * @return Button |
||
39 | */ |
||
40 | public static function make($options = []) |
||
48 | |||
49 | /** |
||
50 | * Set authotization status of the button. |
||
51 | * |
||
52 | * @param bool|callable $bool |
||
53 | * @return $this |
||
54 | */ |
||
55 | public function authorized($bool) |
||
61 | |||
62 | /** |
||
63 | * Make a button if condition is true. |
||
64 | * |
||
65 | * @param string $permission |
||
66 | * @param string|array $options |
||
67 | * @param Authorizable|null $user |
||
68 | * @return Button |
||
69 | */ |
||
70 | public static function makeIfCan($permission, $options, Authorizable $user = null) |
||
82 | |||
83 | /** |
||
84 | * Set extend option value. |
||
85 | * |
||
86 | * @param string $value |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function extend($value) |
||
95 | |||
96 | /** |
||
97 | * Set editor option value. |
||
98 | * |
||
99 | * @param string $value |
||
100 | * @return $this |
||
101 | */ |
||
102 | public function editor($value) |
||
108 | |||
109 | /** |
||
110 | * @param array $buttons |
||
111 | * @return $this |
||
112 | */ |
||
113 | public function buttons(array $buttons) |
||
125 | |||
126 | /** |
||
127 | * Set className option value. |
||
128 | * |
||
129 | * @param string $value |
||
130 | * @return $this |
||
131 | */ |
||
132 | public function className($value) |
||
138 | |||
139 | /** |
||
140 | * Set text option value. |
||
141 | * |
||
142 | * @param string $value |
||
143 | * @return $this |
||
144 | */ |
||
145 | public function text($value) |
||
151 | |||
152 | /** |
||
153 | * Set columns option value. |
||
154 | * |
||
155 | * @param mixed $value |
||
156 | * @return $this |
||
157 | */ |
||
158 | public function columns($value) |
||
164 | |||
165 | /** |
||
166 | * Set exportOptions option value. |
||
167 | * |
||
168 | * @param mixed $value |
||
169 | * @return $this |
||
170 | */ |
||
171 | public function exportOptions($value) |
||
177 | |||
178 | /** |
||
179 | * Convert the Fluent instance to an array. |
||
180 | * |
||
181 | * @return array |
||
182 | */ |
||
183 | public function toArray() |
||
191 | } |
||
192 |