1 | <?php |
||
6 | class FrmTableHTMLGenerator { |
||
7 | |||
8 | /** |
||
9 | * @var string |
||
10 | * @since 2.04 |
||
11 | */ |
||
12 | private $type = ''; |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | * @since 2.04 |
||
17 | */ |
||
18 | private $style_settings = array(); |
||
19 | |||
20 | /** |
||
21 | * @var bool |
||
22 | * @since 2.04 |
||
23 | */ |
||
24 | private $use_inline_style = true; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | * @since 2.04 |
||
29 | */ |
||
30 | private $direction = 'ltr'; |
||
31 | |||
32 | /** |
||
33 | * @var bool |
||
34 | * @since 2.04 |
||
35 | */ |
||
36 | private $odd = true; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | * @since 2.04 |
||
41 | */ |
||
42 | private $table_style = ''; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | * @since 2.04 |
||
47 | */ |
||
48 | private $td_style = ''; |
||
49 | |||
50 | |||
51 | /** |
||
52 | * FrmTableHTMLGenerator constructor. |
||
53 | * |
||
54 | * @param string $type |
||
55 | * @param array $atts |
||
56 | */ |
||
57 | public function __construct( $type, $atts = array() ) { |
||
67 | |||
68 | /** |
||
69 | * Set the style_settings property |
||
70 | * |
||
71 | * @since 2.04 |
||
72 | * |
||
73 | * @param array $atts |
||
74 | */ |
||
75 | private function init_style_settings( $atts ) { |
||
96 | |||
97 | /** |
||
98 | * Set the use_inline_style property |
||
99 | * |
||
100 | * @since 2.04 |
||
101 | * |
||
102 | * @param array $atts |
||
103 | */ |
||
104 | private function init_use_inline_style( $atts ) { |
||
109 | |||
110 | /** |
||
111 | * Set the direction property |
||
112 | * |
||
113 | * @since 2.04 |
||
114 | * |
||
115 | * @param array $atts |
||
116 | */ |
||
117 | private function init_direction( $atts ) { |
||
122 | |||
123 | /** |
||
124 | * Set the table_style property |
||
125 | * |
||
126 | * @since 2.04 |
||
127 | */ |
||
128 | private function init_table_style() { |
||
136 | |||
137 | /** |
||
138 | * Set the td_style property |
||
139 | * |
||
140 | * @since 2.04 |
||
141 | */ |
||
142 | private function init_td_style() { |
||
152 | |||
153 | /** |
||
154 | * Determine if setting is for a color, e.g. text color, background color, or border color |
||
155 | * |
||
156 | * @param string $setting_key name of setting |
||
157 | * |
||
158 | * @since 2.04.02 |
||
159 | * |
||
160 | * @return boolean |
||
161 | */ |
||
162 | private function is_color_setting ( $setting_key ) { |
||
165 | |||
166 | /** |
||
167 | * Get color markup from color setting value |
||
168 | * |
||
169 | * @param string $color_markup value of a color setting, with format #FFFFF, FFFFFF, or white. |
||
170 | * |
||
171 | * @since 2.04.02 |
||
172 | * |
||
173 | * @return string |
||
174 | */ |
||
175 | private function get_color_markup( $color_markup ) { |
||
185 | |||
186 | /** |
||
187 | * Get the table row background color |
||
188 | * |
||
189 | * @since 2.04 |
||
190 | * |
||
191 | * @return string |
||
192 | */ |
||
193 | private function table_row_background_color() { |
||
196 | |||
197 | /** |
||
198 | * Get the table row style |
||
199 | * |
||
200 | * @since 2.04 |
||
201 | * |
||
202 | * @return string |
||
203 | */ |
||
204 | private function tr_style() { |
||
216 | |||
217 | /** |
||
218 | * Switch the odd property from true to false or false to true |
||
219 | * |
||
220 | * @since 2.04 |
||
221 | */ |
||
222 | private function switch_odd() { |
||
227 | |||
228 | /** |
||
229 | * Generate a table header |
||
230 | * |
||
231 | * @since 2.04 |
||
232 | * |
||
233 | * @return string |
||
234 | */ |
||
235 | public function generate_table_header() { |
||
238 | |||
239 | /** |
||
240 | * Generate a table footer |
||
241 | * |
||
242 | * @since 2.04 |
||
243 | * |
||
244 | * @return string |
||
245 | */ |
||
246 | public function generate_table_footer() { |
||
249 | |||
250 | /** |
||
251 | * Generate a two cell row for an HTML table |
||
252 | * |
||
253 | * @since 2.04 |
||
254 | * |
||
255 | * @param string $label |
||
256 | * @param string $value |
||
257 | * |
||
258 | * @return string |
||
259 | */ |
||
260 | public function generate_two_cell_table_row( $label, $value ) { |
||
280 | |||
281 | /** |
||
282 | * Generate a single cell row for an HTML table |
||
283 | * |
||
284 | * @since 2.04 |
||
285 | * |
||
286 | * @param string $value |
||
287 | * |
||
288 | * @return string |
||
289 | */ |
||
290 | public function generate_single_cell_table_row( $value ) { |
||
299 | } |