PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.0.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.0.0
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Render/Sidebar.php +48 -128 3.1.03.0.0 View file →
@@ -83,24 +83,8 @@
83 83 */
84 84 protected $_alignments;
85 85
86 86 /**
87 - * Whether this chart supports animation or not.
88 - *
89 - * @access protected
90 - * @var bool
91 - */
92 - protected $_supportsAnimation = true;
93 -
94 - /**
95 - * Which library does this this chart implement?
96 - *
97 - * @access protected
98 - * @var string
99 - */
100 - protected $_library = null;
101 -
102 - /**
103 87 * Constructor.
104 88 *
105 89 * @since 1.0.0
106 90 *
@@ -131,10 +115,8 @@
131 115 '' => '',
132 116 '1' => esc_html__( 'Yes', 'visualizer' ),
133 117 '0' => esc_html__( 'No', 'visualizer' ),
134 118 );
135 -
136 - $this->hooks();
137 119 }
138 120
139 121 /**
140 122 * Renders chart title settings.
@@ -174,9 +156,9 @@
174 156 self::_renderGroupEnd();
175 157
176 158 self::_renderGroupStart( esc_html__( 'Manual Configuration', 'visualizer' ) );
177 159 self::_renderSectionStart();
178 - self::_renderSectionDescription( '<span class="viz-gvlink">' . sprintf( __( 'Configure the graph by providing configuration variables right from the %1$sGoogle Visualization API%2$s', 'visualizer' ), '<a href="https://developers.google.com/chart/interactive/docs/gallery/?#configuration-options" target="_blank">', '</a>' ) . '</span>' );
160 + self::_renderSectionDescription( __( 'Configure the graph by providing configuration variables right from the','visualizer' ) . ' <a href="https://developers.google.com/chart/interactive/docs/reference" target="_blank">Google Visualization</a> API.' );
179 161
180 162 $example = '
181 163 {
182 164 "vAxis": {
@@ -192,10 +174,9 @@
192 174 esc_html__( 'Configuration', 'visualizer' ),
193 175 'manual',
194 176 $this->manual,
195 177 sprintf(
196 - esc_html__( 'One per line in valid JSON (key:value) format e.g. %s', 'visualizer' ),
197 - '<br><code>' . $example . '</code>'
178 + esc_html__( 'One per line in valid JSON (key:value) format e.g. %s', 'visualizer' ), '<br><code>' . $example . '</code>'
198 179 ),
199 180 '',
200 181 array( 'rows' => 5 )
201 182 );
@@ -210,10 +191,8 @@
210 191 *
211 192 * @access protected
212 193 */
213 194 protected function _renderActionSettings() {
214 - global $wp_version;
215 - $disable_actions = version_compare( $wp_version, '4.7.0', '<' );
216 195 self::_renderSectionStart( esc_html__( 'Actions', 'visualizer' ), false );
217 196 self::_renderCheckboxItem(
218 197 esc_html__( 'Print', 'visualizer' ),
219 198 'actions[]',
@@ -218,10 +197,9 @@
218 197 esc_html__( 'Print', 'visualizer' ),
219 198 'actions[]',
220 199 isset( $this->actions ) && in_array( 'print', $this->actions ) ? true : false,
221 200 'print',
222 - $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : esc_html__( 'To enable printing the data.', 'visualizer' ),
223 - $disable_actions
201 + esc_html__( 'To enable printing the data.', 'visualizer' )
224 202 );
225 203 self::_renderCheckboxItem(
226 204 esc_html__( 'CSV', 'visualizer' ),
227 205 'actions[]',
@@ -226,20 +204,19 @@
226 204 esc_html__( 'CSV', 'visualizer' ),
227 205 'actions[]',
228 206 isset( $this->actions ) && in_array( 'csv;application/csv', $this->actions ) ? true : false,
229 207 'csv;application/csv',
230 - $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : esc_html__( 'To enable downloading the data as a CSV.', 'visualizer' ),
231 - $disable_actions
208 + esc_html__( 'To enable downloading the data as a CSV.', 'visualizer' )
232 209 );
233 210
234 - $disabled = ! ( class_exists( 'PHPExcel' ) && extension_loaded( 'zip' ) && extension_loaded( 'xml' ) && version_compare( PHP_VERSION, '5.2.0', '>' ) );
211 + $disabled = ! ( extension_loaded( 'zip' ) && extension_loaded( 'xml' ) && version_compare( PHP_VERSION, '5.2.0', '>' ) );
235 212 self::_renderCheckboxItem(
236 213 esc_html__( 'Excel', 'visualizer' ),
237 214 'actions[]',
238 215 isset( $this->actions ) && in_array( 'xls;application/vnd.ms-excel', $this->actions ) ? true : false,
239 216 'xls;application/vnd.ms-excel',
240 - $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : ( $disabled ? '<span class="viz-section-error">' . esc_html__( 'Enable the ZIP and XML extensions to use this setting.', 'visualizer' ) . '</span>' : esc_html__( 'To enable downloading the data as an Excel spreadsheet.', 'visualizer' ) ),
241 - $disable_actions || $disabled
217 + $disabled ? '<span class="section-error">' . esc_html__( 'Enable the ZIP and XML extensions to use this setting.', 'visualizer' ) . '</span>' : esc_html__( 'To enable downloading the data as an Excel spreadsheet.', 'visualizer' ),
218 + $disabled
242 219 );
243 220 self::_renderCheckboxItem(
244 221 esc_html__( 'Copy', 'visualizer' ),
245 222 'actions[]',
@@ -244,10 +221,9 @@
244 221 esc_html__( 'Copy', 'visualizer' ),
245 222 'actions[]',
246 223 isset( $this->actions ) && in_array( 'copy', $this->actions ) ? true : false,
247 224 'copy',
248 - $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : esc_html__( 'To enable copying the data to the clipboard.', 'visualizer' ),
249 - $disable_actions
225 + esc_html__( 'To enable copying the data to the clipboard.', 'visualizer' )
250 226 );
251 227 self::_renderSectionEnd();
252 228 }
253 229
@@ -268,15 +244,15 @@
268 244 $this->_renderChartTitleSettings();
269 245 self::_renderSectionEnd();
270 246
271 247 self::_renderSectionStart( esc_html__( 'Font Styles', 'visualizer' ), false );
272 - echo '<div class="viz-section-item">';
248 + echo '<div class="section-item">';
273 249 echo '<a class="more-info" href="javascript:;">[?]</a>';
274 250 echo '<b>', esc_html__( 'Family And Size', 'visualizer' ), '</b>';
275 251
276 - echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
252 + echo '<table class="section-table" cellspacing="0" cellpadding="0" border="0">';
277 253 echo '<tr>';
278 - echo '<td class="viz-section-table-column">';
254 + echo '<td class="section-table-column">';
279 255 echo '<select name="fontName" class="control-select">';
280 256 echo '<option></option>';
281 257 foreach ( self::$_fontFamilies as $font => $label ) {
282 258 echo '<option value="', $font, '"', selected( $font, $this->fontName, false ), '>';
@@ -284,9 +260,9 @@
284 260 echo '</option>';
285 261 }
286 262 echo '</select>';
287 263 echo '</td>';
288 - echo '<td class="viz-section-table-column">';
264 + echo '<td class="section-table-column">';
289 265 echo '<select name="fontSize" class="control-select">';
290 266 echo '<option></option>';
291 267 for ( $i = 7; $i <= 20; $i++ ) {
292 268 echo '<option value="', $i, '"', selected( $i, $this->fontSize, false ), '>', $i, '</option>';
@@ -295,9 +271,9 @@
295 271 echo '</td>';
296 272 echo '</tr>';
297 273 echo '</table>';
298 274
299 - echo '<p class="viz-section-description">';
275 + echo '<p class="section-description">';
300 276 esc_html_e( 'The default font family and size for all text in the chart.', 'visualizer' );
301 277 echo '</p>';
302 278 echo '</div>';
303 279 self::_renderSectionEnd();
@@ -329,61 +305,12 @@
329 305
330 306 self::_renderSectionStart( esc_html__( 'Tooltip', 'visualizer' ), false );
331 307 $this->_renderTooltipSettigns();
332 308 self::_renderSectionEnd();
333 -
334 - $this->_renderAnimationSettings();
335 -
336 309 self::_renderGroupEnd();
337 310 }
338 311
339 312 /**
340 - * Renders animation settings section.
341 - *
342 - * @access protected
343 - */
344 - protected function _renderAnimationSettings() {
345 - if ( ! $this->_supportsAnimation ) {
346 - return;
347 - }
348 -
349 - self::_renderSectionStart( esc_html__( 'Animation', 'visualizer' ), false );
350 -
351 - self::_renderCheckboxItem(
352 - esc_html__( 'Animate on startup', 'visualizer' ),
353 - 'animation[startup]',
354 - $this->animation['startup'],
355 - true,
356 - esc_html__( 'Determines if the chart will animate on the initial draw.', 'visualizer' )
357 - );
358 -
359 - self::_renderTextItem(
360 - esc_html__( 'Duration', 'visualizer' ),
361 - 'animation[duration]',
362 - isset( $this->animation['duration'] ) ? $this->animation['duration'] : 0,
363 - esc_html__( 'The duration of the animation, in milliseconds', 'visualizer' ),
364 - 0,
365 - 'number'
366 - );
367 -
368 - self::_renderSelectItem(
369 - esc_html__( 'Easing', 'visualizer' ),
370 - 'animation[easing]',
371 - isset( $this->animation['easing'] ) ? $this->animation['easing'] : null,
372 - array(
373 - 'linear' => esc_html__( 'Constant speed', 'visualizer' ),
374 - 'in' => esc_html__( 'Start slow and speed up', 'visualizer' ),
375 - 'out' => esc_html__( 'Start fast and slow down', 'visualizer' ),
376 - 'inAndOut' => esc_html__( 'Start slow, speed up, then slow down', 'visualizer' ),
377 - ),
378 - esc_html__( 'The easing function applied to the animation.', 'visualizer' )
379 - );
380 -
381 - self::_renderSectionEnd();
382 -
383 - }
384 -
385 - /**
386 313 * Renders tooltip settings section.
387 314 *
388 315 * @since 1.4.0
389 316 *
@@ -423,29 +350,29 @@
423 350 self::_renderGroupStart( esc_html__( 'Layout & Chart Area', 'visualizer' ) );
424 351 self::_renderSectionStart( esc_html__( 'Layout', 'visualizer' ), false );
425 352 self::_renderSectionDescription( esc_html__( 'Configure the total size of the chart. Two formats are supported: a number, or a number followed by %. A simple number is a value in pixels; a number followed by % is a percentage.', 'visualizer' ) );
426 353
427 - echo '<div class="viz-section-item">';
354 + echo '<div class="section-item">';
428 355 echo '<a class="more-info" href="javascript:;">[?]</a>';
429 356 echo '<b>', esc_html__( 'Width And Height Of Chart', 'visualizer' ), '</b>';
430 357
431 - echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
358 + echo '<table class="section-table" cellspacing="0" cellpadding="0" border="0">';
432 359 echo '<tr>';
433 - echo '<td class="viz-section-table-column">';
360 + echo '<td class="section-table-column">';
434 361 echo '<input type="text" name="width" class="control-text" value="', esc_attr( $this->width ), '" placeholder="100%">';
435 362 echo '</td>';
436 - echo '<td class="viz-section-table-column">';
363 + echo '<td class="section-table-column">';
437 364 echo '<input type="text" name="height" class="control-text" value="', esc_attr( $this->height ), '" placeholder="400">';
438 365 echo '</td>';
439 366 echo '</tr>';
440 367 echo '</table>';
441 368
442 - echo '<p class="viz-section-description">';
369 + echo '<p class="section-description">';
443 370 esc_html_e( 'Determines the total width and height of the chart.', 'visualizer' );
444 371 echo '</p>';
445 372 echo '</div>';
446 373
447 - echo '<div class="viz-section-delimiter"></div>';
374 + echo '<div class="section-delimiter"></div>';
448 375
449 376 self::_renderSectionDescription( esc_html__( 'Configure the background color for the main area of the chart and the chart border width and color.', 'visualizer' ) );
450 377
451 378 self::_renderTextItem(
@@ -470,9 +397,9 @@
470 397 $background_color,
471 398 '#fff'
472 399 );
473 400
474 - echo '<div class="viz-section-item">';
401 + echo '<div class="section-item">';
475 402 echo '<label>';
476 403 echo '<input type="checkbox" class="control-checkbox" name="backgroundColor[fill]" value="transparent"', checked( $background_color, 'transparent', false ), '> ';
477 404 esc_html_e( 'Transparent background', 'visualizer' );
478 405 echo '</label>';
@@ -481,44 +408,44 @@
481 408
482 409 self::_renderSectionStart( esc_html__( 'Chart Area', 'visualizer' ), false );
483 410 self::_renderSectionDescription( esc_html__( 'Configure the placement and size of the chart area (where the chart itself is drawn, excluding axis and legends). Two formats are supported: a number, or a number followed by %. A simple number is a value in pixels; a number followed by % is a percentage.', 'visualizer' ) );
484 411
485 - echo '<div class="viz-section-item">';
412 + echo '<div class="section-item">';
486 413 echo '<a class="more-info" href="javascript:;">[?]</a>';
487 414 echo '<b>', esc_html__( 'Left And Top Margins', 'visualizer' ), '</b>';
488 415
489 - echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
416 + echo '<table class="section-table" cellspacing="0" cellpadding="0" border="0">';
490 417 echo '<tr>';
491 - echo '<td class="viz-section-table-column">';
418 + echo '<td class="section-table-column">';
492 419 echo '<input type="text" name="chartArea[left]" class="control-text" value="', $this->chartArea['left'] || $this->chartArea['left'] === '0' ? esc_attr( $this->chartArea['left'] ) : '', '" placeholder="20%">';
493 420 echo '</td>';
494 - echo '<td class="viz-section-table-column">';
421 + echo '<td class="section-table-column">';
495 422 echo '<input type="text" name="chartArea[top]" class="control-text" value="', $this->chartArea['top'] || $this->chartArea['top'] === '0' ? esc_attr( $this->chartArea['top'] ) : '', '" placeholder="20%">';
496 423 echo '</td>';
497 424 echo '</tr>';
498 425 echo '</table>';
499 426
500 - echo '<p class="viz-section-description">';
427 + echo '<p class="section-description">';
501 428 esc_html_e( 'Determines how far to draw the chart from the left and top borders.', 'visualizer' );
502 429 echo '</p>';
503 430 echo '</div>';
504 431
505 - echo '<div class="viz-section-item">';
432 + echo '<div class="section-item">';
506 433 echo '<a class="more-info" href="javascript:;">[?]</a>';
507 434 echo '<b>', esc_html__( 'Width And Height Of Chart Area', 'visualizer' ), '</b>';
508 435
509 - echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
436 + echo '<table class="section-table" cellspacing="0" cellpadding="0" border="0">';
510 437 echo '<tr>';
511 - echo '<td class="viz-section-table-column">';
438 + echo '<td class="section-table-column">';
512 439 echo '<input type="text" name="chartArea[width]" class="control-text" value="', ! empty( $this->chartArea['width'] ) ? esc_attr( $this->chartArea['width'] ) : '', '" placeholder="60%">';
513 440 echo '</td>';
514 - echo '<td class="viz-section-table-column">';
441 + echo '<td class="section-table-column">';
515 442 echo '<input type="text" name="chartArea[height]" class="control-text" value="', ! empty( $this->chartArea['height'] ) ? esc_attr( $this->chartArea['height'] ) : '', '" placeholder="60%">';
516 443 echo '</td>';
517 444 echo '</tr>';
518 445 echo '</table>';
519 446
520 - echo '<p class="viz-section-description">';
447 + echo '<p class="section-description">';
521 448 esc_html_e( 'Determines the width and hight of the chart area.', 'visualizer' );
522 449 echo '</p>';
523 450 echo '</div>';
524 451 self::_renderSectionEnd();
@@ -547,9 +474,9 @@
547 474 foreach ( $attributes as $k => $v ) {
548 475 $atts .= ' data-visualizer-' . $k . '=' . esc_attr( $v );
549 476 }
550 477 }
551 - echo '<div class="viz-section-item">';
478 + echo '<div class="section-item">';
552 479 echo '<a class="more-info" href="javascript:;">[?]</a>';
553 480 echo '<b>', $title, '</b>';
554 481 echo '<select class="control-select ', implode( ' ', $classes ) , '" name="', $name, '" ', ( $multiple ? 'multiple' : '' ), ' ' , $atts, '>';
555 482 foreach ( $options as $key => $label ) {
@@ -558,9 +485,9 @@
558 485 echo $label;
559 486 echo '</option>';
560 487 }
561 488 echo '</select>';
562 - echo '<p class="viz-section-description">', $desc, '</p>';
489 + echo '<p class="section-description">', $desc, '</p>';
563 490 echo '</div>';
564 491 }
565 492
566 493 /**
@@ -575,9 +502,9 @@
575 502 * @param string $value The actual value of the select item.
576 503 * @param string $default The default value of the color picker.
577 504 */
578 505 protected static function _renderColorPickerItem( $title, $name, $value, $default ) {
579 - echo '<div class="viz-section-item">';
506 + echo '<div class="section-item">';
580 507 echo '<b>', $title, '</b>';
581 508 echo '<div>';
582 509 echo '<input type="text" class="color-picker-hex" name="', $name, '" maxlength="7" placeholder="', esc_attr__( 'Hex Value', 'visualizer' ), '" value="', is_null( $value ) ? $default : esc_attr( $value ), '" data-default-color="', $default, '">';
583 510 echo '</div>';
@@ -605,13 +532,13 @@
605 532 foreach ( $custom_attributes as $k => $v ) {
606 533 $attributes .= ' ' . $k . '="' . esc_attr( $v ) . '"';
607 534 }
608 535 }
609 - echo '<div class="viz-section-item">';
536 + echo '<div class="section-item">';
610 537 echo '<a class="more-info" href="javascript:;">[?]</a>';
611 538 echo '<b>', $title, '</b>';
612 539 echo '<input type="', $type, '" class="control-text" ', $attributes, ' name="', $name, '" value="', esc_attr( $value ), '" placeholder="', $placeholder, '">';
613 - echo '<p class="viz-section-description">', $desc, '</p>';
540 + echo '<p class="section-description">', $desc, '</p>';
614 541 echo '</div>';
615 542 }
616 543
617 544 /**
@@ -625,12 +552,12 @@
625 552 * @param string $html Any additional HTML.
626 553 * @param string $class Any additional classes.
627 554 */
628 555 public static function _renderGroupStart( $title, $html = '', $class = '' ) {
629 - echo '<li class="viz-group ' . $class . '">';
630 - echo '<h3 class="viz-group-title">', $title, '</h3>';
556 + echo '<li class="group ' . $class . '">';
557 + echo '<h3 class="group-title">', $title, '</h3>';
631 558 echo $html;
632 - echo '<ul class="viz-group-content">';
559 + echo '<ul class="group-content">';
633 560 }
634 561
635 562 /**
636 563 * Renders the ending of a group.
@@ -657,14 +584,14 @@
657 584 */
658 585 public static function _renderSectionStart( $title = false, $open = true ) {
659 586
660 587 if ( ! empty( $title ) ) {
661 - echo '<li class="viz-subsection">';
662 - echo '<span class="viz-section-title">', $title, '</span>';
588 + echo '<li class="subsection">';
589 + echo '<span class="section-title">', $title, '</span>';
663 590 } else {
664 591 echo '<li class=" ">';
665 592 }
666 - echo '<div class="viz-section-items section-items', $open ? ' open' : '', '">';
593 + echo '<div class="section-items', $open ? ' open' : '', '">';
667 594 }
668 595
669 596 /**
670 597 * Renders the ending of a section.
@@ -690,10 +617,10 @@
690 617 * @access public
691 618 * @param string $description The description text.
692 619 */
693 620 public static function _renderSectionDescription( $description ) {
694 - echo '<div class="viz-section-item">';
695 - echo '<div class="viz-section-description">', $description, '</div>';
621 + echo '<div class="section-item">';
622 + echo '<div class="section-description">', $description, '</div>';
696 623 echo '</div>';
697 624 }
698 625
699 626 /**
@@ -732,13 +659,13 @@
732 659 /**
733 660 * Render a checkbox item
734 661 */
735 662 protected static function _renderCheckboxItem( $title, $name, $value, $default, $desc, $disabled = false ) {
736 - echo '<div class="viz-section-item">';
663 + echo '<div class="section-item">';
737 664 echo '<a class="more-info" href="javascript:;">[?]</a>';
738 665 echo '<b>', $title, '</b>';
739 - echo '<input type="checkbox" class="control-check" value="', $default, '" name="', $name, '" ', ( $value == $default ? 'checked' : '' ), ' ', ( $disabled ? 'disabled=disabled' : '' ), '>';
740 - echo '<p class="viz-section-description">', $desc, '</p>';
666 + echo '<input type="checkbox" class="control-check" value="', $default, '" name="', $name, '" ', ($value == $default ? 'checked' : ''), ' ', ($disabled ? 'disabled=disabled' : ''), '>';
667 + echo '<p class="section-description">', $desc, '</p>';
741 668 echo '</div>';
742 669 }
743 670
744 671 /**
@@ -750,20 +677,13 @@
750 677 foreach ( $custom_attributes as $k => $v ) {
751 678 $attributes .= ' ' . $k . '="' . esc_attr( $v ) . '"';
752 679 }
753 680 }
754 - echo '<div class="viz-section-item">';
681 + echo '<div class="section-item">';
755 682 echo '<a class="more-info" href="javascript:;">[?]</a>';
756 683 echo '<b>', $title, '</b>';
757 684 echo '<textarea class="control-text" ', $attributes, ' name="', $name, '" placeholder="', $placeholder, '">', $value, '</textarea>';
758 - echo '<p class="viz-section-description">', $desc, '</p>';
685 + echo '<p class="section-description">', $desc, '</p>';
759 686 echo '</div>';
760 - }
761 -
762 - /**
763 - * Returns the library this chart implements.
764 - */
765 - public function getLibrary() {
766 - return $this->_library;
767 687 }
768 688
769 689 }