PluginProbe ʕ •ᴥ•ʔ
AI Copilot – Content Generator / 1.2.0
AI Copilot – Content Generator v1.2.0
1.5.4 1.4.21 1.4.18 1.4.19 1.4.20 trunk 1.0.4 1.1.0 1.2.0 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.17 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.9
ai-copilot-content-generator / classes / html.php
ai-copilot-content-generator / classes Last commit date
tables 1 year ago assets.php 1 year ago baseObject.php 1 year ago cache.php 1 year ago controller.php 1 year ago date.php 1 year ago db.php 1 year ago dispatcher.php 1 year ago errors.php 1 year ago field.php 1 year ago fieldAdapter.php 1 year ago frame.php 1 year ago helper.php 1 year ago html.php 1 year ago installer.php 1 year ago installerDbUpdater.php 1 year ago modInstaller.php 1 year ago model.php 1 year ago module.php 1 year ago req.php 1 year ago response.php 1 year ago table.php 1 year ago uri.php 1 year ago user.php 1 year ago utils.php 1 year ago validator.php 1 year ago view.php 1 year ago
html.php
1395 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5 class WaicHtml {
6 public static $fontsList = array();
7 public static $categoriesOptions = array();
8 public static $productsOptions = array();
9 public static $colsType = 'standart';
10 public static $colClasses = array(
11 'standart' => array('label' => 'col-3 col-xl-2', 'values' => 'col-8 col-sm-9 col-xl-9', 'full' => 'col-12'),
12 'compact' => array('label' => 'col-3 col-xl-3 col-sm-5', 'info' => 'col-xs-2 col-sm-1', 'values' => 'col-9 col-xl-9 col-sm-7', 'full' => 'col-12'),
13 'popup' => array('label' => 'col-5 col-sm-3', 'info' => 'col-1', 'values' => 'col-7 col-sm-9', 'full' => 'col-12'),
14 'super' => array('label' => 'col-3 col-sm-2', 'info' => 'col-1', 'values' => 'col-8 col-sm-9', 'full' => 'col-12'),
15 );
16 public static function setColType( $type ) {
17 if (isset(self::$colClasses[$type])) {
18 self::$colsType = $type;
19 }
20 }
21 public static function blockClasses( $type ) {
22 return 'options-' . $type . ' ' . WaicUtils::getArrayValue(self::$colClasses[self::$colsType], $type);
23 }
24 public static function echoEscapedHtml( $html ) {
25 add_filter('esc_html', array('WaicHtml', 'skipHtmlEscape'), 99, 2);
26 echo esc_html($html);
27 remove_filter('esc_html', array('WaicHtml', 'skipHtmlEscape'), 99, 2);
28 }
29 public static function skipHtmlEscape( $safe_text, $text ) {
30 return $text;
31 }
32 public static function block( $name, $params = array('attrs' => '', 'value' => '') ) {
33 $output .= '<p class="toe_' . self::nameToClassId($name) . '">' . $params['value'] . '</p>';
34 return $output;
35 }
36 public static function nameToClassId( $name, $params = array() ) {
37 if (!empty($params) && isset($params['attrs']) && strpos($params['attrs'], 'id="') !== false) {
38 preg_match('/id="(.+)"/ui', $params['attrs'], $idMatches);
39 if ($idMatches[1]) {
40 return $idMatches[1];
41 }
42 }
43 return str_replace(array('[', ']'), '', $name);
44 }
45 public static function textarea( $name, $params = array('attrs' => '', 'value' => '', 'rows' => 8, 'cols' => 50) ) {
46 $params['attrs'] = isset($params['attrs']) ? $params['attrs'] : '';
47 $params['rows'] = isset($params['rows']) ? $params['rows'] : 8;
48 $params['cols'] = isset($params['cols']) ? $params['cols'] : 50;
49 if (isset($params['required']) && $params['required']) {
50 $params['attrs'] .= ' required '; // HTML5 "required" validation attr
51 }
52 if (isset($params['placeholder']) && $params['placeholder']) {
53 $params['attrs'] .= ' placeholder="' . esc_attr($params['placeholder']) . '"'; // HTML5 "required" validation attr
54 }
55 if (isset($params['disabled']) && $params['disabled']) {
56 $params['attrs'] .= ' disabled ';
57 }
58 if (isset($params['readonly']) && $params['readonly']) {
59 $params['attrs'] .= ' readonly ';
60 }
61 if (isset($params['auto_width']) && $params['auto_width']) {
62 unset($params['rows']);
63 unset($params['cols']);
64 }
65 echo '<textarea' . ( empty($name) ? '' : ' name="' . esc_attr($name) . '"' ) . ' ';
66 if (!empty($params['attrs'])) {
67 self::echoEscapedHtml($params['attrs']);
68 }
69 echo ( isset($params['rows']) ? ' rows="' . esc_attr($params['rows']) . '"' : '' ) .
70 ( isset($params['cols']) ? ' cols="' . esc_attr($params['cols']) . '"' : '' ) . '>' .
71 ( isset($params['value']) ? esc_html($params['value']) : '' ) .
72 '</textarea>';
73 }
74 public static function input( $name, $params = array('attrs' => '', 'type' => 'text', 'value' => '') ) {
75 $params['attrs'] = isset($params['attrs']) ? $params['attrs'] : '';
76 $params['attrs'] .= self::_dataToAttrs($params);
77 if (isset($params['required']) && $params['required']) {
78 $params['attrs'] .= ' required '; // HTML5 "required" validation attr
79 }
80 if (isset($params['placeholder']) && $params['placeholder']) {
81 $params['attrs'] .= ' placeholder="' . esc_attr($params['placeholder']) . '"'; // HTML5 "required" validation attr
82 }
83 if (isset($params['disabled']) && $params['disabled']) {
84 $params['attrs'] .= ' disabled ';
85 }
86 if (isset($params['readonly']) && $params['readonly']) {
87 $params['attrs'] .= ' readonly ';
88 }
89 $params['type'] = isset($params['type']) ? $params['type'] : 'text';
90 $params['value'] = isset($params['value']) ? $params['value'] : '';
91
92 echo '<input type="' . esc_attr($params['type']) . '"' . ( empty($name) ? '' : ' name="' . esc_attr($name) . '"' ) . ' value="' . esc_attr($params['value']) . '" ';
93 if (!empty($params['attrs'])) {
94 self::echoEscapedHtml($params['attrs']);
95 }
96 echo ' />';
97 }
98 public static function inputShortcode( $name, $params = array() ) {
99 $value = $params['value'];
100 self::input('', array('value' => $value, 'attrs' => 'readonly class="wbw-flat-input wbw-nosave wbw-shortcode wbw-width' . ( strlen($value) <= 20 ? 200 : 300 ) . '"'));
101 }
102 private static function _dataToAttrs( $params ) {
103 $res = '';
104 foreach ($params as $k => $v) {
105 if (strpos($k, 'data-') === 0) {
106 $res .= ' ' . $k . '="' . $v . '"';
107 }
108 }
109 return $res;
110 }
111 public static function text( $name, $params = array('attrs' => '', 'value' => '') ) {
112 $params['type'] = 'text';
113 self::input($name, $params);
114 }
115 public static function email( $name, $params = array('attrs' => '', 'value' => '') ) {
116 $params['type'] = 'email';
117 self::input($name, $params);
118 }
119 public static function reset( $name, $params = array('attrs' => '', 'value' => '') ) {
120 $params['type'] = 'reset';
121 self::input($name, $params);
122 }
123 public static function password( $name, $params = array('attrs' => '', 'value' => '') ) {
124 $params['type'] = 'password';
125 self::input($name, $params);
126 }
127 public static function hidden( $name, $params = array('attrs' => '', 'value' => '') ) {
128 $params['type'] = 'hidden';
129 self::input($name, $params);
130 }
131 public static function number( $name, $params = array('attrs' => '', 'value' => '') ) {
132 $params['type'] = 'number';
133 self::input($name, $params);
134 }
135 public static function checkbox( $name, $params = array('attrs' => '', 'value' => '', 'checked' => '') ) {
136 $params['type'] = 'checkbox';
137 $params['checked'] = isset($params['checked']) && $params['checked'] ? ' checked' : '';
138 if ( !isset($params['value']) || null == $params['value'] ) {
139 $params['value'] = 1;
140 }
141 if (!isset($params['attrs'])) {
142 $params['attrs'] = '';
143 }
144 $params['attrs'] .= $params['checked'];
145 self::input($name, $params);
146 }
147 public static function checkboxToggle( $name, $params = array('attrs' => '', 'value' => '', 'checked' => '') ) {
148 $params['type'] = 'checkbox';
149 $params['checked'] = isset($params['checked']) && $params['checked'] ? 'checked' : '';
150 if ( !isset($params['value']) || ( null === $params['value'] ) ) {
151 $params['value'] = 1;
152 }
153 $id = ( empty($params['id']) ? self::nameToClassId($name) . mt_rand(9, 9999) : $params['id'] );
154 $params['attrs'] = 'id="' . esc_attr($id) . '" class="toggle" ' . ( isset($params['attrs']) ? $params['attrs'] . ' ' : '' ) . $params['checked'];
155
156 self::input($name, $params);
157 echo '<label for="' . esc_attr($id) . '" class="toggle"></label>';
158 }
159 public static function checkboxlist( $name, $params = array('options' => array(), 'attrs' => '', 'checked' => '', 'delim' => '<br />', 'usetable' => 5), $delim = '<br />' ) {
160 if (!strpos($name, '[]')) {
161 $name .= '[]';
162 }
163 $i = 0;
164 if ($params['options']) {
165 if (!isset($params['delim'])) {
166 $params['delim'] = $delim;
167 }
168 if (!empty($params['usetable'])) {
169 echo '<table><tr>';
170 }
171 foreach ($params['options'] as $v) {
172 if (!empty($params['usetable'])) {
173 if ( ( 0 != $i ) && ( 0 == $i%$params['usetable'] ) ) {
174 echo '</tr><tr>';
175 }
176 echo '<td>';
177 }
178 self::checkboxToggle($name, array(
179 'attrs' => !empty($params['attrs']),
180 'value' => empty($v['value']) ? $v['id'] : $v['value'],
181 'checked' => $v['checked'],
182 'id' => $v['id'],
183 ));
184 echo '&nbsp;';
185 if (!empty($v['text'])) {
186 self::echoEscapedHtml($v['text']);
187 }
188 if (!empty($params['delim'])) {
189 self::echoEscapedHtml($params['delim']);
190 }
191 if (!empty($params['usetable'])) {
192 echo '</td>';
193 }
194 $i++;
195 }
196 if (!empty($params['usetable'])) {
197 echo '</tr></table>';
198 }
199 }
200 }
201 public static function submit( $name, $params = array('attrs' => '', 'value' => '') ) {
202 $params['type'] = 'submit';
203 self::input($name, $params);
204 }
205 public static function img( $src, $usePlugPath = 1, $params = array('width' => '', 'height' => '', 'attrs' => '') ) {
206 if ($usePlugPath) {
207 $src = WAIC_IMG_PATH . $src;
208 }
209 echo '<img src="' . esc_url($src) . '" '
210 . ( isset($params['width']) ? 'width="' . esc_attr($params['width']) . '"' : '' )
211 . ' '
212 . ( isset($params['height']) ? 'height="' . esc_attr($params['height']) . '"' : '' )
213 . ' ';
214 if (!empty($params['attrs'])) {
215 self::echoEscapedHtml($params['attrs']);
216 }
217 echo ' />';
218 }
219 public static function selectbox( $name, $params = array('attrs' => '', 'options' => array(), 'value' => '') ) {
220 $attrs = WaicUtils::getArrayValue($params, 'attrs');
221 if (WaicUtils::getArrayValue($params, 'required', false)) {
222 $attrs .= ' required ';
223 }
224 echo '<select' . ( empty($name) ? '' : ' name="' . esc_attr($name) . '"' ) . ' ';
225 if (!empty($attrs)) {
226 self::echoEscapedHtml($attrs);
227 }
228 echo '>';
229 $default = WaicUtils::getArrayValue($params, 'default');
230 if (!empty($default)) {
231 echo '<option value="">' . esc_html($default) . '</option>';
232 }
233 $existValue = isset($params['value']);
234 $keyValue = WaicUtils::getArrayValue($params, 'key') == 'value';
235 $add = isset($params['add']) ? $params['add'] : '';
236 if (!empty($params['options'])) {
237 foreach ($params['options'] as $k => $v) {
238 $key = ( $keyValue ? $v : $k ) . $add;
239 $a = '';
240 if (is_array($v)) {
241 $a = isset($v['attrs']) ? $v['attrs'] : '';
242 $v = isset($v['label']) ? $v['label'] : '???';
243 }
244 echo '<option value="' . esc_attr($key) . '"' . ( $existValue && $key == $params['value'] ? ' selected="true"' : '' );
245 if (!empty($a)) {
246 self::echoEscapedHtml($a);
247 }
248 echo '>' . esc_html($v) . '</option>';
249 }
250 }
251 echo '</select>';
252 }
253 public static function selectlist( $name, $params = array('attrs' => '', 'size' => 5, 'class' => '', 'options' => array(), 'value' => '') ) {
254 if (!strpos($name, '[]')) {
255 $name .= '[]';
256 }
257 if ( !isset($params['size']) || !is_numeric($params['size']) || ( '' == $params['size'] ) ) {
258 $params['size'] = 5;
259 }
260 $params['class'] = isset($params['class']) ? $params['class'] : '';
261 $params['attrs'] = isset($params['attrs']) ? $params['attrs'] : '';
262 $params['attrs'] .= self::_dataToAttrs($params);
263
264 echo '<select multiple="multiple" class="wbw-chosen ' . esc_attr($params['class']) . '" size="' . esc_attr($params['size']) . '"' . ( empty($name) ? '' : ' name="' . esc_attr($name) . '"' ) . ' ';
265 if (!empty($params['attrs'])) {
266 self::echoEscapedHtml($params['attrs']);
267 }
268 echo '>';
269
270 $params['value'] = isset($params['value']) ? (array) $params['value'] : array();
271 $keyValue = WaicUtils::getArrayValue($params, 'key') == 'value';
272 $options = $params['options'];
273 if (!empty($params['value'])) {
274 foreach ($params['value'] as $v) {
275 $k = ( $keyValue ? array_search($v, $options) : ( isset($options[$v]) ? $v : false ) );
276 if (false !== $k) {
277 echo '<option value="' . esc_attr($v) . '" selected>' . esc_html($options[$k]) . '</option>';
278 unset($options[$k]);
279 }
280 }
281 }
282 if (!empty($options)) {
283 foreach ($options as $k => $v) {
284 $key = ( $keyValue ? $v : $k );
285 echo '<option value="' . esc_attr($key) . '">' . esc_html($v) . '</option>';
286 }
287 }
288 echo '</select>';
289 }
290 public static function file( $name, $params = array() ) {
291 $id = ( empty($params['id']) ? self::nameToClassId($name) . mt_rand(9, 9999) : $params['id'] );
292 echo '<div class="wbw-inputfile">
293 <input type="file" id="' . esc_attr($id) . '" name="' . esc_attr($name) . '">
294 <label for="' . esc_attr($id) . '">
295 <div class="wbw-namefile"></div>
296 <div class="button buttonfile">
297 <i class="fa fa-upload" aria-hidden="true"></i>' . esc_html__('Select file', 'ai-copilot-content-generator') . '
298 </div>
299 </label>
300 </div>';
301 }
302 public static function button( $params = array('attrs' => '', 'value' => '') ) {
303 echo '<button ';
304 if (!empty($params['attrs'])) {
305 self::echoEscapedHtml($params['attrs']);
306 }
307 echo '>' . esc_html($params['value']) . '</button>';
308 }
309 public static function buttonA( $params = array('attrs' => '', 'value' => '') ) {
310 echo '<a href="#" ';
311 if (!empty($params['attrs'])) {
312 self::echoEscapedHtml($params['attrs']);
313 }
314 echo '>' . esc_html($params['value']) . '</a>';
315 }
316 public static function inputButton( $params = array('attrs' => '', 'value' => '') ) {
317 if (!is_array($params)) {
318 $params = array();
319 }
320 $params['type'] = 'button';
321 self::input('', $params);
322 }
323 public static function radiobuttons( $name, $params = array('attrs' => '', 'options' => array(), 'value' => '', '') ) {
324 if (isset($params['options']) && is_array($params['options']) && !empty($params['options'])) {
325 //$params['labeled'] = isset($params['labeled']) ? $params['labeled'] : false;
326 $params['attrs'] = isset($params['attrs']) ? $params['attrs'] : '';
327 $params['no_br'] = isset($params['no_br']) ? $params['no_br'] : false;
328 foreach ($params['options'] as $key => $val) {
329 $checked = ( $key == $params['value'] ) ? 'checked' : '';
330 self::input($name, array('attrs' => $params['attrs'] . ' ' . $checked, 'type' => 'radio', 'value' => $key));
331 echo '<label>' . esc_html($val) . '</label>';
332 if (!$params['no_br']) {
333 echo '<br />';
334 }
335 }
336 }
337 }
338 public static function radiobutton( $name, $params = array('attrs' => '', 'value' => '', 'checked' => '') ) {
339 $params['type'] = 'radio';
340 $params['attrs'] = isset($params['attrs']) ? $params['attrs'] : '';
341 if (isset($params['checked']) && $params['checked']) {
342 $params['attrs'] .= ' checked';
343 }
344 self::input($name, $params);
345 }
346 public static function formStart( $name, $params = array('action' => '', 'method' => 'GET', 'attrs' => '', 'hideMethodInside' => false) ) {
347 $params['attrs'] = isset($params['attrs']) ? $params['attrs'] : '';
348 $params['action'] = isset($params['action']) ? $params['action'] : '';
349 $params['method'] = isset($params['method']) ? $params['method'] : 'GET';
350 echo '<form name="' . esc_attr($name) . '" action="' . esc_attr($params['action']) . '" method="' . esc_attr($params['method']) . '" ';
351 if (!empty($params['attrs'])) {
352 self::echoEscapedHtml($params['attrs']);
353 }
354 echo '>';
355
356 if (isset($params['hideMethodInside']) && $params['hideMethodInside']) {
357 self::hidden('method', array('value' => $params['method']));
358 }
359 }
360 public static function formEnd() {
361 echo '</form>';
362 }
363 public static function colorPicker( $name, $params = array('value' => '', 'label' => '') ) {
364 $value = isset($params['value']) ? $params['value'] : '';
365 $label = isset($params['label']) ? $params['label'] : '';
366 echo '<div class="wbw-color-picker">
367 <div class="wbw-color-wrapper">
368 <div class="wbw-color-preview"></div>
369 </div>
370 <input type="text" class="wbw-color-input" name="' . esc_attr($name) . '" value="' . esc_attr($value) . '"';
371 if (!empty($params['attrs'])) {
372 self::echoEscapedHtml($params['attrs']);
373 }
374 echo '>';
375 if (!empty($label)) {
376 echo '<label class="right-label">' . esc_html($label) . '</label>';
377 }
378 echo '</div>';
379 }
380 public static function slider( $name, $params = array('value' => '', 'label' => '') ) {
381
382 //https://github.com/IonDen/ion.rangeSlider?tab=readme-ov-file
383 $skin = empty($params['skin']) ? 'round' : $params['skin'];
384 echo '<div class="wbw-slider wbw-slider-' . esc_attr($skin) . '">' .
385 ' <input type="text" name="' . esc_attr($name) .
386 ( empty($params['class']) ? '' : '" class="' . esc_attr($params['class']) ) .
387 ( empty($params['id']) ? '' : '" id="' . esc_attr($params['id']) ) .
388 '" value="' . esc_attr(empty($params['value']) ? '' : $params['value']) .
389 '" data-hide-min-max="' . esc_attr(empty($params['hide-min-max']) ? '0' : $params['hide-min-max']) .
390 '" data-skin="' . esc_attr($skin) .
391 '" data-type="' . esc_attr(empty($params['type']) ? 'single' : $params['type']) .
392 '" data-step="' . esc_attr(empty($params['step']) ? '1' : $params['step']) .
393 '" data-min="' . esc_attr(empty($params['min']) ? '0' : $params['min']) .
394 '" data-max="' . esc_attr(empty($params['max']) ? '100' : $params['max']) .
395 '">' .
396 '</div>';
397 }
398 public static function nonceForAction( $action ) {
399 self::hidden('_wpnonce', array('value' => wp_create_nonce(strtolower($action))));
400 }
401 public static function selectIcon( $name, $params ) {
402 echo '<div class="button chooseLoaderIcon">' . esc_html__('Choose Icon', 'ai-copilot-content-generator') . '</div>';
403 }
404 public static function proOptionLink( $url = '', $label = '' ) {
405 echo '<a href="' . esc_url( empty($url) ? WaicUri::generatePluginLink() : $url ) . '" target="_blank" class="wbw-prolink">' . ( empty($label) ? esc_html__('PRO', 'ai-copilot-content-generator') : esc_html($label) ) . '</a>';
406 }
407 public static function selectFontList( $name, $params = array('attrs' => '', 'value' => '') ) {
408 $attrs = WaicUtils::getArrayValue($params, 'attrs');
409 $value = WaicUtils::getArrayValue($params, 'value');
410
411 echo '<select name="' . esc_attr($name) . '" ';
412 if (!empty($params['attrs'])) {
413 self::echoEscapedHtml($params['attrs']);
414 }
415 echo '><option value="">' . esc_html__('Default', 'ai-copilot-content-generator') . '</option>';
416
417 $standart = WaicDispatcher::applyFilters('getFontsList', array(), 'standart');
418 $fonts = array_merge($standart, WaicDispatcher::applyFilters('getFontsList', array(), ''));
419 natsort($fonts);
420
421 foreach ($fonts as $font) {
422 echo '<option value="' . esc_attr($font) . '" data-standart="' . ( in_array($font, $standart) ? 1 : 0 ) . '" ' . ( $font == $value ? ' selected="true"' : '' ) . '>' . esc_html($font) . '</option>';
423 }
424 echo '</select>';
425 }
426 public static function fontStyleBlock( $preBlock, $preName, $data ) {
427 $name = $preName . '_font';
428 $block = $preBlock . '[' . $name . ']';
429 self::selectbox($block, array(
430 'options' => self::getAllFontsList(),
431 'value' => WaicUtils::getArrayValue($data, $name),
432 'attrs' => 'class="wbw-small-field"'
433 ));
434 $name = $preName . '_style';
435 $block = $preBlock . '[' . $name . ']';
436 self::selectbox($block, array(
437 'options' => self::getFontStyles(),
438 'value' => WaicUtils::getArrayValue($data, $name),
439 'attrs' => 'class="wbw-field-mini"'
440 ));
441 $name = $preName . '_color';
442 $block = $preBlock . '[' . $name . ']';
443 self::colorpicker($block, array(
444 'value' => WaicUtils::getArrayValue($data, $name),
445 ));
446 $name = $preName . '_size';
447 $block = $preBlock . '[' . $name . ']';
448 self::number($block, array(
449 'value' => WaicUtils::getArrayValue($data, $name),
450 'attrs' => 'class="wbw-field-micro"'
451 ));
452 }
453 public static function sizeBlock( $preBlock, $preName, $data ) {
454 $name = $preName . '_width';
455 $block = $preBlock . '[' . $name . ']';
456 self::number($block, array(
457 'value' => WaicUtils::getArrayValue($data, $name),
458 'attrs' => 'class="wbw-field-micro"',
459 'min' => 0,
460 ));
461 $name = $preName . '_height';
462 $block = $preBlock . '[' . $name . ']';
463 self::number($block, array(
464 'value' => WaicUtils::getArrayValue($data, $name),
465 'attrs' => 'class="wbw-field-micro"',
466 'min' => 0,
467 ));
468 }
469 public static function colorSizeBlock( $preBlock, $preName, $data, $withFilter = false ) {
470 $name = $preName . '_color';
471 $block = $preBlock . '[' . $name . ']';
472 self::colorpicker($block, array(
473 'value' => WaicUtils::getArrayValue($data, $name),
474 ));
475 if ($withFilter) {
476 $name = $preName . '_color_filter';
477 $block = $preBlock . '[' . $name . ']';
478 self::hidden($block, array(
479 'value' => WaicUtils::getArrayValue($data, $name),
480 'attrs' => 'class="wbw-color-filter"'
481 ));
482 }
483 self::sizeBlock( $preBlock, $preName, $data );
484 }
485 public static function bgSizeBlock( $preBlock, $preName, $data ) {
486 $name = $preName . '_bg';
487 $block = $preBlock . '[' . $name . ']';
488 self::colorpicker($block, array(
489 'value' => WaicUtils::getArrayValue($data, $name),
490 ));
491 self::sizeBlock( $preBlock, $preName, $data );
492 }
493 public static function bgPaddingsBlock( $preBlock, $preName, $data ) {
494 $name = $preName . '_bg';
495 $block = $preBlock . '[' . $name . ']';
496 self::colorpicker($block, array(
497 'value' => WaicUtils::getArrayValue($data, $name),
498 ));
499 self::paddingsBlock( $preBlock, $preName, $data );
500 }
501 public static function bgHeightPadBlock( $preBlock, $preName, $data ) {
502 $name = $preName . '_bg';
503 $block = $preBlock . '[' . $name . ']';
504 self::colorpicker($block, array(
505 'value' => WaicUtils::getArrayValue($data, $name),
506 ));
507 $name = $preName . '_height';
508 $block = $preBlock . '[' . $name . ']';
509 self::number($block, array(
510 'value' => WaicUtils::getArrayValue($data, $name),
511 'attrs' => 'class="wbw-field-micro"'
512 ));
513 $name = $preName . '_left';
514 $block = $preBlock . '[' . $name . ']';
515 self::number($block, array(
516 'value' => WaicUtils::getArrayValue($data, $name),
517 'attrs' => 'class="wbw-field-micro"'
518 ));
519 $name = $preName . '_right';
520 $block = $preBlock . '[' . $name . ']';
521 self::number($block, array(
522 'value' => WaicUtils::getArrayValue($data, $name),
523 'attrs' => 'class="wbw-field-micro"'
524 ));
525 }
526 public static function bordersBlock( $preBlock, $preName, $data ) {
527 $name = $preName . '_border_color';
528 $block = $preBlock . '[' . $name . ']';
529 self::colorpicker($block, array(
530 'value' => WaicUtils::getArrayValue($data, $name),
531 ));
532 $name = $preName . '_border_style';
533 $block = $preBlock . '[' . $name . ']';
534 self::selectbox($block, array(
535 'options' => self::getBorderStyles(),
536 'value' => WaicUtils::getArrayValue($data, $name),
537 'attrs' => 'class="wbw-field-mini"'
538 ));
539 $name = $preName . '_border_size';
540 $block = $preBlock . '[' . $name . ']';
541 self::number($block, array(
542 'value' => WaicUtils::getArrayValue($data, $name),
543 'attrs' => 'class="wbw-field-micro"'
544 ));
545 }
546 public static function iconColorSizeBlock( $preBlock, $preName, $data, $icons, $check = false ) {
547 if ($check) {
548 $name = 'e_' . $preName;
549 $block = $preBlock . '[' . $name . ']';
550 self::checkbox($block, array(
551 'checked' => WaicUtils::getArrayValue($data, $name, 0),
552 ));
553 }
554 $name = $preName . '_icon';
555 $block = $preBlock . '[' . $name . ']';
556 self::selectbox($block, array(
557 'options' => $icons,
558 'value' => WaicUtils::getArrayValue($data, $name),
559 'attrs' => 'class="wbw-small-field"'
560 ));
561 $name = $preName . '_color';
562 $block = $preBlock . '[' . $name . ']';
563 self::colorpicker($block, array(
564 'value' => WaicUtils::getArrayValue($data, $name),
565 ));
566 $name = $preName . '_size';
567 $block = $preBlock . '[' . $name . ']';
568 self::number($block, array(
569 'value' => WaicUtils::getArrayValue($data, $name),
570 'attrs' => 'class="wbw-field-micro"'
571 ));
572 }
573 public static function shadowBlock( $preBlock, $preName, $data ) {
574 $name = $preName . '_shadow_color';
575 $block = $preBlock . '[' . $name . ']';
576 self::colorpicker($block, array(
577 'value' => WaicUtils::getArrayValue($data, $name),
578 ));
579 $name = $preName . '_shadow_alpha';
580 $block = $preBlock . '[' . $name . ']';
581 self::number($block, array(
582 'value' => WaicUtils::getArrayValue($data, $name),
583 'attrs' => 'class="wbw-field-micro"',
584 'min' => 0,
585 ));
586 $name = $preName . '_shadow_x';
587 $block = $preBlock . '[' . $name . ']';
588 self::number($block, array(
589 'value' => WaicUtils::getArrayValue($data, $name),
590 'attrs' => 'class="wbw-field-micro"',
591 'min' => 0,
592 ));
593 $name = $preName . '_shadow_y';
594 $block = $preBlock . '[' . $name . ']';
595 self::number($block, array(
596 'value' => WaicUtils::getArrayValue($data, $name),
597 'attrs' => 'class="wbw-field-micro"',
598 'min' => 0,
599 ));
600 $name = $preName . '_shadow_blur';
601 $block = $preBlock . '[' . $name . ']';
602 self::number($block, array(
603 'value' => WaicUtils::getArrayValue($data, $name),
604 'attrs' => 'class="wbw-field-micro"',
605 'min' => 0,
606 ));
607 $name = $preName . '_shadow_spread';
608 $block = $preBlock . '[' . $name . ']';
609 self::number($block, array(
610 'value' => WaicUtils::getArrayValue($data, $name),
611 'attrs' => 'class="wbw-field-micro"',
612 'min' => 0,
613 ));
614 }
615 public static function cornerRadiusBlock( $preBlock, $preName, $data ) {
616 $sides = array('t', 'r', 'b', 'l');
617 foreach ($sides as $s) {
618 $name = $preName . '_corner_' . $s;
619 $block = $preBlock . '[' . $name . ']';
620 self::number($block, array(
621 'value' => WaicUtils::getArrayValue($data, $name),
622 'attrs' => 'class="wbw-field-micro"',
623 'min' => 0,
624 ));
625 }
626 }
627
628 public static function paddingsBlock( $preBlock, $preName, $data, $typ = 'padding' ) {
629 $sides = array('t', 'r', 'b', 'l');
630 foreach ($sides as $s) {
631 $name = $preName . '_' . $typ . '_' . $s;
632 $block = $preBlock . '[' . $name . ']';
633 self::number($block, array(
634 'value' => WaicUtils::getArrayValue($data, $name),
635 'attrs' => 'class="wbw-field-micro"',
636 'min' => 0,
637 ));
638 }
639 }
640 public static function getFontsList() {
641 return array(
642 'ABeeZee',
643 'Abel',
644 'Abril Fatface',
645 'Aclonica',
646 'Acme',
647 'Actor',
648 'Adamina',
649 'Advent Pro',
650 'Aguafina Script',
651 'Akronim',
652 'Aladin',
653 'Aldrich',
654 'Alef',
655 'Alegreya',
656 'Alegreya SC',
657 'Alegreya Sans',
658 'Alegreya Sans SC',
659 'Alex Brush',
660 'Alfa Slab One',
661 'Alice',
662 'Alike',
663 'Alike Angular',
664 'Allan',
665 'Allerta',
666 'Allerta Stencil',
667 'Allura',
668 'Almendra',
669 'Almendra Display',
670 'Almendra SC',
671 'Amarante',
672 'Amaranth',
673 'Amatic SC',
674 'Amethysta',
675 'Amiri',
676 'Anaheim',
677 'Andada',
678 'Andika',
679 'Angkor',
680 'Annie Use Your Telescope',
681 'Anonymous Pro',
682 'Antic',
683 'Antic Didone',
684 'Antic Slab',
685 'Anton',
686 'Arapey',
687 'Arbutus',
688 'Arbutus Slab',
689 'Architects Daughter',
690 'Archivo Black',
691 'Archivo Narrow',
692 'Arimo',
693 'Arizonia',
694 'Armata',
695 'Artifika',
696 'Arvo',
697 'Asap',
698 'Asset',
699 'Astloch',
700 'Asul',
701 'Atomic Age',
702 'Aubrey',
703 'Audiowide',
704 'Autour One',
705 'Average',
706 'Average Sans',
707 'Averia Gruesa Libre',
708 'Averia Libre',
709 'Averia Sans Libre',
710 'Averia Serif Libre',
711 'Bad Script',
712 'Balthazar',
713 'Bangers',
714 'Basic',
715 'Battambang',
716 'Baumans',
717 'Bayon',
718 'Belgrano',
719 'Belleza',
720 'BenchNine',
721 'Bentham',
722 'Berkshire Swash',
723 'Bevan',
724 'Bigelow Rules',
725 'Bigshot One',
726 'Bilbo',
727 'Bilbo Swash Caps',
728 'Biryani',
729 'Bitter',
730 'Black Ops One',
731 'Bokor',
732 'Bonbon',
733 'Boogaloo',
734 'Bowlby One',
735 'Bowlby One SC',
736 'Brawler',
737 'Bree Serif',
738 'Bubblegum Sans',
739 'Bubbler One',
740 'Buenard',
741 'Butcherman',
742 'Butterfly Kids',
743 'Cabin',
744 'Cabin Condensed',
745 'Cabin Sketch',
746 'Caesar Dressing',
747 'Cagliostro',
748 'Calligraffitti',
749 'Cambay',
750 'Cambo',
751 'Candal',
752 'Cantarell',
753 'Cantata One',
754 'Cantora One',
755 'Capriola',
756 'Cardo',
757 'Carme',
758 'Carrois Gothic',
759 'Carrois Gothic SC',
760 'Carter One',
761 'Caudex',
762 'Cedarville Cursive',
763 'Ceviche One',
764 'Changa One',
765 'Chango',
766 'Chau Philomene One',
767 'Chela One',
768 'Chelsea Market',
769 'Chenla',
770 'Cherry Cream Soda',
771 'Cherry Swash',
772 'Chewy',
773 'Chicle',
774 'Chivo',
775 'Cinzel',
776 'Cinzel Decorative',
777 'Clicker Script',
778 'Coda',
779 'Codystar',
780 'Combo',
781 'Comfortaa',
782 'Coming Soon',
783 'Concert One',
784 'Condiment',
785 'Content',
786 'Contrail One',
787 'Convergence',
788 'Cookie',
789 'Copse',
790 'Corben',
791 'Courgette',
792 'Cousine',
793 'Coustard',
794 'Covered By Your Grace',
795 'Crafty Girls',
796 'Creepster',
797 'Crete Round',
798 'Crimson Text',
799 'Croissant One',
800 'Crushed',
801 'Cuprum',
802 'Cutive',
803 'Cutive Mono',
804 'Damion',
805 'Dancing Script',
806 'Dangrek',
807 'Dawning of a New Day',
808 'Days One',
809 'Dekko',
810 'Delius',
811 'Delius Swash Caps',
812 'Delius Unicase',
813 'Della Respira',
814 'Denk One',
815 'Devonshire',
816 'Dhurjati',
817 'Didact Gothic',
818 'Diplomata',
819 'Diplomata SC',
820 'Domine',
821 'Donegal One',
822 'Doppio One',
823 'Dorsa',
824 'Dosis',
825 'Dr Sugiyama',
826 'Droid Sans',
827 'Droid Sans Mono',
828 'Droid Serif',
829 'Duru Sans',
830 'Dynalight',
831 'EB Garamond',
832 'Eagle Lake',
833 'Eater',
834 'Economica',
835 'Ek Mukta',
836 'Electrolize',
837 'Elsie',
838 'Elsie Swash Caps',
839 'Emblema One',
840 'Emilys Candy',
841 'Engagement',
842 'Englebert',
843 'Enriqueta',
844 'Erica One',
845 'Esteban',
846 'Euphoria Script',
847 'Ewert',
848 'Exo',
849 'Exo 2',
850 'Expletus Sans',
851 'Fanwood Text',
852 'Fascinate',
853 'Fascinate Inline',
854 'Faster One',
855 'Fasthand',
856 'Fauna One',
857 'Federant',
858 'Federo',
859 'Felipa',
860 'Fenix',
861 'Finger Paint',
862 'Fira Mono',
863 'Fira Sans',
864 'Fjalla One',
865 'Fjord One',
866 'Flamenco',
867 'Flavors',
868 'Fondamento',
869 'Fontdiner Swanky',
870 'Forum',
871 'Francois One',
872 'Freckle Face',
873 'Fredericka the Great',
874 'Fredoka One',
875 'Freehand',
876 'Fresca',
877 'Frijole',
878 'Fruktur',
879 'Fugaz One',
880 'GFS Didot',
881 'GFS Neohellenic',
882 'Gabriela',
883 'Gafata',
884 'Galdeano',
885 'Galindo',
886 'Gentium Basic',
887 'Gentium Book Basic',
888 'Geo',
889 'Geostar',
890 'Geostar Fill',
891 'Germania One',
892 'Gidugu',
893 'Gilda Display',
894 'Give You Glory',
895 'Glass Antiqua',
896 'Glegoo',
897 'Gloria Hallelujah',
898 'Goblin One',
899 'Gochi Hand',
900 'Gorditas',
901 'Goudy Bookletter 1911',
902 'Graduate',
903 'Grand Hotel',
904 'Gravitas One',
905 'Great Vibes',
906 'Griffy',
907 'Gruppo',
908 'Gudea',
909 'Gurajada',
910 'Habibi',
911 'Halant',
912 'Hammersmith One',
913 'Hanalei',
914 'Hanalei Fill',
915 'Handlee',
916 'Hanuman',
917 'Happy Monkey',
918 'Headland One',
919 'Henny Penny',
920 'Herr Von Muellerhoff',
921 'Hind',
922 'Holtwood One SC',
923 'Homemade Apple',
924 'Homenaje',
925 'IM Fell DW Pica',
926 'IM Fell DW Pica SC',
927 'IM Fell Double Pica',
928 'IM Fell Double Pica SC',
929 'IM Fell English',
930 'IM Fell English SC',
931 'IM Fell French Canon',
932 'IM Fell French Canon SC',
933 'IM Fell Great Primer',
934 'IM Fell Great Primer SC',
935 'Iceberg',
936 'Iceland',
937 'Imprima',
938 'Inconsolata',
939 'Inder',
940 'Indie Flower',
941 'Inika',
942 'Irish Grover',
943 'Istok Web',
944 'Italiana',
945 'Italianno',
946 'Jacques Francois',
947 'Jacques Francois Shadow',
948 'Jaldi',
949 'Jim Nightshade',
950 'Jockey One',
951 'Jolly Lodger',
952 'Josefin Sans',
953 'Josefin Slab',
954 'Joti One',
955 'Judson',
956 'Julee',
957 'Julius Sans One',
958 'Junge',
959 'Jura',
960 'Just Another Hand',
961 'Just Me Again Down Here',
962 'Kalam',
963 'Kameron',
964 'Kantumruy',
965 'Karla',
966 'Karma',
967 'Kaushan Script',
968 'Kavoon',
969 'Kdam Thmor',
970 'Keania One',
971 'Kelly Slab',
972 'Kenia',
973 'Khand',
974 'Khmer',
975 'Khula',
976 'Kite One',
977 'Knewave',
978 'Kotta One',
979 'Koulen',
980 'Kranky',
981 'Kreon',
982 'Kristi',
983 'Krona One',
984 'Kurale',
985 'La Belle Aurore',
986 'Laila',
987 'Lakki Reddy',
988 'Lancelot',
989 'Lateef',
990 'Lato',
991 'League Script',
992 'Leckerli One',
993 'Ledger',
994 'Lekton',
995 'Lemon',
996 'Libre Baskerville',
997 'Life Savers',
998 'Lilita One',
999 'Lily Script One',
1000 'Limelight',
1001 'Linden Hill',
1002 'Lobster',
1003 'Lobster Two',
1004 'Londrina Outline',
1005 'Londrina Shadow',
1006 'Londrina Sketch',
1007 'Londrina Solid',
1008 'Lora',
1009 'Love Ya Like A Sister',
1010 'Loved by the King',
1011 'Lovers Quarrel',
1012 'Luckiest Guy',
1013 'Lusitana',
1014 'Lustria',
1015 'Macondo',
1016 'Macondo Swash Caps',
1017 'Magra',
1018 'Maiden Orange',
1019 'Mako',
1020 'Mallanna',
1021 'Mandali',
1022 'Marcellus',
1023 'Marcellus SC',
1024 'Marck Script',
1025 'Margarine',
1026 'Marko One',
1027 'Marmelad',
1028 'Martel',
1029 'Martel Sans',
1030 'Marvel',
1031 'Mate',
1032 'Mate SC',
1033 'Maven Pro',
1034 'McLaren',
1035 'Meddon',
1036 'MedievalSharp',
1037 'Medula One',
1038 'Megrim',
1039 'Meie Script',
1040 'Merienda',
1041 'Merienda One',
1042 'Merriweather',
1043 'Merriweather Sans',
1044 'Metal',
1045 'Metal Mania',
1046 'Metamorphous',
1047 'Metrophobic',
1048 'Michroma',
1049 'Milonga',
1050 'Miltonian',
1051 'Miltonian Tattoo',
1052 'Miniver',
1053 'Miss Fajardose',
1054 'Modak',
1055 'Modern Antiqua',
1056 'Molengo',
1057 'Monda',
1058 'Monofett',
1059 'Monoton',
1060 'Monsieur La Doulaise',
1061 'Montaga',
1062 'Montez',
1063 'Montserrat',
1064 'Montserrat Alternates',
1065 'Montserrat Subrayada',
1066 'Moul',
1067 'Moulpali',
1068 'Mountains of Christmas',
1069 'Mouse Memoirs',
1070 'Mr Bedfort',
1071 'Mr Dafoe',
1072 'Mr De Haviland',
1073 'Mrs Saint Delafield',
1074 'Mrs Sheppards',
1075 'Muli',
1076 'Mystery Quest',
1077 'NTR',
1078 'Neucha',
1079 'Neuton',
1080 'New Rocker',
1081 'News Cycle',
1082 'Niconne',
1083 'Nixie One',
1084 'Nobile',
1085 'Nokora',
1086 'Norican',
1087 'Nosifer',
1088 'Nothing You Could Do',
1089 'Noticia Text',
1090 'Noto Sans',
1091 'Noto Serif',
1092 'Nova Cut',
1093 'Nova Flat',
1094 'Nova Mono',
1095 'Nova Oval',
1096 'Nova Round',
1097 'Nova Script',
1098 'Nova Slim',
1099 'Nova Square',
1100 'Numans',
1101 'Nunito',
1102 'Odor Mean Chey',
1103 'Offside',
1104 'Old Standard TT',
1105 'Oldenburg',
1106 'Oleo Script',
1107 'Oleo Script Swash Caps',
1108 'Open Sans',
1109 'Oranienbaum',
1110 'Orbitron',
1111 'Oregano',
1112 'Orienta',
1113 'Original Surfer',
1114 'Oswald',
1115 'Over the Rainbow',
1116 'Overlock',
1117 'Overlock SC',
1118 'Ovo',
1119 'Oxygen',
1120 'Oxygen Mono',
1121 'PT Mono',
1122 'PT Sans',
1123 'PT Sans Caption',
1124 'PT Sans Narrow',
1125 'PT Serif',
1126 'PT Serif Caption',
1127 'Pacifico',
1128 'Palanquin',
1129 'Palanquin Dark',
1130 'Paprika',
1131 'Parisienne',
1132 'Passero One',
1133 'Passion One',
1134 'Pathway Gothic One',
1135 'Patrick Hand',
1136 'Patrick Hand SC',
1137 'Patua One',
1138 'Paytone One',
1139 'Peddana',
1140 'Peralta',
1141 'Permanent Marker',
1142 'Petit Formal Script',
1143 'Petrona',
1144 'Philosopher',
1145 'Piedra',
1146 'Pinyon Script',
1147 'Pirata One',
1148 'Plaster',
1149 'Play',
1150 'Playball',
1151 'Playfair Display',
1152 'Playfair Display SC',
1153 'Podkova',
1154 'Poiret One',
1155 'Poller One',
1156 'Poly',
1157 'Pompiere',
1158 'Pontano Sans',
1159 'Port Lligat Sans',
1160 'Port Lligat Slab',
1161 'Pragati Narrow',
1162 'Prata',
1163 'Preahvihear',
1164 'Press Start 2P',
1165 'Princess Sofia',
1166 'Prociono',
1167 'Prosto One',
1168 'Puritan',
1169 'Purple Purse',
1170 'Quando',
1171 'Quantico',
1172 'Quattrocento',
1173 'Quattrocento Sans',
1174 'Questrial',
1175 'Quicksand',
1176 'Quintessential',
1177 'Qwigley',
1178 'Racing Sans One',
1179 'Radley',
1180 'Rajdhani',
1181 'Raleway',
1182 'Raleway Dots',
1183 'Ramabhadra',
1184 'Ramaraja',
1185 'Rambla',
1186 'Rammetto One',
1187 'Ranchers',
1188 'Rancho',
1189 'Ranga',
1190 'Rationale',
1191 'Ravi Prakash',
1192 'Redressed',
1193 'Reenie Beanie',
1194 'Revalia',
1195 'Ribeye',
1196 'Ribeye Marrow',
1197 'Righteous',
1198 'Risque',
1199 'Roboto',
1200 'Roboto Condensed',
1201 'Roboto Slab',
1202 'Rochester',
1203 'Rock Salt',
1204 'Rokkitt',
1205 'Romanesco',
1206 'Ropa Sans',
1207 'Rosario',
1208 'Rosarivo',
1209 'Rouge Script',
1210 'Rozha One',
1211 'Rubik Mono One',
1212 'Rubik One',
1213 'Ruda',
1214 'Rufina',
1215 'Ruge Boogie',
1216 'Ruluko',
1217 'Rum Raisin',
1218 'Ruslan Display',
1219 'Russo One',
1220 'Ruthie',
1221 'Rye',
1222 'Sacramento',
1223 'Sail',
1224 'Salsa',
1225 'Sanchez',
1226 'Sancreek',
1227 'Sansita One',
1228 'Sarina',
1229 'Sarpanch',
1230 'Satisfy',
1231 'Scada',
1232 'Scheherazade',
1233 'Schoolbell',
1234 'Seaweed Script',
1235 'Sevillana',
1236 'Seymour One',
1237 'Shadows Into Light',
1238 'Shadows Into Light Two',
1239 'Shanti',
1240 'Share',
1241 'Share Tech',
1242 'Share Tech Mono',
1243 'Shojumaru',
1244 'Short Stack',
1245 'Siemreap',
1246 'Sigmar One',
1247 'Signika',
1248 'Signika Negative',
1249 'Simonetta',
1250 'Sintony',
1251 'Sirin Stencil',
1252 'Six Caps',
1253 'Skranji',
1254 'Slabo 13px',
1255 'Slabo 27px',
1256 'Slackey',
1257 'Smokum',
1258 'Smythe',
1259 'Sniglet',
1260 'Snippet',
1261 'Snowburst One',
1262 'Sofadi One',
1263 'Sofia',
1264 'Sonsie One',
1265 'Sorts Mill Goudy',
1266 'Source Code Pro',
1267 'Source Sans Pro',
1268 'Source Serif Pro',
1269 'Special Elite',
1270 'Spicy Rice',
1271 'Spinnaker',
1272 'Spirax',
1273 'Squada One',
1274 'Sree Krushnadevaraya',
1275 'Stalemate',
1276 'Stalinist One',
1277 'Stardos Stencil',
1278 'Stint Ultra Condensed',
1279 'Stint Ultra Expanded',
1280 'Stoke',
1281 'Strait',
1282 'Sue Ellen Francisco',
1283 'Sumana',
1284 'Sunshiney',
1285 'Supermercado One',
1286 'Suranna',
1287 'Suravaram',
1288 'Suwannaphum',
1289 'Swanky and Moo Moo',
1290 'Syncopate',
1291 'Tangerine',
1292 'Taprom',
1293 'Tauri',
1294 'Teko',
1295 'Telex',
1296 'Tenali Ramakrishna',
1297 'Tenor Sans',
1298 'Text Me One',
1299 'The Girl Next Door',
1300 'Tienne',
1301 'Timmana',
1302 'Tinos',
1303 'Titan One',
1304 'Titillium Web',
1305 'Trade Winds',
1306 'Trocchi',
1307 'Trochut',
1308 'Trykker',
1309 'Tulpen One',
1310 'Ubuntu',
1311 'Ubuntu Condensed',
1312 'Ubuntu Mono',
1313 'Ultra',
1314 'Uncial Antiqua',
1315 'Underdog',
1316 'Unica One',
1317 'UnifrakturMaguntia',
1318 'Unkempt',
1319 'Unlock',
1320 'Unna',
1321 'VT323',
1322 'Vampiro One',
1323 'Varela',
1324 'Varela Round',
1325 'Vast Shadow',
1326 'Vesper Libre',
1327 'Vibur',
1328 'Vidaloka',
1329 'Viga',
1330 'Voces',
1331 'Volkhov',
1332 'Vollkorn',
1333 'Voltaire',
1334 'Waiting for the Sunrise',
1335 'Wallpoet',
1336 'Walter Turncoat',
1337 'Warnes',
1338 'Wellfleet',
1339 'Wendy One',
1340 'Wire One',
1341 'Yanone Kaffeesatz',
1342 'Yellowtail',
1343 'Yeseva One',
1344 'Yesteryear',
1345 'Zeyada'
1346 );
1347 }
1348
1349 public static function getStandardFontsList() {
1350 return array(
1351 'Georgia',
1352 'Palatino Linotype',
1353 'Times New Roman',
1354 'Arial',
1355 'Helvetica',
1356 'Arial Black',
1357 'Gadget',
1358 'Comic Sans MS',
1359 'Impact',
1360 'Charcoal',
1361 'Lucida Sans Unicode',
1362 'Lucida Grande',
1363 'Tahoma',
1364 'Geneva',
1365 'Trebuchet MS',
1366 'Verdana',
1367 'Geneva',
1368 'Courier New',
1369 'Courier',
1370 'Lucida Console',
1371 'Monaco'
1372 );
1373 }
1374
1375 public static function getAllFontsList() {
1376 if (empty(self::$fontsList)) {
1377 $fontsList = array_merge(self::getFontsList(), self::getStandardFontsList());
1378 natsort( $fontsList );
1379 array_unshift( $fontsList, '');
1380 $options = array();
1381 foreach ( $fontsList as $font ) {
1382 $options[ $font ] = $font;
1383 }
1384 self::$fontsList = $options;
1385 }
1386 return self::$fontsList;
1387 }
1388 public static function getFontStyles() {
1389 return array( '' => '', 'n' => 'normal', 'b' => 'bold', 'i' => 'italic', 'bi' => 'bold + italic' );
1390 }
1391 public static function getBorderStyles() {
1392 return array( '' => '', 'solid' => 'solid', 'dashed' => 'dashed', 'dotted' => 'dotted', 'double' => 'double' );
1393 }
1394 }
1395