| @@ -83,16 +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 | 87 | * Constructor. |
| 96 | 88 | * |
| 97 | 89 | * @since 1.0.0 |
| 98 | 90 | * |
| @@ -164,9 +156,9 @@ | ||
| 164 | 156 | self::_renderGroupEnd(); |
| 165 | 157 | |
| 166 | 158 | self::_renderGroupStart( esc_html__( 'Manual Configuration', 'visualizer' ) ); |
| 167 | 159 | self::_renderSectionStart(); |
| 168 | - 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.' ); | |
| 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.' ); | |
| 169 | 161 | |
| 170 | 162 | $example = ' |
| 171 | 163 | { |
| 172 | 164 | "vAxis": { |
| @@ -199,10 +191,8 @@ | ||
| 199 | 191 | * |
| 200 | 192 | * @access protected |
| 201 | 193 | */ |
| 202 | 194 | protected function _renderActionSettings() { |
| 203 | - global $wp_version; | |
| 204 | - $disable_actions = version_compare( $wp_version, '4.7.0', '<' ); | |
| 205 | 195 | self::_renderSectionStart( esc_html__( 'Actions', 'visualizer' ), false ); |
| 206 | 196 | self::_renderCheckboxItem( |
| 207 | 197 | esc_html__( 'Print', 'visualizer' ), |
| 208 | 198 | 'actions[]', |
| @@ -207,10 +197,9 @@ | ||
| 207 | 197 | esc_html__( 'Print', 'visualizer' ), |
| 208 | 198 | 'actions[]', |
| 209 | 199 | isset( $this->actions ) && in_array( 'print', $this->actions ) ? true : false, |
| 210 | 200 | 'print', |
| 211 | - $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' ), | |
| 212 | - $disable_actions | |
| 201 | + esc_html__( 'To enable printing the data.', 'visualizer' ) | |
| 213 | 202 | ); |
| 214 | 203 | self::_renderCheckboxItem( |
| 215 | 204 | esc_html__( 'CSV', 'visualizer' ), |
| 216 | 205 | 'actions[]', |
| @@ -215,10 +204,9 @@ | ||
| 215 | 204 | esc_html__( 'CSV', 'visualizer' ), |
| 216 | 205 | 'actions[]', |
| 217 | 206 | isset( $this->actions ) && in_array( 'csv;application/csv', $this->actions ) ? true : false, |
| 218 | 207 | 'csv;application/csv', |
| 219 | - $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' ), | |
| 220 | - $disable_actions | |
| 208 | + esc_html__( 'To enable downloading the data as a CSV.', 'visualizer' ) | |
| 221 | 209 | ); |
| 222 | 210 | |
| 223 | 211 | $disabled = ! ( class_exists( 'PHPExcel' ) && extension_loaded( 'zip' ) && extension_loaded( 'xml' ) && version_compare( PHP_VERSION, '5.2.0', '>' ) ); |
| 224 | 212 | self::_renderCheckboxItem( |
| @@ -225,10 +213,10 @@ | ||
| 225 | 213 | esc_html__( 'Excel', 'visualizer' ), |
| 226 | 214 | 'actions[]', |
| 227 | 215 | isset( $this->actions ) && in_array( 'xls;application/vnd.ms-excel', $this->actions ) ? true : false, |
| 228 | 216 | 'xls;application/vnd.ms-excel', |
| 229 | - $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' ) ), | |
| 230 | - $disable_actions || $disabled | |
| 217 | + $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' ), | |
| 218 | + $disabled | |
| 231 | 219 | ); |
| 232 | 220 | self::_renderCheckboxItem( |
| 233 | 221 | esc_html__( 'Copy', 'visualizer' ), |
| 234 | 222 | 'actions[]', |
| @@ -233,10 +221,9 @@ | ||
| 233 | 221 | esc_html__( 'Copy', 'visualizer' ), |
| 234 | 222 | 'actions[]', |
| 235 | 223 | isset( $this->actions ) && in_array( 'copy', $this->actions ) ? true : false, |
| 236 | 224 | 'copy', |
| 237 | - $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' ), | |
| 238 | - $disable_actions | |
| 225 | + esc_html__( 'To enable copying the data to the clipboard.', 'visualizer' ) | |
| 239 | 226 | ); |
| 240 | 227 | self::_renderSectionEnd(); |
| 241 | 228 | } |
| 242 | 229 | |
| @@ -318,61 +305,12 @@ | ||
| 318 | 305 | |
| 319 | 306 | self::_renderSectionStart( esc_html__( 'Tooltip', 'visualizer' ), false ); |
| 320 | 307 | $this->_renderTooltipSettigns(); |
| 321 | 308 | self::_renderSectionEnd(); |
| 322 | - | |
| 323 | - $this->_renderAnimationSettings(); | |
| 324 | - | |
| 325 | 309 | self::_renderGroupEnd(); |
| 326 | 310 | } |
| 327 | 311 | |
| 328 | 312 | /** |
| 329 | - * Renders animation settings section. | |
| 330 | - * | |
| 331 | - * @access protected | |
| 332 | - */ | |
| 333 | - protected function _renderAnimationSettings() { | |
| 334 | - if ( ! $this->_supportsAnimation ) { | |
| 335 | - return; | |
| 336 | - } | |
| 337 | - | |
| 338 | - self::_renderSectionStart( esc_html__( 'Animation', 'visualizer' ), false ); | |
| 339 | - | |
| 340 | - self::_renderCheckboxItem( | |
| 341 | - esc_html__( 'Animate on startup', 'visualizer' ), | |
| 342 | - 'animation[startup]', | |
| 343 | - $this->animation['startup'], | |
| 344 | - true, | |
| 345 | - esc_html__( 'Determines if the chart will animate on the initial draw.', 'visualizer' ) | |
| 346 | - ); | |
| 347 | - | |
| 348 | - self::_renderTextItem( | |
| 349 | - esc_html__( 'Duration', 'visualizer' ), | |
| 350 | - 'animation[duration]', | |
| 351 | - isset( $this->animation['duration'] ) ? $this->animation['duration'] : 0, | |
| 352 | - esc_html__( 'The duration of the animation, in milliseconds', 'visualizer' ), | |
| 353 | - 0, | |
| 354 | - 'number' | |
| 355 | - ); | |
| 356 | - | |
| 357 | - self::_renderSelectItem( | |
| 358 | - esc_html__( 'Easing', 'visualizer' ), | |
| 359 | - 'animation[easing]', | |
| 360 | - isset( $this->animation['easing'] ) ? $this->animation['easing'] : null, | |
| 361 | - array( | |
| 362 | - 'linear' => esc_html__( 'Constant speed', 'visualizer' ), | |
| 363 | - 'in' => esc_html__( 'Start slow and speed up', 'visualizer' ), | |
| 364 | - 'out' => esc_html__( 'Start fast and slow down', 'visualizer' ), | |
| 365 | - 'inAndOut' => esc_html__( 'Start slow, speed up, then slow down', 'visualizer' ), | |
| 366 | - ), | |
| 367 | - esc_html__( 'The easing function applied to the animation.', 'visualizer' ) | |
| 368 | - ); | |
| 369 | - | |
| 370 | - self::_renderSectionEnd(); | |
| 371 | - | |
| 372 | - } | |
| 373 | - | |
| 374 | - /** | |
| 375 | 313 | * Renders tooltip settings section. |
| 376 | 314 | * |
| 377 | 315 | * @since 1.4.0 |
| 378 | 316 | * |
| @@ -724,9 +662,9 @@ | ||
| 724 | 662 | protected static function _renderCheckboxItem( $title, $name, $value, $default, $desc, $disabled = false ) { |
| 725 | 663 | echo '<div class="viz-section-item">'; |
| 726 | 664 | echo '<a class="more-info" href="javascript:;">[?]</a>'; |
| 727 | 665 | echo '<b>', $title, '</b>'; |
| 728 | - echo '<input type="checkbox" class="control-check" value="', $default, '" name="', $name, '" ', ( $value == $default ? 'checked' : '' ), ' ', ( $disabled ? 'disabled=disabled' : '' ), '>'; | |
| 666 | + echo '<input type="checkbox" class="control-check" value="', $default, '" name="', $name, '" ', ($value == $default ? 'checked' : ''), ' ', ($disabled ? 'disabled=disabled' : ''), '>'; | |
| 729 | 667 | echo '<p class="viz-section-description">', $desc, '</p>'; |
| 730 | 668 | echo '</div>'; |
| 731 | 669 | } |
| 732 | 670 | |