| @@ -174,9 +174,9 @@ | ||
| 174 | 174 | self::_renderGroupEnd(); |
| 175 | 175 | |
| 176 | 176 | self::_renderGroupStart( esc_html__( 'Manual Configuration', 'visualizer' ) ); |
| 177 | 177 | 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>' ); | |
| 178 | + self::_renderSectionDescription( '<span class="viz-gvlink">' . sprintf( __( 'Configure the graph by providing configuration variables right from the %1$sGoogle Visualization API%2$s. You can refer to to some examples %3$shere%4$s.', 'visualizer' ), '<a href="https://developers.google.com/chart/interactive/docs/gallery/?#configuration-options" target="_blank">', '</a>', '<a href="https://docs.themeisle.com/article/728-manual-configuration" target="_blank">', '</a>' ) . '</span>' ); | |
| 179 | 179 | |
| 180 | 180 | $example = ' |
| 181 | 181 | { |
| 182 | 182 | "vAxis": { |
| @@ -218,9 +218,9 @@ | ||
| 218 | 218 | esc_html__( 'Print', 'visualizer' ), |
| 219 | 219 | 'actions[]', |
| 220 | 220 | isset( $this->actions ) && in_array( 'print', $this->actions ) ? true : false, |
| 221 | 221 | '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' ), | |
| 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 chart/data.', 'visualizer' ), | |
| 223 | 223 | $disable_actions |
| 224 | 224 | ); |
| 225 | 225 | self::_renderCheckboxItem( |
| 226 | 226 | esc_html__( 'CSV', 'visualizer' ), |
| @@ -230,9 +230,9 @@ | ||
| 230 | 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 | 231 | $disable_actions |
| 232 | 232 | ); |
| 233 | 233 | |
| 234 | - $disabled = ! ( class_exists( 'PHPExcel' ) && extension_loaded( 'zip' ) && extension_loaded( 'xml' ) && version_compare( PHP_VERSION, '5.2.0', '>' ) ); | |
| 234 | + $disabled = ! self::is_excel_enabled(); | |
| 235 | 235 | self::_renderCheckboxItem( |
| 236 | 236 | esc_html__( 'Excel', 'visualizer' ), |
| 237 | 237 | 'actions[]', |
| 238 | 238 | isset( $this->actions ) && in_array( 'xls;application/vnd.ms-excel', $this->actions ) ? true : false, |
| @@ -251,8 +251,20 @@ | ||
| 251 | 251 | self::_renderSectionEnd(); |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | + * Checks if the Excel module can be enabled. | |
| 256 | + */ | |
| 257 | + private static function is_excel_enabled() { | |
| 258 | + $vendor_file = VISUALIZER_ABSPATH . '/vendor/autoload.php'; | |
| 259 | + if ( is_readable( $vendor_file ) ) { | |
| 260 | + include_once( $vendor_file ); | |
| 261 | + } | |
| 262 | + | |
| 263 | + return class_exists( 'PhpOffice\PhpSpreadsheet\Spreadsheet' ) && extension_loaded( 'zip' ) && extension_loaded( 'xml' ) && extension_loaded( 'fileinfo' ) && version_compare( PHP_VERSION, '5.6.0', '>' ); | |
| 264 | + } | |
| 265 | + | |
| 266 | + /** | |
| 255 | 267 | * Renders chart general settings group. |
| 256 | 268 | * |
| 257 | 269 | * @since 1.0.0 |
| 258 | 270 | * |
| @@ -350,9 +362,9 @@ | ||
| 350 | 362 | |
| 351 | 363 | self::_renderCheckboxItem( |
| 352 | 364 | esc_html__( 'Animate on startup', 'visualizer' ), |
| 353 | 365 | 'animation[startup]', |
| 354 | - $this->animation['startup'], | |
| 366 | + isset( $this->animation['startup'] ) ? $this->animation['startup'] : 0, | |
| 355 | 367 | true, |
| 356 | 368 | esc_html__( 'Determines if the chart will animate on the initial draw.', 'visualizer' ) |
| 357 | 369 | ); |
| 358 | 370 | |