PluginProbe
Chartify – WordPress Chart Plugin / 3.8.0
Chartify – WordPress Chart Plugin v3.8.0
3.8.0 3.7.9 3.7.8 3.7.7 3.7.6 3.7.5 trunk 1.0.0 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 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.1.4 3.1.5 3.1.6 All 83 releases
chart-builder / admin / class-chart-builder-admin.php

class-chart-builder-admin.php in Chartify – WordPress Chart Plugin 3.8.0, at admin/class-chart-builder-admin.php

10,474 lines 743.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The admin-specific functionality of the plugin.
5 *
6 * @link https://ays-pro.com/
7 * @since 1.0.0
8 *
9 * @package Chart_Builder
10 * @subpackage Chart_Builder/admin
11 */
12
13 /**
14 * The admin-specific functionality of the plugin.
15 *
16 * Defines the plugin name, version, and two examples hooks for how to
17 * enqueue the admin-specific stylesheet and JavaScript.
18 *
19 * @package Chart_Builder
20 * @subpackage Chart_Builder/admin
21 * @author Chart Builder Team <info@ays-pro.com>
22 */
23 class Chart_Builder_Admin {
24
25 /**
26 * The ID of this plugin.
27 *
28 * @since 1.0.0
29 * @access private
30 * @var string $plugin_name The ID of this plugin.
31 */
32 private $plugin_name;
33
34 /**
35 * The version of this plugin.
36 *
37 * @since 1.0.0
38 * @access private
39 * @var string $version The current version of this plugin.
40 */
41 private $version;
42
43 /**
44 * The capability of this plugin.
45 *
46 * @since 1.0.0
47 * @access private
48 * @var string $capability The capability for users access to this plugin.
49 */
50 private $capability;
51
52 /**
53 * @var Chart_Builder_DB_Actions
54 */
55 private $db_obj;
56
57 /**
58 * @var Chart_Builder_Settings_DB_Actions
59 */
60 private $settings_obj;
61
62 /**
63 * Initialize the class and set its properties.
64 *
65 * @since 1.0.0
66 * @param string $plugin_name The name of this plugin.
67 * @param string $version The version of this plugin.
68 */
69 public function __construct( $plugin_name, $version ) {
70
71 $this->plugin_name = $plugin_name;
72 $this->version = $version;
73
74 add_filter('set-screen-option', array(__CLASS__, 'set_screen'), 10, 3);
75 add_filter('set_screen_option_cb_charts_per_page', array(__CLASS__, 'set_screen'), 10, 3);
76
77 }
78
79 /**
80 * Register the stylesheets for the admin area.
81 *
82 * @since 1.0.0
83 */
84 public function enqueue_styles($hook_suffix) {
85 wp_enqueue_style( $this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
86 // Not enqueue styles if they are not on the current plugin page
87 if (false === strpos($hook_suffix, $this->plugin_name)) return;
88 //
89 wp_enqueue_style( $this->plugin_name . '-normalize', plugin_dir_url( __FILE__ ) . 'css/normalize.css', array(), $this->version . time(), 'all' );
90 wp_enqueue_style( $this->plugin_name . '-admin-general', plugin_dir_url( __FILE__ ) . 'css/admin-general.css', array(), $this->version, 'all' );
91 wp_enqueue_style( $this->plugin_name . '-banner', plugin_dir_url( __FILE__ ) . 'css/banner.css', array(), $this->version, 'all' );
92 // wp_enqueue_style( $this->plugin_name . '-chart-builder-banner.css', plugin_dir_url(__FILE__) . 'css/chart-builder-banner.css', array(), $this->version, 'all');
93 wp_enqueue_style( $this->plugin_name . '-animate', plugin_dir_url(__FILE__) . 'css/animate.css', array(), $this->version, 'all');
94 wp_enqueue_style( $this->plugin_name . '-font-awesome', plugin_dir_url(__FILE__) . 'css/ays-font-awesome.min.css', array(), $this->version, 'all');
95 wp_enqueue_style( $this->plugin_name . '-font-awesome-icons', plugin_dir_url(__FILE__) . 'css/ays-font-awesome-icons.css', array(), $this->version, 'all');
96 wp_enqueue_style( $this->plugin_name . '-select2', plugin_dir_url(__FILE__) . 'css/ays-select2.min.css', array(), $this->version, 'all');
97 wp_enqueue_style( $this->plugin_name . '-chosen', plugin_dir_url(__FILE__) . 'css/chosen.min.css', array(), $this->version, 'all');
98 wp_enqueue_style( $this->plugin_name . '-bootstrap', plugin_dir_url(__FILE__) . 'css/bootstrap.min.css', array(), $this->version, 'all');
99 wp_enqueue_style( $this->plugin_name . '-data-bootstrap', plugin_dir_url(__FILE__) . 'css/dataTables.bootstrap4.min.css', array(), $this->version, 'all');
100 wp_enqueue_style( $this->plugin_name . '-jquery-ui.min', plugin_dir_url(__FILE__) . 'css/jquery-ui.min.css', array(), $this->version, 'all');
101
102 wp_enqueue_style( $this->plugin_name . '-layer', plugin_dir_url( __FILE__ ) . 'css/chart-builder-admin-layer.css', array(), $this->version, 'all' );
103 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/chart-builder-admin.css', array(), $this->version . time(), 'all' );
104 wp_enqueue_style( $this->plugin_name . "-pro-features", plugin_dir_url( __FILE__ ) . 'css/chart-builder-pro-features.css', array(), $this->version . time(), 'all' );
105
106 }
107
108 /**
109 * Register the JavaScript for the admin area.
110 *
111 * @since 1.0.0
112 */
113 public function enqueue_scripts($hook_suffix) {
114 if (false !== strpos($hook_suffix, "plugins.php")){
115 wp_enqueue_script( $this->plugin_name . '-sweetalert-js', plugin_dir_url( __FILE__ ) . 'js/chart-builder-sweetalert2.all.min.js', array('jquery'), $this->version, true );
116 wp_enqueue_script($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'js/admin.js', array('jquery'), $this->version, true);
117 wp_localize_script($this->plugin_name . '-admin', 'chart_builder_admin_ajax', array('ajax_url' => admin_url('admin-ajax.php')));
118 }
119
120 // Not enqueue scripts if they are not on the current plugin page
121 if (false === strpos($hook_suffix, $this->plugin_name)) return;
122 //
123 global $wp_version;
124 $version1 = $wp_version;
125 $operator = '>=';
126 $version2 = '5.5';
127 $versionCompare = CBFunctions()->versionCompare( $version1, $operator, $version2 );
128
129 if ( $versionCompare ) {
130 wp_enqueue_script( $this->plugin_name.'-wp-load-scripts', plugin_dir_url(__FILE__) . 'js/load-scripts.js', array(), $this->version, true);
131 }
132
133 wp_enqueue_script( 'jquery' );
134
135 /*
136 ==========================================
137 * Bootstrap
138 * select2
139 * jQuery DataTables
140 ==========================================
141 */
142 wp_enqueue_script( $this->plugin_name . "-popper", plugin_dir_url(__FILE__) . 'js/popper.min.js', array( 'jquery' ), $this->version, true );
143 wp_enqueue_script( $this->plugin_name . "-bootstrap", plugin_dir_url(__FILE__) . 'js/bootstrap.min.js', array( 'jquery' ), $this->version, true );
144 wp_enqueue_script( $this->plugin_name . '-select2js', plugin_dir_url( __FILE__ ) . 'js/ays-select2.min.js', array('jquery'), $this->version, true);
145 wp_enqueue_script( $this->plugin_name . '-chosen', plugin_dir_url( __FILE__ ) . 'js/chosen.jquery.min.js', array('jquery'), $this->version, true);
146 wp_enqueue_script( $this->plugin_name . '-datatable-min', plugin_dir_url( __FILE__ ) . 'js/chart-builder-datatable.min.js', array('jquery'), $this->version, true);
147 wp_enqueue_script( $this->plugin_name . "-db4.min.js", plugin_dir_url( __FILE__ ) . 'js/dataTables.bootstrap4.min.js', array( 'jquery' ), $this->version, true );
148 wp_enqueue_script( $this->plugin_name . "-jquery-ui.min.js", plugin_dir_url( __FILE__ ) . 'js/jquery-ui.min.js', array( 'jquery' ), $this->version, true );
149 wp_enqueue_script( $this->plugin_name . '-sweetalert-js', plugin_dir_url( __FILE__ ) . 'js/chart-builder-sweetalert2.all.min.js', array('jquery'), $this->version, true );
150
151 wp_enqueue_script( $this->plugin_name . "-treeSortable", plugin_dir_url( __FILE__ ) . 'js/treeSortable.js', array( 'jquery' ), $this->version, true );
152 wp_enqueue_script( $this->plugin_name . "-tippy-bundle", plugin_dir_url( __FILE__ ) . 'js/tippy-bundle.umd.js', array( 'jquery' ), $this->version, true );
153
154 $table_col_mapping = CBFunctions()->get_all_db_tables_column_mapping( 1 );
155 $chart_banner_date = $this->ays_chart_update_banner_time();
156
157 wp_enqueue_code_editor(
158 array(
159 'type' => 'sql',
160 'codemirror' => array(
161 'autofocus' => true,
162 'lineWrapping' => true,
163 'dragDrop' => false,
164 'matchBrackets' => true,
165 'autoCloseBrackets' => true,
166 'extraKeys' => array( 'Ctrl-Space' => 'autocomplete' ),
167 'hintOptions' => array( 'tables' => $table_col_mapping ),
168 ),
169 )
170 );
171
172 wp_enqueue_script( $this->plugin_name . '-charts-google', plugin_dir_url(__FILE__) . 'js/google-chart.js', array('jquery'), $this->version, true);
173 wp_enqueue_script( $this->plugin_name . '-chart-js', plugin_dir_url(__FILE__) . 'js/chart-js.js', array('jquery'), $this->version, true);
174
175 wp_enqueue_script( $this->plugin_name . '-functions', plugin_dir_url( __FILE__ ) . 'js/functions.js', array( 'jquery' ), $this->version, true );
176
177 wp_register_script( $this->plugin_name . '-localized', '' , array('jquery'), $this->version, true);
178
179 wp_localize_script( $this->plugin_name . '-localized', 'aysChartBuilderAdmin', array(
180 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
181 'selectUser' => __( 'Select author', "chart-builder" ),
182 'pleaseEnterMore' => __( "Please enter 1 or more characters", "chart-builder" ),
183 'searching' => __( "Searching...", "chart-builder" ),
184 'chartBannerDate' => $chart_banner_date,
185 'selectUserRoles' => __( 'Select user roles', "chart-builder" ),
186 'delete' => __( 'Delete', "chart-builder" ),
187 'selectQuestionDefaultType' => __( 'Select question default type', "chart-builder" ),
188 'yes' => __( 'Yes', "chart-builder" ),
189 'cancel' => __( 'Cancel', "chart-builder" ),
190 'somethingWentWrong' => __( "Maybe something went wrong.", "chart-builder" ),
191 'failed' => __( 'Failed', "chart-builder" ),
192 'selectPage' => __( 'Select page', "chart-builder" ),
193 'selectPostType' => __( 'Select post type', "chart-builder" ),
194 'copied' => __( 'Copied!', "chart-builder"),
195 'clickForCopy' => __( 'Click to copy', "chart-builder"),
196 'selectForm' => __( 'Select form', "chart-builder"),
197 'addImage' => __( 'Add Image', "chart-builder"),
198 'editImage' => __( 'Edit Image', "chart-builder"),
199 'confirmDelete' => __( 'Are you sure you want to delete the chart(s)?', "chart-builder"),
200 'confirmRowDelete' => __( 'Are you sure you want to delete the row?', "chart-builder"),
201 'confirmColDelete' => __( 'Are you sure you want to delete the column?', "chart-builder"),
202 'minRowNotice' => __( 'Sorry, minimum count of rows should be 1', "chart-builder"),
203 'minColNotice' => __( 'Sorry, minimum count of columns should be 1', "chart-builder"),
204 'activated' => __( "Activated", "chart-builder" ),
205 'errorMsg' => __( "Error", "chart-builder" ),
206 'loadResource' => __( "Can't load resource.", "chart-builder" ),
207 'somethingWentWrong' => __( "Maybe something went wrong.", "chart-builder" ),
208 'successCopyCoupon' => esc_html__( "Coupon code copied!", 'chart-builder' ),
209 'failedCopyCoupon' => esc_html__( "Failed to copy coupon code", 'chart-builder' ),
210
211 ) );
212
213 wp_localize_script( $this->plugin_name . '-localized', 'aysChartBuilderChartSettings', array(
214 'types' => CBFunctions()->getAllowedTypes(),
215 'max_selected_options' => 2,
216 'l10n' => array(
217 'invalid_source' => esc_html__( 'You have entered invalid URL. Please, insert proper URL.', "chart-builder" ),
218 'loading' => esc_html__( 'Loading...', "chart-builder" ),
219 'filter_config_error' => esc_html__( 'Please check the filters you have configured.', "chart-builder" ),
220 'select_columns' => esc_html__( 'Please select a few columns to include in the chart.', "chart-builder" ),
221 'save_settings' => __( 'You have modified the chart\'s settings. To modify the source/data again, you must save this chart and reopen it for editing. If you continue without saving the chart, you may lose your changes.', "chart-builder" ),
222 ),
223 'ajax' => array(
224 'url' => admin_url( 'admin-ajax.php' ),
225 'nonces' => array(
226 'filter_get_props' => wp_create_nonce( 'cbuilder-fetch-post-type-props' ),
227 'filter_get_data' => wp_create_nonce( 'cbuilder-fetch-post-type-data' ),
228 'quiz_maker_get_data' => wp_create_nonce( 'cbuilder-fetch-quiz-maker-data' ),
229 'quiz_maker_save_data' => wp_create_nonce( 'cbuilder-save-quiz-maker-data' ),
230 'author_user_search' => wp_create_nonce( 'cbuilder-author-user-search' ),
231
232 ),
233 'actions' => array(
234 'filter_get_props' => 'fetch_post_type_props',
235 'filter_get_data' => 'fetch_post_type_data',
236 'quiz_maker_get_data' => 'fetch_quiz_maker_data',
237 'quiz_maker_save_data' => 'save_quiz_maker_data',
238 'author_user_search' => 'author_user_search'
239 ),
240 ),
241 'db_query' => array(
242 'tables' => $table_col_mapping,
243 ),
244 ) );
245
246 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
247 wp_enqueue_script( $this->plugin_name . '-google', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-google.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
248 wp_enqueue_script( $this->plugin_name . '-chartjs', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-chartjs.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
249 wp_enqueue_script( $this->plugin_name . '-general-js', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-general.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
250
251 if ( false !== strpos( $hook_suffix, 'settings' ) ) {
252 wp_enqueue_script( $this->plugin_name . '-settings', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-settings.js', array( 'jquery' ), $this->version, true );
253
254 wp_localize_script( $this->plugin_name . '-settings', 'aysChartBuilderAdminSettings', array(
255 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
256 'selectUserRoles' => __( 'Select user roles', 'chart-builder' ),
257 'delete' => __( 'Delete', 'chart-builder' ),
258 'selectQuestionDefaultType' => __( 'Select question default type', 'chart-builder' ),
259 'yes' => __( 'Yes', 'chart-builder' ),
260 'cancel' => __( 'Cancel', 'chart-builder' ),
261 'somethingWentWrong' => __( "Maybe something went wrong.", 'chart-builder' ),
262 'failed' => __( 'Failed', 'chart-builder' ),
263 'selectPage' => __( 'Select page', 'chart-builder' ),
264 'selectPostType' => __( 'Select post type', 'chart-builder' ),
265 'copied' => __( 'Copied!', 'chart-builder'),
266 'clickForCopy' => __( 'Click to copy', 'chart-builder'),
267 'selectForm' => __( 'Select form', 'chart-builder'),
268 ) );
269 }
270 }
271
272 /**
273 * De-register JavaScript files for the admin area.
274 *
275 * @since 1.0.0
276 */
277 public function disable_scripts($hook_suffix) {
278 if (false !== strpos($hook_suffix, $this->plugin_name)) {
279 if (is_plugin_active('ai-engine/ai-engine.php')) {
280 wp_deregister_script('mwai');
281 wp_deregister_script('mwai-vendor');
282 wp_dequeue_script('mwai');
283 wp_dequeue_script('mwai-vendor');
284 }
285
286 if (is_plugin_active('html5-video-player/html5-video-player.php')) {
287 wp_dequeue_style('h5vp-admin');
288 wp_dequeue_style('fs_common');
289 }
290
291 if (is_plugin_active('panorama/panorama.php')) {
292 wp_dequeue_style('bppiv_admin_custom_css');
293 wp_dequeue_style('bppiv-custom-style');
294 }
295
296 if (is_plugin_active('wp-social/wp-social.php')) {
297 wp_dequeue_style('wp_social_select2_css');
298 wp_deregister_script('wp_social_select2_js');
299 wp_dequeue_script('wp_social_select2_js');
300 }
301
302 if (is_plugin_active('real-media-library-lite/index.php')) {
303 wp_dequeue_style('real-media-library-lite-rml');
304 }
305
306 // Theme | Phlox 2.17.6
307 wp_dequeue_style('auxin-admin-style');
308
309 // Theme | Pixel Ebook Store
310 wp_dequeue_style('pixel-ebook-store-free-demo-content-style');
311
312 // Theme | Interactive Education
313 wp_dequeue_style('interactive-education-free-demo-content-style');
314
315 }
316 }
317
318 /**
319 * Register the administration menu for this plugin into the WordPress Dashboard menu.
320 *
321 * @since 1.0.0
322 */
323 public function add_plugin_admin_menu(){
324
325 /*
326 * Add a settings page for this plugin to the Settings menu.
327 *
328 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
329 *
330 * Administration Menus: http://codex.wordpress.org/Administration_Menus
331 *
332 */
333 global $wpdb;
334 $menu_item = __( 'Chart Builder', "chart-builder" );
335 $this->capability = 'manage_options';
336
337 add_menu_page(
338 __( 'Chart Builder', "chart-builder" ),
339 $menu_item,
340 $this->capability,
341 $this->plugin_name,
342 array($this, 'display_plugin_charts_page'),
343 CHART_BUILDER_ADMIN_URL . '/images/icons/ays_chart_logo_icon_bw.svg',
344 '26'
345 );
346
347 }
348
349 public function add_plugin_charts_submenu(){
350 $hook_page_view = add_submenu_page(
351 $this->plugin_name,
352 __('All Charts', 'chart-builder'),
353 __('All Charts', 'chart-builder'),
354 'manage_options',
355 $this->plugin_name,
356 array($this, 'display_plugin_charts_page')
357 );
358
359 add_action( "load-$hook_page_view", array( $this, 'screen_option_charts' ) );
360 }
361
362 public function add_plugin_add_new_submenu(){
363 $hook_charts = add_submenu_page(
364 $this->plugin_name,
365 __('Add New', 'chart-builder'),
366 __('Add New', 'chart-builder'),
367 'manage_options',
368 $this->plugin_name."&action=add",
369 array($this, 'display_plugin_addnew_page')
370 );
371 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
372 }
373
374 public function add_plugin_dashboard_submenu(){
375 $hook_charts = add_submenu_page(
376 $this->plugin_name,
377 __('How to use', 'chart-builder'),
378 __('How to use', 'chart-builder'),
379 'manage_options',
380 $this->plugin_name . '-dashboard',
381 array($this, 'display_plugin_setup_page')
382 );
383 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
384 }
385
386 public function add_plugin_general_settings_submenu(){
387 $hook_settings = add_submenu_page( $this->plugin_name,
388 __('General Settings', 'chart-builder'),
389 __('General Settings', 'chart-builder'),
390 'manage_options',
391 $this->plugin_name . '-settings',
392 array($this, 'display_plugin_settings_page')
393 );
394 add_action("load-$hook_settings", array($this, 'screen_option_settings'));
395 }
396
397 public function add_plugin_featured_plugins_submenu(){
398 $hook_our_products = add_submenu_page( $this->plugin_name,
399 __('Our products', 'chart-builder'),
400 __('Our products', 'chart-builder'),
401 'manage_options',
402 $this->plugin_name . '-featured-plugins',
403 array($this, 'display_plugin_featured_plugins_page')
404 );
405
406 add_action("load-$hook_our_products", array( $this, 'add_tabs' ));
407 }
408
409 public function add_plugin_chart_features_submenu(){
410 $hook_pro_features = add_submenu_page(
411 $this->plugin_name,
412 __('PRO Features', 'chart-builder'),
413 __('PRO Features', 'chart-builder'),
414 'manage_options',
415 $this->plugin_name . '-chart-features',
416 array($this, 'display_plugin_chart_features_page')
417 );
418
419 add_action("load-$hook_pro_features", array( $this, 'add_tabs' ));
420 }
421
422 public function screen_option_charts(){
423 $option = 'per_page';
424 $args = array(
425 'label' => __('Charts', "chart-builder"),
426 'default' => 5,
427 'option' => 'cb_charts_per_page'
428 );
429
430 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
431 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
432 add_screen_option( $option, $args );
433 }
434
435 $this->db_obj = new Chart_Builder_DB_Actions( $this->plugin_name );
436 }
437
438 public function screen_option_settings(){
439 $this->settings_obj = new Chart_Builder_Settings_DB_Actions( $this->plugin_name );
440 }
441
442 public function add_tabs() {
443 $screen = get_current_screen();
444
445 if ( ! $screen) {
446 return;
447 }
448 }
449
450 private function check_permissions_and_nonce($nonce_action) {
451 if (!is_user_logged_in() || !current_user_can('manage_options')) {
452 wp_die(__('Access denied.', 'chart-builder'));
453 }
454
455 if (!isset($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'], $this->plugin_name . '-' . $nonce_action)) {
456 wp_die(__('Security check failed. Invalid or missing nonce.', 'chart-builder'));
457 }
458 }
459 public function display_plugin_charts_page(){
460 global $ays_chart_db_actions;
461
462 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
463 $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '';
464 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
465 $id = (isset($_GET['id'])) ? absint( wp_unslash( $_GET['id'] ) ) : 0;
466 if (isset($_POST['bulk_delete_confirm'])) {
467 $this->check_permissions_and_nonce('bulk-delete');
468 if (isset($_POST['bulk-delete']) && !empty($_POST['bulk-delete'])) {
469 $ids = wp_unslash( $_POST['bulk-delete'] );
470 $ids = array_map( 'absint', (array) $ids );
471 foreach ($ids as $id) {
472 if ($id > 0) {
473 $this->db_obj->delete_item( $id );
474 }
475 }
476 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
477 $url = esc_url_raw( add_query_arg( array(
478 "status" => 'all-deleted'
479 ), $url ) );
480 wp_redirect( $url );
481 exit;
482 }
483 }
484
485 switch ($action) {
486 case 'trash':
487 $this->check_permissions_and_nonce('trash-item');
488 if ($id > 0){
489 $this->db_obj->trash_item( $id );
490 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
491 $url = esc_url_raw( add_query_arg( array(
492 "status" => 'trashed'
493 ), $url ) );
494 wp_redirect( $url );
495 exit;
496 }
497 break;
498 case 'restore':
499 $this->check_permissions_and_nonce('delete-item');
500 if ($id > 0 ) {
501 $this->db_obj->restore_item( $id );
502 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
503 $url = esc_url_raw( add_query_arg( array(
504 "status" => 'restored'
505 ), $url ) );
506 wp_redirect( $url );
507 exit;
508 }
509 break;
510 case 'delete':
511 $this->check_permissions_and_nonce('delete-item');
512 if ($id > 0) {
513 $this->db_obj->delete_item( $id );
514 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
515 $url = esc_url_raw( add_query_arg( array(
516 "status" => 'deleted'
517 ), $url ) );
518 wp_redirect( $url );
519 exit;
520 }
521 break;
522 case 'publish':
523 $this->check_permissions_and_nonce('publish-item');
524 if ($id > 0) {
525 $this->db_obj->publish_item( $id );
526 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
527 $url = esc_url_raw( add_query_arg( array(
528 "status" => 'published'
529 ), $url ) );
530 wp_redirect( $url );
531 exit;
532 }
533 break;
534 case 'unpublish':
535 $this->check_permissions_and_nonce('unpublish-item');
536 if ($id > 0) {
537 $this->db_obj->restore_item( $id );
538 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
539 $url = esc_url_raw( add_query_arg( array(
540 "status" => 'unpublished'
541 ), $url ) );
542 wp_redirect( $url );
543 exit;
544 }
545 break;
546 case 'duplicate':
547 $this->check_permissions_and_nonce('duplicate-item');
548 if ($id > 0) {
549 $this->db_obj->duplicate_item( $id );
550 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
551 $url = esc_url_raw( add_query_arg( array(
552 "status" => 'duplicated'
553 ), $url ) );
554 wp_redirect( $url );
555 exit;
556 }
557 break;
558 case 'add':
559 include_once('partials/charts/actions/chart-builder-charts-actions.php');
560 break;
561 case 'edit':
562 include_once('partials/charts/actions/chart-builder-charts-actions.php');
563 break;
564 default:
565 include_once('partials/charts/chart-builder-charts-display.php');
566 }
567 }
568 public static function chart_builder_svg_sanitize_allowed_properties(){
569
570 $allowed_properties = array(
571 'div' => array(
572 'id' => true,
573 'class' => true,
574 'style' => true,
575 ),
576 'svg' => array(
577 'class' => true,
578 'version' => true,
579 'overflow' => true,
580 'preserveAspectRatio' => true,
581 'preserveaspectratio' => true,
582 'fill' => true,
583 'viewBox' => true,
584 'viewbox' => true,
585 'height' => true,
586 'width' => true,
587 'xmlns' => true,
588 'xmlns:xlink' => true,
589 'id' => true,
590 'title' => true,
591 ),
592 'g' => array(
593 'id' => true,
594 'class' => true,
595 'stroke-width' => true,
596 'stroke-linecap' => true,
597 'stroke-linejoin' => true,
598 ),
599 'path' => array(
600 'id' => true,
601 'class' => true,
602 'd' => true,
603 'fill' => true,
604 'vector-effect' => true,
605 'xmlns:default' => true,
606 ),
607 'span' => array(
608 'class' => true,
609 ),
610 'img' => array(
611 'src' => true,
612 'alt' => true,
613 ),
614 );
615
616 return $allowed_properties;
617 }
618
619 public static function get_allowed_tags_for_loader() {
620 return array(
621 'span' => array('class' => array()),
622 'img' => array('src' => array(), 'alt' => array()),
623 );
624 }
625
626 public function display_plugin_setup_page(){
627 include_once('partials/chart-builder-admin-display.php');
628 }
629
630 public function display_plugin_addnew_page(){
631
632 // $url = remove_query_arg( array('action', 'id', '_wpnonce') );
633 // $url = esc_url_raw( add_query_arg( array(
634 // "action" => 'add'
635 // ), $url ) );
636 // wp_redirect( $url );
637 }
638
639 public function display_plugin_settings_page(){
640 include_once('partials/settings/chart-builder-settings.php');
641 }
642
643 public function display_plugin_featured_plugins_page(){
644 include_once('partials/features/chart-builder-plugin-featured-display.php');
645 }
646
647 public function display_plugin_chart_features_page(){
648 include_once('partials/features/chart-builder-features-display.php');
649 }
650
651 /**
652 * Add settings action link to the plugins page.
653 *
654 * @since 1.0.0
655 */
656 public function add_action_links( $links ){
657
658 $chart_ajax_deactivate_plugin_nonce = wp_create_nonce( 'chart-ajax-deactivate-plugin-nonce' );
659
660 /*
661 * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name)
662 */
663 $settings_link = array(
664 '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "chart-builder") . '</a>',
665 '<a href="https://ays-demo.com/chart-builder-demo/" target="_blank">' . __('Demo', "chart-builder") . '</a>',
666 // '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-plugins-page&utm_campaign=chart-buy-now" id="ays-chart-plugins-buy-now-button" target="_blank">' . __('Upgrade', "chart-builder") . '</a>',
667 '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-plugins-page&utm_campaign=chart-buy-now" id="ays-chart-plugins-buy-now-button" target="_blank">' . __('Upgrade 30% Sale', "chart-builder") . '</a>
668 <input type="hidden" id="chart_ajax_deactivate_plugin_nonce" name="chart_ajax_deactivate_plugin_nonce" value="' . $chart_ajax_deactivate_plugin_nonce .'">',
669 );
670 return array_merge( $settings_link, $links );
671
672 }
673
674
675 public static function set_screen($status, $option, $value){
676 return $value;
677 }
678
679 public function ays_admin_ajax(){
680 global $wpdb;
681
682 $response = array(
683 "status" => false
684 );
685 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
686 $function = isset( $_REQUEST['function'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['function'] ) ) : null;
687
688 if($function !== null){
689 $response = array();
690 if( is_callable( array( $this, $function ) ) ){
691 $allowed_functions = array(
692 "deactivate_plugin_option",
693 "ays_chart_dismiss_button",
694 "author_user_search",
695 "ays_chart_activate_plugin",
696 "ays_chart_install_plugin",
697 "fetch_quiz_maker_data",
698 "save_quiz_maker_data",
699 "fetch_post_type_props",
700 "fetch_post_type_data",
701 );
702 if (in_array($function, $allowed_functions, true)) {
703 $response = $this->$function();
704 }
705
706 ob_end_clean();
707 $ob_get_clean = ob_get_clean();
708 echo json_encode( $response );
709 wp_die();
710 }
711
712 }
713
714 ob_end_clean();
715 $ob_get_clean = ob_get_clean();
716 echo json_encode( $response );
717 wp_die();
718 }
719
720 public function deactivate_plugin_option(){
721 // Run a security check.
722 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
723 check_ajax_referer( 'chart-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
724 } else {
725 wp_die();
726 }
727
728 // Check for permissions.
729 if ( ! current_user_can( 'manage_options' ) ) {
730 ob_end_clean();
731 $ob_get_clean = ob_get_clean();
732 echo json_encode(array(
733 'option' => ''
734 ));
735 wp_die();
736 }
737
738 if( is_user_logged_in() ) {
739 $request_value = isset( $_REQUEST['upgrade_plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['upgrade_plugin'] ) ) : '';
740 $upgrade_option = get_option( 'ays_chart_builder_upgrade_plugin', '' );
741
742 if ( $upgrade_option === '' ) {
743 add_option( 'ays_chart_builder_upgrade_plugin', $request_value );
744 } else {
745 update_option( 'ays_chart_builder_upgrade_plugin', $request_value );
746 }
747
748 $response = array(
749 'option' => get_option( 'ays_chart_builder_upgrade_plugin', '' ),
750 );
751
752 wp_send_json_success( $response );
753 } else {
754 ob_end_clean();
755 $ob_get_clean = ob_get_clean();
756 echo json_encode(array(
757 'option' => ''
758 ));
759 wp_die();
760 }
761 }
762
763 public function chart_builder_admin_footer($a){
764 if(isset($_REQUEST['page'])){// phpcs:ignore WordPress.Security.NonceVerification.Recommended
765 if(false !== strpos( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ), $this->plugin_name)){// phpcs:ignore WordPress.Security.NonceVerification.Recommended
766 ?>
767 <div class="ays-chart-footer-support-box">
768 <span class="ays-chart-footer-link-row"><a href="https://wordpress.org/support/plugin/chart-builder" target="_blank"><?php echo esc_html__( "Support", "chart-builder"); ?></a></span>
769 <span class="ays-chart-footer-slash-row">/</span>
770 <span class="ays-chart-footer-link-row"><a href="https://ays-pro.com/wordpress-chart-builder-plugin-user-manual" target="_blank"><?php echo esc_html__( "Docs", "chart-builder"); ?></a></span>
771 <span class="ays-chart-footer-slash-row">/</span>
772 <span class="ays-chart-footer-link-row"><a href="https://ays-demo.com/chart-builder-plugin-suggestion-box" target="_blank"><?php echo esc_html__( "Suggest a Feature", "chart-builder"); ?></a></span>
773 </div>
774 <p style="font-size:13px;text-align:center;font-style:italic;">
775 <span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
776 <span><?php echo esc_html(__( "If you love our plugin, please do big favor and rate us on", "chart-builder")); ?></span>
777 <a target="_blank" href='https://wordpress.org/support/plugin/chart-builder/reviews/'>WordPress.org</a>
778 <span class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
779 </p>
780 <?php
781 }
782 }
783 }
784
785 // Chart Builder Elementor widget init
786 public function chart_builder_el_widgets_registered() {
787 // We check if the Elementor plugin has been installed / activated.
788 if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
789 // get our own widgets up and running:
790 // copied from widgets-manager.php
791 if ( class_exists( 'Elementor\Plugin' ) ) {
792 if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
793 $elementor = Elementor\Plugin::instance();
794 if ( isset( $elementor->widgets_manager ) ) {
795 if ( method_exists( $elementor->widgets_manager, 'register_widget_type' ) ) {
796 wp_enqueue_style($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
797 $widget_file = 'plugins/elementor/chart-builder-elementor.php';
798 $template_file = locate_template( $widget_file );
799 if ( !$template_file || !is_readable( $template_file ) ) {
800 $template_file = CHART_BUILDER_DIR . 'pb_templates/chart-builder-elementor.php';
801 }
802 if ( $template_file && is_readable( $template_file ) ) {
803 require_once $template_file;
804 Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor\Widget_Chart_Builder_Elementor() );
805 }
806 }
807 }
808 }
809 }
810 }
811 }
812
813 public function fetch_post_type_props(){
814 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
815 $nonce = isset( $_POST['nonce'] ) ? wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'cbuilder-fetch-post-type-props' ) : '';
816 if ( $nonce ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
817 $results = isset($_POST['post_type']) ? CBFunctions()->get_post_type_properties( sanitize_text_field( wp_unslash($_POST['post_type']) ) ) : '';
818
819 return array(
820 'success' => true,
821 'fields' => $results,
822 );
823 }
824
825 return array(
826 'success' => false,
827 );
828 }
829
830 public static function get_max_id( $table ) {
831 global $wpdb;
832 $db_table = $wpdb->prefix . CHART_BUILDER_DB_PREFIX . $table;
833
834 $sql = "SELECT MAX(id) FROM {$db_table}";
835
836 $result = intval( $wpdb->get_var( $sql ) );
837
838 return $result;
839 }
840
841 public static function ays_restriction_string($type, $x, $length){
842 $output = "";
843 switch($type){
844 case "char":
845 if(strlen($x)<=$length){
846 $output = $x;
847 } else {
848 $output = substr($x,0,$length) . '...';
849 }
850 break;
851 case "word":
852 $res = explode(" ", $x);
853 if(count($res)<=$length){
854 $output = implode(" ",$res);
855 } else {
856 $res = array_slice($res,0,$length);
857 $output = implode(" ",$res) . '...';
858 }
859 break;
860 }
861 return $output;
862 }
863
864 public function ays_chart_sale_banner(){
865 // if(isset($_POST['ays_chart_sale_btn']) && (isset( $_POST[CHART_BUILDER_NAME . '-sale-banner'] ) && wp_verify_nonce( $_POST[CHART_BUILDER_NAME . '-sale-banner'], CHART_BUILDER_NAME . '-sale-banner' )) && current_user_can( 'manage_options' )) {
866 // update_option('ays_chart_sale_btn', 1);
867 // update_option('ays_chart_sale_date', current_time( 'mysql' ));
868 // }
869
870 $ays_chart_sale_date = get_option('ays_chart_sale_date');
871
872 $val = 60*60*24*5;
873
874 $current_date = current_time( 'mysql' );
875 $date_diff = strtotime($current_date) - intval(strtotime($ays_chart_sale_date)) ;
876
877 $days_diff = $date_diff / $val;
878
879 if(intval($days_diff) > 0 ){
880 update_option('ays_chart_sale_btn', 0);
881 }
882
883 $ays_chart_builder_flag = intval(get_option('ays_chart_sale_btn'));
884 if( $ays_chart_builder_flag == 0 ){
885 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
886 if ( isset( $_GET['page'] ) && strpos( sanitize_text_field( wp_unslash( $_GET['page'] ) ), CHART_BUILDER_NAME ) !== false ) {
887 // if( !(Chart_Builder_Admin::get_max_id('charts') <= 2) ){
888 // $this->ays_chart_sale_message20($ays_chart_builder_flag);
889 // $this->ays_chart_discounted_licenses_banner_message();
890 // $this->ays_chart_new_silver_bundle_message_2025($ays_chart_builder_flag);
891 // $this->ays_chart_footer_sale_banner_2026($ays_chart_builder_flag);
892 // $this->ays_chart_helloween_message($ays_chart_builder_flag);
893 // $this->ays_chart_christmas_message($ays_chart_builder_flag);
894 // $this->ays_chart_silver_bundle_message($ays_chart_builder_flag);
895 // $this->ays_chart_black_friday_message_2024($ays_chart_builder_flag);
896 // $this->ays_chart_christmas_message_2024($ays_chart_builder_flag);
897 // $this->ays_chart_new_halloween_bundle_message_2025($ays_chart_builder_flag);
898 // $this->ays_chart_black_friday_message($ays_chart_builder_flag);
899 // $this->ays_chart_christmas_banner_message_2025($ays_chart_builder_flag);
900 $this->ays_chart_back_to_school_banner_2026($ays_chart_builder_flag);
901 // }
902 }
903 }
904 }
905
906 // Back to School top banner
907 public function ays_chart_back_to_school_banner_2026($ishmar){
908 if($ishmar == 0 ){
909 $content = array();
910 $chart_cta_button_link = esc_url('https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-builder-free&utm_campaign=back-to-school-sale-banner-' . CHART_BUILDER_VERSION);
911 $content[] = '<div id="ays-chart-back-to-school-banner-2026" class="ays-chart-back-to-school-banner-2026 ays-chart-admin-notice notice notice-success is-dismissible ays_chart_dicount_info">';
912 $content[] = '<svg class="ays-chart-bts-decoration ays-chart-bts-plane" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M22 2 11 13"></path><path d="M22 2 15 22l-4-9-9-4Z"></path></svg>';
913 $content[] = '<svg class="ays-chart-bts-decoration ays-chart-bts-ruler" viewBox="0 0 36 20" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><rect x="1" y="6" width="34" height="9" rx="2"></rect><path d="M8 6v3M14 6v4M20 6v3M26 6v4"></path></svg>';
914 $content[] = '<svg class="ays-chart-bts-decoration ays-chart-bts-star" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="m12 2 2.6 6.6L21.5 9l-5 4.6 1.4 7-5.9-3.5L6.1 20.6l1.4-7L2.5 9l6.9-.4Z"></path></svg>';
915 $content[] = '<svg class="ays-chart-bts-decoration ays-chart-bts-pencil" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg>';
916 $content[] = '<svg class="ays-chart-bts-decoration ays-chart-bts-wave" viewBox="0 0 96 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><path d="M2 8c8-8 16 8 24 0s16 8 24 0 16 8 24 0 16 8 20 2"></path></svg>';
917 $content[] = '<div class="ays-chart-bts-content">';
918 $content[] = '<div class="ays-chart-bts-offer">';
919 $content[] = '<img class="ays-chart-bts-handwritten" src="'. esc_url(CHART_BUILDER_ADMIN_URL . '/images/ays-chart-back-to-school-handwritten.svg') .'" alt="Back to School Sale">';
920 $content[] = '<span class="ays-chart-bts-dot" aria-hidden="true"></span>';
921 $content[] = '<span class="ays-chart-bts-discount">'. esc_html__('20% OFF', 'chart-builder') .'</span>';
922 $content[] = '</div>';
923 $content[] = '<div class="ays-chart-bts-actions">';
924 $content[] = '<span class="ays-chart-bts-use-code">'. esc_html__('Use code', 'chart-builder') .'</span>';
925 $content[] = '<button type="button" class="ays-chart-bts-coupon" data-coupon="SCHOOL20" aria-label="'. esc_attr__('Copy coupon code SCHOOL20', 'chart-builder') .'"><span>SCHOOL20</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button>';
926 $content[] = '<a href="'. esc_url($chart_cta_button_link) .'" class="ays-chart-bts-cta" target="_blank" rel="noopener noreferrer">'. esc_html__('Upgrade Now', 'chart-builder') .'</a>';
927 $content[] = '</div>';
928 $content[] = '</div>';
929 $content[] = '<div class="ays-chart-bts-dismiss"><form action="" method="POST"><div id="ays-chart-dismiss-buttons-content">';
930 if( current_user_can( 'manage_options' ) ){
931 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn">'. esc_html__('Dismiss ad', 'chart-builder') .'</button>';
932 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner', CHART_BUILDER_NAME . '-sale-banner', true, false );
933 }
934 $content[] = '</div></form></div>';
935 $content[] = '</div>';
936 $content[] = '<style id="ays-chart-back-to-school-banner-2026-inline-css">';
937 $content[] = '#ays-chart-back-to-school-banner-2026{box-sizing:border-box;position:relative;isolation:isolate;width:calc(100% - 20px);max-width:none;min-height:112px;margin:20px 20px 16px 0;padding:0 38px;overflow:hidden;border:1px solid #e8dcc9;border-left-width:1px;border-radius:12px;background-color:#fffdf8;background-image:radial-gradient(circle at 1px 1px,rgba(91,72,45,.09) 1px,transparent 1px),radial-gradient(120% 140% at 0 0,rgba(20,75,220,.07),transparent 55%),radial-gradient(120% 140% at 100% 100%,rgba(126,34,206,.09),transparent 55%);background-size:6px 6px,100% 100%,100% 100%;box-shadow:0 10px 30px -18px rgba(76,45,140,.55);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.ays-chart-bts-content{position:relative;z-index:2;display:flex;min-height:110px;align-items:center;justify-content:space-between;gap:28px}.ays-chart-bts-offer,.ays-chart-bts-actions{display:flex;align-items:center}.ays-chart-bts-offer{min-width:0;gap:9px}.ays-chart-bts-handwritten{width:280px;max-width:23vw;height:auto;color:#0755df;overflow:visible;flex:0 1 auto}.ays-chart-bts-dot{width:7px;height:7px;flex:0 0 auto;border-radius:50%;background:#ffc51b;align-self:flex-start;margin-top:27px}.ays-chart-bts-discount{color:#8127df;font-size:38px;font-weight:800;line-height:1;letter-spacing:-1.2px;white-space:nowrap}.ays-chart-bts-actions{flex:0 0 auto;gap:12px}.ays-chart-bts-use-code{color:#5f5b69;font-size:11px;font-weight:600;line-height:1;text-transform:uppercase;letter-spacing:.14em;white-space:nowrap}.ays-chart-bts-coupon{box-sizing:border-box;display:flex;min-height:50px;align-items:center;gap:12px;padding:8px 14px;border:2px dashed rgba(129,39,223,.5);border-radius:10px;background:#fff;color:#1147c8;cursor:pointer;box-shadow:none}.ays-chart-bts-coupon:hover,.ays-chart-bts-coupon:focus{border-color:#8127df;background:rgba(129,39,223,.05);color:#1147c8}.ays-chart-bts-coupon span{font-size:19px;font-weight:700;letter-spacing:.04em}.ays-chart-bts-coupon svg{width:16px;height:16px;color:#8127df}.ays-chart-bts-cta{display:inline-flex;min-height:48px;align-items:center;justify-content:center;padding:0 27px;border-radius:9px;background:linear-gradient(90deg,#1249e7,#8127df);color:#fff!important;font-size:16px;font-weight:700;text-decoration:none!important;white-space:nowrap;box-shadow:0 8px 18px -8px rgba(91,37,194,.9);transition:transform .15s,box-shadow .15s}.ays-chart-bts-cta:hover,.ays-chart-bts-cta:focus{color:#fff;transform:translateY(-1px);box-shadow:0 10px 20px -8px rgba(91,37,194,.95)}.ays-chart-bts-decoration{position:absolute;z-index:1;pointer-events:none}.ays-chart-bts-plane{top:8px;left:12px;width:24px;color:rgba(129,39,223,.55)}.ays-chart-bts-ruler{bottom:7px;left:24px;width:36px;color:rgba(20,73,230,.35)}.ays-chart-bts-star{top:8px;right:14px;width:19px;color:#ffc51b}.ays-chart-bts-pencil{right:31px;bottom:7px;width:21px;color:rgba(129,39,223,.5);transform:rotate(-12deg)}.ays-chart-bts-wave{bottom:3px;left:50%;width:96px;color:rgba(20,73,230,.22);transform:translateX(-50%)}#ays-chart-back-to-school-banner-2026 .notice-dismiss{top:1px;right:1px;color:#756b82}#ays-chart-back-to-school-banner-2026 .notice-dismiss:before{font-size:18px}.ays-chart-bts-dismiss{position:absolute;right:39px;bottom:0;z-index:3}.ays-chart-bts-dismiss form{margin:0}.ays-chart-bts-dismiss #ays-chart-dismiss-buttons-content .ays-button{height:22px!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;color:#777!important;font-size:10px!important;line-height:22px!important;text-decoration:underline;box-shadow:none!important}.ays-chart-bts-copy-notification{position:fixed;top:50%;left:50%;z-index:10000;transform:translate(-50%,-50%);padding:12px 24px;border-radius:8px;background:rgba(0,0,0,.82);color:#fff;font-size:14px;opacity:0;transition:opacity .25s}.ays-chart-bts-copy-notification.ays-chart-bts-show{opacity:1}@media screen and (max-width:1200px){.ays-chart-bts-content{gap:18px}.ays-chart-bts-handwritten{width:225px}.ays-chart-bts-discount{font-size:31px}.ays-chart-bts-actions{gap:8px}.ays-chart-bts-coupon{min-height:44px;padding:7px 10px}.ays-chart-bts-cta{min-height:44px;padding:0 18px;font-size:14px}}@media screen and (max-width:960px){#ays-chart-back-to-school-banner-2026{padding:15px 38px 20px}.ays-chart-bts-content{min-height:90px;flex-wrap:wrap;justify-content:center;gap:12px 24px}.ays-chart-bts-handwritten{max-width:none}.ays-chart-bts-actions{justify-content:center}.ays-chart-bts-dismiss{right:38px}}@media screen and (max-width:600px){#ays-chart-back-to-school-banner-2026{width:calc(100% - 20px);margin-right:10px;padding:18px 30px 23px 18px}.ays-chart-bts-content{flex-direction:column}.ays-chart-bts-offer{flex-wrap:wrap;justify-content:center}.ays-chart-bts-handwritten{width:210px}.ays-chart-bts-discount{font-size:28px}.ays-chart-bts-actions{flex-wrap:wrap}.ays-chart-bts-use-code{width:100%;text-align:center}.ays-chart-bts-coupon{min-height:40px}.ays-chart-bts-coupon span{font-size:16px}.ays-chart-bts-cta{min-height:40px}.ays-chart-bts-plane,.ays-chart-bts-ruler,.ays-chart-bts-pencil,.ays-chart-bts-wave{display:none}.ays-chart-bts-dismiss{right:30px}}';
938 $content[] = '</style>';
939 $content[] = '<script>
940 (function() {
941 "use strict";
942 function initBackToSchoolBanner() {
943 var banner = document.getElementById("ays-chart-back-to-school-banner-2026");
944 if (!banner) {
945 return;
946 }
947 var couponButton = banner.querySelector(".ays-chart-bts-coupon");
948 if (!couponButton) {
949 return;
950 }
951 couponButton.addEventListener("click", function() {
952 var couponCode = couponButton.getAttribute("data-coupon");
953 var textarea = document.createElement("textarea");
954 textarea.value = couponCode;
955 textarea.style.position = "fixed";
956 textarea.style.opacity = "0";
957 document.body.appendChild(textarea);
958 textarea.focus();
959 textarea.select();
960 try {
961 document.execCommand("copy");
962 showCopyNotification();
963 } catch (error) {
964 // Keep the banner usable when clipboard access is unavailable.
965 }
966 document.body.removeChild(textarea);
967 });
968 }
969 function showCopyNotification() {
970 var notification = document.createElement("div");
971 notification.className = "ays-chart-bts-copy-notification";
972 notification.textContent = "'. esc_js(__('Coupon code copied', 'chart-builder')) .'";
973 document.body.appendChild(notification);
974 setTimeout(function() {
975 notification.classList.add("ays-chart-bts-show");
976 }, 10);
977 setTimeout(function() {
978 notification.classList.remove("ays-chart-bts-show");
979 setTimeout(function() {
980 if (notification.parentNode) {
981 notification.parentNode.removeChild(notification);
982 }
983 }, 250);
984 }, 2000);
985 }
986 if (document.readyState === "loading") {
987 document.addEventListener("DOMContentLoaded", initBackToSchoolBanner);
988 } else {
989 initBackToSchoolBanner();
990 }
991 })();
992 </script>';
993 echo implode('', $content); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Static banner markup; dynamic values are escaped above.
994 }
995 }
996
997
998 public function ays_chart_footer_sale_banner_2026($ishmar){
999 if($ishmar == 0 ){
1000 $content = array();
1001
1002 $chart_cta_button_link = esc_url('https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-builder-free&utm_campaign=private-offer-20-off-' . CHART_BUILDER_VERSION);
1003
1004 $content[] = '
1005 <div class="ays-chart-footer-banner-bottom-banner-wrapper" style="display: none;">
1006 <div class="ays-chart-footer-banner-bottom-banner-container">
1007 <div class="ays-chart-footer-banner-bottom-banner-content">
1008 <div class="ays-chart-footer-banner-bottom-banner-inner">
1009 <div class="ays-chart-footer-banner-bottom-banner-left">
1010 <div class="ays-chart-footer-banner-bottom-banner-icon">
1011 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
1012 <path d="M12 7v14"></path>
1013 <path d="M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8"></path>
1014 <path d="M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5"></path>
1015 <rect x="3" y="7" width="18" height="4" rx="1"></rect>
1016 </svg>
1017 </div>
1018 <span class="ays-chart-footer-banner-bottom-banner-title">'. esc_html__('Chart Builder by AYS', 'ays-chart-builder') .'</span>
1019 </div>
1020 <span class="ays-chart-footer-banner-bottom-banner-separator"></span>
1021 <span class="ays-chart-footer-banner-bottom-banner-discount">'. esc_html__('20% Off', 'ays-chart-builder') .'</span>
1022 <div class="ays-chart-footer-banner-bottom-banner-code" onclick="aysChartFooterBannerCopyToClipboard()" title="'. esc_html__('Copy Coupon Code', 'ays-chart-builder') .'">
1023 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
1024 <path d="M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"></path>
1025 <path d="M13 5v2"></path>
1026 <path d="M13 17v2"></path>
1027 <path d="M13 11v2"></path>
1028 </svg>
1029 <span>CHARTPRO20</span>
1030 <button type="button" class="ays-chart-footer-banner-bottom-banner-copy" aria-label="'. esc_html__('Copy Coupon Code', 'ays-chart-builder') .'">
1031 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
1032 <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
1033 <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
1034 </svg>
1035 </button>
1036 </div>
1037 <button type="button" class="ays-chart-footer-banner-bottom-banner-cta">
1038 '. esc_html__('Get Deal', 'ays-chart-builder') .'
1039 </button>
1040 <button type="button" class="ays-chart-footer-banner-bottom-banner-close" aria-label="'. esc_html__('Close popup', 'ays-chart-builder') .'">
1041 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
1042 <path d="M18 6 6 18"></path>
1043 <path d="m6 6 12 12"></path>
1044 </svg>
1045 </button>
1046 </div>
1047 </div>
1048 </div>
1049 </div>';
1050
1051 $content[] = '<style id="ays-chart-footer-banner-styles-inline-css">';
1052
1053 $content[] = '@keyframes ays-pro-slide-up{0%{opacity:0;transform:translateY(24px)}100%{opacity:1;transform:translateY(0)}}@keyframes ays-pro-slide-down{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(24px)}}.ays-chart-footer-banner-bottom-banner-wrapper{position:fixed;bottom:0;left:0;right:0;z-index:9999;padding:0 16px 28px;text-align:center;animation:.45s cubic-bezier(.16,1,.3,1) forwards ays-pro-slide-up}.ays-chart-footer-banner-bottom-banner-wrapper.ays-pro-banner-closing{animation:.32s cubic-bezier(.16,1,.3,1) forwards ays-pro-slide-down}.ays-chart-footer-banner-bottom-banner-container{display:inline-block;max-width:100%;border-radius:16px;background:linear-gradient(90deg,#2f6bff 0,#3e7bff 100%);box-shadow:0 20px 40px -15px rgba(47,107,255,.55),0 8px 20px -10px rgba(47,107,255,.35);overflow:hidden}.ays-chart-footer-banner-bottom-banner-code,.ays-chart-footer-banner-bottom-banner-content,.ays-chart-footer-banner-bottom-banner-inner,.ays-chart-footer-banner-bottom-banner-left{display:flex;align-items:center}.ays-chart-footer-banner-bottom-banner-inner{gap:16px;padding:8px 14px 8px 10px;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}.ays-chart-footer-banner-bottom-banner-left{gap:14px}.ays-chart-footer-banner-bottom-banner-icon{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:48px;height:48px;border-radius:50%;background:rgba(255,255,255,.15);color:#fff}.ays-chart-footer-banner-bottom-banner-icon svg{width:24px;height:24px}.ays-chart-footer-banner-bottom-banner-discount,.ays-chart-footer-banner-bottom-banner-title{font-size:17px;font-weight:600;line-height:1.25;letter-spacing:0;white-space:nowrap;color:#fff}.ays-chart-footer-banner-bottom-banner-separator{display:block;width:1px;height:24px;background:rgba(255,255,255,.4)}.ays-chart-footer-banner-bottom-banner-code{gap:6px;border:1px dashed rgba(255,255,255,.7);border-radius:999px;padding:6px 9px;color:#fff;cursor:pointer;transition:background-color .15s,border-color .15s;display:flex;align-items:center}.ays-chart-footer-banner-bottom-banner-code:hover{background:rgba(255,255,255,.1);border-color:#fff}.ays-chart-footer-banner-bottom-banner-code button svg,.ays-chart-footer-banner-bottom-banner-code>svg{width:16px;height:16px}.ays-chart-footer-banner-bottom-banner-code span{font-size:14px;font-weight:600;line-height:1;letter-spacing:.05em;color:#fff}.ays-chart-footer-banner-bottom-banner-close{display:flex;align-items:center;justify-content:center;margin:0;padding:0;background:none;border:none;color:#fff;cursor:pointer;transition:opacity .15s}.ays-chart-footer-banner-bottom-banner-close:hover{opacity:.8}.ays-chart-footer-banner-bottom-banner-copy{display:flex;align-items:center;justify-content:center;margin:0;padding:0;background:none;border:none;color:#fff;cursor:pointer;transition:opacity .15s}.ays-chart-footer-banner-bottom-banner-copy:hover{opacity:.8}.ays-chart-footer-banner-bottom-banner-cta{display:flex;align-items:center;justify-content:center;padding:8px 16px;background:#fff;color:#2f6bff;border:none;border-radius:6px;font-weight:600;font-size:14px;cursor:pointer;transition:all .15s;margin-left:12px}.ays-chart-footer-banner-bottom-banner-cta:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(47,107,255,.3)}';
1054 $content[] = '</style>';
1055
1056 $content[] = '<style id="ays-chart-footer-banner-notification-css">';
1057 $content[] = '.ays-chart-footer-banner-copy-notification{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.9);color:#fff;padding:12px 24px;border-radius:8px;font-size:14px;z-index:10001;opacity:0;transition:opacity .3s ease;pointer-events:none}.ays-chart-footer-banner-copy-notification.show{opacity:1}';
1058 $content[] = '</style>';
1059
1060 $content[] = '<script>';
1061
1062 $content[] = "
1063 /**
1064 * Footer Banner JavaScript - ES5 Compatible
1065 * With delayed popup and visit tracking
1066 */
1067
1068 (function() {
1069 'use strict';
1070
1071 // Configuration
1072 var STORAGE_KEY = 'ays_chart_footer_banner_data';
1073 var POPUP_RULES = [
1074 { visit: 1, delay: 10000 }, // 1st visit: 10 seconds
1075 { visit: 2, delay: 10000 }, // 2nd visit: 10 seconds
1076 { visit: 3, delay: 15000 }, // 3th visit: 15 seconds
1077 { visit: 4, delay: 15000 }, // 4th visit: 15 seconds
1078 { visit: 5, delay: 20000 }, // 5th visit: 20 seconds
1079 { visit: 7, delay: 20000 }, // 7th visit: 20 seconds
1080 { visit: 10, delay: 30000 } // 10th visit: 30 seconds
1081 ];
1082 var MAX_SHOWS_PER_DAY = 7;
1083
1084 // Wait for DOM to be ready
1085 if (document.readyState === 'loading') {
1086 document.addEventListener('DOMContentLoaded', initBanner);
1087 } else {
1088 initBanner();
1089 }
1090
1091 function initBanner() {
1092 var banner = document.querySelector('.ays-chart-footer-banner-bottom-banner-wrapper');
1093 var closeButton = document.querySelector('.ays-chart-footer-banner-bottom-banner-close');
1094 var ctaButton = document.querySelector('.ays-chart-footer-banner-bottom-banner-cta');
1095
1096 if (!banner) {
1097 return;
1098 }
1099
1100 // Hide banner initially
1101 banner.style.display = 'none';
1102
1103 // Get or initialize banner data
1104 var bannerData = getBannerData();
1105
1106 // Check if we need to reset daily data
1107 if (shouldResetData(bannerData.lastResetDate)) {
1108 bannerData = resetDailyData();
1109 }
1110
1111 // Increment visit count
1112 bannerData.visitCount++;
1113 saveBannerData(bannerData);
1114
1115 // Check if banner should be shown
1116 var shouldShow = shouldShowBanner(bannerData);
1117
1118 if (shouldShow.show) {
1119 // Show banner after delay
1120 setTimeout(function() {
1121 banner.style.display = 'block';
1122
1123 // Increment show count
1124 bannerData.showCount++;
1125 saveBannerData(bannerData);
1126 }, shouldShow.delay);
1127 }
1128
1129 // Close button handler
1130 if (closeButton) {
1131 closeButton.addEventListener('click', function() {
1132 closeBanner(banner);
1133 });
1134 }
1135
1136 // CTA button handler
1137 if (ctaButton) {
1138 ctaButton.addEventListener('click', function() {
1139 window.open('https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-builder-free&utm_campaign=private-offer-20-off-". CHART_BUILDER_VERSION ."', '_blank');
1140 // Optionally close banner after click
1141 closeBanner(banner);
1142 });
1143 }
1144 }
1145
1146 /**
1147 * Get banner data from localStorage
1148 */
1149 function getBannerData() {
1150 try {
1151 var data = localStorage.getItem(STORAGE_KEY);
1152 if (data) {
1153 return JSON.parse(data);
1154 }
1155 } catch (e) {
1156 // localStorage not available or parsing error
1157 }
1158
1159 // Return default data
1160 return {
1161 visitCount: 0,
1162 showCount: 0,
1163 lastResetDate: getTodayDate()
1164 };
1165 }
1166
1167 /**
1168 * Save banner data to localStorage
1169 */
1170 function saveBannerData(data) {
1171 try {
1172 localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
1173 } catch (e) {
1174 // localStorage not available
1175 }
1176 }
1177
1178 /**
1179 * Check if data should be reset (new day)
1180 */
1181 function shouldResetData(lastResetDate) {
1182 var today = getTodayDate();
1183 return lastResetDate !== today;
1184 }
1185
1186 /**
1187 * Reset daily data
1188 */
1189 function resetDailyData() {
1190 var newData = {
1191 visitCount: 0,
1192 showCount: 0,
1193 lastResetDate: getTodayDate()
1194 };
1195 saveBannerData(newData);
1196 return newData;
1197 }
1198
1199 /**
1200 * Get today's date as string (YYYY-MM-DD)
1201 */
1202 function getTodayDate() {
1203 var date = new Date();
1204 var year = date.getFullYear();
1205 var month = String(date.getMonth() + 1).padStart(2, '0');
1206 var day = String(date.getDate()).padStart(2, '0');
1207 return year + '-' + month + '-' + day;
1208 }
1209
1210 /**
1211 * Check if banner should be shown based on rules
1212 */
1213 function shouldShowBanner(bannerData) {
1214 // Check if already shown max times today
1215 if (bannerData.showCount >= MAX_SHOWS_PER_DAY) {
1216 return { show: false, delay: 0 };
1217 }
1218
1219 // Check visit count against rules
1220 for (var i = 0; i < POPUP_RULES.length; i++) {
1221 var rule = POPUP_RULES[i];
1222 if (bannerData.visitCount === rule.visit) {
1223 return { show: true, delay: rule.delay };
1224 }
1225 }
1226
1227 return { show: false, delay: 0 };
1228 }
1229
1230 /**
1231 * Close banner with animation
1232 */
1233 function closeBanner(banner) {
1234 if (!banner) {
1235 return;
1236 }
1237
1238 // Add closing animation class
1239 banner.classList.add('ays-pro-banner-closing');
1240
1241 // Wait for animation to complete
1242 setTimeout(function() {
1243 banner.style.display = 'none';
1244 }, 400);
1245 }
1246
1247 // Polyfill for String.padStart (for older browsers)
1248 if (!String.prototype.padStart) {
1249 String.prototype.padStart = function(targetLength, padString) {
1250 targetLength = targetLength >> 0;
1251 padString = String(typeof padString !== 'undefined' ? padString : ' ');
1252 if (this.length >= targetLength) {
1253 return String(this);
1254 } else {
1255 targetLength = targetLength - this.length;
1256 if (targetLength > padString.length) {
1257 padString += padString.repeat(targetLength / padString.length);
1258 }
1259 return padString.slice(0, targetLength) + String(this);
1260 }
1261 };
1262 }
1263 })();
1264
1265 function aysChartFooterBannerCopyToClipboard() {
1266 var textarea = document.createElement('textarea');
1267 textarea.value = 'CHARTPRO20';
1268 textarea.style.position = 'fixed';
1269 textarea.style.opacity = '0';
1270 document.body.appendChild(textarea);
1271
1272 textarea.select();
1273 textarea.setSelectionRange(0, 99999);
1274
1275 try {
1276 document.execCommand('copy');
1277 aysChartFooterBannerShowCopyNotification('". esc_html__('Coupon code copied', 'ays-chart-builder') ."');
1278 } catch (err) {
1279 console.error('Failed to copy text: ', err);
1280 }
1281
1282 document.body.removeChild(textarea);
1283 }
1284
1285 function aysChartFooterBannerShowCopyNotification(message) {
1286 var existingNotification = document.querySelector('.ays-chart-footer-banner-copy-notification');
1287 if (existingNotification) {
1288 document.body.removeChild(existingNotification);
1289 }
1290
1291 var notification = document.createElement('div');
1292 notification.className = 'ays-chart-footer-banner-copy-notification';
1293 notification.textContent = message;
1294 document.body.appendChild(notification);
1295
1296 setTimeout(function() {
1297 notification.classList.add('show');
1298 }, 10);
1299
1300 setTimeout(function() {
1301 notification.classList.remove('show');
1302 setTimeout(function() {
1303 if (notification.parentNode) {
1304 document.body.removeChild(notification);
1305 }
1306 }, 300);
1307 }, 2000);
1308 }";
1309
1310 $content[] = '</script>';
1311
1312 $content = implode( '', $content );
1313 echo ($content);
1314 }
1315 }
1316 public function ays_chart_dismiss_button(){
1317
1318 $data = array(
1319 'status' => false,
1320 );
1321
1322 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_chart_dismiss_button') {
1323 if ( isset( $_REQUEST['_ajax_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_ajax_nonce'] ) ), $this->plugin_name . '-sale-banner' ) && current_user_can( 'manage_options' ) ) {
1324 update_option('ays_chart_sale_btn', 1);
1325 update_option('ays_chart_sale_date', current_time( 'mysql' ));
1326 $data['status'] = true;
1327 }
1328 }
1329
1330 ob_end_clean();
1331 $ob_get_clean = ob_get_clean();
1332 echo json_encode($data);
1333 wp_die();
1334
1335 }
1336
1337 public function ays_chart_discounted_licenses_banner_message(){
1338
1339 $content = array();
1340
1341 $date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1342 $now_date = date('M d, Y H:i:s', $date);
1343
1344 $start_date = strtotime('2025-09-24');
1345 $end_date = strtotime('2025-10-25');
1346 $diff_end = $end_date - $date;
1347
1348 $style_attr = '';
1349 if( $diff_end < 0 ){
1350 $style_attr = 'style="display:none;"';
1351 }
1352
1353 $total_licenses = 50;
1354 $progression_pattern = array(3, 2, 1, 4, 2, 3, 1, 2, 4, 3, 2, 1, 3, 2, 4, 1, 3, 2, 2, 3, 1, 2);
1355 $days_passed = floor(($date - $start_date) / (24 * 60 * 60));
1356 $used_licenses = 0;
1357
1358 for ($i = 0; $i < min($days_passed, count($progression_pattern)); $i++) {
1359 $used_licenses += $progression_pattern[$i];
1360 }
1361 $used_licenses = min($used_licenses, $total_licenses);
1362 $remaining_licenses = $total_licenses - $used_licenses;
1363 $progress_percentage = ($used_licenses / $total_licenses) * 100;
1364
1365 $ays_chart_cta_button_link = esc_url('https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=chart-maker-license-banner-' . CHART_BUILDER_VERSION);
1366
1367 $content[] = '<div id="ays-chart-progress-banner-main" class="ays-chart-progress-banner-main ays-chart-admin-notice notice notice-success is-dismissible" ' . $style_attr . '>';
1368 $content[] = '<div class="ays-chart-progress-banner-content">';
1369 $content[] = '<div class="ays-chart-progress-banner-left">';
1370 $content[] = '<div class="ays-chart-progress-banner-icon">';
1371 $content[] = '<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
1372 <path d="M1.33325 22.6668L11.9999 13.3335L33.3333 14.6668L34.6666 36.0002L25.3333 46.6668C25.3333 46.6668 25.3346 38.6682 17.3333 30.6668C9.33192 22.6655 1.33325 22.6668 1.33325 22.6668Z" fill="#A0041E"/>
1373 <path d="M1.29739 46.6665C1.29739 46.6665 1.24939 36.0278 5.27739 31.9998C9.30539 27.9718 20.0001 28.2492 20.0001 28.2492C20.0001 28.2492 19.9987 38.6665 15.9987 42.6665C11.9987 46.6665 1.29739 46.6665 1.29739 46.6665Z" fill="#FFAC33"/>
1374 <path d="M11.9986 41.3332C14.9441 41.3332 17.3319 38.9454 17.3319 35.9998C17.3319 33.0543 14.9441 30.6665 11.9986 30.6665C9.0531 30.6665 6.66528 33.0543 6.66528 35.9998C6.66528 38.9454 9.0531 41.3332 11.9986 41.3332Z" fill="#FFCC4D"/>
1375 <path d="M47.9986 0C47.9986 0 34.6653 0 18.6653 13.3333C10.6653 20 10.6653 32 13.3319 34.6667C15.9986 37.3333 27.9986 37.3333 34.6653 29.3333C47.9986 13.3333 47.9986 0 47.9986 0Z" fill="#55ACEE"/>
1376 <path d="M35.9987 6.6665C33.8347 6.6665 31.9814 7.96117 31.144 9.81317C31.8134 9.5105 32.5507 9.33317 33.332 9.33317C36.2774 9.33317 38.6654 11.7212 38.6654 14.6665C38.6654 15.4478 38.488 16.1852 38.1867 16.8532C40.0387 16.0172 41.332 14.1638 41.332 11.9998C41.332 9.0545 38.944 6.6665 35.9987 6.6665Z" fill="black"/>
1377 <path d="M10.6667 37.3332C10.6667 37.3332 10.6667 31.9998 12.0001 30.6665C13.3334 29.3332 29.3347 16.0012 30.6667 17.3332C31.9987 18.6652 18.6654 34.6665 17.3321 35.9998C15.9987 37.3332 10.6667 37.3332 10.6667 37.3332Z" fill="#A0041E"/>
1378 </svg>';
1379 $content[] = '</div>';
1380 $content[] = '<div class="ays-chart-progress-banner-text">';
1381 $content[] = '<h2 class="ays-chart-progress-banner-title">' . sprintf( __('Get the Pro Version of %s Chart Builder%s – 20%% OFF', 'chart-builder'), '<a href="'. $ays_chart_cta_button_link .'" target="_blank">', '</a>' ) . '</h2>';
1382 $content[] = '<p class="ays-chart-progress-banner-subtitle">' . __('Unlock advanced features + 30 day Money Back Guarantee', 'chart-builder') . '</p>';
1383 $content[] = '</div>';
1384 $content[] = '</div>';
1385
1386 $content[] = '<div class="ays-chart-progress-banner-center">';
1387 $content[] = '<div class="ays-chart-progress-banner-coupon">';
1388 $content[] = '<div class="ays-chart-progress-banner-coupon-box" onclick="chartCopyToClipboard(\'FREE2PRO20\')" title="' . __('Click to copy', 'chart-builder') . '">';
1389 $content[] = '<span class="ays-chart-progress-banner-coupon-text">FREE2PRO20</span>';
1390 $content[] = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-chart-progress-banner-copy-icon">';
1391 $content[] = '<path d="M13.5 2.5H6.5C5.67 2.5 5 3.17 5 4V10C5 10.83 5.67 11.5 6.5 11.5H13.5C14.33 11.5 15 10.83 15 10V4C15 3.17 14.33 2.5 13.5 2.5ZM13.5 10H6.5V4H13.5V10ZM2.5 6.5V12.5C2.5 13.33 3.17 14 4 14H10V12.5H4V6.5H2.5Z" fill="white"/>';
1392 $content[] = '</svg>';
1393 $content[] = '</div>';
1394 $content[] = '</div>';
1395
1396 $content[] = '<div class="ays-chart-progress-banner-progress">';
1397 $content[] = '<p class="ays-chart-progress-banner-progress-text">' . __('Only', 'chart-builder') . ' <span id="remaining-licenses">' . $remaining_licenses . '</span> ' . __('of 50 discounted licenses left', 'chart-builder') . '</p>';
1398 $content[] = '<div class="ays-chart-progress-banner-progress-bar">';
1399 $content[] = '<div class="ays-chart-progress-banner-progress-fill" id="progress-fill" style="width: ' . $progress_percentage . '%;"></div>';
1400 $content[] = '</div>';
1401 $content[] = '</div>';
1402 $content[] = '</div>';
1403
1404 $content[] = '<div class="ays-chart-progress-banner-right">';
1405 $content[] = '<a href="'. $ays_chart_cta_button_link .'" class="ays-chart-progress-banner-upgrade" target="_blank">';
1406 $content[] = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">';
1407 $content[] = '<path d="M14.6392 6.956C14.5743 6.78222 14.4081 6.66667 14.2223 6.66667H8.85565L11.9512 0.648C12.0485 0.458667 11.9983 0.227111 11.8308 0.0955556C11.7499 0.0315556 11.6525 0 11.5556 0C11.4521 0 11.3485 0.0364444 11.2654 0.108L8.00009 2.928L1.48765 8.55244C1.3472 8.67378 1.29653 8.86978 1.36142 9.04356C1.42631 9.21733 1.59209 9.33333 1.77787 9.33333H7.14454L4.04898 15.352C3.95165 15.5413 4.00187 15.7729 4.16942 15.9044C4.25031 15.9684 4.34765 16 4.44453 16C4.54809 16 4.65165 15.9636 4.73476 15.892L8.00009 13.072L14.5125 7.44756C14.6534 7.32622 14.7036 7.13022 14.6392 6.956Z" fill="white"/>';
1408 $content[] = '</svg>';
1409 $content[] = ' ' . __('Upgrade Now', 'chart-builder');
1410 $content[] = '</a>';
1411 $content[] = '</div>';
1412 $content[] = '</div>';
1413
1414 if( current_user_can( 'manage_options' ) ){
1415 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1416 $content[] = '<form action="" method="POST" style="position: absolute; bottom: 0; right: 0; color: #fff;">';
1417 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="color: darkgrey; font-size: 11px;">'. __( "Dismiss ad", 'chart-builder' ) .'</button>';
1418 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1419 $content[] = '</form>';
1420 $content[] = '</div>';
1421 }
1422 $content[] = '</div>';
1423
1424 // Fox LMS Pro Banner Styles
1425 $content[] = '<style id="ays-chart-progress-banner-styles-inline-css">';
1426 $content[] = '
1427 .ays-chart-progress-banner-main {
1428 background: linear-gradient(135deg, #6344ED 0%, #8C2ABE 100%);
1429 padding: 20px 30px;
1430 border-radius: 16px;
1431 color: white;
1432 position: relative;
1433 margin: 20px 0;
1434 box-shadow: 0 8px 32px rgba(99, 68, 237, 0.3);
1435 border: 0;
1436 }
1437
1438 .ays-chart-progress-banner-main .ays-chart-progress-banner-content {
1439 display: flex;
1440 align-items: center;
1441 justify-content: space-between;
1442 gap: 30px;
1443 }
1444
1445 .ays-chart-progress-banner-main .ays-chart-progress-banner-left {
1446 display: flex;
1447 align-items: center;
1448 gap: 20px;
1449 flex: 1;
1450 }
1451
1452 .ays-chart-progress-banner-main .ays-chart-progress-banner-center {
1453 display: flex;
1454 align-items: center;
1455 gap: 15px;
1456 flex: 1;
1457 }
1458
1459 .ays-chart-progress-banner-main .ays-chart-progress-banner-right {
1460 display: flex;
1461 align-items: center;
1462 gap: 20px;
1463 flex-shrink: 0;
1464 }
1465
1466 .ays-chart-progress-banner-main .ays-chart-progress-banner-icon {
1467 font-size: 32px;
1468 filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
1469 }
1470
1471 .ays-chart-progress-banner-main .ays-chart-progress-banner-title {
1472 font-size: 21px;
1473 font-weight: 700;
1474 margin: 0 0 8px 0;
1475 line-height: 1.2;
1476 color: #fff;
1477 }
1478
1479 .ays-chart-progress-banner-main .ays-chart-progress-banner-title a {
1480 text-decoration: underline;
1481 color: #fff;
1482 }
1483
1484 .ays-chart-progress-banner-main .ays-chart-progress-banner-subtitle {
1485 font-size: 16px;
1486 margin: 0;
1487 opacity: 0.9;
1488 font-weight: 400;
1489 }
1490
1491 .ays-chart-progress-banner-main .ays-chart-progress-banner-coupon {
1492 margin-bottom: 5px;
1493 }
1494
1495 .ays-chart-progress-banner-main .ays-chart-progress-banner-coupon-box {
1496 border: 2px dotted rgba(255, 255, 255, 0.6);
1497 padding: 8px 16px;
1498 border-radius: 8px;
1499 background: rgba(255, 255, 255, 0.1);
1500 cursor: pointer;
1501 transition: all 0.3s ease;
1502 display: flex;
1503 align-items: center;
1504 gap: 8px;
1505 backdrop-filter: blur(10px);
1506 }
1507
1508 .ays-chart-progress-banner-main .ays-chart-progress-banner-coupon-box:hover {
1509 background: rgba(255, 255, 255, 0.2);
1510 border-color: rgba(255, 255, 255, 0.8);
1511 transform: translateY(-1px);
1512 }
1513
1514 .ays-chart-progress-banner-main .ays-chart-progress-banner-coupon-text {
1515 font-size: 16px;
1516 font-weight: 700;
1517 letter-spacing: 1px;
1518 color: #fff;
1519 font-family: monospace;
1520 }
1521
1522 .ays-chart-progress-banner-main .ays-chart-progress-banner-copy-icon {
1523 opacity: 0.8;
1524 transition: opacity 0.3s ease;
1525 }
1526
1527 .ays-chart-progress-banner-main .ays-chart-progress-banner-coupon-box:hover .ays-chart-progress-banner-copy-icon {
1528 opacity: 1;
1529 }
1530
1531 .ays-chart-progress-banner-main .ays-chart-progress-banner-progress {
1532 text-align: center;
1533 width: 100%;
1534 }
1535
1536 .ays-chart-progress-banner-main .ays-chart-progress-banner-progress-text {
1537 font-size: 14px;
1538 margin: 0 0 10px 0;
1539 opacity: 0.9;
1540 }
1541
1542 .ays-chart-progress-banner-main .ays-chart-progress-banner-progress-bar {
1543 width: 300px;
1544 height: 10px;
1545 background: rgba(255, 255, 255, 0.2);
1546 border-radius: 4px;
1547 overflow: hidden;
1548 margin: 0 auto;
1549 }
1550
1551 .ays-chart-progress-banner-main .ays-chart-progress-banner-progress-fill {
1552 height: 100%;
1553 background: linear-gradient(90deg, #4ADE80 0%, #22C55E 100%);
1554 border-radius: 4px;
1555 transition: width 0.8s ease;
1556 width: 70%;
1557 }
1558
1559 .ays-chart-progress-banner-main .ays-chart-progress-banner-upgrade {
1560 background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
1561 color: white;
1562 border: none;
1563 padding: 12px 24px;
1564 border-radius: 8px;
1565 font-size: 16px;
1566 font-weight: 600;
1567 cursor: pointer;
1568 transition: all 0.3s ease;
1569 box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
1570 text-decoration: none;
1571 display: inline-flex;
1572 align-items: center;
1573 gap: 8px;
1574 }
1575
1576 .ays-chart-progress-banner-main .ays-chart-progress-banner-upgrade:hover {
1577 transform: translateY(-2px);
1578 box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
1579 text-decoration: none;
1580 color: white;
1581 }
1582
1583 .ays-chart-progress-banner-main .notice-dismiss:before {
1584 color: #fff;
1585 }
1586
1587 /* Copy notification */
1588 .ays-chart-copy-notification {
1589 position: fixed;
1590 top: 50%;
1591 left: 50%;
1592 transform: translate(-50%, -50%);
1593 background: rgba(0, 0, 0, 0.8);
1594 color: white;
1595 padding: 12px 24px;
1596 border-radius: 8px;
1597 font-size: 14px;
1598 z-index: 10000;
1599 opacity: 0;
1600 transition: opacity 0.3s ease;
1601 }
1602
1603 .ays-chart-copy-notification.show {
1604 opacity: 1;
1605 }
1606
1607 @media (max-width: 1400px) {
1608 .ays-chart-progress-banner-main .ays-chart-progress-banner-center {
1609 flex-direction: column;
1610 }
1611 }
1612
1613 @media (max-width: 1200px) {
1614 .ays-chart-progress-banner-main .ays-chart-progress-banner-content {
1615 flex-direction: column;
1616 gap: 20px;
1617 }
1618
1619 .ays-chart-progress-banner-main .ays-chart-progress-banner-left {
1620 width: 100%;
1621 justify-content: center;
1622 text-align: center;
1623 flex-direction: column;
1624 }
1625
1626 .ays-chart-progress-banner-main .ays-chart-progress-banner-center {
1627 width: 100%;
1628 }
1629
1630 .ays-chart-progress-banner-main .ays-chart-progress-banner-right {
1631 width: 100%;
1632 justify-content: center;
1633 }
1634 }
1635
1636 @media (max-width: 768px) {
1637 #ays-chart-progress-banner-main {
1638 display: none !important;
1639 }
1640
1641 .ays-chart-progress-banner-main {
1642 padding: 15px 20px;
1643 margin: 15px 0;
1644 }
1645
1646 .ays-chart-progress-banner-main .ays-chart-progress-banner-title {
1647 font-size: 18px;
1648 }
1649
1650 .ays-chart-progress-banner-main .ays-chart-progress-banner-subtitle {
1651 font-size: 14px;
1652 }
1653
1654 .ays-chart-progress-banner-main .ays-chart-progress-banner-progress-bar {
1655 width: 100%;
1656 max-width: 280px;
1657 }
1658
1659 .ays-chart-progress-banner-main .ays-chart-progress-banner-upgrade {
1660 padding: 10px 20px;
1661 font-size: 14px;
1662 }
1663 }
1664
1665 @media (max-width: 480px) {
1666 .ays-chart-progress-banner-main {
1667 padding: 12px 15px;
1668 }
1669
1670 .ays-chart-progress-banner-main .ays-chart-progress-banner-coupon-text {
1671 font-size: 14px;
1672 }
1673
1674 .ays-chart-progress-banner-main .ays-chart-progress-banner-progress-bar {
1675 max-width: 250px;
1676 }
1677 }
1678 ';
1679
1680 $content[] = '</style>';
1681
1682 $content = implode( '', $content );
1683 echo ($content);
1684 }
1685
1686 // 30% Sale Emma
1687 public function ays_chart_sale_message_30_emma($ishmar){
1688 if($ishmar == 0 ){
1689 $content = array();
1690 $content[] = '<div id="ays-chart-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1691 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1692
1693 $content[] = '<div class="ays-chart-discount-box-sale-image"></div>';
1694 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1695
1696 $content[] = '<div class="ays-chart-dicount-wrap-text-box-texts">';
1697 $content[] = '<div>
1698 <a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=chart-sale-plugin-name" target="_blank" style="color:#30499B;">
1699 <span class="ays-chart-new-mega-bundle-limited-text">Limited</span> Offer for Chart Builder </a> <br>
1700 </div>';
1701 $content[] = '</div>';
1702
1703 $content[] = '<div style="font-size: 17px;">';
1704 $content[] = '<img style="width: 24px; height: 24px;" src="' . esc_url(plugins_url('admin/images/icons/guarantee-new.png', dirname(__FILE__))) . '">';// phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage
1705 $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
1706
1707 $content[] = '</div>';
1708
1709
1710
1711 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
1712
1713 $content[] = '<form action="" method="POST">';
1714 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1715 if( current_user_can( 'manage_options' ) ){
1716 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
1717 ">Dismiss ad</button>';
1718 $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
1719 }
1720 $content[] = '</div>';
1721 $content[] = '</form>';
1722
1723 $content[] = '</div>';
1724
1725 $content[] = '</div>';
1726
1727 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1728
1729 $content[] = '<div id="ays-chart-countdown-main-container">';
1730 $content[] = '<div class="ays-chart-countdown-container">';
1731
1732 $content[] = '<div id="ays-chart-countdown">';
1733
1734 $content[] = '<div style="font-weight: 500;">';
1735 $content[] = __( "Offer ends in:", "chart-builder" );
1736 $content[] = '</div>';
1737
1738 $content[] = '<ul>';
1739 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
1740 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
1741 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
1742 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
1743 $content[] = '</ul>';
1744 $content[] = '</div>';
1745
1746 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1747 $content[] = '<span>🚀</span>';
1748 $content[] = '<span>⌛</span>';
1749 $content[] = '<span>🔥</span>';
1750 $content[] = '<span>💣</span>';
1751 $content[] = '</div>';
1752
1753 $content[] = '</div>';
1754 $content[] = '</div>';
1755
1756 $content[] = '</div>';
1757
1758 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1759 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=chart-sale-button" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now !', "chart-builder" ) . '</a>';
1760 $content[] = '<span >One-time payment</span>';
1761 $content[] = '</div>';
1762 $content[] = '</div>';
1763 $content[] = '</div>';
1764
1765 $content = implode( '', $content );
1766 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1767
1768 }
1769 }
1770
1771 // Self 20% sale
1772 public static function ays_chart_sale_message20($ishmar){
1773 if($ishmar == 0 ){
1774 $content = array();
1775
1776 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1777 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1778 // $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-chart-sale-banner-link"><img src="' . CHART_BUILDER_ADMIN_URL . '/images/ays_chart_logo.png"></a>';
1779
1780 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1781
1782 $content[] = '<div class="ays-chart-dicount-sale-name-discount-box">';
1783 $content[] = '<span class="ays-chart-new-chart-pro-title">';
1784 // Translators: %s is the URL to the Chart Builder plugin page.
1785 $content[] = sprintf(
1786 /* translators: %s is the Chart Builder plugin URL. */
1787 __(
1788 "<span><a href='%s' target='_blank' style='color:#ffffff; text-decoration: underline;'>Chart Builder</a></span>",
1789 'chart-builder'
1790 ),
1791 "https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=chart-sale-plugin-name" . CHART_BUILDER_VERSION
1792 );
1793 $content[] = '</span>';
1794 $content[] = '<div>';
1795 $content[] = '<img src="' . esc_url(plugins_url('admin/images/ays-chart-banner-sale-30.svg', dirname(__FILE__))) . '" style="width: 70px;">';// phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage
1796 $content[] = '</div>';
1797 $content[] = '</div>';
1798
1799 $content[] = '<span class="ays-chart-new-chart-pro-desc">';
1800 $content[] = '<img class="ays-chart-new-chart-pro-guaranteeicon" src="' . esc_url(plugins_url('admin/images/chart-builder-guaranteeicon.webp', dirname(__FILE__))) . '" style="width: 30px;">'; // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage
1801 $content[] = esc_html__( "30 Days Money Back Guarantee", 'chart-builder' );
1802 $content[] = '</span>';
1803
1804 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
1805 $content[] = '<form method="POST">';
1806 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1807 if (current_user_can( 'manage_options' )) {
1808 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
1809 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1810 }
1811 $content[] = '</div>';
1812 $content[] = '</form>';
1813 $content[] = '</div>';
1814
1815 $content[] = '</div>';
1816
1817 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1818
1819 $content[] = '<div id="ays-chart-countdown-main-container">';
1820 $content[] = '<div class="ays-chart-countdown-container">';
1821 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1822 $content[] = esc_html__( "Offer ends in:", 'chart-builder' );
1823
1824 $content[] = '<ul style="padding: 0">';
1825 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . esc_html__( 'Days', 'chart-builder' ) . '</li>';
1826 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . esc_html__( 'Hours', 'chart-builder' ) . '</li>';
1827 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . esc_html__( 'Minutes', 'chart-builder' ) . '</li>';
1828 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . esc_html__( 'Seconds', 'chart-builder' ) . '</li>';
1829 $content[] = '</ul>';
1830 $content[] = '</div>';
1831
1832 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1833 $content[] = '<span>🚀</span>';
1834 $content[] = '<span>⌛</span>';
1835 $content[] = '<span>🔥</span>';
1836 $content[] = '<span>💣</span>';
1837 $content[] = '</div>';
1838 $content[] = '</div>';
1839 $content[] = '</div>';
1840
1841 $content[] = '</div>';
1842
1843 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1844 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=chart-sale-button'.CHART_BUILDER_VERSION.'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank" style="" >' . esc_html__( 'Buy Now', 'chart-builder' ) . '</a>';
1845 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1846 $content[] = esc_html__( "One-time payment", 'chart-builder' );
1847 $content[] = '</span>';
1848 $content[] = '</div>';
1849
1850 $content[] = '</div>';
1851
1852 $content[] = '</div>';
1853
1854 $content = implode( '', $content );
1855 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1856 }
1857 }
1858
1859 // Helloween banner
1860 public static function ays_chart_helloween_message($ishmar){
1861 if($ishmar == 0 ){
1862 $content = array();
1863
1864 $content[] = '<div id="ays-chart-dicount-month-main-helloween" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1865 $content[] = '<div id="ays-chart-dicount-month-helloween" class="ays_chart_dicount_month_helloween">';
1866 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-limited">';
1867
1868 $content[] = '<p>';
1869 $content[] = __( "Limited Time
1870 <span class='ays-chart-dicount-wrap-color-helloween' style='color:#b2ff00;'>30%</span>
1871 <span>
1872 SALE on
1873 </span>
1874 <br>
1875 <span style='' class='ays-chart-helloween-bundle'>
1876 <a href='https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=helloween-sale-banner' target='_blank' class='ays-chart-dicount-wrap-color-helloween ays-chart-dicount-wrap-text-decoration-helloween' style='display:block; color:#b2ff00;margin-right:6px;'>
1877 Chart Builder
1878 </a>
1879 </span>", 'chart-builder' );
1880 $content[] = '</p>';
1881 $content[] = '<p>';
1882 $content[] = __( "Hurry up!
1883 <a href='https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=helloween-sale-banner' target='_blank' style='color:#ffc700;'>
1884 Check it out!
1885 </a>", 'chart-builder' );
1886 $content[] = '</p>';
1887
1888 $content[] = '</div>';
1889
1890
1891 $content[] = '<div class="ays-chart-helloween-bundle-buy-now-timer">';
1892 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-timer">';
1893 $content[] = '<div id="ays-chart-countdown-main-container" class="ays-chart-countdown-main-container-helloween">';
1894 $content[] = '<div class="ays-chart-countdown-container-helloween">';
1895 $content[] = '<div id="ays-chart-countdown">';
1896 $content[] = '<ul>';
1897 $content[] = '<li><p><span id="ays-chart-countdown-days"></span><span>days</span></p></li>';
1898 $content[] = '<li><p><span id="ays-chart-countdown-hours"></span><span>Hours</span></p></li>';
1899 $content[] = '<li><p><span id="ays-chart-countdown-minutes"></span><span>Mins</span></p></li>';
1900 $content[] = '<li><p><span id="ays-chart-countdown-seconds"></span><span>Secs</span></p></li>';
1901 $content[] = '</ul>';
1902 $content[] = '</div>';
1903
1904 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1905 $content[] = '<span>🚀</span>';
1906 $content[] = '<span>⌛</span>';
1907 $content[] = '<span>🔥</span>';
1908 $content[] = '<span>💣</span>';
1909 $content[] = '</div>';
1910
1911 $content[] = '</div>';
1912
1913 $content[] = '</div>';
1914
1915 $content[] = '</div>';
1916 $content[] = '<div class="ays-chart-dicount-wrap-box ays-buy-now-button-box-helloween">';
1917 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=helloween-sale-banner" class="button button-primary ays-buy-now-button-helloween" id="ays-button-top-buy-now-helloween" target="_blank" style="" >' . __( 'Buy Now !', 'chart-builder' ) . '</a>';
1918 $content[] = '</div>';
1919 $content[] = '</div>';
1920
1921 $content[] = '</div>';
1922
1923 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-helloween">';
1924 $content[] = '<form method="POST">';
1925 $content[] = '<div id="ays-chart-dismiss-buttons-content-helloween">';
1926 if( current_user_can( 'manage_options' ) ){
1927 $content[] = '<button class="btn btn-link ays-button-helloween" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
1928 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1929 }
1930 $content[] = '</div>';
1931 $content[] = '</form>';
1932
1933 $content[] = '</div>';
1934 // $content[] = '<button type="button" class="notice-dismiss">';
1935 // $content[] = '</button>';
1936 $content[] = '</div>';
1937
1938 $content = implode( '', $content );
1939
1940 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1941 }
1942 }
1943
1944 // Christmas banner
1945 public static function ays_chart_christmas_message($ishmar){
1946 if($ishmar == 0 ){
1947 $content = array();
1948
1949 $content[] = '<div id="ays-chart-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1950 $content[] = '<div id="ays-chart-dicount-christmas-month" class="ays_chart_dicount_month">';
1951 $content[] = '<div class="ays-chart-dicount-christmas-box">';
1952 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box ays-chart-dicount-christmas-wrap-box-80">';
1953 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Limited Time', 'chart-builder' ) .' '. '<a href="https://ays-pro.com/wordpress/chart-builder" class="ays-chart-dicount-christmas-button-sale" target="_blank">' . __( '40%', 'chart-builder' ) . '</a>' . ' SALE</div>';
1954 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Chart Builder Plugin', 'chart-builder' ) . '</div>';
1955 $content[] = '</div>';
1956
1957 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1958 $content[] = '<div id="ays-chart-countdown-main-container">';
1959 $content[] = '<div class="ays-chart-countdown-container">';
1960 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1961 $content[] = '<ul>';
1962 $content[] = '<li><span id="ays-chart-countdown-days"></span>' . __( 'Days', 'chart-builder' ) . '</li>';
1963 $content[] = '<li><span id="ays-chart-countdown-hours"></span>' . __( 'Hours', 'chart-builder' ) . '</li>';
1964 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>' . __( 'Minutes', 'chart-builder' ) . '</li>';
1965 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>' . __( 'Seconds', 'chart-builder' ) . '</li>';
1966 $content[] = '</ul>';
1967 $content[] = '</div>';
1968 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1969 $content[] = '<span>🚀</span>';
1970 $content[] = '<span>⌛</span>';
1971 $content[] = '<span>🔥</span>';
1972 $content[] = '<span>💣</span>';
1973 $content[] = '</div>';
1974 $content[] = '</div>';
1975 $content[] = '</div>';
1976 $content[] = '</div>';
1977
1978 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1979 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder" class="ays-chart-dicount-christmas-button-buy-now" target="_blank">' . __( 'BUY NOW!', 'chart-builder' ) . '</a>';
1980 $content[] = '</div>';
1981 $content[] = '</div>';
1982 $content[] = '</div>';
1983
1984 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-christmas">';
1985 $content[] = '<form method="POST">';
1986 $content[] = '<div id="ays-chart-dismiss-buttons-content-christmas">';
1987 $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', 'chart-builder' ) . '</button>';
1988 $content[] = '</div>';
1989 $content[] = '</form>';
1990 $content[] = '</div>';
1991 $content[] = '</div>';
1992
1993 $content = implode( '', $content );
1994
1995 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1996 }
1997 }
1998
1999 // Silver Bundle
2000 public function ays_chart_silver_bundle_message($ishmar){
2001 if($ishmar == 0 ){
2002 $content = array();
2003
2004 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
2005 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
2006 $content[] = '<a href="https://ays-pro.com/silver-bundle" target="_blank" class="ays-chart-sale-banner-link"><img src="' . esc_url(plugins_url('/images/silver_bundle_logo_box.png', dirname(__FILE__))) . '"></a>';// phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage
2007
2008 $content[] = '<div class="ays-chart-dicount-wrap-box">';
2009
2010 $content[] = '<strong style="font-weight: bold;">';
2011 $content[] = __( "Limited Time <span style='color:#E85011;'>50%</span> SALE on <br><span><a href='https://ays-pro.com/silver-bundle' target='_blank' style='color:#E85011; text-decoration: underline;'>Silver Bundle</a></span> (Quiz + Chart + Form)!", 'chart-builder' );
2012 $content[] = '</strong>';
2013
2014 $content[] = '<br>';
2015
2016 $content[] = '<strong>';
2017 $content[] = __( "Hurry up! <a href='https://ays-pro.com/silver-bundle' target='_blank'>Check it out!</a>", 'chart-builder' );
2018 $content[] = '</strong>';
2019
2020 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
2021
2022 $content[] = '<form method="POST">';
2023 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
2024 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
2025 $content[] = '</div>';
2026 $content[] = '</form>';
2027
2028 $content[] = '</div>';
2029
2030 $content[] = '</div>';
2031
2032 $content[] = '<div class="ays-chart-dicount-wrap-box">';
2033
2034 $content[] = '<div id="ays-chart-countdown-main-container">';
2035 $content[] = '<div class="ays-chart-countdown-container">';
2036
2037 $content[] = '<div id="ays-chart-countdown">';
2038 $content[] = '<ul>';
2039 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
2040 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
2041 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
2042 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
2043 $content[] = '</ul>';
2044 $content[] = '</div>';
2045
2046 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
2047 $content[] = '<span>🚀</span>';
2048 $content[] = '<span>⌛</span>';
2049 $content[] = '<span>🔥</span>';
2050 $content[] = '<span>💣</span>';
2051 $content[] = '</div>';
2052
2053 $content[] = '</div>';
2054 $content[] = '</div>';
2055
2056 $content[] = '</div>';
2057
2058 $content[] = '<a href="https://ays-pro.com/silver-bundle" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank" style="height: 32px; display: flex; align-items: center; font-weight: 500; " >' . __( 'Buy Now !', 'chart-builder' ) . '</a>';
2059 $content[] = '</div>';
2060 $content[] = '</div>';
2061
2062 $content = implode( '', $content );
2063 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
2064 }
2065 }
2066
2067 //silver bundle
2068 public function ays_chart_new_silver_bundle_message_2025($ishmar){
2069 $content = array();
2070
2071 $date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
2072 $now_date = date('M d, Y H:i:s', $date);
2073
2074 $chart_banner_date = strtotime( $this->ays_chart_update_banner_time() );
2075
2076 $diff = $chart_banner_date - $date;
2077
2078 $style_attr = '';
2079 if( $diff < 0 ){
2080 $style_attr = 'style="display:none;"';
2081 }
2082
2083 $chart_cta_button_link = esc_url( 'https://ays-pro.com/silver-bundle?utm_source=dashboard&utm_medium=chart-free&utm_campaign=silver-bundle-sale-banner-' . CHART_BUILDER_VERSION );
2084
2085 $content[] = '<div id="ays-chart-new-silver-bundle-dicount-month-main" class="ays-chart-admin-notice notice notice-success is-dismissible ays_chart_dicount_info">';
2086 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
2087
2088 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
2089 $content[] = '<div>';
2090 $content[] = '<div class="ays-chart-dicount-logo-box">';
2091 $content[] = '<a href="' . $chart_cta_button_link . '" target="_blank" class="ays-chart-sale-banner-link"><img src="' . CHART_BUILDER_ADMIN_URL . '/images/mega_bundle_logo_box.webp"></a>';
2092
2093 $content[] = '<div>';
2094 $content[] = '<span class="ays-chart-new-silver-bundle-title">';
2095 $content[] = sprintf(
2096 /* translators: 1: opening link wrapper with <a> tag, 2: closing </a> tag */
2097 __( '%1$s Silver Bundle %2$s (Quiz + Form + Chart)', 'chart-builder' ),
2098 '<span style="display:inline-block; margin-right:5px;"><a href="' . esc_url( $chart_cta_button_link ) . '" target="_blank" rel="noopener noreferrer" style="color:#ffffff !important; text-decoration: underline;">',
2099 '</a></span>'
2100 );
2101 $content[] = '</span>';
2102 $content[] = '</br>';
2103 $content[] = '<span class="ays-chart-new-silver-bundle-desc">';
2104 $content[] = __( "30 Day Money Back Guarantee", 'chart-builder' );
2105 $content[] = '</span>';
2106 $content[] = '</div>';
2107
2108 $content[] = '<div class="ays-chart-new-silver-bundle-title-icon-row" style="display: inline-block;">';
2109 $content[] = '<img src="' . CHART_BUILDER_ADMIN_URL . '/images/ays-chart-banner-50.svg" class="ays-chart-new-silver-bundle-mobile-image-display-none" style="width: 70px;">';
2110 $content[] = '</div>';
2111
2112 $content[] = '</div>';
2113
2114 $content[] = '<div class="ays-chart-new-silver-bundle-mobile-image-display-block display_none">';
2115 $content[] = '<img src="' . CHART_BUILDER_ADMIN_URL . '/images/ays-chart-banner-50.svg" style="width: 70px;">';
2116 $content[] = '</div>';
2117 $content[] = '</div>';
2118
2119 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
2120
2121 $content[] = '<form action="" method="POST">';
2122 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
2123 if( current_user_can( 'manage_options' ) ){
2124 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", 'chart-builder' ) .'</button>';
2125 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
2126 }
2127 $content[] = '</div>';
2128 $content[] = '</form>';
2129
2130 $content[] = '</div>';
2131
2132 $content[] = '</div>';
2133
2134 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
2135
2136 $content[] = '<div id="ays-chart-maker-countdown-main-container">';
2137 $content[] = '<div class="ays-chart-maker-countdown-container">';
2138
2139 $content[] = '<div ' . $style_attr . ' id="ays-chart-countdown">';
2140
2141 $content[] = '<ul>';
2142
2143 $content[] = '<li><span id="ays-chart-countdown-days"></span></li>';
2144 $content[] = '<li><span id="ays-chart-countdown-hours"></span></li>';
2145 $content[] = '<li><span id="ays-chart-countdown-minutes"></span></li>';
2146 $content[] = '<li><span id="ays-chart-countdown-seconds"></span></li>';
2147 $content[] = '</ul>';
2148 $content[] = '</div>';
2149
2150 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
2151 $content[] = '</div>';
2152
2153 $content[] = '</div>';
2154 $content[] = '</div>';
2155
2156 $content[] = '</div>';
2157
2158 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
2159 $content[] = '<a href="'. $chart_cta_button_link .'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now', 'chart-builder' ) . '</a>';
2160 $content[] = '<span class="ays-chart-dicount-one-time-text">';
2161 $content[] = __( "One-time payment", 'chart-builder' );
2162 $content[] = '</span>';
2163 $content[] = '</div>';
2164 $content[] = '</div>';
2165 $content[] = '</div>';
2166
2167 // /* New Mega Bundle Banner Quiz | Start */
2168 $content[] = '<style id="ays-chart-mega-bundle-styles-inline-css">';
2169 $content[] = '
2170 div#ays-chart-new-silver-bundle-dicount-month-main{border:0;background:#fff;border-radius:20px;box-shadow:unset;position:relative;z-index:1;min-height:80px}div#ays-chart-new-silver-bundle-dicount-month-main.ays_chart_dicount_info button{display:flex;align-items:center}div#ays-chart-new-silver-bundle-dicount-month-main div#ays-chart-dicount-month a.ays-chart-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-chart-new-silver-bundle-dicount-month-main .btn-link{color:#007bff;background-color:transparent;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem}div#ays-chart-new-silver-bundle-dicount-month-main.ays_chart_dicount_info{background-image:url("'. CHART_BUILDER_ADMIN_URL .'/images/chart-builder-banner-background-50.svg");background-position:center right;background-repeat:no-repeat;background-size:cover;background-color:#5551ff;padding:1px 38px 1px 12px}#ays-chart-new-silver-bundle-dicount-month-main .ays_chart_dicount_month{display:flex;align-items:center;justify-content:space-between;color:#fff}#ays-chart-new-silver-bundle-dicount-month-main .ays_chart_dicount_month img{width:60px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-sale-banner-link{display:flex;justify-content:center;align-items:center;width:60px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box{font-size:14px;padding:12px;text-align:center}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box{text-align:left;width:auto;display:flex;justify-content:space-around;align-items:flex-start}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-countdown-box{width:30%;display:flex;justify-content:center;align-items:center}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-button-box{width:20%;display:flex;justify-content:center;align-items:center;flex-direction:column}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box .ays-chart-dicount-logo-box{display:flex;justify-content:flex-start;align-items:center;gap:20px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box .ays-chart-new-silver-bundle-title{color:#fdfdfd;font-size:19px;font-style:normal;font-weight:600;line-height:normal}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box .ays-chart-new-silver-bundle-title-icon-row{display:inline-block}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box .ays-chart-new-silver-bundle-desc{display:inline-block;color:#fff;font-size:15px;font-style:normal;font-weight:400;line-height:normal;margin-top:10px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-color{color:#971821}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-text-decoration{text-decoration:underline}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box .ays-button,#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box .ays-buy-now-button{background:#971821;border-color:#fff;display:flex;justify-content:center;align-items:center;padding:5px 15px;font-size:16px;border-radius:5px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-chart-new-silver-bundle-dicount-month-main #ays-chart-dismiss-buttons-content{display:flex;justify-content:center}#ays-chart-new-silver-bundle-dicount-month-main #ays-chart-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#fff}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-opacity-box{width:19%}#ays-chart-new-silver-bundle-dicount-month-main .ays-buy-now-opacity-button{padding:40px 15px;display:flex;justify-content:center;align-items:center;opacity:0}#ays-chart-maker-countdown-main-container .ays-chart-maker-countdown-container{margin:0 auto;text-align:center}#ays-chart-maker-countdown-main-container #ays-chart-countdown-headline{letter-spacing:.125rem;text-transform:uppercase;font-size:18px;font-weight:400;margin:0;padding:9px 0 4px;line-height:1.3}#ays-chart-maker-countdown-main-container li,#ays-chart-maker-countdown-main-container ul{margin:0}#ays-chart-maker-countdown-main-container li{display:inline-block;font-size:14px;list-style-type:none;padding:14px;text-transform:lowercase}#ays-chart-maker-countdown-main-container li span{display:flex;justify-content:center;align-items:center;font-size:22px;min-height:40px;min-width:40px;border-radius:4.273px;border:.534px solid #f4f4f4;background:#9896ed;color:#fff}#ays-chart-maker-countdown-main-container .emoji{display:none;padding:1rem}#ays-chart-maker-countdown-main-container .emoji span{font-size:30px;padding:0 .5rem}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box li{position:relative}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box li span:after{content:":";color:#fff;position:absolute;top:0;right:-5px;font-size:40px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box li span#ays-chart-countdown-seconds:after{content:unset}#ays-chart-new-silver-bundle-dicount-month-main #ays-button-top-buy-now{display:flex;align-items:center;border-radius:6.409px;background:#f66123;padding:12px 32px;color:#fff;font-size:15px;font-style:normal;line-height:normal;margin:0!important}div#ays-chart-new-silver-bundle-dicount-month-main button.notice-dismiss:before{color:#fff;content:"\f00d";font-family:fontawesome;font-size:22px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-new-silver-bundle-guaranteeicon{width:30px;margin-right:5px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-one-time-text{color:#fff;font-size:12px;font-style:normal;font-weight:600;line-height:normal}@media all and (max-width:768px){div#ays-chart-new-silver-bundle-dicount-month-main.ays_chart_dicount_info.notice{display:none!important;background-position:bottom right;background-repeat:no-repeat;background-size:cover;border-radius:32px}div#ays-chart-new-silver-bundle-dicount-month-main{padding-right:0}div#ays-chart-new-silver-bundle-dicount-month-main .ays_chart_dicount_month{display:flex;align-items:center;justify-content:space-between;align-content:center;flex-wrap:wrap;flex-direction:column;padding:10px 0}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box{width:100%!important;text-align:center}#ays-chart-maker-countdown-main-container #ays-chart-countdown-headline{font-size:15px;font-weight:600}#ays-chart-maker-countdown-main-container ul{font-weight:500}div#ays-chart-maker-countdown-main-container li{padding:10px}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-new-silver-bundle-mobile-image-display-none{display:none!important}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-new-silver-bundle-mobile-image-display-block{display:block!important;margin-top:5px}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box{width:100%!important;text-align:center;flex-direction:column;margin-top:20px;justify-content:center;align-items:center}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box li span:after{top:unset}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-countdown-box{width:100%;display:flex;justify-content:center;align-items:center}#ays-chart-new-silver-bundle-dicount-month-main .ays-button{margin:0 auto!important}#ays-chart-new-silver-bundle-dicount-month-main #ays-chart-dismiss-buttons-content .ays-button{padding-left:unset!important}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-chart-new-silver-bundle-dicount-month-main .ays-buy-now-opacity-button{display:none}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dismiss-buttons-container-for-form{position:static!important}.comparison .product img{width:70px}.ays-chart-features-wrap .comparison a.price-buy{padding:8px 5px;font-size:11px}}@media screen and (max-width:1350px) and (min-width:768px){div#ays-chart-new-silver-bundle-dicount-month-main.ays_chart_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:cover}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box strong{font-size:15px}#ays-chart-maker-countdown-main-container li{font-size:11px}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-opacity-box{display:none}}@media screen and (max-width:1680px) and (min-width:1551px){div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box{width:29%}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-countdown-box{width:30%}}@media screen and (max-width:1410px){#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-coupon-row{width:150px}}@media screen and (max-width:1550px) and (min-width:1400px){div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-countdown-box{width:35%}}@media screen and (max-width:1400px) and (min-width:1250px){div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-countdown-box{width:35%}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box{width:40%}}@media screen and (max-width:1274px){#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box .ays-chart-new-silver-bundle-title{font-size:15px}}@media screen and (max-width:1200px){#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-button-box{margin-bottom:16px}#ays-chart-maker-countdown-main-container ul{padding-left:0}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-coupon-row{width:120px;font-size:18px}#ays-chart-new-silver-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 20px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box{font-size:12px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box .ays-chart-new-silver-bundle-desc{font-size:13px}}@media screen and (max-width:1076px) and (min-width:769px){#ays-chart-maker-countdown-main-container li{padding:10px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-coupon-row{width:100px;font-size:16px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-button-box{margin-bottom:16px}#ays-chart-new-silver-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 15px}#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box{font-size:11px;padding:12px 0}}@media screen and (max-width:1250px) and (min-width:769px){div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-countdown-box{width:45%}div#ays-chart-new-silver-bundle-dicount-month-main .ays-chart-dicount-wrap-box.ays-chart-dicount-wrap-text-box{width:35%}}';
2171 $content[] = '</style>';
2172 // /* New Mega Bundle Banner Quiz | End */
2173
2174 $content = implode( '', $content );
2175 echo ($content);
2176 }
2177
2178 // Christmas Top Banner 2024
2179 public function ays_chart_christmas_message_2024($ishmar){
2180 if($ishmar == 0 ){
2181 $content = array();
2182
2183 $content[] = '<div id="ays-chart-christmas-top-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
2184 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
2185
2186 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
2187
2188 $content[] = '<div id="ays-chart-countdown-main-container">';
2189 $content[] = '<div class="ays-chart-countdown-container">';
2190
2191 $content[] = '<div id="ays-chart-countdown">';
2192
2193 $content[] = '<div>';
2194 $content[] = __( "Offer ends in:", 'chart-builder' );
2195 $content[] = '</div>';
2196
2197 $content[] = '<ul style="padding-left: 0;">';
2198 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
2199 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
2200 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
2201 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
2202 $content[] = '</ul>';
2203 $content[] = '</div>';
2204
2205 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
2206 $content[] = '<span>🚀</span>';
2207 $content[] = '<span>⌛</span>';
2208 $content[] = '<span>🔥</span>';
2209 $content[] = '<span>💣</span>';
2210 $content[] = '</div>';
2211
2212 $content[] = '</div>';
2213 $content[] = '</div>';
2214
2215 $content[] = '</div>';
2216
2217 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
2218 $content[] = '<div>';
2219
2220 $content[] = '<span class="ays-chart-christmas-top-bundle-title">';
2221 $content[] = sprintf(
2222 /* translators: %s is the Chart Builder plugin URL with version parameter. */
2223 __(
2224 "<span><a href='%s' class='ays-chart-christmas-top-bundle-title-link' target='_blank'>Christmas Sale</a></span>",
2225 'chart-builder'
2226 ),
2227 "https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner" . CHART_BUILDER_VERSION
2228 );
2229 $content[] = '</span>';
2230
2231 $content[] = '</br>';
2232
2233 $content[] = '<span class="ays-chart-christmas-top-bundle-desc">';
2234 $content[] = '<a class="ays-chart-christmas-top-bundle-desc" href="https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner'.CHART_BUILDER_VERSION.'" class="ays-chart-christmas-top-bundle-title-link" target="_blank">';
2235 $content[] = __( "20% Extra OFF", 'chart-builder' );
2236 $content[] = '</a>';
2237 $content[] = '</span>';
2238 $content[] = '</div>';
2239
2240 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
2241
2242 $content[] = '<form action="" method="POST">';
2243 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
2244 if( current_user_can( 'manage_options' ) ){
2245 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", 'chart-builder' ) .'</button>';
2246 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
2247 }
2248 $content[] = '</div>';
2249 $content[] = '</form>';
2250
2251 $content[] = '</div>';
2252
2253 $content[] = '</div>';
2254
2255 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-christmas-top-bundle-coupon-text-box">';
2256 $content[] = '<div class="ays-chart-christmas-top-bundle-coupon-row">';
2257 $content[] = 'xmas20off';
2258 $content[] = '</div>';
2259 $content[] = '<div class="ays-chart-christmas-top-bundle-text-row">';
2260 $content[] = __( '20% Extra Discount Coupon', 'chart-builder' );
2261 $content[] = '</div>';
2262 $content[] = '</div>';
2263
2264 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
2265 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner'.CHART_BUILDER_VERSION.'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', 'chart-builder' ) . '</a>';
2266 $content[] = '<span class="ays-chart-dicount-one-time-text">';
2267 $content[] = __( "One-time payment", 'chart-builder' );
2268 $content[] = '</span>';
2269 $content[] = '</div>';
2270 $content[] = '</div>';
2271 $content[] = '</div>';
2272
2273 $content = implode( '', $content );
2274 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
2275 }
2276 }
2277
2278 // Halloween Bundle 2025
2279 public function ays_chart_new_halloween_bundle_message_2025($ishmar){
2280 if($ishmar == 0 ){
2281 $content = array();
2282
2283 $date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
2284 $now_date = date('M d, Y H:i:s', $date);
2285
2286 $start_date = strtotime('2025-09-08');
2287 $end_date = strtotime('2025-10-31');
2288 $diff_end = $end_date - $date;
2289
2290 $style_attr = '';
2291 if( $diff_end < 0 ){
2292 $style_attr = 'style="display:none;"';
2293 }
2294
2295 $ays_chart_cta_button_link = esc_url('https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=chart-halloween-banner-' . CHART_BUILDER_VERSION);
2296
2297 $content[] = '
2298 <div id="ays-chart-halloween-banner-2025-main" class="ays-chart-halloween-banner-2025-main ays_chart_dicount_info notice notice-success is-dismissible">
2299 <div class="ays-chart-halloween-banner-2025-content">
2300 <div class="ays-chart-halloween-banner-2025-left">
2301 <div class="ays-chart-halloween-banner-2025-text">
2302 <h2 class="ays-chart-halloween-banner-2025-title">Boo! Grab Your <a href="'. $ays_chart_cta_button_link .'" class="" target="_blank">Halloween Deal</a> <br/> Before It Vanishes!</h2>
2303 <p class="ays-chart-halloween-banner-2025-subtitle">Don’t get spooked by missing out!<br/> Get 25% discount using the coupon code while the magic lasts!</p>
2304 </div>
2305 </div>
2306
2307 <div class="ays-chart-halloween-banner-2025-center">';
2308
2309 $content[] = '<div id="ays-chart-halloween-banner-2025-countdown" class="ays-chart-halloween-banner-2025-countdown" ' . $style_attr . '>';
2310 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-timer">';
2311 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-item">';
2312 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-value" id="ays-chart-halloween-banner-2025-days">00</div>';
2313 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-label">' . __('days', 'chart-builder') . '</div>';
2314 $content[] = '</div>';
2315 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-separator">:</div>';
2316 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-item">';
2317 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-value" id="ays-chart-halloween-banner-2025-hours">00</div>';
2318 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-label">' . __('hours', 'chart-builder') . '</div>';
2319 $content[] = '</div>';
2320 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-separator">:</div>';
2321 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-item">';
2322 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-value" id="ays-chart-halloween-banner-2025-minutes">00</div>';
2323 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-label">' . __('minutes', 'chart-builder') . '</div>';
2324 $content[] = '</div>';
2325 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-separator">:</div>';
2326 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-item">';
2327 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-value" id="ays-chart-halloween-banner-2025-seconds">00</div>';
2328 $content[] = '<div class="ays-chart-halloween-banner-2025-countdown-label">' . __('seconds', 'chart-builder') . '</div>';
2329 $content[] = '</div>';
2330 $content[] = '</div>';
2331 $content[] = '</div>';
2332
2333 $content[] = '</div>
2334
2335 <div class="ays-chart-halloween-banner-2025-right">
2336 <div class="ays-chart-halloween-banner-2025-pumpkin">
2337 <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
2338 <g clip-path="url(#clip0_177_40)">
2339 <path d="M32.664 8.519C29.364 5.134 23.42 4.75 18 4.75C12.58 4.75 6.636 5.134 3.336 8.519C0.582 11.344 0 15.751 0 19.791C0 25.054 1.982 31.102 6.357 34.035C9.364 36.051 13.95 35.871 18 35.871C22.05 35.871 26.636 36.051 29.643 34.035C34.018 31.101 36 25.054 36 19.791C36 15.751 35.418 11.344 32.664 8.519Z" fill="#F4900C"/>
2340 <path d="M20.783 5.44401C20.852 5.86401 20.561 6.20801 20.136 6.20801H15.685C15.259 6.20801 14.968 5.86401 15.038 5.44401L15.783 0.972008C15.853 0.551008 16.259 0.208008 16.685 0.208008H19.136C19.562 0.208008 19.968 0.552008 20.037 0.972008L20.783 5.44401Z" fill="#3F7123"/>
2341 <path d="M20.6541 21.159L19.0561 18.563C18.7651 18.021 18.3831 17.75 17.9991 17.746C17.6161 17.75 17.2331 18.021 16.9421 18.563L15.3441 21.159C14.7571 22.252 16.2171 22.875 17.9981 22.875C19.7791 22.875 21.2411 22.251 20.6541 21.159ZM30.1621 24.351C30.1171 24.276 30.0361 24.23 29.9481 24.23H29.1071C29.0391 24.23 28.9731 24.258 28.9261 24.307L26.6951 26.641L23.9971 24.472C23.9461 24.431 23.8801 24.414 23.8121 24.419C23.7461 24.426 23.6851 24.46 23.6441 24.513L21.2361 27.575L18.1821 24.309C18.1691 24.295 18.1491 24.292 18.1341 24.281C18.1191 24.271 18.1091 24.254 18.0911 24.247C18.0851 24.245 18.0781 24.247 18.0721 24.245C18.0481 24.238 18.0251 24.24 18.0001 24.24C17.9751 24.24 17.9521 24.238 17.9281 24.246C17.9221 24.248 17.9151 24.245 17.9081 24.248C17.8901 24.255 17.8811 24.272 17.8651 24.282C17.8491 24.292 17.8301 24.295 17.8171 24.309L14.7641 27.575L12.3551 24.513C12.3141 24.46 12.2531 24.426 12.1871 24.419C12.1211 24.413 12.0541 24.431 12.0021 24.472L9.30411 26.641L7.07411 24.307C7.02711 24.258 6.96211 24.23 6.89311 24.23H6.05211C5.96511 24.23 5.88311 24.276 5.83811 24.351C5.79311 24.426 5.79011 24.519 5.83111 24.596L8.58511 29.815C8.61911 29.879 8.6781 29.925 8.7491 29.942C8.8201 29.959 8.8941 29.944 8.9521 29.902L10.9861 28.444L13.9901 32.077C14.0331 32.13 14.0961 32.162 14.1641 32.167L14.1831 32.168C14.2451 32.168 14.3041 32.146 14.3501 32.105L18.0001 28.836L21.6501 32.104C21.6961 32.145 21.7551 32.167 21.8171 32.167L21.8361 32.166C21.9041 32.161 21.9671 32.129 22.0101 32.076L25.0151 28.443L27.0491 29.901C27.1091 29.944 27.1821 29.961 27.2521 29.941C27.3221 29.924 27.3821 29.879 27.4151 29.815L30.1701 24.596C30.2101 24.519 30.2081 24.426 30.1621 24.351ZM27.9761 15.421C28.1051 17.548 27.1921 19.227 24.7711 19.374C22.3511 19.52 21.2421 17.963 21.1131 15.837C20.9841 13.711 22.3451 10.717 24.2401 10.603C26.1361 10.487 27.8481 13.294 27.9761 15.421ZM8.02411 15.421C7.89511 17.548 8.80811 19.227 11.2291 19.374C13.6491 19.52 14.7581 17.963 14.8871 15.837C15.0161 13.711 13.6551 10.717 11.7601 10.603C9.86511 10.489 8.15211 13.294 8.02411 15.421Z" fill="#642116"/>
2342 </g>
2343 <defs>
2344 <clipPath id="clip0_177_40">
2345 <rect width="36" height="36" fill="white"/>
2346 </clipPath>
2347 </defs>
2348 </svg>
2349 </div>
2350
2351
2352
2353 <div class="ays-chart-halloween-banner-2025-discount-section">
2354 <div class="ays-chart-halloween-banner-2025-discount">25% OFF</div>
2355 <div class="ays-chart-halloween-banner-2025-coupon-wrapper">
2356 <div class="ays-chart-halloween-banner-2025-coupon-box" onclick="aysChartHalloweenCopyToClipboard(\'HALLOWEEN25\')" title="Click to copy">
2357 <span class="ays-chart-halloween-banner-2025-coupon-text">HALLOWEEN25</span>
2358 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-chart-halloween-banner-2025-copy-icon">
2359 <path d="M13.5 2.5H6.5C5.67 2.5 5 3.17 5 4V10C5 10.83 5.67 11.5 6.5 11.5H13.5C14.33 11.5 15 10.83 15 10V4C15 3.17 14.33 2.5 13.5 2.5ZM13.5 10H6.5V4H13.5V10ZM2.5 6.5V12.5C2.5 13.33 3.17 14 4 14H10V12.5H4V6.5H2.5Z" fill="white"/>
2360 </svg>
2361 </div>
2362 </div>
2363 <a href="'. $ays_chart_cta_button_link .'" class="ays-chart-halloween-banner-2025-upgrade" target="_blank">Upgrade Now</a>
2364 </div>';
2365
2366 if( current_user_can( 'manage_options' ) ){
2367 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
2368 $content[] = '<form action="" method="POST" style="position: absolute; bottom: -5px; right: 0; color: #fff;">';
2369 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="color: darkgrey; font-size: 11px;">'. __( "Dismiss ad", 'chart-builder' ) .'</button>';
2370 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
2371 $content[] = '</form>';
2372 $content[] = '</div>';
2373 }
2374
2375 $content[] = '
2376 </div>
2377 </div>
2378 </div>';
2379
2380 $content[] = '<style id="ays-chart-progress-banner-styles-inline-css">';
2381 $content[] = '
2382 .ays-chart-halloween-banner-2025-main {
2383 background: linear-gradient(135deg, #1A0F2E 100%, #2D1B4E 0%);
2384 background-image: url("' . esc_attr( CHART_BUILDER_ADMIN_URL ) . '/images/halloween-banner-background-image-remove.png"), linear-gradient(135deg, #2D1B4E 0%, #1A0F2E 100%);
2385 background-position: left center, center;
2386 background-repeat: no-repeat, no-repeat;
2387 background-size: auto 100%, cover;
2388 padding: 20px 30px 20px 130px;
2389 border-radius: 12px;
2390 color: white;
2391 margin: 20px 0;
2392 border: 0;
2393 box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
2394 overflow: hidden;
2395 }
2396
2397 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-content {
2398 display: flex;
2399 align-items: center;
2400 justify-content: space-between;
2401 gap: 30px;
2402 }
2403
2404 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-left {
2405 display: flex;
2406 align-items: center;
2407 gap: 20px;
2408 }
2409
2410 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-center {
2411 display: flex;
2412 align-items: center;
2413 justify-content: center;
2414 flex: 1;
2415 max-width: 350px;
2416 }
2417
2418 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-right {
2419 display: flex;
2420 align-items: center;
2421 gap: 15px;
2422 flex-shrink: 0;
2423 }
2424
2425 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-icon {
2426 flex-shrink: 0;
2427 }
2428
2429 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-pumpkin svg {
2430 display: inline !important;
2431 border: none !important;
2432 box-shadow: none !important;
2433 height: 1em !important;
2434 width: 1em !important;
2435 margin: 0 0.07em !important;
2436 vertical-align: -0.1em !important;
2437 background: none !important;
2438 padding: 0 !important;
2439 }
2440
2441 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-orb {
2442 width: 80px;
2443 height: 80px;
2444 background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
2445 border-radius: 50%;
2446 display: flex;
2447 align-items: center;
2448 justify-content: center;
2449 box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
2450 border: 3px solid rgba(168, 85, 247, 0.4);
2451 }
2452
2453 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-question {
2454 font-size: 48px;
2455 font-weight: 700;
2456 color: #E9D5FF;
2457 }
2458
2459 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-bat {
2460 font-size: 20px;
2461 opacity: 0.8;
2462 }
2463
2464 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-bat-1 {
2465 margin-left: -100px;
2466 margin-top: -40px;
2467 }
2468
2469 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-bat-2 {
2470 margin-left: -110px;
2471 margin-top: 35px;
2472 }
2473
2474 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-sparkle {
2475 font-size: 12px;
2476 opacity: 0.7;
2477 }
2478
2479 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-sparkle-1 {
2480 margin-left: -95px;
2481 margin-top: -60px;
2482 }
2483
2484 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-sparkle-2 {
2485 margin-left: -70px;
2486 margin-top: -15px;
2487 }
2488
2489 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-sparkle-3 {
2490 margin-left: -120px;
2491 margin-top: 10px;
2492 }
2493
2494 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-text {
2495 flex: 1;
2496 }
2497
2498 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-title {
2499 font-size: 24px;
2500 font-weight: 700;
2501 margin: 0 0 8px 0;
2502 line-height: 1.2;
2503 color: #fff;
2504 text-transform: uppercase;
2505 letter-spacing: 1px;
2506 }
2507
2508 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-title a {
2509 color: #FB923C;
2510 text-decoration: underline;
2511 }
2512
2513 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-subtitle {
2514 font-size: 16px;
2515 margin: 0;
2516 opacity: 0.9;
2517 font-weight: 400;
2518 color: #E9D5FF;
2519 }
2520
2521 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-description {
2522 font-size: 14px;
2523 margin: 0;
2524 opacity: 0.85;
2525 line-height: 1.5;
2526 color: #D8B4FE;
2527 }
2528
2529 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-pumpkin {
2530 font-size: 64px;
2531 filter: drop-shadow(0 0 20px rgba(251, 146, 60, 0.8));
2532 flex-shrink: 0;
2533 }
2534
2535 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-discount-section {
2536 display: flex;
2537 flex-direction: column;
2538 align-items: center;
2539 gap: 10px;
2540 }
2541
2542 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-discount {
2543 font-size: 36px;
2544 font-weight: 700;
2545 color: #FB923C;
2546 text-shadow: 0 0 20px rgba(251, 146, 60, 0.6);
2547 margin: 0;
2548 line-height: 1;
2549 }
2550
2551 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-coupon-wrapper {
2552 margin-bottom: 5px;
2553 }
2554
2555 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-coupon-box {
2556 border: 2px dashed rgba(255, 255, 255, 0.4);
2557 padding: 6px 12px;
2558 border-radius: 6px;
2559 background: rgba(255, 255, 255, 0.1);
2560 cursor: pointer;
2561 transition: all 0.3s ease;
2562 display: flex;
2563 align-items: center;
2564 gap: 6px;
2565 backdrop-filter: blur(10px);
2566 }
2567
2568 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-coupon-box:hover {
2569 background: rgba(255, 255, 255, 0.2);
2570 border-color: rgba(255, 255, 255, 0.6);
2571 transform: translateY(-1px);
2572 }
2573
2574 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-coupon-text {
2575 font-size: 14px;
2576 font-weight: 700;
2577 letter-spacing: 1px;
2578 color: #fff;
2579 font-family: monospace;
2580 }
2581
2582 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-copy-icon {
2583 opacity: 0.8;
2584 transition: opacity 0.3s ease;
2585 }
2586
2587 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-coupon-box:hover .ays-chart-halloween-banner-2025-copy-icon {
2588 opacity: 1;
2589 }
2590
2591 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-upgrade {
2592 background: linear-gradient(135deg, #FB923C 0%, #F97316 100%);
2593 color: white;
2594 border: none;
2595 padding: 12px 28px;
2596 border-radius: 8px;
2597 font-size: 16px;
2598 font-weight: 600;
2599 cursor: pointer;
2600 transition: all 0.3s ease;
2601 box-shadow: 0 4px 16px rgba(251, 146, 60, 0.5);
2602 text-decoration: none;
2603 display: inline-flex;
2604 align-items: center;
2605 text-align: center;
2606 }
2607
2608 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-upgrade:hover {
2609 transform: translateY(-2px);
2610 box-shadow: 0 6px 20px rgba(251, 146, 60, 0.7);
2611 text-decoration: none;
2612 color: white;
2613 }
2614
2615 .ays-chart-halloween-banner-2025-main .notice-dismiss:before {
2616 color: #fff;
2617 }
2618
2619 .ays-chart-halloween-banner-2025-copy-notification {
2620 position: fixed;
2621 top: 50%;
2622 left: 50%;
2623 transform: translate(-50%, -50%);
2624 background: rgba(0, 0, 0, 0.8);
2625 color: white;
2626 padding: 12px 24px;
2627 border-radius: 8px;
2628 font-size: 14px;
2629 z-index: 10000;
2630 opacity: 0;
2631 transition: opacity 0.3s ease;
2632 }
2633
2634 .ays-chart-halloween-banner-2025-copy-notification.show {
2635 opacity: 1;
2636 }
2637
2638 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-countdown-timer {
2639 display: flex;
2640 align-items: center;
2641 justify-content: center;
2642 gap: 8px;
2643 }
2644
2645 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-countdown-item {
2646 background: rgba(255, 255, 255, 0.15);
2647 border-radius: 8px;
2648 padding: 8px 12px;
2649 min-width: 60px;
2650 backdrop-filter: blur(10px);
2651 }
2652
2653 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-countdown-value {
2654 font-size: 24px;
2655 font-weight: 700;
2656 line-height: 1;
2657 margin-bottom: 4px;
2658 color: #fff;
2659 text-align: center;
2660 }
2661
2662 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-countdown-label {
2663 font-size: 11px;
2664 opacity: 0.8;
2665 text-transform: lowercase;
2666 text-align: center;
2667 }
2668
2669 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-countdown-separator {
2670 font-size: 24px;
2671 font-weight: 700;
2672 opacity: 0.6;
2673 margin: 0 4px;
2674 }
2675
2676 @media (min-width: 1200px) {
2677 .ays-chart-halloween-banner-2025-main .wp-core-ui .notice.is-dismissible {
2678 padding-right: 60px;
2679 }
2680 }
2681
2682 @media (max-width: 1200px) {
2683
2684 div.ays-chart-halloween-banner-2025-main {
2685 padding: 20px 30px;
2686 }
2687
2688 div.ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-pumpkin {
2689 display: none;
2690 }
2691
2692 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-subtitle,
2693 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-title {
2694 text-align: center;
2695 }
2696
2697 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-content {
2698 flex-wrap: wrap;
2699 gap: 20px;
2700 }
2701
2702 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-left {
2703 width: 100%;
2704 }
2705
2706 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-center {
2707 width: 100%;
2708 max-width: 100%;
2709 text-align: center;
2710 }
2711
2712 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-right {
2713 width: 100%;
2714 justify-content: center;
2715 }
2716 }
2717
2718 @media (max-width: 786px) {
2719 #ays-chart-halloween-banner-2025-main {
2720 display: none !important;
2721 }
2722 }
2723
2724 @media (max-width: 768px) {
2725 .ays-chart-halloween-banner-2025-main {
2726 padding: 15px 20px;
2727 margin: 15px 0;
2728 }
2729
2730 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-title {
2731 font-size: 20px;
2732 }
2733
2734 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-subtitle {
2735 font-size: 14px;
2736 }
2737
2738 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-description {
2739 font-size: 13px;
2740 }
2741
2742 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-pumpkin {
2743 font-size: 48px;
2744 }
2745
2746 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-discount {
2747 font-size: 28px;
2748 }
2749
2750 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-upgrade {
2751 padding: 10px 20px;
2752 font-size: 14px;
2753 }
2754 }
2755
2756 @media (max-width: 480px) {
2757 .ays-chart-halloween-banner-2025-main {
2758 padding: 12px 15px;
2759 }
2760
2761 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-orb {
2762 width: 60px;
2763 height: 60px;
2764 }
2765
2766 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-question {
2767 font-size: 36px;
2768 }
2769
2770 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-title {
2771 font-size: 18px;
2772 }
2773
2774 .ays-chart-halloween-banner-2025-main .ays-chart-halloween-banner-2025-coupon-text {
2775 font-size: 12px;
2776 }
2777 }
2778 ';
2779
2780 $content[] = '</style>';
2781
2782 $content[] = '<script>';
2783 $content[] = "
2784 function aysChartHalloweenCopyToClipboard(text) {
2785 // Create a temporary textarea element
2786 var textarea = document.createElement('textarea');
2787 textarea.value = text;
2788 textarea.style.position = 'fixed';
2789 textarea.style.opacity = '0';
2790 document.body.appendChild(textarea);
2791
2792 // Select and copy the text
2793 textarea.select();
2794 textarea.setSelectionRange(0, 99999); // For mobile devices
2795
2796 try {
2797 document.execCommand('copy');
2798 aysChartHalloweenShowCopyNotification('Coupon code copied!');
2799 } catch (err) {
2800 console.error('Failed to copy text: ', err);
2801 }
2802
2803 // Remove the temporary textarea
2804 document.body.removeChild(textarea);
2805 }
2806
2807 function aysChartHalloweenShowCopyNotification(message) {
2808 // Check if notification already exists
2809 var existingNotification = document.querySelector('.ays-chart-halloween-banner-2025-copy-notification');
2810 if (existingNotification) {
2811 document.body.removeChild(existingNotification);
2812 }
2813
2814 // Create notification element
2815 var notification = document.createElement('div');
2816 notification.className = 'ays-chart-halloween-banner-2025-copy-notification';
2817 notification.textContent = message;
2818 document.body.appendChild(notification);
2819
2820 // Show notification with animation
2821 setTimeout(function() {
2822 notification.classList.add('show');
2823 }, 10);
2824
2825 // Hide and remove notification after 2 seconds
2826 setTimeout(function() {
2827 notification.classList.remove('show');
2828 setTimeout(function() {
2829 if (notification.parentNode) {
2830 document.body.removeChild(notification);
2831 }
2832 }, 300);
2833 }, 2000);
2834 }
2835
2836 (function() {
2837 var endDate = new Date('". date('Y-m-d H:i:s', $end_date) ."').getTime();
2838
2839 function updateCountdown() {
2840 var now = new Date().getTime();
2841 var distance = endDate - now;
2842
2843 if (distance < 0) {
2844 clearInterval(updateCountdown);
2845 document.getElementById('ays-chart-halloween-banner-2025-progress-banner-countdown').style.display = 'none';
2846 return;
2847 }
2848
2849 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
2850 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
2851 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
2852 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
2853
2854 function padZero(num) {
2855 return num < 10 ? '0' + num : num;
2856 }
2857
2858 document.getElementById('ays-chart-halloween-banner-2025-days').textContent = padZero(days);
2859 document.getElementById('ays-chart-halloween-banner-2025-hours').textContent = padZero(hours);
2860 document.getElementById('ays-chart-halloween-banner-2025-minutes').textContent = padZero(minutes);
2861 document.getElementById('ays-chart-halloween-banner-2025-seconds').textContent = padZero(seconds);
2862 }
2863
2864 updateCountdown();
2865 setInterval(updateCountdown, 1000);
2866 })()";
2867 $content[] = '</script>';
2868
2869 $content = implode( '', $content );
2870 echo ($content);
2871 }
2872 }
2873
2874 // Black Friday
2875 public static function ays_chart_black_friday_message($ishmar){
2876 if($ishmar == 0 ){
2877 $content = array();
2878
2879 $ays_chart_cta_button_link = esc_url('https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=black-friday-sale-banner-' . CHART_BUILDER_VERSION);
2880
2881 $content[] = '<div id="ays-chart-dicount-black-friday-month-main" class="ays-chart notice notice-success is-dismissible ays_chart_dicount_info">';
2882 $content[] = '<div id="ays-chart-dicount-black-friday-month" class="ays_chart_dicount_month">';
2883 $content[] = '<div class="ays-chart-dicount-black-friday-box">';
2884 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-box-80" style="width: 70%;">';
2885 $content[] = '<div class="">';
2886 $content[] = '<div class="ays-chart-dicount-black-friday-title-row" >' . __( 'Coupon Code', "ays-popup-box" ) .' ' . '</div>';
2887 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">';
2888
2889 $content[] = '
2890 <span class="ays-chart-dicount-black-friday-banner-2025-coupon-wrapper">
2891 <span class="ays-chart-dicount-black-friday-banner-2025-coupon-box" onclick="aysChartHalloweenCopyToClipboard(\'FREE2PROBF\')" title="Click to copy">
2892 <span class="ays-chart-dicount-black-friday-banner-2025-coupon-text">FREE2PROBF</span>
2893 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-chart-dicount-black-friday-banner-2025-copy-icon">
2894 <path d="M13.5 2.5H6.5C5.67 2.5 5 3.17 5 4V10C5 10.83 5.67 11.5 6.5 11.5H13.5C14.33 11.5 15 10.83 15 10V4C15 3.17 14.33 2.5 13.5 2.5ZM13.5 10H6.5V4H13.5V10ZM2.5 6.5V12.5C2.5 13.33 3.17 14 4 14H10V12.5H4V6.5H2.5Z" fill="white"/>
2895 </svg>
2896 </span>
2897 </span>';
2898 $content[] = '</div> ';
2899 $content[] = '</div>';
2900
2901 $content[] = '</div>';
2902
2903 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-text-box">';
2904 $content[] = '<div class="ays-chart-dicount-black-friday-text-row">' . '30% off' . '</div>';
2905 $content[] = '</div>';
2906
2907 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
2908 $content[] = '<div id="ays-chart-countdown-main-container">';
2909 $content[] = '<div class="ays-chart-countdown-container">';
2910 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
2911 $content[] = '<ul>';
2912 $content[] = '<li><span id="ays-chart-countdown-days"></span>' . __( 'Days', "ays-popup-box" ) . '</li>';
2913 $content[] = '<li><span id="ays-chart-countdown-hours"></span>' . __( 'Hours', "ays-popup-box" ) . '</li>';
2914 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>' . __( 'Minutes', "ays-popup-box" ) . '</li>';
2915 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>' . __( 'Seconds', "ays-popup-box" ) . '</li>';
2916 $content[] = '</ul>';
2917 $content[] = '</div>';
2918 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
2919 $content[] = '<span></span>';
2920 $content[] = '<span></span>';
2921 $content[] = '<span></span>';
2922 $content[] = '<span></span>';
2923 $content[] = '</div>';
2924 $content[] = '</div>';
2925 $content[] = '</div>';
2926 $content[] = '</div>';
2927
2928 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
2929 $content[] = '<a href="'. $ays_chart_cta_button_link .'" class="ays-chart-dicount-black-friday-button-buy-now" target="_blank">' . __( 'Get Your Deal', "ays-popup-box" ) . '</a>';
2930 $content[] = '</div>';
2931 $content[] = '</div>';
2932 $content[] = '</div>';
2933
2934 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-black-friday">';
2935 $content[] = '<form action="" method="POST">';
2936 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
2937 if( current_user_can( 'manage_options' ) ){
2938 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
2939 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
2940 }
2941 $content[] = '</div>';
2942 $content[] = '</form>';
2943 $content[] = '</div>';
2944 $content[] = '</div>';
2945
2946 $content[] = '<script>';
2947 $content[] = "
2948 function aysChartHalloweenCopyToClipboard(text) {
2949 // Create a temporary textarea element
2950 var textarea = document.createElement('textarea');
2951 textarea.value = text;
2952 textarea.style.position = 'fixed';
2953 textarea.style.opacity = '0';
2954 document.body.appendChild(textarea);
2955
2956 // Select and copy the text
2957 textarea.select();
2958 textarea.setSelectionRange(0, 99999); // For mobile devices
2959
2960 try {
2961 document.execCommand('copy');
2962 aysChartHalloweenShowCopyNotification('Coupon code copied!');
2963 } catch (err) {
2964 console.error('Failed to copy text: ', err);
2965 }
2966
2967 // Remove the temporary textarea
2968 document.body.removeChild(textarea);
2969 }
2970
2971 function aysChartHalloweenShowCopyNotification(message) {
2972 // Check if notification already exists
2973 var existingNotification = document.querySelector('.ays-chart-discount-black-friday-banner-2025-copy-notification');
2974 if (existingNotification) {
2975 document.body.removeChild(existingNotification);
2976 }
2977
2978 // Create notification element
2979 var notification = document.createElement('div');
2980 notification.className = 'ays-chart-discount-black-friday-banner-2025-copy-notification';
2981 notification.textContent = message;
2982 document.body.appendChild(notification);
2983
2984 // Show notification with animation
2985 setTimeout(function() {
2986 notification.classList.add('show');
2987 }, 10);
2988
2989 // Hide and remove notification after 2 seconds
2990 setTimeout(function() {
2991 notification.classList.remove('show');
2992 setTimeout(function() {
2993 if (notification.parentNode) {
2994 document.body.removeChild(notification);
2995 }
2996 }, 300);
2997 }, 2000);
2998 }";
2999 $content[] = '</script>';
3000
3001 $content[] = '<style>';
3002 $content[] = '
3003 /* Black friday banner start */
3004 div#ays-chart-dicount-black-friday-month-main *{color:#fff}div#ays-chart-dicount-black-friday-month-main div#ays-chart-dicount-black-friday-month a.ays-chart-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-chart-dicount-black-friday-month-main .btn-link{background-color:transparent;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:12px;line-height:1.5;border-radius:.25rem;color:rgba(255,255,255,.6)}div#ays-chart-dicount-black-friday-month-main.ays_chart_dicount_info{background-image:linear-gradient(45deg,#1e101d,#c60af4);padding:unset;border-left:0}#ays-chart-dicount-black-friday-month-main .ays_chart_dicount_month{position:relative;background-image:url("'. esc_attr(CHART_BUILDER_ADMIN_URL) .'/images/black-friday-plugins-background-image.webp");background-position:center right;background-repeat:no-repeat;background-size:100% 100%}#ays-chart-dicount-black-friday-month-main .ays_chart_dicount_month img{width:80px}#ays-chart-dicount-black-friday-month-main .ays-chart-sale-banner-link{display:flex;justify-content:center;align-items:center;width:200px}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-button-sale{font-style:normal;font-weight:600;font-size:24px;text-align:center;color:#b2ff00;text-transform:uppercase}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box{font-size:14px;padding:12px;text-align:center;width:50%;white-space:nowrap}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-color{color:#971821}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-text-decoration{text-decoration:underline}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box .ays-button,#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box .ays-buy-now-button{background:#971821;border-color:#fff;display:flex;justify-content:center;align-items:center;padding:5px 15px;font-size:16px;border-radius:5px}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-chart-dicount-black-friday-month-main #ays-chart-dismiss-buttons-content{display:flex;justify-content:center}#ays-chart-dicount-black-friday-month-main #ays-chart-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#969393b0}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-opacity-box{width:19%}#ays-chart-dicount-black-friday-month-main .ays-buy-now-opacity-button{padding:40px 15px;display:flex;justify-content:center;align-items:center;opacity:0}#ays-chart-countdown-main-container .ays-chart-countdown-container{margin:0 auto;text-align:center}#ays-chart-countdown-main-container #ays-chart-countdown-headline{letter-spacing:.125rem;text-transform:uppercase;font-size:18px;font-weight:400;margin:0;padding:9px 0 4px;line-height:1.3}#ays-chart-countdown-main-container li,#ays-chart-countdown-main-container ul{margin:0;font-weight:600}#ays-chart-countdown-main-container li{display:inline-block;font-size:10px;list-style-type:none;padding:10px;text-transform:uppercase}#ays-chart-countdown-main-container li span{display:block;font-size:22px;min-height:33px}#ays-chart-countdown-main-container .emoji{display:none;padding:1rem}#ays-chart-countdown-main-container .emoji span{font-size:25px;padding:0 .5rem}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-box{display:flex;justify-content:space-between;align-items:center;width:95%;margin:auto}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-title-row{text-align:center;padding-right:50px;font-style:normal;font-weight:900;font-size:19px;color:#fff;}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-button-buy-now{border:none;outline:0;padding:10px 20px;font-size:22px;text-transform:uppercase;font-weight:700;text-decoration:none;background:linear-gradient(180deg,#dd0bef 0,#82008d 100%);border-radius:16px}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-text-row{text-transform:uppercase;text-shadow:-1.5px 0 #dd0bef,0 1.5px #dd0bef,1.5px 0 #dd0bef,0 -1.5px #dd0bef;font-weight:900;font-style:normal;font-size:40px;line-height:40px;color:#fff}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-text-box{position:absolute;width:25%;top:10px;bottom:0;right:0;left:0;margin:0 auto}#ays-chart-countdown ul{padding:0}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-banner-2025-coupon-box{border:2px dashed rgba(255,255,255,.4);padding:0 12px;border-radius:6px;background:rgba(255,255,255,.1);cursor:pointer;transition:.3s;display:flex;align-items:center;justify-content:center;gap:6px;backdrop-filter:blur(10px);width:fit-content;margin:0 auto}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-banner-2025-coupon-box:hover{background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.6);transform:translateY(-1px)}#ays-chart-dicount-black-friday-month-main .ays-chart-discount-black-friday-banner-2025-coupon-text{font-size:14px;font-weight:700;letter-spacing:1px;color:#fff;font-family:monospace}#ays-chart-dicount-black-friday-month-main .ays-chart-discount-black-friday-banner-2025-copy-icon{opacity:.8;transition:opacity .3s}#ays-chart-dicount-black-friday-month-main .ays-chart-discount-black-friday-banner-banner-2025-coupon-box:hover .ays-chart-discount-black-friday-banner-2025-copy-icon,.ays-chart-discount-black-friday-banner-2025-copy-notification.show{opacity:1}.ays-chart-discount-black-friday-banner-2025-copy-notification{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.8);color:#fff;padding:12px 24px;border-radius:8px;font-size:14px;z-index:10000;opacity:0;transition:opacity .3s}@media screen and (max-width:1400px) and (min-width:1200px){div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-title-row{font-size:15px}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-text-row{font-size:27px}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-box{width:100%}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-button-buy-now{font-size:13px}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box-80{width:80%!important}}@media all and (max-width:1200px){div#ays-chart-dicount-black-friday-month-main .ays_chart_dicount_month{background:unset}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-text-row{font-size:30px}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-box{width:100%}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-button-buy-now{font-size:15px}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box-80{width:80%!important}}@media all and (max-width:1200px) and (min-width:1150px){div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-title-row{font-size:15px}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-button-buy-now{font-size:10px}}@media all and (max-width:1150px){div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box-80{width:80%!important}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-box{flex-direction:column}div#ays-chart-dicount-black-friday-month-main{padding-right:0}div#ays-chart-dicount-black-friday-month-main .ays_chart_dicount_month{display:flex;align-items:center;justify-content:space-between;align-content:center;flex-wrap:wrap;flex-direction:column;padding:10px 0}div#ays-chart-dicount-black-friday-month-main div.ays-chart-dicount-black-friday-wrap-box{width:100%!important;text-align:center}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-title-row,div#ays-chart-dicount-black-friday-month-main #ays-chart-countdown-main-container ul{padding:0;font-size:13px}#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-button-sale,div#ays-chart-countdown-main-container li{font-size:15px}div#ays-chart-countdown-main-container li span{font-size:25px}div#ays-chart-dicount-black-friday-month-main div.ays-chart-dicount-black-friday-wrap-text-box{position:unset}#ays-chart-countdown-main-container #ays-chart-countdown-headline{font-size:15px;font-weight:600}#ays-chart-countdown-main-container ul{font-weight:500}#ays-chart-countdown-main-container li span{font-size:20px}#ays-chart-dicount-black-friday-month-main .ays-button{margin:0 auto!important}div#ays-chart-dicount-black-friday-month-main.ays_chart_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:contain;display:flex;justify-content:center;background-image:linear-gradient(45deg,#1e101d,#c60af4)}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-chart-dicount-black-friday-month-main .ays-chart-dicount-black-friday-button-buy-now{padding:10px 18px;font-size:15px}}@media all and (max-width:768px){#ays-chart-dicount-black-friday-month-main{display:none!important}}
3005 ';
3006 $content[] = '</style>';
3007
3008 $content = implode( '', $content );
3009
3010 echo $content;
3011 }
3012 }
3013
3014 // Christmas Banner 2025
3015 public static function ays_chart_christmas_banner_message_2025($ishmar){
3016 if($ishmar == 0 ){
3017 $content = array();
3018
3019 $svg_icon = '<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg">
3020 <path fill-rule="evenodd" clip-rule="evenodd" d="M10.0445 0C10.4587 0 10.7945 0.33579 10.7945 0.75V2.93934L12.5141 1.21967C12.807 0.92678 13.2819 0.92678 13.5748 1.21967C13.8677 1.51256 13.8677 1.98744 13.5748 2.28033L10.7945 5.06066V9.451L14.5965 7.25588L15.6142 3.45788C15.7214 3.05778 16.1326 2.82034 16.5327 2.92755C16.9328 3.03475 17.1703 3.44601 17.0631 3.84611L16.4336 6.19522L18.3296 5.10055C18.6884 4.89344 19.147 5.01635 19.3542 5.37507C19.5613 5.73379 19.4384 6.19248 19.0796 6.39959L17.1836 7.49426L19.5327 8.1237C19.9328 8.23091 20.1703 8.64216 20.0631 9.0423C19.9558 9.4424 19.5446 9.6798 19.1445 9.5726L15.3465 8.55492L11.5445 10.75L15.3467 12.9452L19.1447 11.9275C19.5448 11.8203 19.956 12.0578 20.0633 12.4579C20.1705 12.858 19.933 13.2692 19.5329 13.3764L17.1838 14.0059L19.0798 15.1005C19.4386 15.3077 19.5615 15.7663 19.3544 16.1251C19.1472 16.4838 18.6886 16.6067 18.3298 16.3996L16.4338 15.3049L17.0633 17.654C17.1705 18.0541 16.933 18.4654 16.5329 18.5726C16.1328 18.6798 15.7216 18.4424 15.6144 18.0423L14.5967 14.2443L10.7945 12.049V16.4393L13.5748 19.2197C13.8677 19.5126 13.8677 19.9874 13.5748 20.2803C13.2819 20.5732 12.807 20.5732 12.5141 20.2803L10.7945 18.5607V20.75C10.7945 21.1642 10.4587 21.5 10.0445 21.5C9.63033 21.5 9.29453 21.1642 9.29453 20.75V18.5607L7.57484 20.2803C7.28195 20.5732 6.80707 20.5732 6.51418 20.2803C6.22129 19.9874 6.22129 19.5126 6.51418 19.2197L9.29453 16.4393V12.049L5.4923 14.2443L4.47463 18.0423C4.36742 18.4424 3.95617 18.6798 3.55607 18.5726C3.15597 18.4654 2.91853 18.0541 3.02574 17.654L3.65518 15.3049L1.75916 16.3996C1.40044 16.6067 0.941743 16.4838 0.734643 16.1251C0.527533 15.7663 0.650443 15.3077 1.00916 15.1005L2.90518 14.0059L0.556073 13.3764C0.155973 13.2692 -0.081467 12.858 0.0257431 12.4579C0.132943 12.0578 0.544203 11.8203 0.944303 11.9275L4.7423 12.9452L8.54453 10.75L4.74249 8.55492L0.944493 9.5726C0.544393 9.6798 0.133143 9.4424 0.0259331 9.0423C-0.0812669 8.64216 0.156163 8.23091 0.556263 8.1237L2.90538 7.49426L1.00935 6.39959C0.650633 6.19248 0.527733 5.73379 0.734833 5.37507C0.941943 5.01635 1.40063 4.89344 1.75935 5.10055L3.65538 6.19522L3.02593 3.84611C2.91873 3.44601 3.15616 3.03475 3.55626 2.92755C3.95636 2.82034 4.36762 3.05778 4.47482 3.45788L5.49249 7.25588L9.29453 9.451V5.06066L6.51418 2.28033C6.22129 1.98744 6.22129 1.51256 6.51418 1.21967C6.80707 0.92678 7.28195 0.92678 7.57484 1.21967L9.29453 2.93934V0.75C9.29453 0.33579 9.63033 0 10.0445 0Z" fill="white" fill-opacity="0.2"/>
3021 </svg>
3022 ';
3023
3024 $ays_chart_cta_button_link = esc_url('https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner-' . CHART_BUILDER_VERSION);
3025
3026 $content[] = '<div id="ays-chart-christmas-banner-main" class="notice notice-success is-dismissible ays-chart-christmas-banner-info ays_chart_dicount_info">';
3027 $content[] = '<div id="ays-chart-christmas-banner-month" class="ays-chart-christmas-banner-month">';
3028
3029 // Background effects
3030 $content[] = '<div class="ays-chart-christmas-banner-bg-effects">';
3031 $content[] = '<div class="ays-chart-christmas-banner-bg-gradient-1"></div>';
3032 $content[] = '<div class="ays-chart-christmas-banner-bg-gradient-2"></div>';
3033
3034 // Snowflakes
3035 $content[] = '<div class="ays-chart-christmas-banner-snowflake" style="left: 5%; animation-delay: 0s; animation-duration: 8s;">'. $svg_icon .'</div>';
3036 $content[] = '<div class="ays-chart-christmas-banner-snowflake" style="left: 15%; animation-delay: 2s; animation-duration: 10s;">'. $svg_icon .'</div>';
3037 $content[] = '<div class="ays-chart-christmas-banner-snowflake" style="left: 25%; animation-delay: 4s; animation-duration: 9s;">'. $svg_icon .'</div>';
3038 $content[] = '<div class="ays-chart-christmas-banner-snowflake" style="left: 75%; animation-delay: 1s; animation-duration: 11s;">'. $svg_icon .'</div>';
3039 $content[] = '<div class="ays-chart-christmas-banner-snowflake" style="left: 85%; animation-delay: 3s; animation-duration: 8s;">'. $svg_icon .'</div>';
3040 $content[] = '<div class="ays-chart-christmas-banner-snowflake" style="left: 92%; animation-delay: 5s; animation-duration: 10s;">'. $svg_icon .'</div>';
3041
3042 // Sparkles
3043 $content[] = '<svg class="ays-chart-christmas-banner-sparkle" style="top: 20%; left: 8%; animation-delay: 0s; width: 14px; height: 14px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">';
3044 $content[] = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>';
3045 $content[] = '</svg>';
3046 $content[] = '<svg class="ays-chart-christmas-banner-sparkle" style="top: 60%; left: 3%; animation-delay: 0.5s; width: 10px; height: 10px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">';
3047 $content[] = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>';
3048 $content[] = '</svg>';
3049 $content[] = '<svg class="ays-chart-christmas-banner-sparkle" style="top: 30%; right: 12%; animation-delay: 1s; width: 12px; height: 12px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">';
3050 $content[] = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>';
3051 $content[] = '</svg>';
3052 $content[] = '</div>';
3053
3054 // Main content
3055 $content[] = '<div class="ays-chart-christmas-banner-content">';
3056 $content[] = '<div class="ays-chart-christmas-banner-left">';
3057 // Gift icon with hat
3058 $content[] = '<div class="ays-chart-christmas-banner-gift-wrapper">';
3059 $content[] = '<svg class="ays-chart-christmas-banner-gift-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">';
3060 $content[] = '<rect x="3" y="8" width="18" height="4" rx="1"></rect>';
3061 $content[] = '<path d="M12 8v13"></path>';
3062 $content[] = '<path d="M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7"></path>';
3063 $content[] = '<path d="M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5"></path>';
3064 $content[] = '</svg>';
3065 $content[] = '<div class="ays-chart-christmas-banner-hat">';
3066 $content[] = '<svg viewBox="0 0 24 24" fill="none" class="ays-chart-christmas-banner-hat-svg">';
3067 $content[] = '<path d="M12 2L4 14h16L12 2z" fill="hsl(0 80% 45%)"></path>';
3068 $content[] = '<path d="M4 14c0 2 3.5 3 8 3s8-1 8-3" fill="hsl(0 0% 100%)"></path>';
3069 $content[] = '<circle cx="12" cy="3" r="2" fill="hsl(0 0% 100%)"></circle>';
3070 $content[] = '</svg>';
3071 $content[] = '</div>';
3072 $content[] = '</div>';
3073
3074 $content[] = '<div class="ays-chart-christmas-banner-special-label">';
3075 $content[] = '<div class="ays-chart-christmas-banner-special-label-name">';
3076 $content[] = '<a href="'. $ays_chart_cta_button_link .'" class="ays-chart-christmas-banner-special-label-name-link" target="_blank">';
3077 $content[] = __( 'Chart Builder', "chart-builder" );
3078 $content[] = '</a>';
3079 $content[] = '</div>';
3080
3081 $content[] = '<div>✦ ' . __( 'CHRISTMAS SPECIAL', "chart-builder" ) . ' ✦</div>';
3082 $content[] = '</div>';
3083 $content[] = '</div>';
3084
3085 $content[] = '<div class="ays-chart-christmas-banner-center">';
3086 $content[] = '<div class="ays-chart-christmas-banner-discount-text">25% OFF</div>';
3087 $content[] = '<div class="ays-chart-christmas-banner-limited-offer">' . __( 'Limited time offer', "chart-builder" ) . '</div>';
3088 $content[] = '</div>';
3089
3090 $content[] = '<div class="ays-chart-christmas-banner-right">';
3091 $content[] = '<div class="ays-chart-christmas-banner-coupon-box" onclick="aysChartChristmasCopyToClipboard(\'XMAS25\')" title="' . __( 'Click to copy', "chart-builder" ) . '">';
3092 $content[] = '<span class="ays-chart-christmas-banner-coupon-text">XMAS25</span>';
3093 $content[] = '<svg class="ays-chart-christmas-banner-copy-icon" width="16" height="16" viewBox="0 0 16 16" fill="none">';
3094 $content[] = '<path d="M13.5 2.5H6.5C5.67 2.5 5 3.17 5 4V10C5 10.83 5.67 11.5 6.5 11.5H13.5C14.33 11.5 15 10.83 15 10V4C15 3.17 14.33 2.5 13.5 2.5ZM13.5 10H6.5V4H13.5V10ZM2.5 6.5V12.5C2.5 13.33 3.17 14 4 14H10V12.5H4V6.5H2.5Z" fill="white"/>';
3095 $content[] = '</svg>';
3096 $content[] = '</div>';
3097
3098 $content[] = '<a href="'. $ays_chart_cta_button_link .'" class="ays-chart-christmas-banner-buy-now-btn" target="_blank">';
3099 $content[] = __( 'Buy Now', "chart-builder" );
3100 $content[] = '</a>';
3101 $content[] = '</div>';
3102 $content[] = '</div>';
3103
3104 $content[] = '</div>';
3105
3106 if( current_user_can( 'manage_options' ) ){
3107 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
3108 $content[] = '<form action="" method="POST" style="position: absolute; bottom: 0; right: 0; color: #fff;">';
3109 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="color: darkgrey; font-size: 11px; padding: 0 .75rem;">'. __( "Dismiss ad", 'chart-builder' ) .'</button>';
3110 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
3111 $content[] = '</form>';
3112 $content[] = '</div>';
3113 }
3114
3115 $content[] = '</div>';
3116
3117 $content[] = '<script>';
3118 $content[] = "
3119 function aysChartChristmasCopyToClipboard(text) {
3120 var textarea = document.createElement('textarea');
3121 textarea.value = text;
3122 textarea.style.position = 'fixed';
3123 textarea.style.opacity = '0';
3124 document.body.appendChild(textarea);
3125
3126 textarea.select();
3127 textarea.setSelectionRange(0, 99999);
3128
3129 try {
3130 document.execCommand('copy');
3131 aysChartChristmasShowCopyNotification('" . __( 'Coupon code copied!', "chart-builder" ) . "');
3132 } catch (err) {
3133 console.error('Failed to copy text: ', err);
3134 }
3135
3136 document.body.removeChild(textarea);
3137 }
3138
3139 function aysChartChristmasShowCopyNotification(message) {
3140 var existingNotification = document.querySelector('.ays-chart-christmas-banner-copy-notification');
3141 if (existingNotification) {
3142 document.body.removeChild(existingNotification);
3143 }
3144
3145 var notification = document.createElement('div');
3146 notification.className = 'ays-chart-christmas-banner-copy-notification';
3147 notification.textContent = message;
3148 document.body.appendChild(notification);
3149
3150 setTimeout(function() {
3151 notification.classList.add('show');
3152 }, 10);
3153
3154 setTimeout(function() {
3155 notification.classList.remove('show');
3156 setTimeout(function() {
3157 if (notification.parentNode) {
3158 document.body.removeChild(notification);
3159 }
3160 }, 300);
3161 }, 2000);
3162 }";
3163 $content[] = '</script>';
3164
3165 $content[] = '<style>';
3166 $content[] = '
3167 /* Christmas banner start */
3168
3169 div#ays-chart-christmas-banner-main .btn-link {
3170 background-color: transparent;
3171 display: inline-block;
3172 font-weight: 400;
3173 text-align: center;
3174 white-space: nowrap;
3175 vertical-align: middle;
3176 -webkit-user-select: none;
3177 -moz-user-select: none;
3178 -ms-user-select: none;
3179 user-select: none;
3180 border: 1px solid transparent;
3181 padding: .375rem .75rem;
3182 font-size: 12px;
3183 line-height: 1.5;
3184 border-radius: .25rem;
3185 color: rgba(255, 255, 255, .6);
3186 }
3187
3188 div#ays-chart-christmas-banner-main.ays-chart-christmas-banner-info {
3189 background: linear-gradient(to right, hsl(0, 70%, 28%), hsl(0, 65%, 38%), hsl(0, 70%, 28%));
3190 padding: unset;
3191 border-left: 0;
3192 position: relative;
3193 }
3194
3195 #ays-chart-christmas-banner-main .ays-chart-christmas-banner-month {
3196 position: relative;
3197 padding: 15px 40px;
3198 overflow: hidden;
3199 }
3200
3201 /* Background effects */
3202 .ays-chart-christmas-banner-bg-effects {
3203 position: absolute;
3204 top: 0;
3205 left: 0;
3206 right: 0;
3207 bottom: 0;
3208 pointer-events: none;
3209 z-index: 1;
3210 }
3211
3212 .ays-chart-christmas-banner-bg-gradient-1 {
3213 position: absolute;
3214 top: 0;
3215 left: 30%;
3216 width: 40%;
3217 height: 100%;
3218 background: radial-gradient(circle, rgba(202, 43, 43, 0.5) 0%, transparent 60%);
3219 opacity: 0.4;
3220 }
3221
3222 .ays-chart-christmas-banner-bg-gradient-2 {
3223 position: absolute;
3224 top: 0;
3225 right: 15%;
3226 width: 35%;
3227 height: 100%;
3228 background: radial-gradient(circle, rgba(246, 201, 85, 0.15) 0%, transparent 50%);
3229 opacity: 0.3;
3230 }
3231
3232 .ays-chart-christmas-banner-snowflake {
3233 position: absolute;
3234 color: rgba(255, 255, 255, 0.2);
3235 font-size: 20px;
3236 animation: ays-chart-christmas-snowfall linear infinite;
3237 top: -10px;
3238 }
3239
3240 @keyframes ays-chart-christmas-snowfall {
3241 0% {
3242 transform: translateY(-10px) rotate(0deg);
3243 opacity: 0;
3244 }
3245 10% {
3246 opacity: 0.8;
3247 }
3248 90% {
3249 opacity: 0.8;
3250 }
3251 100% {
3252 transform: translateY(100%) rotate(360deg);
3253 opacity: 0;
3254 }
3255 }
3256
3257 .ays-chart-christmas-banner-sparkle {
3258 position: absolute;
3259 color: hsl(43, 90%, 65%);
3260 animation: ays-chart-christmas-twinkle 2s ease-in-out infinite;
3261 }
3262
3263 @keyframes ays-chart-christmas-twinkle {
3264 0%, 100% {
3265 opacity: 0.3;
3266 transform: scale(0.8);
3267 }
3268 50% {
3269 opacity: 1;
3270 transform: scale(1.2);
3271 }
3272 }
3273
3274 /* Main content */
3275 .ays-chart-christmas-banner-content {
3276 position: relative;
3277 display: flex;
3278 align-items: center;
3279 justify-content: space-between;
3280 z-index: 2;
3281 }
3282
3283 /* Left section */
3284 .ays-chart-christmas-banner-left {
3285 display: flex;
3286 align-items: center;
3287 gap: 50px;
3288 }
3289
3290 .ays-chart-christmas-banner-gift-wrapper {
3291 position: relative;
3292 animation: ays-chart-christmas-float 3s ease-in-out infinite;
3293 }
3294
3295 .ays-chart-christmas-banner-gift-icon {
3296 width: 48px;
3297 height: 48px;
3298 color: rgba(255, 247, 237, 0.9);
3299 }
3300
3301 @keyframes ays-chart-christmas-float {
3302 0%, 100% {
3303 transform: translateY(0);
3304 }
3305 50% {
3306 transform: translateY(-5px);
3307 }
3308 }
3309
3310 .ays-chart-christmas-banner-hat {
3311 position: absolute;
3312 top: -12px;
3313 right: -4px;
3314 width: 24px;
3315 height: 24px;
3316 }
3317
3318 .ays-chart-christmas-banner-hat-svg {
3319 width: 100%;
3320 height: 100%;
3321 }
3322
3323 .ays-chart-christmas-banner-special-label {
3324 color: hsl(43, 90%, 65%);
3325 font-size: 14px;
3326 font-weight: 500;
3327 text-transform: uppercase;
3328 letter-spacing: 1px;
3329 /* font-family: "Outfit", sans-serif; */
3330 }
3331
3332 .ays-chart-christmas-banner-special-label-name {
3333 color: #fffaf0;
3334 text-align: center;
3335 }
3336
3337 div#ays-chart-christmas-banner-main .ays-chart-christmas-banner-special-label-name-link {
3338 color: #fffaf0;
3339 box-shadow: unset;
3340 }
3341
3342 /* Center section */
3343 .ays-chart-christmas-banner-center {
3344 display: flex;
3345 flex-direction: row;
3346 text-align: center;
3347 justify-content: center;
3348 align-items: center;
3349 gap: 30px;
3350 }
3351
3352 .ays-chart-christmas-banner-discount-text {
3353 font-family: "Outfit", sans-serif;
3354 font-weight: 800;
3355 font-size: 30px;
3356 color: hsl(40, 100%, 97%);
3357 letter-spacing: -1px;
3358 line-height: 1;
3359 }
3360
3361 .ays-chart-christmas-banner-limited-offer {
3362 color: rgba(255, 247, 237, 0.7);
3363 font-size: 13px;
3364 font-weight: 500;
3365 }
3366
3367 /* Right section */
3368 .ays-chart-christmas-banner-right {
3369 display: flex;
3370 align-items: center;
3371 gap: 20px;
3372 }
3373
3374 .ays-chart-christmas-banner-coupon-box {
3375 border: 2px dashed rgba(255, 255, 255, 0.4);
3376 padding: 8px 16px;
3377 border-radius: 6px;
3378 background: rgba(255, 255, 255, 0.1);
3379 cursor: pointer;
3380 transition: all 0.3s;
3381 display: flex;
3382 align-items: center;
3383 gap: 8px;
3384 backdrop-filter: blur(10px);
3385 }
3386
3387 .ays-chart-christmas-banner-coupon-box:hover {
3388 background: rgba(255, 255, 255, 0.2);
3389 border-color: rgba(255, 255, 255, 0.6);
3390 transform: translateY(-1px);
3391 }
3392
3393 .ays-chart-christmas-banner-coupon-text {
3394 font-size: 16px;
3395 font-weight: 700;
3396 letter-spacing: 1px;
3397 color: #fff;
3398 font-family: monospace;
3399 }
3400
3401 .ays-chart-christmas-banner-copy-icon {
3402 opacity: 0.8;
3403 transition: opacity 0.3s;
3404 }
3405
3406 .ays-chart-christmas-banner-coupon-box:hover .ays-chart-christmas-banner-copy-icon {
3407 opacity: 1;
3408 }
3409
3410 #ays-chart-christmas-banner-main .ays-chart-christmas-banner-buy-now-btn {
3411 background-color: #fbe19f;
3412 color: hsl(0, 72%, 35%);
3413 padding: 10px 30px;
3414 border-radius: 9999px;
3415 font-size: 16px;
3416 font-weight: 600;
3417 font-family: "Outfit", sans-serif;
3418 border: none;
3419 cursor: pointer;
3420 transition: all 0.3s;
3421 text-decoration: none;
3422 display: flex;
3423 align-items: center;
3424 gap: 6px;
3425 box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 30px rgba(246, 201, 85, 0.2);
3426 }
3427
3428 #ays-chart-christmas-banner-main .ays-chart-christmas-banner-buy-now-btn:hover {
3429 background-color: #f2d58c;
3430 transform: scale(1.05);
3431 box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 40px rgba(246, 201, 85, 0.3);
3432 }
3433
3434 .ays-chart-christmas-banner-btn-arrow {
3435 display: inline-block;
3436 transition: transform 0.3s;
3437 }
3438
3439 .ays-chart-christmas-banner-buy-now-btn:hover .ays-chart-christmas-banner-btn-arrow {
3440 transform: translateX(4px);
3441 }
3442
3443 /* Notification */
3444 .ays-chart-christmas-banner-copy-notification {
3445 position: fixed;
3446 top: 50%;
3447 left: 50%;
3448 transform: translate(-50%, -50%);
3449 background: rgba(0, 0, 0, 0.8);
3450 color: #fff;
3451 padding: 12px 24px;
3452 border-radius: 8px;
3453 font-size: 14px;
3454 z-index: 10000;
3455 opacity: 0;
3456 transition: opacity 0.3s;
3457 }
3458
3459 .ays-chart-christmas-banner-copy-notification.show {
3460 opacity: 1;
3461 }
3462
3463 /* Dismiss button */
3464 #ays-chart-christmas-banner-main #ays-chart-christmas-banner-dismiss-content {
3465 display: flex;
3466 justify-content: center;
3467 }
3468
3469 #ays-chart-christmas-banner-main #ays-chart-christmas-banner-dismiss-content .ays-button {
3470 margin: 0 !important;
3471 font-size: 13px;
3472 color: rgba(150, 147, 147, 0.69);
3473 }
3474
3475 /* Responsive */
3476 @media (max-width: 1024px) {
3477 .ays-chart-christmas-banner-discount-text {
3478 font-size: 40px;
3479 }
3480 .ays-chart-christmas-banner-content {
3481 flex-wrap: wrap;
3482 }
3483 }
3484
3485 @media (max-width: 768px) {
3486 #ays-chart-christmas-banner-main {
3487 display: none !important;
3488 }
3489 }
3490 /* Christmas banner end */
3491 ';
3492 $content[] = '</style>';
3493
3494 $content = implode( '', $content );
3495
3496 echo $content;
3497 }
3498 }
3499
3500 public function ays_chart_update_banner_time(){
3501 if (!current_user_can('manage_options')) {
3502 return array('error' => 'Insufficient permissions');
3503 }
3504
3505 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
3506 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
3507 $next_3_days = gmdate('M d, Y H:i:s', $date);
3508
3509 $ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
3510
3511 if ( !$ays_chart_banner_time || is_null( $ays_chart_banner_time ) ) {
3512 update_option('ays_chart_20_bundle_banner_time', $next_3_days );
3513 }
3514
3515 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
3516
3517 $val = 60*60*24*0.5; // half day
3518 // $val = 60; // for testing | 1 min
3519
3520 $current_date = current_time( 'mysql' );
3521 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_chart_banner_time));
3522
3523 $days_diff = $date_diff / $val;
3524 if(intval($days_diff) > 0 ){
3525 update_option('ays_chart_20_bundle_banner_time', $next_3_days);
3526 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
3527 }
3528
3529 return $get_ays_chart_banner_time;
3530 }
3531
3532
3533 public function ays_chart_add_body_class( $classes ) {
3534 global $pagenow;
3535
3536 if ( $pagenow === 'admin.php' ) {
3537 $page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : '';
3538
3539 if ( strpos( $page, $this->plugin_name ) === 0 ) {
3540 $classes .= ' ays-chart-builder-admin';
3541 }
3542 }
3543
3544 return $classes;
3545 }
3546
3547 public function author_user_search() {
3548 check_ajax_referer( 'cbuilder-author-user-search', 'security' );
3549 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
3550 $search = isset($params['search']) && $params['search'] != '' ? sanitize_text_field( $params['search'] ) : null;
3551 $checked = isset($params['val']) && $params['val'] !='' ? sanitize_text_field( $params['val'] ) : null;
3552 $args = 'search=';
3553 if ($search !== null) {
3554 $args .= '*';
3555 $args .= $search;
3556 $args .= '*';
3557 }
3558
3559 $users = get_users($args);
3560
3561 $content_text = array(
3562 'results' => array()
3563 );
3564
3565 foreach ($users as $key => $value) {
3566 if ($checked !== null) {
3567 if ( !is_array( $checked ) ) {
3568 $checked2 = $checked;
3569 $checked = array();
3570 $checked[] = absint($checked2);
3571 }
3572 if (in_array($value->ID, $checked)) {
3573 continue;
3574 } else {
3575 $content_text['results'][] = array(
3576 'id' => $value->ID,
3577 'text' => $value->data->display_name,
3578 );
3579 }
3580 } else {
3581 $content_text['results'][] = array(
3582 'id' => $value->ID,
3583 'text' => $value->data->display_name,
3584 );
3585 }
3586 }
3587
3588 ob_end_clean();
3589 echo json_encode($content_text);
3590 wp_die();
3591 }
3592
3593 /**
3594 * Determine if the plugin/addon installations are allowed.
3595 *
3596 * @since 6.4.0.4
3597 *
3598 * @param string $type Should be `plugin` or `addon`.
3599 *
3600 * @return bool
3601 */
3602 public static function ays_chart_can_install( $type ) {
3603
3604 return self::ays_chart_can_do( 'install', $type );
3605 }
3606
3607 /**
3608 * Determine if the plugin/addon activations are allowed.
3609 *
3610 * @since 6.4.0.4
3611 *
3612 * @param string $type Should be `plugin` or `addon`.
3613 *
3614 * @return bool
3615 */
3616 public static function ays_chart_can_activate( $type ) {
3617
3618 return self::ays_chart_can_do( 'activate', $type );
3619 }
3620
3621 /**
3622 * Determine if the plugin/addon installations/activations are allowed.
3623 *
3624 * @since 6.4.0.4
3625 *
3626 * @param string $what Should be 'activate' or 'install'.
3627 * @param string $type Should be `plugin` or `addon`.
3628 *
3629 * @return bool
3630 */
3631 public static function ays_chart_can_do( $what, $type ) {
3632
3633 if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
3634 return false;
3635 }
3636
3637 if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
3638 return false;
3639 }
3640
3641 $capability = $what . '_plugins';
3642
3643 if ( ! current_user_can( $capability ) ) {
3644 return false;
3645 }
3646
3647 // Determine whether file modifications are allowed and it is activation permissions checking.
3648 if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_chart_can_install' ) ) {
3649 return false;
3650 }
3651
3652 // All plugin checks are done.
3653 if ( $type === 'plugin' ) {
3654 return true;
3655 }
3656 return false;
3657 }
3658
3659 /**
3660 * Activate plugin.
3661 *
3662 * @since 1.0.0
3663 * @since 6.4.0.4 Updated the permissions checking.
3664 */
3665 public function ays_chart_activate_plugin() {
3666
3667 // Run a security check.
3668 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', '_ajax_nonce' );
3669
3670
3671 // Check for permissions.
3672 if ( ! current_user_can( 'activate_plugins' ) ) {
3673 wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'chart-builder' ) );
3674 }
3675
3676 $type = 'addon';
3677
3678 if ( isset( $_POST['plugin'] ) ) {
3679
3680 if ( ! empty( $_POST['type'] ) ) {
3681 $type = sanitize_key( $_POST['type'] );
3682 }
3683
3684 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
3685 $activate = activate_plugins( $plugin );
3686
3687 if ( ! is_wp_error( $activate ) ) {
3688 if ( $type === 'plugin' ) {
3689 wp_send_json_success( esc_html__( 'Plugin activated.', 'chart-builder' ) );
3690 } else {
3691 ( esc_html__( 'Addon activated.', 'chart-builder' ) );
3692 }
3693 }
3694 }
3695
3696 if ( $type === 'plugin' ) {
3697 wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', 'chart-builder' ) );
3698 }
3699
3700 wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', 'chart-builder' ) );
3701 }
3702
3703 /**
3704 * Install addon.
3705 *
3706 * @since 1.0.0
3707 * @since 6.4.0.4 Updated the permissions checking.
3708 */
3709 public function ays_chart_install_plugin() {
3710
3711 // Run a security check.
3712 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', '_ajax_nonce' );
3713
3714
3715 $generic_error = esc_html__( 'There was an error while performing your request.', 'chart-builder' );
3716 $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
3717
3718 // Check if new installations are allowed.
3719 if ( ! self::ays_chart_can_install( $type ) ) {
3720 wp_send_json_error( $generic_error );
3721 }
3722
3723 $error = $type === 'plugin'
3724 ? esc_html__( 'Could not install the plugin. Please download and install it manually.', 'chart-builder' )
3725 : "";
3726
3727 $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
3728
3729 if ( empty( $plugin_url ) ) {
3730 wp_send_json_error( $error );
3731 }
3732
3733 // Prepare variables.
3734 $url = esc_url_raw(
3735 add_query_arg(
3736 [
3737 'page' => 'chart-builder-featured-plugins',
3738 ],
3739 admin_url( 'admin.php' )
3740 )
3741 );
3742
3743 ob_start();
3744 $creds = request_filesystem_credentials( $url, '', false, false, null );
3745
3746 // Hide the filesystem credentials form.
3747 ob_end_clean();
3748
3749 // Check for file system permissions.
3750 if ( $creds === false ) {
3751 wp_send_json_error( $error );
3752 }
3753
3754 if ( ! WP_Filesystem( $creds ) ) {
3755 wp_send_json_error( $error );
3756 }
3757
3758 /*
3759 * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
3760 */
3761 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-upgrader.php';
3762 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-install-skin.php';
3763 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-skin.php';
3764
3765
3766 // Do not allow WordPress to search/download translations, as this will break JS output.
3767 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
3768
3769 // Create the plugin upgrader with our custom skin.
3770 $installer = new ChartBuilder\Helpers\ChartBuilderPluginSilentUpgrader( new Chart_Builder_Install_Skin() );
3771
3772 // Error check.
3773 if ( ! method_exists( $installer, 'install' ) ) {
3774 wp_send_json_error( $error );
3775 }
3776
3777 $installer->install( $plugin_url );
3778
3779 // Flush the cache and return the newly installed plugin basename.
3780 wp_cache_flush();
3781
3782 $plugin_basename = $installer->plugin_info();
3783
3784 if ( empty( $plugin_basename ) ) {
3785 wp_send_json_error( $error );
3786 }
3787
3788 $result = array(
3789 'msg' => $generic_error,
3790 'is_activated' => false,
3791 'basename' => $plugin_basename,
3792 );
3793
3794 // Check for permissions.
3795 if ( ! current_user_can( 'activate_plugins' ) ) {
3796 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', 'chart-builder' ) : "";
3797
3798 wp_send_json_success( $result );
3799 }
3800
3801 // Activate the plugin silently.
3802 $activated = activate_plugin( $plugin_basename );
3803 remove_action( 'activated_plugin', array( 'ays_sccp_activation_redirect_method', 'gallery_p_gallery_activation_redirect_method', 'poll_maker_activation_redirect_method' ), 100 );
3804
3805 if ( ! is_wp_error( $activated ) ) {
3806
3807 $result['is_activated'] = true;
3808 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', 'chart-builder' ) : esc_html__( 'Addon installed and activated.', 'chart-builder' );
3809
3810 wp_send_json_success( $result );
3811 }
3812
3813 // Fallback error just in case.
3814 wp_send_json_error( $result );
3815 }
3816
3817 /**
3818 * List of AM plugins that we propose to install.
3819 *
3820 * @since 6.4.0.4
3821 *
3822 * @return array
3823 */
3824 protected function get_am_plugins() {
3825 if ( !isset( $_SESSION ) ) {
3826 session_start();
3827 }
3828
3829 $images_url = CHART_BUILDER_ADMIN_URL . '/images/icons/';
3830
3831 $plugin_slug = array(
3832 'fox-lms',
3833 'quiz-maker',
3834 'survey-maker',
3835 'poll-maker',
3836 'chart-builder',
3837 'ays-popup-box',
3838 'secure-copy-content-protection',
3839 'gallery-photo-gallery',
3840 'ays-chatgpt-assistant',
3841 'easy-form',
3842 );
3843
3844 $plugin_url_arr = array();
3845 foreach ($plugin_slug as $key => $slug) {
3846 if ( isset( $_SESSION['ays_chart_our_product_links'] ) && !empty( $_SESSION['ays_chart_our_product_links'] )
3847 && isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && !empty( $_SESSION['ays_chart_our_product_links'][$slug] ) ) {
3848 $plugin_url = (isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && $_SESSION['ays_chart_our_product_links'][$slug] != "") ? esc_url_raw(sanitize_text_field($_SESSION['ays_chart_our_product_links'][$slug])) : "";
3849 } else {
3850 $latest_version = $this->ays_chart_get_latest_plugin_version($slug);
3851 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
3852 if ( $latest_version != '' ) {
3853 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
3854 $_SESSION['ays_chart_our_product_links'][$slug] = $plugin_url;
3855 }
3856 }
3857
3858 $plugin_url_arr[$slug] = $plugin_url;
3859 }
3860
3861 $plugins_array = array(
3862 'fox-lms/fox-lms.php' => array(
3863 'icon' => $images_url . 'icon-fox-lms-128x128.png',
3864 'name' => __( 'Fox LMS', 'chart-builder' ),
3865 'desc' => __( 'Build and manage online courses directly on your WordPress site.', 'chart-builder' ),
3866 'desc_hidden' => __( 'With the FoxLMS plugin, you can create, sell, and organize courses, lessons, and quizzes, transforming your website into a dynamic e-learning platform.', 'chart-builder' ),
3867 'wporg' => 'https://wordpress.org/plugins/fox-lms/',
3868 'buy_now' => 'https://foxlms.com/pricing/?utm_source=dashboard&utm_medium=chart-free&utm_campaign=fox-lms-our-products-page',
3869 'url' => $plugin_url_arr['fox-lms'],
3870 ),
3871 'quiz-maker/quiz-maker.php' => array(
3872 'icon' => $images_url . 'icon-quiz-128x128.png',
3873 'name' => __( 'Quiz Maker', 'chart-builder' ),
3874 'desc' => __( 'Create powerful and engaging quizzes, tests, and exams in minutes.', 'chart-builder' ),
3875 'desc_hidden' => __( 'Build an unlimited number of quizzes and questions.', 'chart-builder' ),
3876 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
3877 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
3878 'url' => $plugin_url_arr['quiz-maker'],
3879 ),
3880 'survey-maker/survey-maker.php' => array(
3881 'icon' => $images_url . 'icon-survey-128x128.png',
3882 'name' => __( 'Survey Maker', 'chart-builder' ),
3883 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'chart-builder' ),
3884 'desc_hidden' => __( 'Learn what your website visitors want, need, and expect with the help of Survey Maker. Build surveys without limiting your needs.', 'chart-builder' ),
3885 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
3886 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
3887 'url' => $plugin_url_arr['survey-maker'],
3888 ),
3889 'poll-maker/poll-maker-ays.php' => array(
3890 'icon' => $images_url . 'icon-poll-128x128.png',
3891 'name' => __( 'Poll Maker', 'chart-builder' ),
3892 'desc' => __( 'Create amazing online polls for your WordPress website super easily.', 'chart-builder' ),
3893 'desc_hidden' => __( 'Build up various types of polls in a minute and get instant feedback on any topic or product.', 'chart-builder' ),
3894 'wporg' => 'https://wordpress.org/plugins/poll-maker/',
3895 'buy_now' => 'https://ays-pro.com/wordpress/poll-maker/',
3896 'url' => $plugin_url_arr['poll-maker'],
3897 ),
3898 'ays-popup-box/ays-pb.php' => array(
3899 'icon' => $images_url . 'icon-popup-128x128.png',
3900 'name' => __( 'Popup Box', 'chart-builder' ),
3901 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'chart-builder' ),
3902 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'chart-builder' ),
3903 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
3904 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
3905 'url' => $plugin_url_arr['ays-popup-box'],
3906 ),
3907 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
3908 'icon' => $images_url . 'icon-sccp-128x128.png',
3909 'name' => __( 'Secure Copy Content Protection', 'chart-builder' ),
3910 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'chart-builder' ),
3911 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'chart-builder' ),
3912 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
3913 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
3914 'url' => $plugin_url_arr['secure-copy-content-protection'],
3915 ),
3916 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
3917 'icon' => $images_url . 'icon-gallery-128x128.png',
3918 'name' => __( 'Gallery Photo Gallery', 'chart-builder' ),
3919 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'chart-builder' ),
3920 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'chart-builder' ),
3921 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
3922 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
3923 'url' => $plugin_url_arr['gallery-photo-gallery'],
3924 ),
3925 'ays-chatgpt-assistant/ays-chatgpt-assistant.php' => array(
3926 'icon' => $images_url . 'icon-chatgpt-128x128.png',
3927 'name' => __( 'AI Assistant with ChatGPT', 'chart-builder' ),
3928 'desc' => __( 'ChatGPT AI Assistant plugin gives you the ability to automate various tasks related to content creation and programming.', 'chart-builder' ),
3929 'desc_hidden' => __( 'The ChatGPT AI Assistant plugin is here to empower your WordPress website. Have your personal chatbot, content generator right on your front end and backend.', 'chart-builder' ),
3930 'wporg' => 'https://wordpress.org/plugins/ays-chatgpt-assistant/',
3931 'buy_now' => 'https://ays-pro.com/wordpress/chatgpt-assistant',
3932 'url' => $plugin_url_arr['ays-chatgpt-assistant'],
3933 ),
3934 'easy-form/easy-form.php' => array(
3935 'icon' => $images_url . 'icon-form-128x128.png',
3936 'name' => __( 'Easy Form', 'chart-builder' ),
3937 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'chart-builder' ),
3938 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'chart-builder' ),
3939 'wporg' => 'https://wordpress.org/plugins/easy-form/',
3940 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
3941 'url' => $plugin_url_arr['easy-form'],
3942 ),
3943 );
3944
3945 return $plugins_array;
3946 }
3947
3948 protected function ays_chart_get_latest_plugin_version( $slug ){
3949
3950 if ( is_null( $slug ) || empty($slug) ) {
3951 return "";
3952 }
3953
3954 $version_latest = "";
3955
3956 if ( ! function_exists( 'plugins_api' ) ) {
3957 require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
3958 }
3959
3960 // set the arguments to get latest info from repository via API ##
3961 $args = array(
3962 'slug' => $slug,
3963 'fields' => array(
3964 'version' => true,
3965 )
3966 );
3967
3968 /** Prepare our query */
3969 $call_api = plugins_api( 'plugin_information', $args );
3970
3971 /** Check for Errors & Display the results */
3972 if ( is_wp_error( $call_api ) ) {
3973 $api_error = $call_api->get_error_message();
3974 } else {
3975
3976 //echo $call_api;
3977 // everything ##
3978 if ( ! empty( $call_api->version ) ) {
3979 $version_latest = $call_api->version;
3980 }
3981 }
3982
3983 return $version_latest;
3984 }
3985
3986 /**
3987 * Get AM plugin data to display in the Addons section of About tab.
3988 *
3989 * @since 6.4.0.4
3990 *
3991 * @param string $plugin Plugin slug.
3992 * @param array $details Plugin details.
3993 * @param array $all_plugins List of all plugins.
3994 *
3995 * @return array
3996 */
3997 protected function get_plugin_data( $plugin, $details, $all_plugins ) {
3998
3999 $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
4000 $show_pro = false;
4001
4002 $plugin_data = array();
4003
4004 if ( $have_pro ) {
4005 if ( array_key_exists( $plugin, $all_plugins ) ) {
4006 if ( is_plugin_active( $plugin ) ) {
4007 $show_pro = true;
4008 }
4009 }
4010 if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
4011 $show_pro = true;
4012 }
4013 if ( $show_pro ) {
4014 $plugin = $details['pro']['plug'];
4015 $details = $details['pro'];
4016 }
4017 }
4018
4019 if ( array_key_exists( $plugin, $all_plugins ) ) {
4020 if ( is_plugin_active( $plugin ) ) {
4021 // Status text/status.
4022 $plugin_data['status_class'] = 'status-active';
4023 $plugin_data['status_text'] = esc_html__( 'Active', 'chart-builder' );
4024 // Button text/status.
4025 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info disabled';
4026 $plugin_data['action_text'] = esc_html__( 'Activated', 'chart-builder' );
4027 $plugin_data['plugin_src'] = esc_attr( $plugin );
4028 } else {
4029 // Status text/status.
4030 $plugin_data['status_class'] = 'status-installed';
4031 $plugin_data['status_text'] = esc_html__( 'Inactive', 'chart-builder' );
4032 // Button text/status.
4033 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
4034 $plugin_data['action_text'] = esc_html__( 'Activate', 'chart-builder' );
4035 $plugin_data['plugin_src'] = esc_attr( $plugin );
4036 }
4037 } else {
4038 // Doesn't exist, install.
4039 // Status text/status.
4040 $plugin_data['status_class'] = 'status-missing';
4041
4042 if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
4043 $plugin_data['status_class'] = 'status-go-to-url';
4044 }
4045 $plugin_data['status_text'] = esc_html__( 'Not Installed', 'chart-builder' );
4046 // Button text/status.
4047 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
4048 $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'chart-builder' );
4049 $plugin_data['plugin_src'] = esc_url( $details['url'] );
4050 }
4051
4052 $plugin_data['details'] = $details;
4053
4054 return $plugin_data;
4055 }
4056
4057 /**
4058 * Display the Addons section of About tab.
4059 *
4060 * @since 6.4.0.4
4061 */
4062 public function output_about_addons() {
4063
4064 if ( ! function_exists( 'get_plugins' ) ) {
4065 require_once ABSPATH . 'wp-admin/includes/plugin.php';
4066 }
4067
4068 $all_plugins = get_plugins();
4069 $am_plugins = $this->get_am_plugins();
4070 $can_install_plugins = self::ays_chart_can_install( 'plugin' );
4071 $can_activate_plugins = self::ays_chart_can_activate( 'plugin' );
4072
4073 $content = '';
4074 $content.= '<div class="ays-chart-cards-block">';
4075 foreach ( $am_plugins as $plugin => $details ){
4076
4077 $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins );
4078 $plugin_ready_to_activate = $can_activate_plugins
4079 && isset( $plugin_data['status_class'] )
4080 && $plugin_data['status_class'] === 'status-installed';
4081 $plugin_not_activated = ! isset( $plugin_data['status_class'] )
4082 || $plugin_data['status_class'] !== 'status-active';
4083
4084 $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
4085
4086 $plugin_action_class_disbaled = "";
4087 if ( strpos($plugin_action_class, 'status-active') !== false ) {
4088 $plugin_action_class_disbaled = "disbaled='true'";
4089 }
4090
4091 $content .= '
4092 <div class="ays-chart-card">
4093 <div class="ays-chart-card__content flexible">
4094 <div class="ays-chart-card__content-img-box">
4095 <img class="ays-chart-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
4096 </div>
4097 <div class="ays-chart-card__text-block">
4098 <h5 class="ays-chart-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
4099 <p class="ays-chart-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
4100 <span class="ays-chart-card__text-hidden">
4101 '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
4102 </span>
4103 </p>
4104 </div>
4105 </div>
4106 <div class="ays-chart-card__footer">';
4107 if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
4108 $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
4109 '. wp_kses_post( $plugin_data['action_text'] ) .'
4110 </button>';
4111 }
4112 elseif ( $plugin_not_activated ) {
4113 $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
4114 '. esc_html_e( 'WordPress.org', 'chart-builder' ) .'
4115 <span aria-hidden="true" class="dashicons dashicons-external"></span>
4116 </a>';
4117 }
4118 $content .='
4119 <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-chart-card__btn-primary">'. __('Buy Now', 'chart-builder') .'</a>
4120 </div>
4121 </div>';
4122 }
4123 $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
4124 $content.= '<input type="hidden" id="ays_chart_ajax_install_plugin_nonce" name="ays_chart_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
4125 $content.= '</div>';
4126
4127 echo html_entity_decode($content);
4128 }
4129
4130 /**
4131 * Returns the data from Quiz maker.
4132 *
4133 * @access public
4134 */
4135 public function fetch_quiz_maker_data(){
4136 check_ajax_referer( 'cbuilder-fetch-quiz-maker-data', 'security' );
4137
4138 $params = isset($_REQUEST['params']) ? $_REQUEST['params'] : array();
4139 if ( !isset($params) || empty($params) ) {
4140 return array(
4141 'success' => false,
4142 'data' => array(
4143 'msg' => __( "Something went wrong.", "chart-builder" )
4144 )
4145 );
4146 }
4147
4148 $query = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
4149 if ( $query == '' ) {
4150 return array(
4151 'success' => false,
4152 'data' => array(
4153 'msg' => __( "No data given.", "chart-builder" )
4154 )
4155 );
4156 }
4157 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : null;
4158 $user_id = get_current_user_id();
4159
4160 $return_results = CBFunctions()->get_quiz_query($query, $quiz_id, $user_id);
4161
4162 if (empty($return_results)) {
4163 return array(
4164 'success' => false,
4165 'data' => array(
4166 'msg' => __( "Something went wrong.", "chart-builder" )
4167 )
4168 );
4169 }
4170
4171 $result_values = $return_results['result'];
4172 $query = $return_results['query'];
4173
4174 if (empty($result_values)) {
4175 return array(
4176 'success' => false,
4177 'data' => array(
4178 'msg' => $return_results['message']
4179 )
4180 );
4181 }
4182
4183 if (count($return_results['result'][0]) != 1 ) {
4184 $results = array();
4185 $headers = array();
4186 if ( $result_values ) {
4187 $row_num = 0;
4188 foreach ( $result_values as $row ) {
4189 $result = array();
4190 foreach ( $row as $k => $v ) {
4191 $result[] = $v;
4192 if ( $row_num === 0 ) {
4193 $headers[] = $k;
4194 }
4195 }
4196 $results[] = $result;
4197 $row_num++;
4198 }
4199 }
4200 } else if (count($return_results['result'][0]) == 1) {
4201 $results = array();
4202 $headers = array();
4203 if ( $result_values ) {
4204 $row_num = 0;
4205 foreach ( $result_values as $index => $row ) {
4206 $result = array();
4207 foreach ( $row as $k => $v ) {
4208 $result[] = strval($index) + 1;
4209 $result[] = $v;
4210 if ( $row_num === 0 ) {
4211 $headers[] = 'Quiz';
4212 $headers[] = $k;
4213 }
4214 }
4215 $results[] = $result;
4216 $row_num++;
4217 }
4218 }
4219 }
4220
4221 if (empty($results)) {
4222 return array(
4223 'success' => false,
4224 'data' => array(
4225 'msg' => $return_results['message']
4226 )
4227 );
4228 }
4229
4230 foreach ($results as $key => $value) {
4231 if (!isset($value) || count($value) <= 1 && $key != 0) {
4232 unset($results[$key]);
4233 }
4234 }
4235
4236 array_unshift($results, $headers);
4237 $results = array_values( $results );
4238 $data = $results;
4239
4240 $headers = $results[0];
4241 unset( $results[0] );
4242
4243 $html = CBFunctions()->get_table_html( $headers, $results );
4244
4245 return array(
4246 'success' => true,
4247 'data' => array(
4248 'table' => $html,
4249 'data' => $data
4250 )
4251 );
4252 }
4253
4254 /**
4255 * Saves the Quiz maker data.
4256 *
4257 * @access public
4258 */
4259 public function save_quiz_maker_data() {
4260 check_ajax_referer( 'cbuilder-save-quiz-maker-data', 'security' );
4261
4262 $params = isset($_REQUEST['params']) ? $_REQUEST['params'] : array();
4263 if ( !isset($params) || empty($params) ) {
4264 return array(
4265 'success' => false,
4266 'data' => array(
4267 'msg' => __( "Something went wrong.", "chart-builder" )
4268 )
4269 );
4270 }
4271
4272 $query_id = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
4273 if ( $query_id == '' ) {
4274 return array(
4275 'success' => false,
4276 'data' => array(
4277 'msg' => __( "No data given.", "chart-builder" )
4278 )
4279 );
4280 }
4281
4282 $chart_id = isset( $params['chart_id'] ) ? absint( $params['chart_id'] ) : 0;
4283 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : 0;
4284 $user_id = get_current_user_id();
4285
4286 if ( $chart_id >= 0 ) {
4287
4288 $return_results = CBFunctions()->get_quiz_query($query_id, $quiz_id, $user_id);
4289
4290 if (empty($return_results)) {
4291 return array(
4292 'success' => false,
4293 'data' => array(
4294 'msg' => __( "Something went wrong.", "chart-builder" )
4295 )
4296 );
4297 }
4298
4299 $result_values = $return_results['result'];
4300 $query = $return_results['query'];
4301
4302 if (empty($result_values)) {
4303 return array(
4304 'success' => false,
4305 'data' => array(
4306 'msg' => $return_results['message']
4307 )
4308 );
4309 }
4310
4311 if ( !empty($result_values) && count($return_results['result'][0]) != 1 ) {
4312 $results = array();
4313 $headers = array();
4314 if ( $result_values ) {
4315 $row_num = 0;
4316 foreach ( $result_values as $row ) {
4317 $result = array();
4318 foreach ( $row as $k => $v ) {
4319 $result[] = $v;
4320 if ( $row_num === 0 ) {
4321 $headers[] = $k;
4322 }
4323 }
4324 $results[] = $result;
4325 $row_num++;
4326 }
4327 }
4328 } else if (count($return_results['result'][0]) == 1) {
4329 $results = array();
4330 $headers = array();
4331 if ( $result_values ) {
4332 $row_num = 0;
4333 foreach ( $result_values as $index => $row ) {
4334 $result = array();
4335 foreach ( $row as $k => $v ) {
4336 $result[] = strval($index) + 1;
4337 $result[] = $v;
4338 if ( $row_num === 0 ) {
4339 $headers[] = 'Quiz';
4340 $headers[] = $k;
4341 }
4342 }
4343 $results[] = $result;
4344 $row_num++;
4345 }
4346 }
4347 }
4348
4349 $source_type = 'quiz_maker';
4350 $option_name_for_data = $chart_id == 0 ? 'ays_chart_quiz_maker_results_temp' : 'ays_chart_quiz_maker_results_' . $chart_id;
4351 $option_name_for_quiz = $chart_id == 0 ? 'ays_chart_quiz_maker_quiz_data_temp' : 'ays_chart_quiz_maker_quiz_data_' . $chart_id;
4352
4353 update_option( $option_name_for_data, array(
4354 'source_type' => $source_type,
4355 'source' => $query,
4356 'data' => $results,
4357 ) );
4358 update_option( $option_name_for_quiz, array(
4359 'quiz_query' => $query_id,
4360 'quiz_id' => $quiz_id
4361 ) );
4362
4363 } else {
4364 return array(
4365 'success' => false,
4366 'data' => array(
4367 'msg' => __( 'Given incorrect Chart ID.', "chart-builder")
4368 )
4369 );
4370 }
4371
4372 return array(
4373 'success' => true,
4374 'data' => array(
4375 'msg' => __( 'Data was successfully saved.', "chart-builder" )
4376 )
4377 );
4378 }
4379
4380 /**
4381 * Chart page action hooks
4382 */
4383
4384 /**
4385 * Chart page sources contents
4386 * @param $args
4387 */
4388 public function ays_chart_page_source_contents( $args ){
4389 $chart_source_type = $args['chart_source_type'];
4390
4391 if ($chart_source_type === 'chart-js') {
4392 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings_chartjs', array(), $args );
4393 } else {
4394 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings', array(), $args );
4395 }
4396
4397 $source_type = $args['source_type'];
4398
4399 $sources = array();
4400 foreach ( $sources_contents as $key => $sources_content ) {
4401 $collapsed = $key == $source_type ? 'false' : 'true';
4402
4403 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="'. $collapsed .'">';
4404 if( isset( $sources_content['title'] ) ){
4405 $content .= '<legend class="ays-accordion-options-header">';
4406 $content .= '<svg class="ays-accordion-arrow '. ( $key == $source_type ? 'ays-accordion-arrow-down' : 'ays-accordion-arrow-right' ) .'" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
4407 <g>
4408 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: '. ( $key == $source_type ? '#008cff' : '#c4c4c4' ) .';" vector-effect="non-scaling-stroke" />
4409 </g>
4410 </svg>';
4411
4412 $content .= '<span>'. $sources_content['title'] .'</span></legend>';
4413 }
4414
4415 $content .= '<div class="ays-accordion-options-content">';
4416 $content .= $sources_content['content'];
4417 $content .= '</div>';
4418
4419 $content .= '</fieldset>';
4420
4421 $sources[] = $content;
4422 }
4423 $content_for_escape = implode('' , $sources );
4424 echo html_entity_decode( esc_html($content_for_escape) );
4425 }
4426
4427 public function source_contents_import_from_csv_settings( $sources, $args ){
4428 $html_class_prefix = $args['html_class_prefix'];
4429 $html_name_prefix = $args['html_name_prefix'];
4430
4431 ob_start();
4432 ?>
4433 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
4434 <div class="ays-pro-features-v2-big-buttons-box">
4435 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
4436 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
4437 <div class="ays-pro-features-v2-video-text">
4438 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
4439 </div>
4440 </a>
4441 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4442 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4443 <div class="ays-pro-features-v2-upgrade-text">
4444 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
4445 </div>
4446 </a>
4447 </div>
4448 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap">
4449 <div class="<?php echo esc_attr($html_class_prefix) ?>file-import-form">
4450 <h6><?php echo esc_html__("Choose what kind of data would you like to upload.", "chart-builder"); ?></h6>
4451 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>import-files-file-type">
4452 <option value="csv">CSV File</option>
4453 </select>
4454 <span style="display: block; font-style: italic; color: gray; font-size: 12px; margin: 5px 0;" class="<?php echo esc_attr($html_class_prefix) ?>small-hint-text"><?php echo esc_html__("Choose the format of the file you are going to import.", "chart-builder"); ?></span>
4455 <p class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example" style="font-size: 15px; font-style: italic;">Example:
4456 <a class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example-link <?php echo esc_attr($html_class_prefix) ?>csv-export-example-link-other-types" style="cursor: pointer;">example.csv</a>
4457 </p>
4458 <div>
4459 <input style="padding: 0.5rem 1rem;" class="form-control form-control-md" id="<?php echo esc_attr($html_class_prefix) ?>import-files-input" name="<?php echo esc_attr($html_class_prefix) ?>import-files-input" type="file" accept=".csv" />
4460 </div>
4461 <div class='ays-chart-file-import-success'></div>
4462 <div class='ays-chart-file-import-error'></div>
4463 <div class="ays-chart-buttons-group">
4464 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-fetch">
4465 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
4466 </button>
4467 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-show-on-chart">
4468 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
4469 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
4470 </button>
4471 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-save">
4472 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
4473 </button>
4474 </div>
4475 </div>
4476 </div>
4477 </div>
4478 <?php
4479 $content = ob_get_clean();
4480
4481 $title = __( 'Import data from file', "chart-builder" ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("With the help of this option, you can import a file in your chosen file format.","chart-builder") . '">
4482 <i class="ays_fa ays_fa_info_circle"></i>
4483 </a>';
4484
4485 $sources['file_import'] = array(
4486 'content' => $content,
4487 'title' => $title
4488 );
4489
4490 return $sources;
4491 }
4492
4493 public function source_contents_import_from_db_settings( $sources, $args ){
4494 $html_class_prefix = $args['html_class_prefix'];
4495 $html_name_prefix = $args['html_name_prefix'];
4496
4497 ob_start();
4498 ?>
4499 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
4500 <div class="ays-pro-features-v2-big-buttons-box">
4501 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
4502 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
4503 <div class="ays-pro-features-v2-video-text">
4504 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
4505 </div>
4506 </a>
4507 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4508 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4509 <div class="ays-pro-features-v2-upgrade-text">
4510 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
4511 </div>
4512 </a>
4513 </div>
4514 <div class="<?php echo esc_attr( $html_class_prefix ) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
4515 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
4516 <div id="ays-chart-db-query">
4517 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
4518 <div id="db-query-form">
4519 <input type="hidden" name="chart_id" value="1">
4520 <textarea name="query" class="<?php echo esc_attr($html_class_prefix) ?>db-query" placeholder="<?php echo esc_html__( "Add your query here.", 'chart-builder' ); ?>"></textarea>
4521 <div class='db-wizard-success'></div>
4522 <div class='db-wizard-error'></div>
4523 </div>
4524 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
4525 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-fetch">
4526 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
4527 </button>
4528 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-show-on-chart">
4529 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
4530 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
4531 </button>
4532 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-save">
4533 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
4534 </button>
4535 </div>
4536 </div>
4537 <div class="db-wizard-hints">
4538 <ul>
4539 <!-- <li><//?php echo sprintf( __( 'For examples of queries and links to resources that you can use with this feature, please click %1$shere%2$s', $this->plugin_name ), '<a href="' . '#' . '" target="_blank">', '</a>' ); ?></li> -->
4540 <li>
4541 <?php
4542 echo sprintf(
4543 /* translators: %1$s and %2$s are HTML span tags for styling. */
4544 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
4545 '<span class="ays-chart-emboss">',
4546 '</span>'
4547 );
4548 ?>
4549 </li>
4550 </ul>
4551 </div>
4552 </div>
4553 </div>
4554 </div>
4555 </div>
4556 <?php
4557 $content = ob_get_clean();
4558
4559 $title = __( 'Connect to Database', 'chart-builder') . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Insert the Database query and the appropriate information from your Database will be displayed in the chart.", 'chart-builder') . '">
4560 <i class="ays_fa ays_fa_info_circle"></i>
4561 </a>';
4562
4563 $sources['import_from_db'] = array(
4564 'content' => $content,
4565 'title' => $title
4566 );
4567
4568 return $sources;
4569 }
4570
4571 public function source_contents_import_from_external_db_settings( $sources, $args ){
4572 $html_class_prefix = $args['html_class_prefix'];
4573 $html_name_prefix = $args['html_name_prefix'];
4574
4575 ob_start();
4576 ?>
4577 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
4578 <div class="ays-pro-features-v2-big-buttons-box">
4579 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4580 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4581 <div class="ays-pro-features-v2-upgrade-text">
4582 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
4583 </div>
4584 </a>
4585 </div>
4586 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
4587 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
4588 <div class="form-group row mb-2">
4589 <div class="col-sm-8 <?php echo esc_attr($html_class_prefix) ?>option-title">
4590 <label class="form-label">
4591 <?php echo esc_html(__('Use custom database settings for this chart', "chart-builder")); ?>
4592 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __(".","chart-builder") ); ?>">
4593 <i class="ays_fa ays_fa_info_circle"></i>
4594 </a>
4595 </label>
4596 </div>
4597 <div class="col-sm-3 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4598 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4599 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" type="checkbox" />
4600 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4601 </label>
4602 </div>
4603 </div>
4604 <div id="ays-chart-external-db-query">
4605 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
4606 <div id="external-db-query-form">
4607 <input type="hidden" name="chart_id" value="1">
4608 <textarea name="query" class="<?php echo esc_attr($html_class_prefix) ?>external-db-query" placeholder="<?php echo esc_html__( "Add your query here.", 'chart-builder' ); ?>"></textarea>
4609 <div class='db-wizard-success'></div>
4610 <div class='db-wizard-error'></div>
4611 </div>
4612 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
4613 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-fetch">
4614 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
4615 </button>
4616 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-show-on-chart">
4617 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
4618 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
4619 </button>
4620 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-save">
4621 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
4622 </button>
4623 </div>
4624 </div>
4625 <div class="db-wizard-hints">
4626 <ul>
4627 <!-- <li><//?php echo sprintf( __( 'For examples of queries and links to resources that you can use with this feature, please click %1$shere%2$s', $this->plugin_name ), '<a href="' . '#' . '" target="_blank">', '</a>' ); ?></li> -->
4628 <li>
4629 <?php
4630 echo sprintf(
4631 /* translators: %1$s and %2$s are HTML span tags for styling. */
4632 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
4633 '<span class="ays-chart-emboss">',
4634 '</span>'
4635 );
4636 ?>
4637 </li>
4638 </ul>
4639 </div>
4640 </div>
4641 </div>
4642 </div>
4643 </div>
4644 <?php
4645 $content = ob_get_clean();
4646
4647 $title = __( 'Connect to External Database', 'chart-builder' ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Insert the Database query and fetch data from an external database.", 'chart-builder') . '">
4648 <i class="ays_fa ays_fa_info_circle"></i>
4649 </a>';
4650
4651 $sources['import_from_external_db'] = array(
4652 'content' => $content,
4653 'title' => $title
4654 );
4655
4656 return $sources;
4657 }
4658
4659 public function source_contents_quiz_maker_integration_settings( $sources, $args ){
4660 global $wpdb;
4661 $chart_id = $args['chart_id'];
4662 $html_class_prefix = $args['html_class_prefix'];
4663 $html_name_prefix = $args['html_name_prefix'];
4664 $source = $args['source'];
4665 $settings = $args['settings'];
4666 $quiz_queries = $args['quiz_queries'];
4667 $quiz_query_tooltips = $args['quiz_query_tooltips'];
4668 $quiz_id = $args['quiz_id'];
4669 $quiz_query = $args['quiz_query'];
4670
4671 if ( !is_plugin_active('quiz-maker/quiz-maker.php') && !is_plugin_active('quiz-maker-pro/quiz-maker-pro.php') ) {
4672 // $title = sprintf( __( 'Get Quiz Maker data', "chart-builder" ) . ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' . __("By using this option, you can display the quiz statistics by charts.%s %sNote:%s The Quiz Maker plugin must be active.","chart-builder") . '">
4673 // <i class="ays_fa ays_fa_info_circle"></i>
4674 // </a>', '<br>', '<b>', '</b>');
4675 // $content = $this->blockquote_content_quiz;
4676 // $sources['quiz_maker'] = array(
4677 // 'content' => $content,
4678 // 'title' => $title
4679 // );
4680
4681 return $sources;
4682 }
4683 $quizes = $wpdb->get_results( // phpcs:ignore
4684 $wpdb->prepare(
4685 "SELECT `title`, `id` FROM {$wpdb->prefix}aysquiz_quizes
4686 WHERE `published` = %d AND `question_ids` <> %s",
4687 1,
4688 ''
4689 ),
4690 ARRAY_A
4691 );
4692
4693
4694 ob_start();
4695 ?>
4696 <div class="ays-accordion-data-main-wrap">
4697 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
4698 <div id="<?php echo esc_attr($html_class_prefix) ?>quiz-maker-form">
4699 <input type="hidden" class="<?php echo esc_attr($html_class_prefix) ?>chart-id" value="<?php echo esc_attr($chart_id) ?>">
4700 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-data-query-container" id="<?php echo esc_attr($html_class_prefix) ?>quiz-queries">
4701 <a class="ays_help <?php echo esc_attr($html_class_prefix) ?>quiz-query-tooltip" data-bs-toggle="tooltip" data-bs-html="true" title="<?php echo isset($quiz_query) ? esc_attr($quiz_query_tooltips[$quiz_query]) : esc_html__( 'Select a query to display quiz data.', 'chart-builder' ) ?>">
4702 <i class="ays_fa ays_fa_info_circle"></i>
4703 </a>
4704 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-data-query" name="<?php echo esc_attr($html_name_prefix) ?>quiz_query">
4705 <option value=""><?php echo esc_html__( "Select query", "chart-builder" ) ?></option>
4706 <?php foreach ( $quiz_queries as $id => $q):
4707 $disabled = preg_replace('/[^0-9]/', '', $id) <= 6 ? "false" : "true" ; ?>
4708 <option value="<?php echo esc_attr($id) ?>" <?php echo $quiz_query == $id ? 'selected' : '' ?> <?php echo 'is-pro="'.esc_attr($disabled).'"'; ?>><?php echo esc_attr($q) ?></option>
4709 <?php endforeach; ?>
4710 </select>
4711 </div>
4712 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz-container">
4713 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz" name="<?php echo esc_attr($html_name_prefix) ?>quiz_id">
4714 <option value="0"><?php echo esc_html__( "Select quiz", "chart-builder" ) ?></option>
4715 <?php foreach ( $quizes as $quiz): ?>
4716 <option value="<?php echo esc_attr($quiz['id']) ?>" <?php echo $quiz_id == $quiz['id'] ? 'selected' : '' ?> ><?php echo esc_html($quiz['title'] )?></option>
4717 <?php endforeach; ?>
4718 </select>
4719 </div>
4720 <div id="ays-chart-quiz-maker-success"></div>
4721 <div id="ays-chart-quiz-maker-error"></div>
4722 <div class="ays-chart-buttons-group">
4723 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-fetch">
4724 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
4725 </button>
4726 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-show-on-chart">
4727 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
4728 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
4729 </button>
4730 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-save">
4731 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
4732 </button>
4733 </div>
4734 </div>
4735 <div>
4736 <a href="https://www.youtube.com/watch?v=vqx76dw6NC8" target="_blank" style="text-decoration:none;font-style:italic"><?php echo esc_html__('How to Connect Quizzes to Charts', 'chart-builder'); ?></a>
4737 </div>
4738 </div>
4739 </div>
4740 <?php
4741 $content = ob_get_clean();
4742
4743 $title = sprintf(
4744 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
4745 __( 'Get Quiz Maker data', 'chart-builder' ) .
4746 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
4747 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
4748 __( 'By using this option, you can display the quiz statistics by charts.%1$s %2$sNote:%3$s The Quiz Maker plugin must be active.', 'chart-builder' ) . '">
4749 <i class="ays_fa ays_fa_info_circle"></i>
4750 </a>',
4751 '<br>', '<b>', '</b>'
4752 );
4753 $sources['quiz_maker'] = array(
4754 'content' => $content,
4755 'title' => $title
4756 );
4757
4758 return $sources;
4759 }
4760
4761 public function source_contents_woocommerce_integration_settings( $sources, $args ){
4762 if ( !is_plugin_active('woocommerce/woocommerce.php') ) {
4763 return $sources;
4764 }
4765
4766 $chart_id = $args['chart_id'];
4767 $html_class_prefix = $args['html_class_prefix'];
4768 $html_name_prefix = $args['html_name_prefix'];
4769 ob_start();
4770 ?>
4771 <div class="ays-accordion-data-main-wrap ays-accordion-data-main-wrap-woocommerce ays-pro-features-v2-main-box" style="padding:10px;">
4772 <div class="ays-pro-features-v2-big-buttons-box">
4773 <div class="ays-pro-features-v2-video-button"></div>
4774 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4775 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4776 <div class="ays-pro-features-v2-upgrade-text">
4777 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
4778 </div>
4779 </a>
4780 </div>
4781 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap ">
4782 <div id="ays-chart-woocommerce-datas">
4783 <div class="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-form">
4784 <div id="woocommerce-datas-form">
4785 <input type="hidden" name="chart_id" value="<?php echo esc_attr( $chart_id )?>">
4786 <div class="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-query-container" id="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-container-id" >
4787 <a class="ays_help <?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-tooltip" data-bs-toggle="tooltip" data-bs-html="true" title="<?php echo esc_html__( 'Select a query to display data.', 'chart-builder' ) ?>">
4788 <i class="ays_fa ays_fa_info_circle"></i>
4789 </a>
4790 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-select" name="<?php echo esc_attr($html_name_prefix); ?>settings[woocommerce_data_id]">
4791 <option value=""><?php echo esc_html__( 'Select query', 'chart-builder') ?></option>
4792 </select>
4793 </div>
4794 <div class='ays-chart-woocommerce-datas-success'></div>
4795 <div class='ays-chart-woocommerce-datas-error'></div>
4796 </div>
4797 <div class="ays-chart-buttons-group">
4798 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-fetch">
4799 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
4800 </button>
4801 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-show-on-chart">
4802 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
4803 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
4804 </button>
4805 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-save">
4806 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
4807 </button>
4808 </div>
4809 </div>
4810 </div>
4811 </div>
4812 </div>
4813 <?php
4814 $content = ob_get_clean();
4815
4816 $title = sprintf(
4817 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
4818 esc_html__( 'Get WooCommerce data', 'chart-builder' ) .
4819 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
4820 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
4821 __( 'By using this option, you can display the WooCommerce statistics by charts.%1$s %2$sNote:%3$s The WooCommerce plugin must be active.', 'chart-builder' ) . '">
4822 <i class="ays_fa ays_fa_info_circle"></i>
4823 </a>',
4824 '<br>', '<b>', '</b>'
4825 );
4826 $sources['woocommerce'] = array(
4827 'content' => $content,
4828 'title' => $title
4829 );
4830
4831 return $sources;
4832 }
4833
4834 public function source_contents_manual_settings( $sources, $args ){
4835 $html_class_prefix = $args['html_class_prefix'];
4836 $html_name_prefix = $args['html_name_prefix'];
4837 $source = $args['source'];
4838 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
4839 $settings = $args['settings'];
4840 $source_chart_type = $args['source_chart_type'];
4841 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
4842 $action = isset($_GET['action']) ? sanitize_text_field(wp_unslash($_GET['action'])) : 'add';
4843
4844 if (isset($source) && !empty($source)) {
4845 if ( !isset( $source[0] ) ) {
4846 if (count($source[1]) > 2) {
4847 $titles = array();
4848 for ($i = 0; $i < count($source[1]); $i++) {
4849 array_push($titles, __("Title", 'chart-builder').$i);
4850 }
4851 $source[0] = $titles;
4852 } else {
4853 $source[0] = array(
4854 __("Country", 'chart-builder'),
4855 __("Population", 'chart-builder'),
4856 );
4857 }
4858
4859 ksort($source);
4860 }
4861 }
4862
4863 if ($action == 'add') {
4864 foreach ($source as $key => $row) {
4865 $source[$key] = array_slice($row, 0, 2);
4866 }
4867 } else if ($action == 'edit') {
4868 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
4869 foreach ($source as $key => $row) {
4870 $source[$key] = array_slice($row, 0, 2);
4871 }
4872 }
4873 }
4874 ob_start();
4875 ?>
4876 <div class="ays-accordion-data-main-wrap">
4877 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
4878 <?php if($source_chart_type != 'org_chart'): ?>
4879 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?php echo esc_attr( $html_class_prefix) ?>chart-source-data-manual cb-changable-manual cb-pie_chart-manual cb-bar_chart-manual cb-column_chart-manual cb-line_chart-manual cb-donut_chart-manual display_none">
4880 <!-- <div class="<//?= $html_class_prefix ?>icons-box">
4881 <img class="<//?= $html_class_prefix ?>add-new-row" src="<//?php echo CHART_BUILDER_ADMIN_URL; ?>/images/icons/add-circle-outline.svg">
4882 </div> -->
4883 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
4884 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
4885 <?php if(!empty($source)):
4886 foreach($source as $source_id => $source_value):
4887 if(!empty($source_value) ):
4888 if ($source_id == 0): ?>
4889 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
4890 <div class="ays-chart-empty-data-table-cell"></div>
4891 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
4892 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-title-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
4893 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-col" data-trigger="hover" data-bs-toggle="tooltip" title="Delete column" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" width="10px">
4894 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
4895 </svg>
4896 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
4897 <input type="text" class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(stripslashes($each_source_value)); ?>" <?php echo $each_source_id == 0 ? "style='min-width:100px'" : "" ?>>
4898 <?php if ($each_source_id !== 0): ?>
4899 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-sort" data-sort-order="asc" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512">
4900 <path d="M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z" style="fill: #b8b8b8;" />
4901 </svg>
4902 <?php endif; ?>
4903 </div>
4904 </div>
4905 <?php endforeach; ?>
4906 </div>
4907 <?php else: ?>
4908 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
4909 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-row">
4910 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
4911 <path d="M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z" style="fill: #b8b8b8;" />
4912 </svg>
4913 </div>
4914 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
4915 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
4916 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
4917 </svg>
4918 </div>
4919 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
4920 <?php if ($each_source_id == 0): ?>
4921 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-name-input-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
4922 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(htmlspecialchars($each_source_value)); ?>">
4923 </div>
4924 <?php else: ?>
4925 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-number" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
4926 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(stripslashes($each_source_value)); ?>" step="any">
4927 </div>
4928 <?php endif; ?>
4929 <?php endforeach; ?>
4930 </div>
4931 <?php endif; ?>
4932 <?php endif; ?>
4933 <?php endforeach; ?>
4934 <?php else:?>
4935 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
4936 <div style="height: 63.11px; padding: 0 15px;"></div>
4937 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-title-box">
4938 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-col" data-trigger="hover" data-bs-toggle="tooltip" title="Delete column" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" width="10px">
4939 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
4940 </svg>
4941 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
4942 <input type="text" class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[0][]" style='min-width:100px'>
4943 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-sort" data-sort-order="asc" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512">
4944 <path d="M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z" style="fill: #b8b8b8;" />
4945 </svg>
4946 </div>
4947 </div>
4948 </div>
4949 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
4950 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-row">
4951 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
4952 <path d="M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z" />
4953 </svg>
4954 </div>
4955 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
4956 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
4957 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
4958 </svg>
4959 </div>
4960 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
4961 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
4962 </div>
4963 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-number">
4964 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
4965 </div>
4966 </div>
4967 <?php endif; ?>
4968 </div>
4969 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-column-box cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt display_none">
4970 <img class="<?php echo esc_attr($html_class_prefix) ?>add-new-column" src="<?php echo esc_url(CHART_BUILDER_ADMIN_URL); ?>/images/icons/add-circle-outline.svg">
4971 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
4972 </div>
4973 </div>
4974 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
4975 <img class="<?php echo esc_attr($html_class_prefix) ?>add-new-row" src="<?php echo esc_url(CHART_BUILDER_ADMIN_URL); ?>/images/icons/add-circle-outline.svg">
4976 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
4977 </div>
4978 <br>
4979 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
4980 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
4981 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
4982 </button>
4983 </div>
4984 <?php endif; ?>
4985 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main-org-type display_none cb-changable-manual cb-org_chart-manual">
4986 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-org-type">
4987 <ul id="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-tree-content">
4988 </ul>
4989 </div>
4990 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
4991 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
4992 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
4993 </button>
4994 </div>
4995 </div>
4996 </div>
4997 <?php
4998 $content = ob_get_clean();
4999
5000 $title = __( 'Manual data', "chart-builder" ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Add the data manually. By clicking on the Add Row button you will be able to add as many rows as you need. While choosing the Line, Bar, Column Chart types you will be able to also add the columns.","chart-builder") . '">
5001 <i class="ays_fa ays_fa_info_circle"></i>
5002 </a>';
5003
5004 $sources['manual'] = array(
5005 'content' => $content,
5006 'title' => $title
5007 );
5008
5009 return $sources;
5010 }
5011
5012 public function source_contents_manual_settings_chartjs( $sources, $args ){
5013 $html_class_prefix = $args['html_class_prefix'];
5014 $html_name_prefix = $args['html_name_prefix'];
5015 $source = $args['source'];
5016 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
5017 $settings = $args['settings'];
5018 $source_chart_type = $args['source_chart_type'];
5019 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
5020 $action = isset($_GET['action']) ? sanitize_text_field((wp_unslash($_GET['action']))) : 'add';
5021
5022 ob_start();
5023 ?>
5024 <div class="ays-accordion-data-main-wrap">
5025 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
5026 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?php echo esc_attr($html_class_prefix) ?>chart-source-data-manual">
5027 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
5028 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
5029 <?php if(!empty($source)):
5030 foreach($source as $source_id => $source_value):
5031 if(!empty($source_value) ):
5032 if ($source_id == 0): ?>
5033 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
5034 <div class="ays-chart-empty-data-table-cell"></div>
5035 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
5036 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-title-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
5037 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-col" data-trigger="hover" data-bs-toggle="tooltip" title="Delete column" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" width="10px">
5038 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
5039 </svg>
5040 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
5041 <input type="text" class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(stripslashes($each_source_value)); ?>" <?php echo $each_source_id == 0 ? "style='min-width:100px'" : "" ?>>
5042 <?php if ($each_source_id !== 0): ?>
5043 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-sort" data-sort-order="asc" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512">
5044 <path d="M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z" style="fill: #b8b8b8;" />
5045 </svg>
5046 <?php endif; ?>
5047 </div>
5048 </div>
5049 <?php endforeach; ?>
5050 </div>
5051 <?php else: ?>
5052 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
5053 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-row">
5054 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
5055 <path d="M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z" style="fill: #b8b8b8;" />
5056 </svg>
5057 </div>
5058 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
5059 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
5060 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
5061 </svg>
5062 </div>
5063 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
5064 <?php if ($each_source_id == 0): ?>
5065 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-name-input-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
5066 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(htmlspecialchars($each_source_value)); ?>">
5067 </div>
5068 <?php else: ?>
5069 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-number" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
5070 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(stripslashes($each_source_value)); ?>" step="any">
5071 </div>
5072 <?php endif; ?>
5073 <?php endforeach; ?>
5074 </div>
5075 <?php endif; ?>
5076 <?php endif; ?>
5077 <?php endforeach; ?>
5078 <?php else:?>
5079 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
5080 <div style="height: 63.11px; padding: 0 15px;"></div>
5081 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-title-box">
5082 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-col" data-trigger="hover" data-bs-toggle="tooltip" title="Delete column" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" width="10px">
5083 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
5084 </svg>
5085 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
5086 <input type="text" class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[0][]" style='min-width:100px'>
5087 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-sort" data-sort-order="asc" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512">
5088 <path d="M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z" style="fill: #b8b8b8;" />
5089 </svg>
5090 </div>
5091 </div>
5092 </div>
5093 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
5094 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-row">
5095 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
5096 <path d="M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z" />
5097 </svg>
5098 </div>
5099 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
5100 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
5101 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
5102 </svg>
5103 </div>
5104 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
5105 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
5106 </div>
5107 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-number">
5108 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
5109 </div>
5110 </div>
5111 <?php endif; ?>
5112 </div>
5113 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-column-box cb-changable-opt cb-bar_chart-opt cb-line_chart-opt display_none">
5114 <img class="<?php echo esc_attr($html_class_prefix) ?>add-new-column" src="<?php echo esc_url(CHART_BUILDER_ADMIN_URL); ?>/images/icons/add-circle-outline.svg">
5115 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
5116 </div>
5117 </div>
5118 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
5119 <img class="<?php echo esc_attr($html_class_prefix) ?>add-new-row" src="<?php echo esc_url(CHART_BUILDER_ADMIN_URL); ?>/images/icons/add-circle-outline.svg">
5120 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
5121 </div>
5122 <br>
5123 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
5124 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
5125 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
5126 </button>
5127 </div>
5128 </div>
5129 </div>
5130 <?php
5131 $content = ob_get_clean();
5132
5133 $title = __( 'Manual data', "chart-builder" ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Add the data manually. By clicking on the Add Row button you will be able to add as many rows as you need. While choosing the Line, Bar, Column Chart types you will be able to also add the columns.","chart-builder") . '">
5134 <i class="ays_fa ays_fa_info_circle"></i>
5135 </a>';
5136
5137 $sources['manual'] = array(
5138 'content' => $content,
5139 'title' => $title
5140 );
5141
5142 return $sources;
5143 }
5144
5145 /**
5146 * Chart page settings contents
5147 * @param $args
5148 */
5149 public function ays_chart_page_settings_contents( $args ){
5150 $chart_source_type = $args['chart_source_type'];
5151
5152 if ($chart_source_type === 'chart-js') {
5153 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings_chartjs', array(), $args );
5154 } else {
5155 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings', array(), $args );
5156 }
5157
5158 $sources = array();
5159 foreach ( $sources_contents as $key => $sources_content ) {
5160 $collapsed = $key == 'general_settings' ? 'false' : 'true';
5161
5162 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
5163 if(isset($sources_content['title'])){
5164 $content .= '<legend class="ays-accordion-options-header">';
5165 $content .= '<svg class="ays-accordion-arrow '. ( $key == 'general_settings' ? 'ays-accordion-arrow-down' : 'ays-accordion-arrow-right' ) .'" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
5166 <g>
5167 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: '. ( $key == 'general_settings' ? '#008cff' : '#c4c4c4' ) .';" vector-effect="non-scaling-stroke" />
5168 </g>
5169 </svg>';
5170
5171 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
5172 }
5173
5174 $content .= '<div class="ays-accordion-options-content">';
5175 $content .= $sources_content['content'];
5176 $content .= '</div>';
5177
5178 $content .= '</fieldset>';
5179
5180 $sources[] = $content;
5181 }
5182 $content_for_escape = implode('' , $sources );
5183 echo html_entity_decode( $content_for_escape );
5184 }
5185
5186 public function settings_contents_general_settings( $sources, $args ){
5187 $html_class_prefix = $args['html_class_prefix'];
5188 $html_name_prefix = $args['html_name_prefix'];
5189 $chart_description = $args['chart_description'];
5190 $create_author_data = $args['create_author_data'];
5191 $status = $args['status'];
5192 $settings = $args['settings'];
5193
5194 $show_title = $settings['show_title'];
5195 $show_description = $settings['show_description'];
5196 $enable_interactivity = $settings['enable_interactivity'];
5197 $maximized_view = $settings['maximized_view'];
5198
5199 ob_start();
5200 ?>
5201 <div class="ays-accordion-data-main-wrap">
5202 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5203 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5204 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
5205 <label for="ays-status" class="form-label">
5206 <?php echo esc_html(__('Status', "chart-builder")); ?>
5207 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Decide whether the chart is active or not. If the chart is a draft, it won't be shown anywhere on your website (you don't need to remove shortcodes).","chart-builder") ); ?>">
5208 <i class="ays_fa ays_fa_info_circle"></i>
5209 </a>
5210 </label>
5211 </div>
5212 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5213 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5214 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-status" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>status" value="published" <?php echo $status == 'published' ? 'checked' : ''; ?> >
5215 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5216 </label>
5217 </div>
5218 </div> <!-- Status -->
5219 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5220 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5221 <label for="ays-chart-description" class="form-label">
5222 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
5223 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
5224 <i class="ays_fa ays_fa_info_circle"></i>
5225 </a>
5226 </label>
5227 </div>
5228 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5229 <textarea class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-textarea-input" id="ays-chart-description" type="text" name="<?php echo esc_attr($html_name_prefix); ?>description"><?php echo esc_attr($chart_description) ?></textarea>
5230 </div>
5231 </div> <!-- Chart description -->
5232 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5233 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5234 <label for="ays-chart-create-author" class="form-label">
5235 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
5236 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_html(__('You can change the author who created the current chart to your preferred one. You need to write the User ID here. Please note, that in case you write an ID, by which there are no users found, the changes will not be applied and the previous author will remain the same.',"chart-builder")); ?>">
5237 <i class="ays_fa ays_fa_info_circle"></i>
5238 </a>
5239 </label>
5240 </div>
5241 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5242 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-create-author" name="<?php echo esc_attr($html_name_prefix); ?>create_author">
5243 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
5244 <?php if (isset($create_author_data['ID'])) : ?>
5245 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
5246 <?php endif; ?>
5247 </select>
5248 </div>
5249 </div> <!-- Change chart author -->
5250 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5251 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
5252 <label for="ays-chart-show-title" class="form-label">
5253 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
5254 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you disable the toggle, the Chart title will not be displayed on the Front-end. By default, the toggle is enabled.","chart-builder") ); ?>">
5255 <i class="ays_fa ays_fa_info_circle"></i>
5256 </a>
5257 </label>
5258 </div>
5259 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5260 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5261 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-show-title" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_title]" value="on" <?php echo esc_attr($show_title); ?> >
5262 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5263 </label>
5264 </div>
5265 </div> <!-- Show title -->
5266 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5267 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
5268 <label for="ays-chart-show-description" class="form-label">
5269 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
5270 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you disable the toggle, the Chart description will not be displayed on the Front-end. By default, the toggle is enabled.","chart-builder") ); ?>">
5271 <i class="ays_fa ays_fa_info_circle"></i>
5272 </a>
5273 </label>
5274 </div>
5275 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5276 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5277 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-show-description" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_description]" value="on" <?php echo esc_attr($show_description); ?> >
5278 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5279 </label>
5280 </div>
5281 </div> <!-- Show description -->
5282 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-pie_chart-opt cb-donut_chart-opt">
5283 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
5284 <label for="ays-chart-option-enable-interactivity" class="form-label">
5285 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
5286 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Decide if the chart shows events based on user actions or responds to user interaction. If not, the chart won't generate 'select' or similar interaction-based events (but will generate ready or error events), and won't show hovertext or change based on user input.","chart-builder") ); ?>">
5287 <i class="ays_fa ays_fa_info_circle"></i>
5288 </a>
5289 </label>
5290 </div>
5291 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5292 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5293 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-enable-interactivity" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_interactivity]" value="on" <?php echo esc_attr($enable_interactivity); ?> >
5294 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5295 </label>
5296 </div>
5297 </div> <!-- Enable interactivity -->
5298 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
5299 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
5300 <label for="ays-chart-option-maximized-view" class="form-label">
5301 <?php echo esc_html(__('Maximized view', "chart-builder")); ?>
5302 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, maximizes the area of the chart.","chart-builder") ); ?>">
5303 <i class="ays_fa ays_fa_info_circle"></i>
5304 </a>
5305 </label>
5306 </div>
5307 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5308 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5309 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-maximized-view" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[maximized_view]" value="on" <?php echo esc_attr($maximized_view); ?> >
5310 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5311 </label>
5312 </div>
5313 </div> <!-- Maximized view -->
5314 </div>
5315 </div>
5316 <?php
5317 $content = ob_get_clean();
5318
5319 $title = __( 'General Settings', "chart-builder" );
5320
5321 $sources['general_settings'] = array(
5322 'content' => $content,
5323 'title' => $title
5324 );
5325
5326 return $sources;
5327 }
5328
5329 public function settings_contents_general_settings_chartjs( $sources, $args ){
5330 $html_class_prefix = $args['html_class_prefix'];
5331 $html_name_prefix = $args['html_name_prefix'];
5332 $chart_description = $args['chart_description'];
5333 $create_author_data = $args['create_author_data'];
5334 $status = $args['status'];
5335 $settings = $args['settings'];
5336
5337 $show_title = $settings['show_title'];
5338 $show_description = $settings['show_description'];
5339 $enable_interactivity = $settings['enable_interactivity'];
5340
5341 ob_start();
5342 ?>
5343 <div class="ays-accordion-data-main-wrap">
5344 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5345 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5346 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
5347 <label for="ays-status" class="form-label">
5348 <?php echo esc_html(__('Status', "chart-builder")); ?>
5349 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Decide whether the chart is active or not. If the chart is a draft, it won't be shown anywhere on your website (you don't need to remove shortcodes).","chart-builder") ); ?>">
5350 <i class="ays_fa ays_fa_info_circle"></i>
5351 </a>
5352 </label>
5353 </div>
5354 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5355 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5356 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-status" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>status" value="published" <?php echo $status == 'published' ? 'checked' : ''; ?> >
5357 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5358 </label>
5359 </div>
5360 </div> <!-- Status -->
5361 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5362 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5363 <label for="ays-chart-description" class="form-label">
5364 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
5365 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
5366 <i class="ays_fa ays_fa_info_circle"></i>
5367 </a>
5368 </label>
5369 </div>
5370 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5371 <textarea class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-textarea-input" id="ays-chart-description" type="text" name="<?php echo esc_attr($html_name_prefix); ?>description"><?php echo esc_attr($chart_description) ?></textarea>
5372 </div>
5373 </div> <!-- Chart description -->
5374 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5375 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5376 <label for="ays-chart-create-author" class="form-label">
5377 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
5378 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_html(__('You can change the author who created the current chart to your preferred one. You need to write the User ID here. Please note, that in case you write an ID, by which there are no users found, the changes will not be applied and the previous author will remain the same.',"chart-builder")); ?>">
5379 <i class="ays_fa ays_fa_info_circle"></i>
5380 </a>
5381 </label>
5382 </div>
5383 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5384 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-create-author" name="<?php echo esc_attr($html_name_prefix); ?>create_author">
5385 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
5386 <?php if (isset($create_author_data['ID'])) : ?>
5387 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
5388 <?php endif; ?>
5389 </select>
5390 </div>
5391 </div> <!-- Change chart author -->
5392 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5393 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
5394 <label for="ays-chart-show-title" class="form-label">
5395 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
5396 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you disable the toggle, the Chart title will not be displayed on the Front-end. By default, the toggle is enabled.","chart-builder") ); ?>">
5397 <i class="ays_fa ays_fa_info_circle"></i>
5398 </a>
5399 </label>
5400 </div>
5401 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5402 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5403 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-show-title" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_title]" value="on" <?php echo esc_attr($show_title); ?> >
5404 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5405 </label>
5406 </div>
5407 </div> <!-- Show title -->
5408 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5409 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
5410 <label for="ays-chart-show-description" class="form-label">
5411 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
5412 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you disable the toggle, the Chart description will not be displayed on the Front-end. By default, the toggle is enabled.","chart-builder") ); ?>">
5413 <i class="ays_fa ays_fa_info_circle"></i>
5414 </a>
5415 </label>
5416 </div>
5417 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5418 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5419 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-show-description" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_description]" value="on" <?php echo esc_attr($show_description); ?> >
5420 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5421 </label>
5422 </div>
5423 </div> <!-- Show description -->
5424 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5425 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
5426 <label for="ays-chart-option-enable-interactivity" class="form-label">
5427 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
5428 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Decide if the chart shows events based on user actions or responds to user interaction. If not, the chart won't generate 'select' or similar interaction-based events (but will generate ready or error events), and won't show hovertext or change based on user input.","chart-builder") ); ?>">
5429 <i class="ays_fa ays_fa_info_circle"></i>
5430 </a>
5431 </label>
5432 </div>
5433 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5434 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5435 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-enable-interactivity" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_interactivity]" value="on" <?php echo esc_attr($enable_interactivity); ?> >
5436 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5437 </label>
5438 </div>
5439 </div> <!-- Enable interactivity -->
5440 </div>
5441 </div>
5442 <?php
5443 $content = ob_get_clean();
5444
5445 $title = __( 'General Settings', "chart-builder" );
5446
5447 $sources['general_settings'] = array(
5448 'content' => $content,
5449 'title' => $title
5450 );
5451
5452 return $sources;
5453 }
5454
5455 public function settings_contents_tooltip_settings( $sources, $args ){
5456 $html_class_prefix = $args['html_class_prefix'];
5457 $html_name_prefix = $args['html_name_prefix'];
5458 $settings = $args['settings'];
5459
5460 $tooltip_trigger_options = $settings['tooltip_trigger_options'];
5461 $tooltip_trigger = $settings['tooltip_trigger'];
5462 $show_color_code = $settings['show_color_code'];
5463 $tooltip_italic = $settings['tooltip_italic'];
5464 $tooltip_bold = $settings['tooltip_bold'];
5465 $tooltip_bold_options = $settings['tooltip_bold_options'];
5466 $tooltip_text_color = $settings['tooltip_text_color'];
5467 $tooltip_font_size = $settings['tooltip_font_size'];
5468
5469 ob_start();
5470 ?>
5471 <div class="ays-accordion-data-main-wrap cb-changable-tab cb-pie_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab cb-donut_chart-tab">
5472 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5473 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5474 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5475 <label for="ays-chart-option-tooltip-trigger">
5476 <?php echo esc_html(__( "Trigger", "chart-builder" )); ?>
5477 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") )); ?>">
5478 <i class="ays_fa ays_fa_info_circle"></i>
5479 </a>
5480 </label>
5481 </div>
5482 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5483 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-tooltip-trigger" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_trigger]">
5484 <?php
5485 foreach ( $tooltip_trigger_options as $option_slug => $option ):
5486 $selected = ( $tooltip_trigger == $option_slug ) ? 'selected' : '';
5487 ?>
5488 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5489 <?php
5490 endforeach;
5491 ?>
5492 </select>
5493 </div>
5494 </div> <!-- Trigger -->
5495 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5496 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5497 <label for="ays-chart-option-show-color-code">
5498 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
5499 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color will be displayed while clicking on a particular part of the chart.","chart-builder") ); ?>">
5500 <i class="ays_fa ays_fa_info_circle"></i>
5501 </a>
5502 </label>
5503 </div>
5504 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5505 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5506 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-show-color-code" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_color_code]" value="on" <?php echo esc_attr($show_color_code); ?> >
5507 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5508 </label>
5509 </div>
5510 </div> <!-- Show Color Code -->
5511 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5512 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5513 <label for="ays-chart-option-tooltip-text-color">
5514 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
5515 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
5516 <i class="ays_fa ays_fa_info_circle"></i>
5517 </a>
5518 </label>
5519 </div>
5520 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5521 <input id="ays-chart-option-tooltip-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_text_color]" value="<?php echo esc_attr($tooltip_text_color) ?>">
5522 </div>
5523 </div> <!-- Text color -->
5524 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5525 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5526 <label for="ays-chart-option-tooltip-font-size" class="form-label">
5527 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5528 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("The font size for all text within the chart tooltip, specified in pixels. Please note that if an invalid value is entered, it will revert to the default global font size.","chart-builder") )); ?>">
5529 <i class="ays_fa ays_fa_info_circle"></i>
5530 </a>
5531 </label>
5532 </div>
5533 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5534 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-tooltip-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_font_size]" value="<?php echo esc_attr($tooltip_font_size) ?>">
5535 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5536 </div>
5537 </div> <!-- Font size -->
5538 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5539 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5540 <label for="ays-chart-option-tooltip-italic">
5541 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5542 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
5543 <i class="ays_fa ays_fa_info_circle"></i>
5544 </a>
5545 </label>
5546 </div>
5547 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5548 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5549 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-tooltip-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_italic]" value="on" <?php echo esc_attr($tooltip_italic); ?> >
5550 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5551 </label>
5552 </div>
5553 </div> <!-- Italic text -->
5554 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5555 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5556 <label for="ays-chart-option-tooltip-bold">
5557 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5558 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Make the tooltip text bold. Choose 'Enable' to apply bold formatting, 'Disable' for normal text, or 'Default' to use the chart's default font weight.","chart-builder") )); ?>">
5559 <i class="ays_fa ays_fa_info_circle"></i>
5560 </a>
5561 </label>
5562 </div>
5563 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5564 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-tooltip-bold" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_bold]">
5565 <?php
5566 foreach ( $tooltip_bold_options as $option_slug => $option ):
5567 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
5568 ?>
5569 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5570 <?php
5571 endforeach;
5572 ?>
5573 </select>
5574 </div>
5575 </div> <!-- Bold text -->
5576 </div>
5577 </div>
5578 <?php
5579 $content = ob_get_clean();
5580
5581 $title = __( 'Tooltip', "chart-builder" );
5582
5583 $sources['tooltip'] = array(
5584 'content' => $content,
5585 'title' => $title
5586 );
5587
5588 return $sources;
5589 }
5590
5591 public function settings_contents_tooltip_settings_chartjs( $sources, $args ){
5592 $html_class_prefix = $args['html_class_prefix'];
5593 $html_name_prefix = $args['html_name_prefix'];
5594 $settings = $args['settings'];
5595
5596 $tooltip_text_color = $settings['tooltip_text_color'];
5597 $show_color_code = $settings['show_color_code'];
5598 $tooltip_italic = $settings['tooltip_italic'];
5599 $tooltip_font_size = $settings['tooltip_font_size'];
5600 $tooltip_bold = $settings['tooltip_bold'];
5601 $tooltip_bold_options = $settings['tooltip_bold_options'];
5602
5603 ob_start();
5604 ?>
5605 <div class="ays-accordion-data-main-wrap ">
5606 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5607 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5608 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5609 <label for="ays-chart-option-show-color-code">
5610 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
5611 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color will be displayed while clicking on a particular part of the chart.","chart-builder") ); ?>">
5612 <i class="ays_fa ays_fa_info_circle"></i>
5613 </a>
5614 </label>
5615 </div>
5616 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5617 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5618 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-show-color-code" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_color_code]" value="on" <?php echo esc_attr($show_color_code); ?> >
5619 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5620 </label>
5621 </div>
5622 </div> <!-- Show Color Code -->
5623 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5624 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5625 <label for="ays-chart-option-tooltip-text-color">
5626 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
5627 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
5628 <i class="ays_fa ays_fa_info_circle"></i>
5629 </a>
5630 </label>
5631 </div>
5632 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5633 <input id="ays-chart-option-tooltip-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_text_color]" value="<?php echo esc_attr($tooltip_text_color) ?>">
5634 </div>
5635 </div> <!-- Text color -->
5636 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5637 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5638 <label for="ays-chart-option-tooltip-italic">
5639 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5640 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
5641 <i class="ays_fa ays_fa_info_circle"></i>
5642 </a>
5643 </label>
5644 </div>
5645 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5646 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5647 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-tooltip-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_italic]" value="on" <?php echo esc_attr($tooltip_italic); ?> >
5648 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5649 </label>
5650 </div>
5651 </div> <!-- Italic text -->
5652 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5653 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5654 <label for="ays-chart-option-tooltip-font-size" class="form-label">
5655 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5656 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("The font size for all text within the chart tooltip, specified in pixels. Please note that if an invalid value is entered, it will revert to the default global font size.","chart-builder") )); ?>">
5657 <i class="ays_fa ays_fa_info_circle"></i>
5658 </a>
5659 </label>
5660 </div>
5661 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5662 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-tooltip-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_font_size]" value="<?php echo esc_attr($tooltip_font_size) ?>">
5663 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5664 </div>
5665 </div> <!-- Font size -->
5666 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5667 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5668 <label for="ays-chart-option-tooltip-bold">
5669 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5670 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Make the tooltip text bold. Choose 'Enable' to apply bold formatting, 'Disable' for normal text, or 'Default' to use the chart's default font weight.","chart-builder") )); ?>">
5671 <i class="ays_fa ays_fa_info_circle"></i>
5672 </a>
5673 </label>
5674 </div>
5675 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5676 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-tooltip-bold" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_bold]">
5677 <?php
5678 foreach ( $tooltip_bold_options as $option_slug => $option ):
5679 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
5680 ?>
5681 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5682 <?php
5683 endforeach;
5684 ?>
5685 </select>
5686 </div>
5687 </div> <!-- Bold text -->
5688 </div>
5689 </div>
5690 <?php
5691 $content = ob_get_clean();
5692
5693 $title = __( 'Tooltip', "chart-builder" );
5694
5695 $sources['tooltip'] = array(
5696 'content' => $content,
5697 'title' => $title
5698 );
5699
5700 return $sources;
5701 }
5702
5703 public function settings_contents_legend_settings( $sources, $args ){
5704 $html_class_prefix = $args['html_class_prefix'];
5705 $html_name_prefix = $args['html_name_prefix'];
5706 $settings = $args['settings'];
5707 $legend_positions = $settings['legend_positions'];
5708 $legend_position = $settings['legend_position'];
5709 $legend_alignments = $settings['legend_alignments'];
5710 $legend_alignment = $settings['legend_alignment'];
5711 $legend_color = $settings['legend_color'];
5712 $legend_font_size = $settings['legend_font_size'];
5713 $legend_bold = $settings['legend_bold'];
5714 $legend_italic = $settings['legend_italic'];
5715
5716 ob_start();
5717 ?>
5718 <div class="ays-accordion-data-main-wrap cb-changable-tab cb-pie_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab cb-donut_chart-tab">
5719 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5720 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5721 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5722 <label for="ays-chart-option-legend-position">
5723 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5724 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") )); ?>">
5725 <i class="ays_fa ays_fa_info_circle"></i>
5726 </a>
5727 </label>
5728 </div>
5729 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5730 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-legend-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_position]">
5731 <?php
5732 foreach ( $legend_positions as $option_slug => $option ):
5733 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
5734
5735 $type_class = '';
5736 if ($option_slug == 'left') {
5737 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
5738 } else if ($option_slug == 'in') {
5739 $type_class = ' cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt ';
5740 } else if ($option_slug == 'labeled') {
5741 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
5742 }
5743
5744 ?>
5745
5746 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?> class="<?php echo esc_attr($type_class); ?>"><?php echo esc_html($option); ?></option>
5747 <?php
5748 endforeach;
5749 ?>
5750 </select>
5751 </div>
5752 </div> <!-- Legend position -->
5753 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5754 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5755 <label for="ays-chart-option-legend-alignment">
5756 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
5757 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") )); ?>">
5758 <i class="ays_fa ays_fa_info_circle"></i>
5759 </a>
5760 </label>
5761 </div>
5762 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5763 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-legend-alignment" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_alignment]">
5764 <?php
5765 foreach ( $legend_alignments as $option_slug => $option ):
5766 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
5767 ?>
5768 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5769 <?php
5770 endforeach;
5771 ?>
5772 </select>
5773 </div>
5774 </div> <!-- Legend alignment -->
5775 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5776 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5777 <label for="ays-chart-option-legend-font-color">
5778 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
5779 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") )); ?>">
5780 <i class="ays_fa ays_fa_info_circle"></i>
5781 </a>
5782 </label>
5783 </div>
5784 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5785 <input id="ays-chart-option-legend-font-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_color]" value="<?php echo esc_attr($legend_color) ?>">
5786 </div>
5787 </div> <!-- Legend font color -->
5788 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5789 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5790 <label for="ays-chart-option-legend-font-size" class="form-label">
5791 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5792 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("The font size for all text within the chart legend, specified in pixels. Please note that if an invalid value is entered, it will revert to the default global font size.","chart-builder") )); ?>">
5793 <i class="ays_fa ays_fa_info_circle"></i>
5794 </a>
5795 </label>
5796 </div>
5797 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5798 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-legend-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_font_size]" value="<?php echo esc_attr($legend_font_size) ?>">
5799 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5800 </div>
5801 </div> <!-- Font size -->
5802 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5803 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5804 <label for="ays-chart-option-legend-italic">
5805 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5806 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
5807 <i class="ays_fa ays_fa_info_circle"></i>
5808 </a>
5809 </label>
5810 </div>
5811 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5812 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5813 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-legend-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_italic]" value="on" <?php echo esc_attr($legend_italic); ?> >
5814 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5815 </label>
5816 </div>
5817 </div> <!-- Italic text -->
5818 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5819 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5820 <label for="ays-chart-option-legend-bold">
5821 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5822 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
5823 <i class="ays_fa ays_fa_info_circle"></i>
5824 </a>
5825 </label>
5826 </div>
5827 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5828 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5829 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-legend-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_bold]" value="on" <?php echo esc_attr($legend_bold); ?> >
5830 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5831 </label>
5832 </div>
5833 </div> <!-- Bold text -->
5834 </div>
5835 </div>
5836 <?php
5837 $content = ob_get_clean();
5838
5839 $title = __( 'Legend', "chart-builder" );
5840
5841 $sources['legend'] = array(
5842 'content' => $content,
5843 'title' => $title
5844 );
5845
5846 return $sources;
5847 }
5848
5849 public function settings_contents_legend_settings_chartjs( $sources, $args ){
5850 $html_class_prefix = $args['html_class_prefix'];
5851 $html_name_prefix = $args['html_name_prefix'];
5852 $settings = $args['settings'];
5853 $legend_positions = $settings['legend_positions'];
5854 $legend_position = $settings['legend_position'];
5855 $legend_alignments = $settings['legend_alignments'];
5856 $legend_alignment = $settings['legend_alignment'];
5857 $legend_color = $settings['legend_color'];
5858 $legend_font_size = $settings['legend_font_size'];
5859 $legend_reverse = $settings['legend_reverse'];
5860 $legend_bold = $settings['legend_bold'];
5861 $legend_italic = $settings['legend_italic'];
5862 ob_start();
5863 ?>
5864 <div class="ays-accordion-data-main-wrap">
5865 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5866 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5867 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5868 <label for="ays-chart-option-legend-position">
5869 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5870 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") )); ?>">
5871 <i class="ays_fa ays_fa_info_circle"></i>
5872 </a>
5873 </label>
5874 </div>
5875 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5876 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-legend-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_position]">
5877 <?php
5878 foreach ( $legend_positions as $option_slug => $option ):
5879 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
5880 ?>
5881 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?> ><?php echo esc_html($option); ?></option>
5882 <?php
5883 endforeach;
5884 ?>
5885 </select>
5886 </div>
5887 </div> <!-- Legend position -->
5888 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5889 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5890 <label for="ays-chart-option-legend-alignment">
5891 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
5892 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") )); ?>">
5893 <i class="ays_fa ays_fa_info_circle"></i>
5894 </a>
5895 </label>
5896 </div>
5897 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5898 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-legend-alignment" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_alignment]">
5899 <?php
5900 foreach ( $legend_alignments as $option_slug => $option ):
5901 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
5902 ?>
5903 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5904 <?php
5905 endforeach;
5906 ?>
5907 </select>
5908 </div>
5909 </div> <!-- Legend alignment -->
5910 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5911 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5912 <label for="ays-chart-option-legend-font-color">
5913 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
5914 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") )); ?>">
5915 <i class="ays_fa ays_fa_info_circle"></i>
5916 </a>
5917 </label>
5918 </div>
5919 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5920 <input id="ays-chart-option-legend-font-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_color]" value="<?php echo esc_attr($legend_color) ?>">
5921 </div>
5922 </div> <!-- Legend font color -->
5923 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5924 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5925 <label for="ays-chart-option-legend-font-size" class="form-label">
5926 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5927 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("The font size for all text within the chart legend, specified in pixels. Please note that if an invalid value is entered, it will revert to the default global font size.","chart-builder") )); ?>">
5928 <i class="ays_fa ays_fa_info_circle"></i>
5929 </a>
5930 </label>
5931 </div>
5932 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5933 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-legend-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_font_size]" value="<?php echo esc_attr($legend_font_size) ?>">
5934 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5935 </div>
5936 </div> <!-- Font size -->
5937 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5938 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5939 <label for="ays-chart-option-legend-italic">
5940 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5941 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
5942 <i class="ays_fa ays_fa_info_circle"></i>
5943 </a>
5944 </label>
5945 </div>
5946 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5947 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5948 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-legend-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_italic]" value="on" <?php echo esc_attr($legend_italic); ?> >
5949 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5950 </label>
5951 </div>
5952 </div> <!-- Italic text -->
5953 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5954 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5955 <label for="ays-chart-option-legend-bold">
5956 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5957 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
5958 <i class="ays_fa ays_fa_info_circle"></i>
5959 </a>
5960 </label>
5961 </div>
5962 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5963 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5964 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-legend-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_bold]" value="on" <?php echo esc_attr($legend_bold); ?> >
5965 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5966 </label>
5967 </div>
5968 </div> <!-- Bold text -->
5969 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt">
5970 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5971 <label for="ays-chart-option-legend-revers">
5972 <?php echo esc_html(__( "Show datasets in reverse order", "chart-builder" )); ?>
5973 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this toggle to show datasets in reverse ordering.","chart-builder") ); ?>">
5974 <i class="ays_fa ays_fa_info_circle"></i>
5975 </a>
5976 </label>
5977 </div>
5978 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5979 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5980 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-legend-reverse" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_reverse]" value="on" <?php echo esc_attr($legend_reverse); ?> >
5981 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5982 </label>
5983 </div>
5984 </div> <!-- reverse datasets -->
5985 </div>
5986 </div>
5987 <?php
5988 $content = ob_get_clean();
5989
5990 $title = __( 'Legend', "chart-builder" );
5991
5992 $sources['legend'] = array(
5993 'content' => $content,
5994 'title' => $title
5995 );
5996
5997 return $sources;
5998 }
5999
6000 public function settings_contents_horizontal_axis_settings( $sources, $args ){
6001 $html_class_prefix = $args['html_class_prefix'];
6002 $html_name_prefix = $args['html_name_prefix'];
6003 $settings = $args['settings'];
6004
6005 $haxis_title = $settings['haxis_title'];
6006 $axes_text_positions = $settings['axes_text_positions'];
6007 $haxis_text_position = $settings['haxis_text_position'];
6008 $haxis_direction = $settings['haxis_direction'];
6009 $haxis_text_color = $settings['haxis_text_color'];
6010 $haxis_baseline_color = $settings['haxis_baseline_color'];
6011 $haxis_slanted_options = $settings['haxis_slanted_options'];
6012 $haxis_slanted = $settings['haxis_slanted'];
6013 $haxis_slanted_text_angle = $settings['haxis_slanted_text_angle'];
6014 $haxis_show_text_every = $settings['haxis_show_text_every'];
6015 $haxis_format_options = $settings['axes_format_options'];
6016 $haxis_format = $settings['haxis_format'];
6017 $haxis_enable_divide_percent = $settings['haxis_enable_divide_percent'];
6018 $haxis_label_font_size = $settings['haxis_label_font_size'];
6019 $haxis_max_value = $settings['haxis_max_value'];
6020 $haxis_min_value = $settings['haxis_min_value'];
6021 $haxis_text_font_size = $settings['haxis_text_font_size'];
6022 $haxis_label_color = $settings['haxis_label_color'];
6023 $haxis_bold = $settings['haxis_bold'];
6024 $haxis_italic = $settings['haxis_italic'];
6025 $haxis_title_bold = $settings['haxis_title_bold'];
6026 $haxis_title_italic = $settings['haxis_title_italic'];
6027 $haxis_gridlines_count = $settings['haxis_gridlines_count'];
6028 $haxis_gridlines_color = $settings['haxis_gridlines_color'];
6029 $haxis_minor_gridlines_color = $settings['haxis_minor_gridlines_color'];
6030
6031 ob_start();
6032 ?>
6033 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-haxis-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
6034 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6035 <h6>Label</h6>
6036 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6037 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6038 <label for="ays-chart-option-haxis-title" class="form-label">
6039 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
6040 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the horizontal axis","chart-builder") ); ?>">
6041 <i class="ays_fa ays_fa_info_circle"></i>
6042 </a>
6043 </label>
6044 </div>
6045 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6046 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-title" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_title]" value="<?php echo esc_attr($haxis_title) ?>">
6047 </div>
6048 </div> <!-- Horizontal axis label -->
6049 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6050 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6051 <label for="ays-chart-option-haxis-label-font-size" class="form-label">
6052 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6053 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis label.","chart-builder") ); ?>">
6054 <i class="ays_fa ays_fa_info_circle"></i>
6055 </a>
6056 </label>
6057 </div>
6058 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6059 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-label-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_label_font_size]" value="<?php echo esc_attr($haxis_label_font_size) ?>">
6060 </div>
6061 </div> <!-- Horizontal axis label font size -->
6062 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6063 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6064 <label for="ays-chart-option-haxis-label-color">
6065 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6066 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
6067 <i class="ays_fa ays_fa_info_circle"></i>
6068 </a>
6069 </label>
6070 </div>
6071 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6072 <input id="ays-chart-option-haxis-label-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_label_color]" value="<?php echo esc_attr($haxis_label_color) ?>">
6073 </div>
6074 </div> <!-- Horizontal axis label color -->
6075 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6076 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6077 <label for="ays-chart-option-haxis-title-italic">
6078 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
6079 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart horizontal axis label italic.","chart-builder") ); ?>">
6080 <i class="ays_fa ays_fa_info_circle"></i>
6081 </a>
6082 </label>
6083 </div>
6084 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6085 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6086 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-title-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_title_italic]" value="on" <?php echo esc_attr($haxis_title_italic); ?> >
6087 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6088 </label>
6089 </div>
6090 </div> <!-- Italic label -->
6091 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6092 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6093 <label for="ays-chart-option-haxis-title-bold">
6094 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
6095 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart horizontal axis label bold.","chart-builder") ); ?>">
6096 <i class="ays_fa ays_fa_info_circle"></i>
6097 </a>
6098 </label>
6099 </div>
6100 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6101 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6102 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-title-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_title_bold]" value="on" <?php echo esc_attr($haxis_title_bold); ?> >
6103 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6104 </label>
6105 </div>
6106 </div> <!-- Bold label -->
6107 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
6108 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6109 <label for="ays-chart-option-haxis-show-text-every" class="form-label">
6110 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
6111 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("How many horizontal axis labels to show, where 1 means show every label, 2 means show every other label, and so on. 0 is to try to show as many labels as possible without overlapping.","chart-builder") ); ?>">
6112 <i class="ays_fa ays_fa_info_circle"></i>
6113 </a>
6114 </label>
6115 </div>
6116 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6117 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-show-text-every" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_show_text_every]" value="<?php echo esc_attr($haxis_show_text_every) ?>" step="1" min="0">
6118 </div>
6119 </div> <!-- Label interval -->
6120
6121 <br>
6122 <h6>Text</h6>
6123 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6124 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6125 <label for="ays-chart-option-haxis-text-position" class="form-label">
6126 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6127 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Position of the horizontal axis text, relative to the chart area.","chart-builder") ); ?>">
6128 <i class="ays_fa ays_fa_info_circle"></i>
6129 </a>
6130 </label>
6131 </div>
6132 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6133 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-haxis-text-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_text_position]">
6134 <?php
6135 foreach ( $axes_text_positions as $option_slug => $option ):
6136 $selected = ( $haxis_text_position == $option_slug ) ? 'selected' : '';
6137 ?>
6138 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6139 <?php
6140 endforeach;
6141 ?>
6142 </select>
6143 </div>
6144 </div> <!-- Horizontal axis text position -->
6145 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6146 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6147 <label for="ays-chart-option-haxis-text-color">
6148 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6149 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis text.","chart-builder") ); ?>">
6150 <i class="ays_fa ays_fa_info_circle"></i>
6151 </a>
6152 </label>
6153 </div>
6154 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6155 <input id="ays-chart-option-haxis-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_text_color]" value="<?php echo esc_attr($haxis_text_color) ?>">
6156 </div>
6157 </div> <!-- Horizontal axis text color -->
6158 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6159 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6160 <label for="ays-chart-option-haxis-text-font-size" class="form-label">
6161 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6162 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
6163 <i class="ays_fa ays_fa_info_circle"></i>
6164 </a>
6165 </label>
6166 </div>
6167 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6168 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-text-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_text_font_size]" value="<?php echo esc_attr($haxis_text_font_size) ?>">
6169 </div>
6170 </div> <!-- Horizontal axis text font size -->
6171 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6172 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6173 <label for="ays-chart-option-haxis-text-direction">
6174 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
6175 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The direction in which the values grow along the horizontal axis. By default, low values are on the left of the chart.","chart-builder") ); ?>">
6176 <i class="ays_fa ays_fa_info_circle"></i>
6177 </a>
6178 </label>
6179 </div>
6180 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6181 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6182 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-text-direction" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_direction]" value="-1" <?php echo esc_attr($haxis_direction); ?> >
6183 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6184 </label>
6185 </div>
6186 </div> <!-- Horizontal axis text direction -->
6187 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6188 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6189 <label for="ays-chart-option-haxis-italic">
6190 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
6191 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart horizontal axis text italic.","chart-builder") ); ?>">
6192 <i class="ays_fa ays_fa_info_circle"></i>
6193 </a>
6194 </label>
6195 </div>
6196 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6197 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6198 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_italic]" value="on" <?php echo esc_attr($haxis_italic); ?> >
6199 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6200 </label>
6201 </div>
6202 </div> <!-- Italic text -->
6203 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6204 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6205 <label for="ays-chart-option-haxis-bold">
6206 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
6207 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart horizontal axis text bold.","chart-builder") ); ?>">
6208 <i class="ays_fa ays_fa_info_circle"></i>
6209 </a>
6210 </label>
6211 </div>
6212 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6213 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6214 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_bold]" value="on" <?php echo esc_attr($haxis_bold); ?> >
6215 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6216 </label>
6217 </div>
6218 </div> <!-- Bold text -->
6219 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6220 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6221 <label for="ays-chart-option-haxis-slanted-text" class="form-label">
6222 <?php echo esc_html(__( "Slanted text", "chart-builder" )); ?>
6223 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("By choosing true the text will be slanted. In false it will be horizontal. In Automatic based on the size, it will be displayed either in horizontal or slanted. Note: This option only works, if 'Text position' option is set to 'Outside the chart'","chart-builder") ); ?>">
6224 <i class="ays_fa ays_fa_info_circle"></i>
6225 </a>
6226 </label>
6227 </div>
6228 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6229 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-haxis-slanted-text" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_slanted]">
6230 <?php
6231 foreach ( $haxis_slanted_options as $option_slug => $option ):
6232 $selected = ( $haxis_slanted == $option_slug ) ? 'selected' : '';
6233 ?>
6234 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6235 <?php
6236 endforeach;
6237 ?>
6238 </select>
6239 </div>
6240 </div> <!-- Horizontal axis slanted text -->
6241 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section <?php echo ($haxis_slanted == 'false') ? 'display_none' : ''; ?>">
6242 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6243 <label for="ays-chart-option-haxis-slanted-text-angle" class="form-label">
6244 <?php echo esc_html(__( "Slanted text angle", "chart-builder" )); ?>
6245 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The slanted text angle will define the angle. It will tilt in between -90 from 90 (except 0).","chart-builder") ); ?>">
6246 <i class="ays_fa ays_fa_info_circle"></i>
6247 </a>
6248 </label>
6249 </div>
6250 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6251 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-slanted-text-angle" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_slanted_text_angle]" value="<?php echo esc_attr($haxis_slanted_text_angle) ?>" step="15" min="-90" max="90">
6252 </div>
6253 </div> <!-- Horizontal axis slanted text angle -->
6254
6255 <br>
6256 <h6>Gridlines</h6>
6257 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6258 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6259 <label for="ays-chart-option-haxis-gridlines-count" class="form-label">
6260 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
6261 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The approximate number of vertical gridlines inside the chart area. If you specify a positive number for gridlines count, it will be used to compute the min spacing between gridlines. You can specify a value of 1 to only draw one gridline, or 0 to draw no gridlines. Specify -1, which is the default, to automatically compute the number of gridlines based on other options. Note: This option will not work with 'Rotate vertical' option.","chart-builder") ); ?>">
6262 <i class="ays_fa ays_fa_info_circle"></i>
6263 </a>
6264 </label>
6265 </div>
6266 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6267 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-gridlines-count" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_gridlines_count]" value="<?php echo esc_attr($haxis_gridlines_count) ?>">
6268 </div>
6269 </div> <!-- Horizontal axis gridlines count -->
6270 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6271 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6272 <label for="ays-chart-option-haxis-gridlines-color">
6273 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6274 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis gridlines.","chart-builder") ); ?>">
6275 <i class="ays_fa ays_fa_info_circle"></i>
6276 </a>
6277 </label>
6278 </div>
6279 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6280 <input id="ays-chart-option-haxis-gridlines-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_gridlines_color]" value="<?php echo esc_attr($haxis_gridlines_color) ?>">
6281 </div>
6282 </div> <!-- Horizontal axis gridlines color -->
6283 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6284 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6285 <label for="ays-chart-option-haxis-minor-gridlines-color">
6286 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
6287 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis minor gridlines.","chart-builder") ); ?>">
6288 <i class="ays_fa ays_fa_info_circle"></i>
6289 </a>
6290 </label>
6291 </div>
6292 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6293 <input id="ays-chart-option-haxis-minor-gridlines-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_minor_gridlines_color]" value="<?php echo esc_attr($haxis_minor_gridlines_color) ?>">
6294 </div>
6295 </div> <!-- Horizontal axis minor gridlines color -->
6296 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-line_chart-opt">
6297 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6298 <label for="ays-chart-option-haxis-baseline-color">
6299 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
6300 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specifies the color of the baseline for the horizontal axis.","chart-builder") ); ?>">
6301 <i class="ays_fa ays_fa_info_circle"></i>
6302 </a>
6303 </label>
6304 </div>
6305 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6306 <input id="ays-chart-option-haxis-baseline-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_baseline_color]" value="<?php echo esc_attr($haxis_baseline_color) ?>">
6307 </div>
6308 </div> <!-- Horizontal axis baseline color -->
6309
6310 <br class="cb-changable-opt cb-bar_chart-opt " >
6311 <h6 class="cb-changable-opt cb-bar_chart-opt">Format</h6>
6312 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt " >
6313 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6314 <label for="ays-chart-option-haxis-format" class="form-label">
6315 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
6316 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6317 echo esc_attr( sprintf(
6318 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6319 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6320 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6321 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
6322 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6323 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
6324 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6325 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
6326 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6327 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
6328 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6329 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
6330 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6331 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
6332 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6333 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
6334 '<em>', '</em>',
6335 '<em>', '</em>',
6336 '<em>', '</em>',
6337 '<em>', '</em>',
6338 '<em>', '</em>',
6339 '<em>', '</em>',
6340 '<em>', '</em>'
6341 ));
6342 ?>">
6343 <i class="ays_fa ays_fa_info_circle"></i>
6344 </a>
6345 </label>
6346 </div>
6347 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6348 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-haxis-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_format]">
6349 <?php
6350 foreach ( $haxis_format_options as $option_slug => $option ):
6351 $selected = ( $haxis_format == $option_slug ) ? 'selected' : '';
6352 ?>
6353 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6354 <?php
6355 endforeach;
6356 ?>
6357 </select>
6358 </div>
6359 </div> <!-- Horizontal axis format -->
6360 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section option-haxis-enable-divide-percent cb-changable-opt cb-bar_chart-opt" style="<?php echo ($haxis_format == 'percent') ? '' : 'display: none;'; ?>">
6361 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6362 <label for="ays-chart-option-haxis-enable-divide-percent">
6363 <?php echo esc_html(__( "Remove Extra Zeros ", "chart-builder" )); ?>
6364 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to hide extra 00's from the axis text if the Format option is set to 'Percent'. Note: Make sure to save chart, to see changes.","chart-builder") ); ?>">
6365 <i class="ays_fa ays_fa_info_circle"></i>
6366 </a>
6367 </label>
6368 </div>
6369 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6370 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6371 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-enable-divide-percent" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_enable_divide_percent]" value="on" <?php echo esc_attr($haxis_enable_divide_percent); ?> >
6372 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6373 </label>
6374 </div>
6375 </div> <!--Remove Extra Zeros"-->
6376 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt" >
6377 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6378 <label for="ays-chart-option-haxis-max-value" class="form-label">
6379 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
6380 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
6381 <i class="ays_fa ays_fa_info_circle"></i>
6382 </a>
6383 </label>
6384 </div>
6385 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6386 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-max-value" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_max_value]" value="<?php echo esc_attr($haxis_max_value) ?>">
6387 </div>
6388 </div> <!-- Horizontal axis max value -->
6389 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt" >
6390 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6391 <label for="ays-chart-option-haxis-min-value" class="form-label">
6392 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
6393 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
6394 <i class="ays_fa ays_fa_info_circle"></i>
6395 </a>
6396 </label>
6397 </div>
6398 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6399 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-min-value" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_min_value]" value="<?php echo esc_attr($haxis_min_value) ?>">
6400 </div>
6401 </div> <!-- Horizontal axis min value -->
6402 </div>
6403 </div>
6404 <?php
6405 $content = ob_get_clean();
6406
6407 $title = __( 'Horizontal Axis Settings', "chart-builder" );
6408
6409 $sources['horizontal_axis'] = array(
6410 'content' => $content,
6411 'title' => $title
6412 );
6413
6414 return $sources;
6415 }
6416
6417 public function settings_contents_vertical_axis_settings( $sources, $args ){
6418 $html_class_prefix = $args['html_class_prefix'];
6419 $html_name_prefix = $args['html_name_prefix'];
6420 $settings = $args['settings'];
6421
6422 $vaxis_title = $settings['vaxis_title'];
6423 $axes_text_positions = $settings['axes_text_positions'];
6424 $vaxis_text_position = $settings['vaxis_text_position'];
6425 $vaxis_direction = $settings['vaxis_direction'];
6426 $vaxis_text_color = $settings['vaxis_text_color'];
6427 $vaxis_baseline_color = $settings['vaxis_baseline_color'];
6428 $vaxis_format_options = $settings['axes_format_options'];
6429 $vaxis_format = $settings['vaxis_format'];
6430 $vaxis_enable_divide_percent = $settings['vaxis_enable_divide_percent'];
6431 $vaxis_label_font_size = $settings['vaxis_label_font_size'];
6432 $vaxis_max_value = $settings['vaxis_max_value'];
6433 $vaxis_min_value = $settings['vaxis_min_value'];
6434 $vaxis_text_font_size = $settings['vaxis_text_font_size'];
6435 $vaxis_label_color = $settings['vaxis_label_color'];
6436 $vaxis_bold = $settings['vaxis_bold'];
6437 $vaxis_italic = $settings['vaxis_italic'];
6438 $vaxis_title_bold = $settings['vaxis_title_bold'];
6439 $vaxis_title_italic = $settings['vaxis_title_italic'];
6440 $vaxis_gridlines_count = $settings['vaxis_gridlines_count'];
6441 $vaxis_gridlines_color = $settings['vaxis_gridlines_color'];
6442 $vaxis_minor_gridlines_color = $settings['vaxis_minor_gridlines_color'];
6443
6444 ob_start();
6445 ?>
6446 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-vaxis-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
6447 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6448 <h6>Label</h6>
6449 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6450 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6451 <label for="ays-chart-option-vaxis-title" class="form-label">
6452 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
6453 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the vertical axis","chart-builder") ); ?>">
6454 <i class="ays_fa ays_fa_info_circle"></i>
6455 </a>
6456 </label>
6457 </div>
6458 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6459 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-title" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_title]" value="<?php echo esc_attr($vaxis_title) ?>">
6460 </div>
6461 </div> <!-- Vertical axis label -->
6462 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6463 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6464 <label for="ays-chart-option-vaxis-label-font-size" class="form-label">
6465 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6466 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the vertical axis label.","chart-builder") ); ?>">
6467 <i class="ays_fa ays_fa_info_circle"></i>
6468 </a>
6469 </label>
6470 </div>
6471 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6472 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-label-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_label_font_size]" value="<?php echo esc_attr($vaxis_label_font_size) ?>">
6473 </div>
6474 </div> <!-- Vertical axis label font size -->
6475 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6476 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6477 <label for="ays-chart-option-vaxis-label-color">
6478 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6479 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
6480 <i class="ays_fa ays_fa_info_circle"></i>
6481 </a>
6482 </label>
6483 </div>
6484 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6485 <input id="ays-chart-option-vaxis-label-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_label_color]" value="<?php echo esc_attr($vaxis_label_color) ?>">
6486 </div>
6487 </div> <!-- Vertical axis label color -->
6488 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6489 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6490 <label for="ays-chart-option-vaxis-title-italic">
6491 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
6492 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart vertical axis label italic.","chart-builder") ); ?>">
6493 <i class="ays_fa ays_fa_info_circle"></i>
6494 </a>
6495 </label>
6496 </div>
6497 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6498 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6499 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-title-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_title_italic]" value="on" <?php echo esc_attr($vaxis_title_italic); ?> >
6500 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6501 </label>
6502 </div>
6503 </div> <!-- Italic label -->
6504 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6505 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6506 <label for="ays-chart-option-vaxis-title-bold">
6507 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
6508 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart vertical axis label bold.","chart-builder") ); ?>">
6509 <i class="ays_fa ays_fa_info_circle"></i>
6510 </a>
6511 </label>
6512 </div>
6513 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6514 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6515 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-title-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_title_bold]" value="on" <?php echo esc_attr($vaxis_title_bold); ?> >
6516 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6517 </label>
6518 </div>
6519 </div> <!-- Bold label -->
6520
6521 <br>
6522 <h6>Text</h6>
6523 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6524 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6525 <label for="ays-chart-option-vaxis-text-position" class="form-label">
6526 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6527 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Position of the vertical axis text, relative to the chart area.","chart-builder") ); ?>">
6528 <i class="ays_fa ays_fa_info_circle"></i>
6529 </a>
6530 </label>
6531 </div>
6532 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6533 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-vaxis-text-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_text_position]">
6534 <?php
6535 foreach ( $axes_text_positions as $option_slug => $option ):
6536 $selected = ( $vaxis_text_position == $option_slug ) ? 'selected' : '';
6537 ?>
6538 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6539 <?php
6540 endforeach;
6541 ?>
6542 </select>
6543 </div>
6544 </div> <!-- Vertical axis text position -->
6545 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6546 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6547 <label for="ays-chart-option-vaxis-text-color">
6548 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6549 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis text.","chart-builder") ); ?>">
6550 <i class="ays_fa ays_fa_info_circle"></i>
6551 </a>
6552 </label>
6553 </div>
6554 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6555 <input id="ays-chart-option-vaxis-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_text_color]" value="<?php echo esc_attr($vaxis_text_color) ?>">
6556 </div>
6557 </div> <!-- Vertical axis text color -->
6558 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6559 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6560 <label for="ays-chart-option-vaxis-text-font-size" class="form-label">
6561 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6562 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
6563 <i class="ays_fa ays_fa_info_circle"></i>
6564 </a>
6565 </label>
6566 </div>
6567 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6568 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-text-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_text_font_size]" value="<?php echo esc_attr($vaxis_text_font_size) ?>">
6569 </div>
6570 </div> <!-- Vertical axis text font size -->
6571 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6572 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6573 <label for="ays-chart-option-vaxis-text-direction">
6574 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
6575 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The direction in which the values along the vertical axis grow. By default, low values are on the bottom of the chart.","chart-builder") ); ?>">
6576 <i class="ays_fa ays_fa_info_circle"></i>
6577 </a>
6578 </label>
6579 </div>
6580 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6581 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6582 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-text-direction" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_direction]" value="-1" <?php echo esc_attr($vaxis_direction); ?> >
6583 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6584 </label>
6585 </div>
6586 </div> <!-- Vertical axis text direction -->
6587 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6588 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6589 <label for="ays-chart-option-vaxis-italic">
6590 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
6591 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart vertical axis text italic.","chart-builder") ); ?>">
6592 <i class="ays_fa ays_fa_info_circle"></i>
6593 </a>
6594 </label>
6595 </div>
6596 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6597 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6598 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_italic]" value="on" <?php echo esc_attr($vaxis_italic); ?> >
6599 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6600 </label>
6601 </div>
6602 </div> <!-- Italic text -->
6603 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6604 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6605 <label for="ays-chart-option-vaxis-bold">
6606 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
6607 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart vertical axis text bold.","chart-builder") ); ?>">
6608 <i class="ays_fa ays_fa_info_circle"></i>
6609 </a>
6610 </label>
6611 </div>
6612 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6613 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6614 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_bold]" value="on" <?php echo esc_attr($vaxis_bold); ?> >
6615 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6616 </label>
6617 </div>
6618 </div> <!-- Bold text -->
6619
6620 <br>
6621 <h6>Gridlines</h6>
6622 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6623 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6624 <label for="ays-chart-option-vaxis-gridlines-count" class="form-label">
6625 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
6626 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The approximate number of horizontal gridlines inside the chart area. If you specify a positive number for gridlines count, it will be used to compute the min spacing between gridlines. You can specify a value of 1 to only draw one gridline, or 0 to draw no gridlines. Specify -1, which is the default, to automatically compute the number of gridlines based on other options. Note: This option will not work with 'Rotate vertical' option.","chart-builder") ); ?>">
6627 <i class="ays_fa ays_fa_info_circle"></i>
6628 </a>
6629 </label>
6630 </div>
6631 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6632 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-gridlines-count" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_gridlines_count]" value="<?php echo esc_attr($vaxis_gridlines_count) ?>">
6633 </div>
6634 </div> <!-- Vertical axis gridlines count -->
6635 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6636 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6637 <label for="ays-chart-option-vaxis-gridlines-color">
6638 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6639 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis gridlines.","chart-builder") ); ?>">
6640 <i class="ays_fa ays_fa_info_circle"></i>
6641 </a>
6642 </label>
6643 </div>
6644 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6645 <input id="ays-chart-option-vaxis-gridlines-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_gridlines_color]" value="<?php echo esc_attr($vaxis_gridlines_color) ?>">
6646 </div>
6647 </div> <!-- Vertical axis gridlines color -->
6648 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6649 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6650 <label for="ays-chart-option-vaxis-minor-gridlines-color">
6651 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
6652 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis minor gridlines.","chart-builder") ); ?>">
6653 <i class="ays_fa ays_fa_info_circle"></i>
6654 </a>
6655 </label>
6656 </div>
6657 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6658 <input id="ays-chart-option-vaxis-minor-gridlines-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_minor_gridlines_color]" value="<?php echo esc_attr($vaxis_minor_gridlines_color) ?>">
6659 </div>
6660 </div> <!-- Vertical axis minor gridlines color -->
6661 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
6662 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6663 <label for="ays-chart-option-vaxis-baseline-color">
6664 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
6665 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specifies the color of the baseline for the vertical axis.","chart-builder") ); ?>">
6666 <i class="ays_fa ays_fa_info_circle"></i>
6667 </a>
6668 </label>
6669 </div>
6670 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6671 <input id="ays-chart-option-vaxis-baseline-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_baseline_color]" value="<?php echo esc_attr($vaxis_baseline_color) ?>">
6672 </div>
6673 </div> <!-- Vertical axis baseline color -->
6674
6675 <br class="cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
6676 <h6 class="cb-changable-opt cb-column_chart-opt cb-line_chart-opt">Format</h6>
6677 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
6678 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6679 <label for="ays-chart-option-vaxis-format" class="form-label">
6680 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
6681 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6682 echo esc_attr( sprintf(
6683 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6684 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6685 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6686 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
6687 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6688 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
6689 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6690 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
6691 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6692 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
6693 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6694 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
6695 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6696 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
6697 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6698 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
6699 '<em>', '</em>',
6700 '<em>', '</em>',
6701 '<em>', '</em>',
6702 '<em>', '</em>',
6703 '<em>', '</em>',
6704 '<em>', '</em>',
6705 '<em>', '</em>'
6706 ));
6707 ?>">
6708 <i class="ays_fa ays_fa_info_circle"></i>
6709 </a>
6710 </label>
6711 </div>
6712 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6713 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-vaxis-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_format]">
6714 <?php
6715 foreach ( $vaxis_format_options as $option_slug => $option ):
6716 $selected = ( $vaxis_format == $option_slug ) ? 'selected' : '';
6717 ?>
6718 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6719 <?php
6720 endforeach;
6721 ?>
6722 </select>
6723 </div>
6724 </div> <!-- Vertical axis format -->
6725 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section option-vaxis-enable-divide-percent cb-changable-opt cb-column_chart-opt cb-line_chart-opt" style="<?php echo ($vaxis_format == 'percent') ? '' : 'display: none;'; ?>">
6726 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6727 <label for="ays-chart-option-vaxis-enable-divide-percent">
6728 <?php echo esc_html(__( "Remove Extra Zeros", "chart-builder" )); ?>
6729 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to hide extra 00's from the axis text if the Format option is set to 'Percent'. Note: Make sure to save chart, to see changes.","chart-builder") ); ?>">
6730 <i class="ays_fa ays_fa_info_circle"></i>
6731 </a>
6732 </label>
6733 </div>
6734 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6735 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6736 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-enable-divide-percent" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_enable_divide_percent]" value="on" <?php echo esc_attr($vaxis_enable_divide_percent); ?> >
6737 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6738 </label>
6739 </div>
6740 </div> <!--Remove Extra Zeros-->
6741 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
6742 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6743 <label for="ays-chart-option-vaxis-max-value" class="form-label">
6744 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
6745 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
6746 <i class="ays_fa ays_fa_info_circle"></i>
6747 </a>
6748 </label>
6749 </div>
6750 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6751 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-max-value" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_max_value]" value="<?php echo esc_attr($vaxis_max_value) ?>">
6752 </div>
6753 </div> <!-- Vertical axis max value -->
6754 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
6755 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6756 <label for="ays-chart-option-vaxis-min-value" class="form-label">
6757 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
6758 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
6759 <i class="ays_fa ays_fa_info_circle"></i>
6760 </a>
6761 </label>
6762 </div>
6763 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6764 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-min-value" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_min_value]" value="<?php echo esc_attr($vaxis_min_value) ?>">
6765 </div>
6766 </div> <!-- Vertical axis min value -->
6767 </div>
6768 </div>
6769 <?php
6770 $content = ob_get_clean();
6771
6772 $title = __( 'Vertical Axis Settings', "chart-builder" );
6773
6774 $sources['vertical_axis'] = array(
6775 'content' => $content,
6776 'title' => $title
6777 );
6778
6779 return $sources;
6780 }
6781
6782 public function settings_contents_animation_settings( $sources, $args ) {
6783 $html_class_prefix = $args['html_class_prefix'];
6784 $html_name_prefix = $args['html_name_prefix'];
6785 $settings = $args['settings'];
6786
6787 $enable_animation = $settings['enable_animation'];
6788 $animation_duration = $settings['animation_duration'];
6789 $animation_startup = $settings['animation_startup'];
6790 $animation_easing_options = $settings['animation_easing_options'];
6791 $animation_easing = $settings['animation_easing'];
6792
6793 ob_start();
6794 ?>
6795 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-animation-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
6796 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6797 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6798 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6799 <label for="ays-chart-option-enable-animation">
6800 <?php echo esc_html(__( "Enable chart animation", "chart-builder" )); ?>
6801 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable chart animation.","chart-builder") ); ?>">
6802 <i class="ays_fa ays_fa_info_circle"></i>
6803 </a>
6804 </label>
6805 </div>
6806 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6807 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6808 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch <?php echo esc_attr($html_class_prefix) ?>toggle-hidden-option" id="ays-chart-option-enable-animation" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_animation]" value="on" <?php echo esc_attr($enable_animation); ?> >
6809 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6810 </label>
6811 </div>
6812 </div> <!-- Enable animation -->
6813 <div class="form-group row <?php echo esc_attr($html_class_prefix) ?>animation-options-section <?php echo esc_attr($html_class_prefix) ?>hidden-options-section <?php echo ($enable_animation == 'checked') ? '' : 'display_none'; ?>">
6814 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6815 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6816 <label for="ays-chart-option-animation-duration" class="form-label">
6817 <?php echo esc_html(__( "Duration", "chart-builder" )); ?>
6818 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The duration of the chart animation, in milliseconds.","chart-builder") ); ?>">
6819 <i class="ays_fa ays_fa_info_circle"></i>
6820 </a>
6821 </label>
6822 </div>
6823 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6824 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-animation-duration" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[animation_duration]" value="<?php echo esc_attr($animation_duration) ?>">
6825 </div>
6826 </div> <!-- Animation duration -->
6827 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6828 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6829 <label for="ays-chart-option-animation-startup">
6830 <?php echo esc_html(__( "Startup", "chart-builder" )); ?>
6831 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Determine if the chart will animate on the window load. If checked, the chart will start at the baseline and animate to its final state, else it will animate on size or data change.","chart-builder") ); ?>">
6832 <i class="ays_fa ays_fa_info_circle"></i>
6833 </a>
6834 </label>
6835 </div>
6836 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6837 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6838 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-animation-startup" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[animation_startup]" value="on" <?php echo esc_attr($animation_startup); ?> >
6839 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6840 </label>
6841 </div>
6842 </div> <!-- Animation startup -->
6843 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6844 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6845 <label for="ays-chart-option-animation-easing" class="form-label">
6846 <?php echo esc_html(__( "Easing", "chart-builder" )); ?>
6847 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6848 echo esc_attr( sprintf(
6849 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6850 "<p>" . __('The easing function applied to the chart animation. The following options are available:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6851 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6852 __('%1$sLinear:%2$s Constant speed.', "chart-builder") . "</li><li>" .
6853 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6854 __('%1$sEase in:%2$s Start slow and speed up.', "chart-builder") . "</li><li>" .
6855 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6856 __('%1$sEase out:%2$s Start fast and slow down.', "chart-builder") . "</li><li>" .
6857 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6858 __('%1$sEase in and out:%2$s Start slow, speed up, then slow down.', "chart-builder") . "</li></ul>",
6859 '<em>', '</em>',
6860 '<em>', '</em>',
6861 '<em>', '</em>',
6862 '<em>', '</em>'
6863 ));
6864 ?>">
6865 <i class="ays_fa ays_fa_info_circle"></i>
6866 </a>
6867 </label>
6868 </div>
6869 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6870 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-animation-easing" name="<?php echo esc_attr($html_name_prefix); ?>settings[animation_easing]">
6871 <?php
6872 foreach ( $animation_easing_options as $option_slug => $option ):
6873 $selected = ( $animation_easing == $option_slug ) ? 'selected' : '';
6874 ?>
6875 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6876 <?php
6877 endforeach;
6878 ?>
6879 </select>
6880 </div>
6881 </div> <!-- Animation easing -->
6882 <div>
6883 </div>
6884 </div>
6885 <?php
6886 $content = ob_get_clean();
6887
6888 $title = __( 'Chart animation', "chart-builder" );
6889
6890 $sources['animation'] = array(
6891 'content' => $content,
6892 'title' => $title
6893 );
6894
6895 return $sources;
6896 }
6897
6898 public function settings_contents_live_chart_settings( $sources, $args ) {
6899 $html_class_prefix = $args['html_class_prefix'];
6900 $html_name_prefix = $args['html_name_prefix'];
6901
6902 ob_start();
6903 ?>
6904 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-live-chart-settings-tab">
6905 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6906 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
6907 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
6908 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
6909 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
6910 <div class="ays-pro-features-v2-video-text">
6911 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
6912 </div>
6913 </a>
6914 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
6915 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
6916 <div class="ays-pro-features-v2-upgrade-text">
6917 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
6918 </div>
6919 </a>
6920 </div>
6921 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6922 <label for="ays-chart-option-enable-live-chart">
6923 <?php echo esc_html(__( "Enable live chart", "chart-builder" )); ?>
6924 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you enable this option, the chart data will be dynamically updated on the front end. Note: If the option is enabled, the chart data will be periodically updated (e.g., once in 3 seconds) without refreshing the page..","chart-builder") ); ?>">
6925 <i class="ays_fa ays_fa_info_circle"></i>
6926 </a>
6927 </label>
6928 </div>
6929 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6930 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6931 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch <?php echo esc_attr($html_class_prefix) ?>toggle-hidden-option" id="ays-chart-option-enable-live-chart" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_live_chart]" value="on">
6932 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6933 </label>
6934 </div>
6935 </div> <!-- Enable live chart -->
6936 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
6937 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
6938 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
6939 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
6940 <div class="ays-pro-features-v2-video-text">
6941 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
6942 </div>
6943 </a>
6944 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
6945 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
6946 <div class="ays-pro-features-v2-upgrade-text">
6947 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
6948 </div>
6949 </a>
6950 </div>
6951 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6952 <label for="ays-chart-option-live-chart-interval" class="form-label">
6953 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
6954 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the time intervals to update the chart on the front end (e.g., once in 3 seconds). The option works via milliseconds. Note: The minimum interval must be 3000 milliseconds.","chart-builder") ); ?>">
6955 <i class="ays_fa ays_fa_info_circle"></i>
6956 </a>
6957 </label>
6958 </div>
6959 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6960 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-live-chart-interval" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[live_chart_interval]" value="" min="3000">
6961 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">ms</div>
6962 </div>
6963 </div> <!-- Live chart interval -->
6964 </div>
6965 </div>
6966 <?php
6967 $content = ob_get_clean();
6968
6969 $title = __( 'Live Chart', "chart-builder" );
6970
6971 $sources['live_chart'] = array(
6972 'content' => $content,
6973 'title' => $title
6974 );
6975
6976 return $sources;
6977
6978 }
6979
6980 public function settings_contents_export_options( $sources, $args ){
6981 $html_class_prefix = $args['html_class_prefix'];
6982 $html_name_prefix = $args['html_name_prefix'];
6983 $settings = $args['settings'];
6984
6985 $enable_img = $settings['enable_img'];
6986
6987 ob_start();
6988 ?>
6989 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-export-tab cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
6990 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6991 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
6992 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
6993 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
6994 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
6995 <div class="ays-pro-features-v2-video-text">
6996 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
6997 </div>
6998 </a>
6999 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
7000 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
7001 <div class="ays-pro-features-v2-upgrade-text">
7002 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
7003 </div>
7004 </a>
7005 </div>
7006 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7007 <label for="ays-chart-option-export-print">
7008 <?php echo esc_html(__( "Print chart", "chart-builder" )); ?>
7009 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can print the chart data.","chart-builder") ); ?>">
7010 <i class="ays_fa ays_fa_info_circle"></i>
7011 </a>
7012 </label>
7013 </div>
7014 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7015 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7016 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-print" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_print]" value="on">
7017 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7018 </label>
7019 </div>
7020 </div> <!-- Print option end -->
7021 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
7022 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
7023 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
7024 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
7025 <div class="ays-pro-features-v2-video-text">
7026 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
7027 </div>
7028 </a>
7029 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
7030 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
7031 <div class="ays-pro-features-v2-upgrade-text">
7032 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
7033 </div>
7034 </a>
7035 </div>
7036 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7037 <label for="ays-chart-option-export-Excel">
7038 <?php echo esc_html(__( "Excel download", "chart-builder" )); ?>
7039 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can export the chart data in Excel file format.","chart-builder") ); ?>">
7040 <i class="ays_fa ays_fa_info_circle"></i>
7041 </a>
7042 </label>
7043 </div>
7044 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7045 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7046 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-excel" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_excel]" value="on">
7047 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7048 </label>
7049 </div>
7050 </div> <!-- Excel option end -->
7051 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
7052 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
7053 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
7054 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
7055 <div class="ays-pro-features-v2-video-text">
7056 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
7057 </div>
7058 </a>
7059 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
7060 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
7061 <div class="ays-pro-features-v2-upgrade-text">
7062 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
7063 </div>
7064 </a>
7065 </div>
7066 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7067 <label for="ays-chart-option-export-CSV">
7068 <?php echo esc_html(__( "CSV download", "chart-builder" )); ?>
7069 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can export the chart data in CSV file format.","chart-builder") ); ?>">
7070 <i class="ays_fa ays_fa_info_circle"></i>
7071 </a>
7072 </label>
7073 </div>
7074 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7075 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7076 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-csv" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_csv]" value="on">
7077 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7078 </label>
7079 </div>
7080 </div> <!-- CSV option end -->
7081 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
7082 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
7083 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
7084 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
7085 <div class="ays-pro-features-v2-video-text">
7086 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
7087 </div>
7088 </a>
7089 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
7090 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
7091 <div class="ays-pro-features-v2-upgrade-text">
7092 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
7093 </div>
7094 </a>
7095 </div>
7096 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7097 <label for="ays-chart-option-export-Copy">
7098 <?php echo esc_html(__( "Copy chart data", "chart-builder" )); ?>
7099 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can copy the chart data (CTRL+C, CTRL+V).","chart-builder") ); ?>">
7100 <i class="ays_fa ays_fa_info_circle"></i>
7101 </a>
7102 </label>
7103 </div>
7104 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7105 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7106 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-copy" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_copy]" value="on">
7107 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7108 </label>
7109 </div>
7110 </div> <!-- Copy option end -->
7111 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt cb-line_chart-opt cb-bar_chart-opt cb-column_chart-opt display_none">
7112 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7113 <label for="ays-chart-option-export-img">
7114 <?php echo esc_html(__( "Download chart image", "chart-builder" )); ?>
7115 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can download the chart as an image.","chart-builder") ); ?>">
7116 <i class="ays_fa ays_fa_info_circle"></i>
7117 </a>
7118 </label>
7119 </div>
7120 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7121 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7122 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-img" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_img]" value="on" <?php echo esc_attr($enable_img)?> >
7123 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7124 </label>
7125 </div>
7126 </div> <!-- IMG option end -->
7127 </div>
7128 </div>
7129 <?php
7130
7131 $content = ob_get_clean();
7132
7133 $title = __( 'Frontend Actions', "chart-builder" );
7134
7135 $sources['export_options'] = array(
7136 'content' => $content,
7137 'title' => $title
7138 );
7139
7140 return $sources;
7141 }
7142
7143 /**
7144 * Chart page styles contents
7145 * @param $args
7146 */
7147 public function ays_chart_page_styles_contents( $args ){
7148 $chart_source_type = $args['chart_source_type'];
7149
7150 if ($chart_source_type === 'chart-js') {
7151 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings_chartjs', array(), $args );
7152 } else {
7153 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings', array(), $args );
7154 }
7155
7156 $sources = array();
7157 foreach ( $sources_contents as $key => $sources_content ) {
7158 $collapsed = $key == 'chart' ? 'false' : 'true';
7159
7160 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
7161 if(isset($sources_content['title'])){
7162 $content .= '<legend class="ays-accordion-options-header">';
7163 $content .= '<svg class="ays-accordion-arrow '. ( $key == 'chart' ? 'ays-accordion-arrow-down' : 'ays-accordion-arrow-right' ) .'" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
7164 <g>
7165 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: '. ( $key == 'chart' ? '#008cff' : '#c4c4c4' ) .';" vector-effect="non-scaling-stroke" />
7166 </g>
7167 </svg>';
7168
7169 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
7170 }
7171
7172 $content .= '<div class="ays-accordion-options-content">';
7173 $content .= $sources_content['content'];
7174 $content .= '</div>';
7175
7176 $content .= '</fieldset>';
7177
7178 $sources[] = $content;
7179 }
7180 $content_for_escape = implode('' , $sources );
7181 echo html_entity_decode( esc_html($content_for_escape) );
7182 }
7183
7184 public function settings_contents_chart_styles_settings( $sources, $args ){
7185 $html_class_prefix = $args['html_class_prefix'];
7186 $html_name_prefix = $args['html_name_prefix'];
7187 $settings = $args['settings'];
7188
7189 $width = $settings['width'];
7190 $width_format = $settings['width_format'];
7191 $title_positions = $settings['title_positions'];
7192 $position = $settings['position'];
7193 $width_format_options = $settings['width_format_options'];
7194 $responsive_width = $settings['responsive_width'];
7195 $height = $settings['height'];
7196 $height_format = $settings['height_format'];
7197 $font_size = $settings['font_size'];
7198 $org_chart_font_size_options = $settings['org_chart_font_size_options'];
7199 $org_chart_font_size = $settings['org_chart_font_size'];
7200 $background_color = $settings['background_color'];
7201 $transparent_background = $settings['transparent_background'];
7202 $border_width = $settings['border_width'];
7203 $border_width_with_title = $settings['border_width_with_title'];
7204 $border_radius_with_title = $settings['border_radius_with_title'];
7205 $border_color_with_title = $settings['border_color_with_title'];
7206 $border_style_with_title = $settings['border_style_with_title'];
7207 $border_style = $settings['border_style'];
7208 $border_styles = $settings['border_styles'];
7209 $border_radius = $settings['border_radius'];
7210 $border_color = $settings['border_color'];
7211 $box_shadow = $settings['box_shadow'];
7212 $box_shadow_color = $settings['box_shadow_color'];
7213 $padding_outer = $settings['padding_outer'];
7214 ob_start();
7215 ?>
7216 <div class="ays-accordion-data-main-wrap">
7217 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7218 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7219 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7220 <label for="ays-chart-option-width" class="form-label">
7221 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
7222 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container, in percents.","chart-builder") ); ?>">
7223 <i class="ays_fa ays_fa_info_circle"></i>
7224 </a>
7225 </label>
7226 </div>
7227 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7228 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[width]" value="<?php echo esc_attr($width) ?>">
7229 <select class="<?php echo esc_attr($html_class_prefix) ?>option-width-format-change <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-width-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[width_format]">
7230 <?php
7231 foreach ( $width_format_options as $option_slug => $option ):
7232 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
7233 ?>
7234 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7235 <?php
7236 endforeach;
7237 ?>
7238 </select>
7239 </div>
7240 </div> <!-- Width -->
7241 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7242 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7243 <label for="ays-chart-option-responsive-width" class="form-label">
7244 <?php echo esc_html(__( "Responsive Width", "chart-builder" )); ?>
7245 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to keep the chart's width fixed at 100%, no matter what is set for the Width option. This makes the chart more responsive.","chart-builder") ); ?>">
7246 <i class="ays_fa ays_fa_info_circle"></i>
7247 </a>
7248 </label>
7249 </div>
7250 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7251 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7252 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-responsive-width" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[responsive_width]" value="on" <?php echo esc_attr($responsive_width); ?> >
7253 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7254 </label>
7255 </div>
7256 </div> <!-- Responsive Width -->
7257 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7258 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7259 <label for="ays-chart-option-position">
7260 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
7261 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart. Note: The changes will be visible when the width option is not set to 100%","chart-builder") ); ?>">
7262 <i class="ays_fa ays_fa_info_circle"></i>
7263 </a>
7264 </label>
7265 </div>
7266 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7267 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[position]">
7268 <?php
7269 foreach ( $title_positions as $option_slug => $option ):
7270 $selected = ( $position == $option_slug ) ? 'selected' : '';
7271 ?>
7272 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7273 <?php
7274 endforeach;
7275 ?>
7276 </select>
7277 </div>
7278 </div> <!-- Position -->
7279 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7280 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7281 <label for="ays-chart-option-height" class="form-label">
7282 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
7283 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
7284 <i class="ays_fa ays_fa_info_circle"></i>
7285 </a>
7286 </label>
7287 </div>
7288 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7289 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-height" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[height]" value="<?php echo esc_attr($height) ?>">
7290 <select class="<?php echo esc_attr($html_class_prefix) ?>option-width-format-change <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-height-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[height_format]">
7291 <?php
7292 foreach ( $width_format_options as $option_slug => $option ):
7293 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
7294 ?>
7295 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7296 <?php
7297 endforeach;
7298 ?>
7299 </select>
7300 </div>
7301 </div> <!-- Height -->
7302 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7303 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7304 <label for="ays-chart-option-font-size" class="form-label">
7305 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
7306 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart text.","chart-builder") ); ?>">
7307 <i class="ays_fa ays_fa_info_circle"></i>
7308 </a>
7309 </label>
7310 </div>
7311 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7312 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[font_size]" value="<?php echo esc_attr($font_size) ?>">
7313 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7314 </div>
7315 </div> <!-- Font size -->
7316 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
7317 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7318 <label for="ays-chart-option-org-chart-font-size" class="form-label">
7319 <?php echo esc_html(__( "Element size", 'chart-builder' )); ?>
7320 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The size of the chart element.","chart-builder") ); ?>">
7321 <i class="ays_fa ays_fa_info_circle"></i>
7322 </a>
7323 </label>
7324 </div>
7325 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7326 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-org-chart-font-size" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_chart_font_size]">
7327 <?php
7328 foreach ( $org_chart_font_size_options as $option_slug => $option ):
7329 $selected = ( $org_chart_font_size == $option_slug ) ? 'selected' : '';
7330 ?>
7331 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_attr($option); ?></option>
7332 <?php
7333 endforeach;
7334 ?>
7335 </select>
7336 </div>
7337 </div> <!-- Font size for org type -->
7338 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7339 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7340 <label for="ays-chart-option-background-color">
7341 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
7342 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart container.","chart-builder") ); ?>">
7343 <i class="ays_fa ays_fa_info_circle"></i>
7344 </a>
7345 </label>
7346 </div>
7347 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7348 <input id="ays-chart-option-background-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[background_color]" value="<?php echo esc_attr($background_color) ?>">
7349 </div>
7350 </div> <!-- Background color -->
7351 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7352 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7353 <label for="ays-chart-option-transparent-background" class="form-label">
7354 <?php echo esc_html(__( "Transparent background", "chart-builder" )); ?>
7355 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart's background transparent. When enabled, both Background Color and Chart Area Background Color options will not work","chart-builder") ); ?>">
7356 <i class="ays_fa ays_fa_info_circle"></i>
7357 </a>
7358 </label>
7359 </div>
7360 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7361 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7362 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-transparent-background" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[transparent_background]" value="on" <?php echo esc_attr($transparent_background); ?> >
7363 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7364 </label>
7365 </div>
7366 </div> <!-- Transparent background -->
7367 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7368 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7369 <label for="ays-chart-option-border-width">
7370 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
7371 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
7372 <i class="ays_fa ays_fa_info_circle"></i>
7373 </a>
7374 </label>
7375 </div>
7376 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7377 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_width]" value="<?php echo esc_attr($border_width) ?>">
7378 </div>
7379 </div> <!-- Border Width -->
7380 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7381 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7382 <label for="ays-chart-option-border-color">
7383 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
7384 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
7385 <i class="ays_fa ays_fa_info_circle"></i>
7386 </a>
7387 </label>
7388 </div>
7389 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7390 <input id="ays-chart-option-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_color]" value="<?php echo esc_attr($border_color) ?>">
7391 </div>
7392 </div> <!-- Border color -->
7393 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7394 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7395 <label for="ays-chart-option-border-radius">
7396 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
7397 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border radius of the chart container.","chart-builder") ); ?>">
7398 <i class="ays_fa ays_fa_info_circle"></i>
7399 </a>
7400 </label>
7401 </div>
7402 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7403 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-radius" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_radius]" value="<?php echo esc_attr($border_radius) ?>">
7404 </div>
7405 </div> <!-- Border radius -->
7406 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7407 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7408 <label for="ays-chart-option-border-style">
7409 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
7410 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
7411 <i class="ays_fa ays_fa_info_circle"></i>
7412 </a>
7413 </label>
7414 </div>
7415 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7416 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-border-style" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_style]">
7417 <?php
7418 foreach ( $border_styles as $option_slug => $option ):
7419 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
7420 ?>
7421 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7422 <?php
7423 endforeach;
7424 ?>
7425 </select>
7426 </div>
7427 </div> <!-- Border style -->
7428 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7429 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7430 <label for="ays-chart-option-box-shadow" class="form-label">
7431 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
7432 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add shadow to chart's container.","chart-builder") ); ?>">
7433 <i class="ays_fa ays_fa_info_circle"></i>
7434 </a>
7435 </label>
7436 </div>
7437 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7438 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7439 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-box-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[box_shadow]" value="on" <?php echo esc_attr($box_shadow); ?> >
7440 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7441 </label>
7442 </div>
7443 </div> <!-- box shadow -->
7444 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7445 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7446 <label for="ays-chart-option-box-shadow-color" class="form-label">
7447 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
7448 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
7449 <i class="ays_fa ays_fa_info_circle"></i>
7450 </a>
7451 </label>
7452 </div>
7453 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7454 <input id="ays-chart-option-box-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[box_shadow_color]" value="<?php echo esc_attr($box_shadow_color) ?>">
7455 </div>
7456 </div> <!-- box shadow color -->
7457 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7458 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7459 <label for="ays-chart-option-border-width-with-title">
7460 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
7461 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border including chart title and description.","chart-builder") ); ?>">
7462 <i class="ays_fa ays_fa_info_circle"></i>
7463 </a>
7464 </label>
7465 </div>
7466 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7467 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-width-with-title" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_width_with_title]" value="<?php echo esc_attr($border_width_with_title) ?>">
7468 </div>
7469 </div> <!-- Border Width with title -->
7470 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7471 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7472 <label for="ays-chart-option-border-radius-with-title">
7473 <?php echo esc_html(__( "Border radius (including title)", "chart-builder" )); ?>
7474 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The radius of the chart container border including chart title and description.","chart-builder") ); ?>">
7475 <i class="ays_fa ays_fa_info_circle"></i>
7476 </a>
7477 </label>
7478 </div>
7479 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7480 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-radius-with-title" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_radius_with_title]" value="<?php echo esc_attr($border_radius_with_title) ?>">
7481 </div>
7482 </div> <!-- Border radius with title -->
7483 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7484 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7485 <label for="ays-chart-option-border-color-with-title">
7486 <?php echo esc_html(__( "Border Color (including title)", "chart-builder" )); ?>
7487 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart container border including chart title and description.","chart-builder") ); ?>">
7488 <i class="ays_fa ays_fa_info_circle"></i>
7489 </a>
7490 </label>
7491 </div>
7492 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7493 <input id="ays-chart-option-border-color-with-title" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_color_with_title]" value="<?php echo esc_attr($border_color_with_title) ?>">
7494 </div>
7495 </div> <!-- Border color with title -->
7496 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7497 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7498 <label for="ays-chart-option-border-style-with-title">
7499 <?php echo esc_html(__( "Border Style (including title)", "chart-builder" )); ?>
7500 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border including chart title and description.","chart-builder") ); ?>">
7501 <i class="ays_fa ays_fa_info_circle"></i>
7502 </a>
7503 </label>
7504 </div>
7505 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7506 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-border-style-with-title" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_style_with_title]">
7507 <?php
7508 foreach ( $border_styles as $option_slug => $option ):
7509 $selected = ( $border_style_with_title == $option_slug ) ? 'selected' : '';
7510 ?>
7511 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7512 <?php
7513 endforeach;
7514 ?>
7515 </select>
7516 </div>
7517 </div> <!-- Border style with title -->
7518 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7519 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7520 <label for="ays-chart-option-padding-outer">
7521 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
7522 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The padding of the chart container.","chart-builder") ); ?>">
7523 <i class="ays_fa ays_fa_info_circle"></i>
7524 </a>
7525 </label>
7526 </div>
7527 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7528 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-padding-outer" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[padding_outer]" value="<?php echo esc_attr($padding_outer) ?>">
7529 </div>
7530 </div> <!-- Padding outer -->
7531 </div>
7532 </div>
7533 <?php
7534 $content = ob_get_clean();
7535
7536 $title = __( 'Chart', "chart-builder" );
7537
7538 $sources['chart'] = array(
7539 'content' => $content,
7540 'title' => $title
7541 );
7542
7543 return $sources;
7544 }
7545
7546 public function settings_contents_chart_styles_settings_chartjs( $sources, $args ){
7547 $html_class_prefix = $args['html_class_prefix'];
7548 $html_name_prefix = $args['html_name_prefix'];
7549 $settings = $args['settings'];
7550 $border_width_with_title = $settings['border_width_with_title'];
7551 $border_radius_with_title = $settings['border_radius_with_title'];
7552 $border_color_with_title = $settings['border_color_with_title'];
7553 $border_style_with_title = $settings['border_style_with_title'];
7554 $width = $settings['width'];
7555 $width_format = $settings['width_format'];
7556 $height = $settings['height'];
7557 $height_format = $settings['height_format'];
7558 $width_format_options = $settings['width_format_options'];
7559 $border_width = $settings['border_width'];
7560 $border_radius = $settings['border_radius'];
7561 $border_color = $settings['border_color'];
7562 $background_color_chart = $settings['background_color_chart'];
7563 $border_style = $settings['border_style'];
7564 $border_styles = $settings['border_styles'];
7565 $box_shadow = $settings['box_shadow'];
7566 $box_shadow_color = $settings['box_shadow_color'];
7567 $padding_outer = $settings['padding_outer'];
7568 ob_start();
7569 ?>
7570 <div class="ays-accordion-data-main-wrap">
7571 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7572 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7573 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7574 <label for="ays-chart-option-width" class="form-label">
7575 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
7576 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container, in percents.","chart-builder") ); ?>">
7577 <i class="ays_fa ays_fa_info_circle"></i>
7578 </a>
7579 </label>
7580 </div>
7581 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7582 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[width]" value="<?php echo esc_attr($width) ?>">
7583 <select class="<?php echo esc_attr($html_class_prefix) ?>option-width-format-change <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-width-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[width_format]">
7584 <?php
7585 foreach ( $width_format_options as $option_slug => $option ):
7586 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
7587 ?>
7588 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7589 <?php
7590 endforeach;
7591 ?>
7592 </select>
7593 </div>
7594 </div> <!-- Width -->
7595 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7596 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7597 <label for="ays-chart-option-height" class="form-label">
7598 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
7599 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
7600 <i class="ays_fa ays_fa_info_circle"></i>
7601 </a>
7602 </label>
7603 </div>
7604 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7605 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-height" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[height]" value="<?php echo esc_attr($height) ?>">
7606 <select class="<?php echo esc_attr($html_class_prefix) ?>option-width-format-change <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-height-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[height_format]">
7607 <?php
7608 foreach ( $width_format_options as $option_slug => $option ):
7609 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
7610 ?>
7611 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7612 <?php
7613 endforeach;
7614 ?>
7615 </select>
7616 </div>
7617 </div> <!-- Height -->
7618 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7619 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7620 <label for="ays-chart-option-border-width">
7621 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
7622 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
7623 <i class="ays_fa ays_fa_info_circle"></i>
7624 </a>
7625 </label>
7626 </div>
7627 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7628 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_width]" value="<?php echo esc_attr($border_width) ?>">
7629 </div>
7630 </div> <!-- Border Width -->
7631 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7632 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7633 <label for="ays-chart-option-border-radius">
7634 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
7635 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The radius of the chart container border.","chart-builder") ); ?>">
7636 <i class="ays_fa ays_fa_info_circle"></i>
7637 </a>
7638 </label>
7639 </div>
7640 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7641 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-radius" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_radius]" value="<?php echo esc_attr($border_radius) ?>">
7642 </div>
7643 </div> <!-- Border Radius -->
7644 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7645 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7646 <label for="ays-chart-option-border-color">
7647 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
7648 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
7649 <i class="ays_fa ays_fa_info_circle"></i>
7650 </a>
7651 </label>
7652 </div>
7653 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7654 <input id="ays-chart-option-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_color]" value="<?php echo esc_attr($border_color) ?>">
7655 </div>
7656 </div> <!-- Border color -->
7657 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7658 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7659 <label for="ays-chart-option-border-style">
7660 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
7661 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
7662 <i class="ays_fa ays_fa_info_circle"></i>
7663 </a>
7664 </label>
7665 </div>
7666 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7667 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-border-style" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_style]">
7668 <?php
7669 foreach ( $border_styles as $option_slug => $option ):
7670 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
7671 ?>
7672 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7673 <?php
7674 endforeach;
7675 ?>
7676 </select>
7677 </div>
7678 </div> <!-- Border style -->
7679 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7680 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7681 <label for="ays-chart-option-backgorund-color">
7682 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
7683 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("With the help of this feature, you will be able to add background color for the Chart JS.","chart-builder") ); ?>">
7684 <i class="ays_fa ays_fa_info_circle"></i>
7685 </a>
7686 </label>
7687 </div>
7688 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7689 <input id="ays-chart-option-background-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[background_color_chart]" value="<?php echo esc_attr($background_color_chart) ?>">
7690 </div>
7691 </div><!-- Background color -->
7692
7693 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7694 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7695 <label for="ays-chart-option-box-shadow" class="form-label">
7696 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
7697 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add shadow to chart's container.","chart-builder") ); ?>">
7698 <i class="ays_fa ays_fa_info_circle"></i>
7699 </a>
7700 </label>
7701 </div>
7702 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7703 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7704 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-box-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[box_shadow]" value="on" <?php echo esc_attr($box_shadow); ?> >
7705 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7706 </label>
7707 </div>
7708 </div> <!-- box shadow -->
7709 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7710 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7711 <label for="ays-chart-option-box-shadow-color" class="form-label">
7712 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
7713 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
7714 <i class="ays_fa ays_fa_info_circle"></i>
7715 </a>
7716 </label>
7717 </div>
7718 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7719 <input id="ays-chart-option-box-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[box_shadow_color]" value="<?php echo esc_attr($box_shadow_color) ?>">
7720 </div>
7721 </div> <!-- box shadow color -->
7722 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7723 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7724 <label for="ays-chart-option-border-width-with-title">
7725 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
7726 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border including chart title and description.","chart-builder") ); ?>">
7727 <i class="ays_fa ays_fa_info_circle"></i>
7728 </a>
7729 </label>
7730 </div>
7731 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7732 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-width-with-title" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_width_with_title]" value="<?php echo esc_attr($border_width_with_title) ?>">
7733 </div>
7734 </div> <!-- Border Width with title -->
7735 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7736 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7737 <label for="ays-chart-option-border-radius-with-title">
7738 <?php echo esc_html(__( "Border Radius (including title)", "chart-builder" )); ?>
7739 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The radius of the chart container border including chart title and description.","chart-builder") ); ?>">
7740 <i class="ays_fa ays_fa_info_circle"></i>
7741 </a>
7742 </label>
7743 </div>
7744 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7745 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-radius-with-title" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_radius_with_title]" value="<?php echo esc_attr($border_radius_with_title) ?>">
7746 </div>
7747 </div> <!-- Border radius with title -->
7748 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7749 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7750 <label for="ays-chart-option-border-color-with-title">
7751 <?php echo esc_html(__( "Border Color (including title)", "chart-builder" )); ?>
7752 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart container border including chart title and description.","chart-builder") ); ?>">
7753 <i class="ays_fa ays_fa_info_circle"></i>
7754 </a>
7755 </label>
7756 </div>
7757 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7758 <input id="ays-chart-option-border-color-with-title" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_color_with_title]" value="<?php echo esc_attr($border_color_with_title) ?>">
7759 </div>
7760 </div> <!-- Border colro with title -->
7761 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7762 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7763 <label for="ays-chart-option-border-style-with-title">
7764 <?php echo esc_html(__( "Border Style (including title)", "chart-builder" )); ?>
7765 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border including chart title and description.","chart-builder") ); ?>">
7766 <i class="ays_fa ays_fa_info_circle"></i>
7767 </a>
7768 </label>
7769 </div>
7770 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7771 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-border-style-with-title" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_style_with_title]">
7772 <?php
7773 foreach ( $border_styles as $option_slug => $option ):
7774 $selected = ( $border_style_with_title == $option_slug ) ? 'selected' : '';
7775 ?>
7776 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7777 <?php
7778 endforeach;
7779 ?>
7780 </select>
7781 </div>
7782 </div> <!-- Border style with title -->
7783 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
7784 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7785 <label for="ays-chart-option-padding-outer">
7786 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
7787 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The padding of the chart container.","chart-builder") ); ?>">
7788 <i class="ays_fa ays_fa_info_circle"></i>
7789 </a>
7790 </label>
7791 </div>
7792 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7793 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-padding-outer" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[padding_outer]" value="<?php echo esc_attr($padding_outer) ?>">
7794 </div>
7795 </div> <!-- Padding outer -->
7796 </div>
7797 </div>
7798 <?php
7799 $content = ob_get_clean();
7800
7801 $title = __( 'Chart', "chart-builder" );
7802
7803 $sources['chart'] = array(
7804 'content' => $content,
7805 'title' => $title
7806 );
7807
7808 return $sources;
7809 }
7810
7811 public function settings_contents_chart_area_styles_settings( $sources, $args ){
7812 $html_class_prefix = $args['html_class_prefix'];
7813 $html_name_prefix = $args['html_name_prefix'];
7814 $settings = $args['settings'];
7815
7816 $chart_background_color = $settings['chart_background_color'];
7817 $chart_border_color = $settings['chart_border_color'];
7818 $chart_left_margin = $settings['chart_left_margin'];
7819 $chart_right_margin = $settings['chart_right_margin'];
7820 $chart_top_margin = $settings['chart_top_margin'];
7821 $chart_bottom_margin = $settings['chart_bottom_margin'];
7822 $chart_border_width = $settings['chart_border_width'];
7823 ob_start();
7824 ?>
7825 <div class="ays-accordion-data-main-wrap">
7826 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap cb-changable-tab cb-pie_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab cb-donut_chart-tab">
7827 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
7828 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7829 <label for="ays-chart-option-chart-background-color">
7830 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
7831 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart area.","chart-builder") ); ?>">
7832 <i class="ays_fa ays_fa_info_circle"></i>
7833 </a>
7834 </label>
7835 </div>
7836 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7837 <input id="ays-chart-option-chart-background-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_background_color]" value="<?php echo esc_attr($chart_background_color) ?>">
7838 </div>
7839 </div> <!-- Chart Area background color -->
7840 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
7841 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7842 <label for="ays-chart-option-chart-border-width">
7843 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
7844 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border width of the chart area.","chart-builder") ); ?>">
7845 <i class="ays_fa ays_fa_info_circle"></i>
7846 </a>
7847 </label>
7848 </div>
7849 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7850 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_border_width]" value="<?php echo esc_attr($chart_border_width) ?>">
7851 </div>
7852 </div> <!-- Chart Area Border Width -->
7853 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
7854 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7855 <label for="ays-chart-option-chart-border-color">
7856 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
7857 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart area.","chart-builder") ); ?>">
7858 <i class="ays_fa ays_fa_info_circle"></i>
7859 </a>
7860 </label>
7861 </div>
7862 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7863 <input id="ays-chart-option-chart-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_border_color]" value="<?php echo esc_attr($chart_border_color) ?>">
7864 </div>
7865 </div> <!-- Chart Area border color -->
7866 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7867 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7868 <label for="ays-chart-option-chart-left-margin">
7869 <?php echo esc_html(__( "Left Margin", "chart-builder" )); ?>
7870 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the chart's distance from the left border. Leave blank for auto-positioning.","chart-builder") ); ?>">
7871 <i class="ays_fa ays_fa_info_circle"></i>
7872 </a>
7873 </label>
7874 </div>
7875 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7876 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-left-margin" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_left_margin]" value="<?php echo esc_attr($chart_left_margin) ?>">
7877 </div>
7878 </div> <!-- Chart Area Left Margin -->
7879 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7880 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7881 <label for="ays-chart-option-chart-right-margin">
7882 <?php echo esc_html(__( "Right Margin", "chart-builder" )); ?>
7883 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the chart's distance from the right border. Leave blank for auto-positioning.","chart-builder") ); ?>">
7884 <i class="ays_fa ays_fa_info_circle"></i>
7885 </a>
7886 </label>
7887 </div>
7888 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7889 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-right-margin" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_right_margin]" value="<?php echo esc_attr($chart_right_margin) ?>">
7890 </div>
7891 </div> <!-- Chart Area Right Margin -->
7892 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7893 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7894 <label for="ays-chart-option-chart-top-margin">
7895 <?php echo esc_html(__( "Top Margin", "chart-builder" )); ?>
7896 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the chart's distance from the top border. Leave blank for auto-positioning.","chart-builder") ); ?>">
7897 <i class="ays_fa ays_fa_info_circle"></i>
7898 </a>
7899 </label>
7900 </div>
7901 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7902 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-top-margin" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_top_margin]" value="<?php echo esc_attr($chart_top_margin) ?>">
7903 </div>
7904 </div> <!-- Chart Area Top Margin -->
7905 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7906 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7907 <label for="ays-chart-option-chart-bottom-margin">
7908 <?php echo esc_html(__( "Bottom Margin", "chart-builder" )); ?>
7909 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the chart's distance from the bottom border. Leave blank for auto-positioning.","chart-builder") ); ?>">
7910 <i class="ays_fa ays_fa_info_circle"></i>
7911 </a>
7912 </label>
7913 </div>
7914 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7915 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-bottom-margin" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_bottom_margin]" value="<?php echo esc_attr($chart_bottom_margin) ?>">
7916 </div>
7917 </div> <!-- Chart Area Bottom Margin -->
7918 </div>
7919 </div>
7920 <?php
7921 $content = ob_get_clean();
7922
7923 $title = __( 'Chart Area', "chart-builder" );
7924
7925 $sources['chart_area'] = array(
7926 'content' => $content,
7927 'title' => $title
7928 );
7929
7930 return $sources;
7931 }
7932
7933 public function settings_contents_title_styles_settings( $sources, $args ){
7934 $html_class_prefix = $args['html_class_prefix'];
7935 $html_name_prefix = $args['html_name_prefix'];
7936 $settings = $args['settings'];
7937
7938 $title_color = $settings['title_color'];
7939 $title_shadow_color = $settings['title_shadow_color'];
7940 $title_font_size = $settings['title_font_size'];
7941 $title_gap = $settings['title_gap'];
7942 $title_gap_description = $settings['title_gap_description'];
7943 $title_positions = $settings['title_positions'];
7944 $title_position = $settings['title_position'];
7945 $title_bold = $settings['title_bold'];
7946 $title_text_shadow = $settings['title_text_shadow'];
7947 $title_italic = $settings['title_italic'];
7948 $text_transforms = $settings['text_transforms'];
7949 $text_decorations = $settings['text_decorations'];
7950 $title_text_transform = $settings['title_text_transform'];
7951 $title_text_decoration = $settings['title_text_decoration'];
7952 $title_letter_spacing = $settings['title_letter_spacing'];
7953 ob_start();
7954 ?>
7955 <div class="ays-accordion-data-main-wrap">
7956 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7957 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7958 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7959 <label for="ays-chart-option-title-color">
7960 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7961 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
7962 <i class="ays_fa ays_fa_info_circle"></i>
7963 </a>
7964 </label>
7965 </div>
7966 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7967 <input id="ays-chart-option-title-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_color]" value="<?php echo esc_attr($title_color) ?>">
7968 </div>
7969 </div> <!-- Chart title color -->
7970 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7971 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7972 <label for="ays-chart-option-title-font-size" class="form-label">
7973 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
7974 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
7975 <i class="ays_fa ays_fa_info_circle"></i>
7976 </a>
7977 </label>
7978 </div>
7979 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7980 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_font_size]" value="<?php echo esc_attr($title_font_size) ?>">
7981 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7982 </div>
7983 </div> <!-- Chart title font size -->
7984 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7985 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7986 <label for="ays-chart-option-title-bold" class="form-label">
7987 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
7988 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
7989 <i class="ays_fa ays_fa_info_circle"></i>
7990 </a>
7991 </label>
7992 </div>
7993 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7994 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7995 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_bold]" value="on" <?php echo esc_attr($title_bold); ?> >
7996 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7997 </label>
7998 </div>
7999 </div> <!-- Title bold -->
8000 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8001 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8002 <label for="ays-chart-option-title-italic" class="form-label">
8003 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
8004 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
8005 <i class="ays_fa ays_fa_info_circle"></i>
8006 </a>
8007 </label>
8008 </div>
8009 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8010 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8011 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_italic]" value="on" <?php echo esc_attr($title_italic); ?> >
8012 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8013 </label>
8014 </div>
8015 </div> <!-- Title italic -->
8016 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8017 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8018 <label for="ays-chart-option-title-position">
8019 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
8020 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
8021 <i class="ays_fa ays_fa_info_circle"></i>
8022 </a>
8023 </label>
8024 </div>
8025 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8026 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_position]">
8027 <?php
8028 foreach ( $title_positions as $option_slug => $option ):
8029 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
8030 ?>
8031 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8032 <?php
8033 endforeach;
8034 ?>
8035 </select>
8036 </div>
8037 </div> <!-- Title position -->
8038 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8039 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8040 <label for="ays-chart-option-title-gap" class="form-label">
8041 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
8042 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title and the chart container.","chart-builder") ); ?>">
8043 <i class="ays_fa ays_fa_info_circle"></i>
8044 </a>
8045 </label>
8046 </div>
8047 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8048 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-gap" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_gap]" value="<?php echo esc_attr($title_gap) ?>">
8049 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8050 </div>
8051 </div> <!-- Chart title gap -->
8052 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8053 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8054 <label for="ays-chart-option-title-gap-description" class="form-label">
8055 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
8056 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title and the chart description.","chart-builder") ); ?>">
8057 <i class="ays_fa ays_fa_info_circle"></i>
8058 </a>
8059 </label>
8060 </div>
8061 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8062 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-gap-description" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_gap_description]" value="<?php echo esc_attr($title_gap_description) ?>">
8063 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8064 </div>
8065 </div> <!-- Chart title gap -->
8066 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8067 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8068 <label for="ays-chart-option-title-text-transform">
8069 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
8070 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
8071 <i class="ays_fa ays_fa_info_circle"></i>
8072 </a>
8073 </label>
8074 </div>
8075 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8076 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-text-transform" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_transform]">
8077 <?php
8078 foreach ( $text_transforms as $option_slug => $option ):
8079 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
8080 ?>
8081 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8082 <?php
8083 endforeach;
8084 ?>
8085 </select>
8086 </div>
8087 </div> <!-- Title text transform -->
8088 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8089 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8090 <label for="ays-chart-option-title-letter-spacing" class="form-label">
8091 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
8092 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
8093 <i class="ays_fa ays_fa_info_circle"></i>
8094 </a>
8095 </label>
8096 </div>
8097 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8098 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-letter-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_letter_spacing]" value="<?php echo esc_attr($title_letter_spacing) ?>">
8099 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8100 </div>
8101 </div> <!-- Chart title letter spacing -->
8102 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8103 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8104 <label for="ays-chart-option-title-text-decoration">
8105 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
8106 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
8107 <i class="ays_fa ays_fa_info_circle"></i>
8108 </a>
8109 </label>
8110 </div>
8111 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8112 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-text-decoration" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_decoration]">
8113 <?php
8114 foreach ( $text_decorations as $option_slug => $option ):
8115 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
8116 ?>
8117 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8118 <?php
8119 endforeach;
8120 ?>
8121 </select>
8122 </div>
8123 </div> <!-- Title text decoration -->
8124 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8125 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8126 <label for="ays-chart-option-title-text-shadow" class="form-label">
8127 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
8128 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add a text shadow to chart title.","chart-builder") ); ?>">
8129 <i class="ays_fa ays_fa_info_circle"></i>
8130 </a>
8131 </label>
8132 </div>
8133 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8134 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8135 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-text-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_shadow]" value="on" <?php echo esc_attr($title_text_shadow); ?> >
8136 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8137 </label>
8138 </div>
8139 </div> <!-- Title bold -->
8140 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8141 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8142 <label for="ays-chart-option-title-shadow-color">
8143 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
8144 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
8145 <i class="ays_fa ays_fa_info_circle"></i>
8146 </a>
8147 </label>
8148 </div>
8149 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8150 <input id="ays-chart-option-title-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_shadow_color]" value="<?php echo esc_attr($title_shadow_color) ?>">
8151 </div>
8152 </div> <!-- Chart title color -->
8153 </div>
8154 </div>
8155 <?php
8156 $content = ob_get_clean();
8157
8158 $title = __( 'Title', "chart-builder" );
8159
8160 $sources['title'] = array(
8161 'content' => $content,
8162 'title' => $title
8163 );
8164
8165 return $sources;
8166 }
8167
8168 public function settings_contents_title_styles_settings_chartjs( $sources, $args ){
8169 $html_class_prefix = $args['html_class_prefix'];
8170 $html_name_prefix = $args['html_name_prefix'];
8171 $settings = $args['settings'];
8172
8173 $title_color = $settings['title_color'];
8174 $title_shadow_color = $settings['title_shadow_color'];
8175 $title_font_size = $settings['title_font_size'];
8176 $title_gap = $settings['title_gap'];
8177 $title_gap_description = $settings['title_gap_description'];
8178 $title_positions = $settings['title_positions'];
8179 $title_position = $settings['title_position'];
8180 $title_bold = $settings['title_bold'];
8181 $title_text_shadow = $settings['title_text_shadow'];
8182 $title_italic = $settings['title_italic'];
8183 $text_transforms = $settings['text_transforms'];
8184 $text_decorations = $settings['text_decorations'];
8185 $title_text_transform = $settings['title_text_transform'];
8186 $title_text_decoration = $settings['title_text_decoration'];
8187 $title_letter_spacing = $settings['title_letter_spacing'];
8188 ob_start();
8189 ?>
8190 <div class="ays-accordion-data-main-wrap">
8191 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
8192 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8193 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8194 <label for="ays-chart-option-title-color">
8195 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
8196 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
8197 <i class="ays_fa ays_fa_info_circle"></i>
8198 </a>
8199 </label>
8200 </div>
8201 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8202 <input id="ays-chart-option-title-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_color]" value="<?php echo esc_attr($title_color) ?>">
8203 </div>
8204 </div> <!-- Chart title color -->
8205 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8206 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8207 <label for="ays-chart-option-title-font-size" class="form-label">
8208 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
8209 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
8210 <i class="ays_fa ays_fa_info_circle"></i>
8211 </a>
8212 </label>
8213 </div>
8214 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8215 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_font_size]" value="<?php echo esc_attr($title_font_size) ?>">
8216 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8217 </div>
8218 </div> <!-- Chart title font size -->
8219 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8220 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8221 <label for="ays-chart-option-title-bold" class="form-label">
8222 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
8223 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
8224 <i class="ays_fa ays_fa_info_circle"></i>
8225 </a>
8226 </label>
8227 </div>
8228 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8229 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8230 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_bold]" value="on" <?php echo esc_attr($title_bold); ?> >
8231 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8232 </label>
8233 </div>
8234 </div> <!-- Title bold -->
8235 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8236 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8237 <label for="ays-chart-option-title-italic" class="form-label">
8238 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
8239 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
8240 <i class="ays_fa ays_fa_info_circle"></i>
8241 </a>
8242 </label>
8243 </div>
8244 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8245 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8246 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_italic]" value="on" <?php echo esc_attr($title_italic); ?> >
8247 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8248 </label>
8249 </div>
8250 </div> <!-- Title italic -->
8251 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8252 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8253 <label for="ays-chart-option-title-position">
8254 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
8255 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
8256 <i class="ays_fa ays_fa_info_circle"></i>
8257 </a>
8258 </label>
8259 </div>
8260 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8261 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_position]">
8262 <?php
8263 foreach ( $title_positions as $option_slug => $option ):
8264 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
8265 ?>
8266 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8267 <?php
8268 endforeach;
8269 ?>
8270 </select>
8271 </div>
8272 </div> <!-- Title position -->
8273 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8274 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8275 <label for="ays-chart-option-title-gap" class="form-label">
8276 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
8277 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title and the chart container.","chart-builder") ); ?>">
8278 <i class="ays_fa ays_fa_info_circle"></i>
8279 </a>
8280 </label>
8281 </div>
8282 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8283 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-gap" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_gap]" value="<?php echo esc_attr($title_gap) ?>">
8284 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8285 </div>
8286 </div> <!-- Chart title gap -->
8287 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8288 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8289 <label for="ays-chart-option-title-gap-description" class="form-label">
8290 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
8291 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title and the chart description.","chart-builder") ); ?>">
8292 <i class="ays_fa ays_fa_info_circle"></i>
8293 </a>
8294 </label>
8295 </div>
8296 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8297 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-gap-description" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_gap_description]" value="<?php echo esc_attr($title_gap_description) ?>">
8298 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8299 </div>
8300 </div> <!-- Chart title gap -->
8301 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8302 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8303 <label for="ays-chart-option-title-text-transform">
8304 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
8305 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
8306 <i class="ays_fa ays_fa_info_circle"></i>
8307 </a>
8308 </label>
8309 </div>
8310 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8311 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-text-transform" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_transform]">
8312 <?php
8313 foreach ( $text_transforms as $option_slug => $option ):
8314 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
8315 ?>
8316 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8317 <?php
8318 endforeach;
8319 ?>
8320 </select>
8321 </div>
8322 </div> <!-- Title text transform -->
8323 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8324 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8325 <label for="ays-chart-option-title-letter-spacing" class="form-label">
8326 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
8327 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
8328 <i class="ays_fa ays_fa_info_circle"></i>
8329 </a>
8330 </label>
8331 </div>
8332 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8333 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-letter-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_letter_spacing]" value="<?php echo esc_attr($title_letter_spacing) ?>">
8334 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8335 </div>
8336 </div> <!-- Chart title letter spacing -->
8337 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8338 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8339 <label for="ays-chart-option-title-text-decoration">
8340 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
8341 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
8342 <i class="ays_fa ays_fa_info_circle"></i>
8343 </a>
8344 </label>
8345 </div>
8346 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8347 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-text-decoration" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_decoration]">
8348 <?php
8349 foreach ( $text_decorations as $option_slug => $option ):
8350 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
8351 ?>
8352 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8353 <?php
8354 endforeach;
8355 ?>
8356 </select>
8357 </div>
8358 </div> <!-- Title text decoration -->
8359 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8360 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8361 <label for="ays-chart-option-title-text-shadow" class="form-label">
8362 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
8363 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add a text shadow to chart title.","chart-builder") ); ?>">
8364 <i class="ays_fa ays_fa_info_circle"></i>
8365 </a>
8366 </label>
8367 </div>
8368 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8369 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8370 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-text-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_shadow]" value="on" <?php echo esc_attr($title_text_shadow); ?> >
8371 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8372 </label>
8373 </div>
8374 </div> <!-- Title bold -->
8375 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8376 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8377 <label for="ays-chart-option-title-shadow-color">
8378 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
8379 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
8380 <i class="ays_fa ays_fa_info_circle"></i>
8381 </a>
8382 </label>
8383 </div>
8384 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8385 <input id="ays-chart-option-title-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_shadow_color]" value="<?php echo esc_attr($title_shadow_color) ?>">
8386 </div>
8387 </div> <!-- Chart title color -->
8388 </div>
8389 </div>
8390 <?php
8391 $content = ob_get_clean();
8392
8393 $title = __( 'Title', "chart-builder" );
8394
8395 $sources['title'] = array(
8396 'content' => $content,
8397 'title' => $title
8398 );
8399
8400 return $sources;
8401 }
8402
8403 public function settings_contents_description_styles_settings( $sources, $args ){
8404 $html_class_prefix = $args['html_class_prefix'];
8405 $html_name_prefix = $args['html_name_prefix'];
8406 $settings = $args['settings'];
8407
8408 $description_color = $settings['description_color'];
8409 $description_font_size = $settings['description_font_size'];
8410 $title_positions = $settings['title_positions'];
8411 $description_position = $settings['description_position'];
8412 $description_bold = $settings['description_bold'];
8413 $description_text_shadow = $settings['description_text_shadow'];
8414 $description_shadow_color = $settings['description_shadow_color'];
8415 $description_italic = $settings['description_italic'];
8416 $text_transforms = $settings['text_transforms'];
8417 $text_decorations = $settings['text_decorations'];
8418 $description_text_transform = $settings['description_text_transform'];
8419 $description_text_decoration = $settings['description_text_decoration'];
8420 $description_letter_spacing = $settings['description_letter_spacing'];
8421
8422 ob_start();
8423 ?>
8424 <div class="ays-accordion-data-main-wrap">
8425 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
8426 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8427 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8428 <label for="ays-chart-option-description-color">
8429 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
8430 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
8431 <i class="ays_fa ays_fa_info_circle"></i>
8432 </a>
8433 </label>
8434 </div>
8435 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8436 <input id="ays-chart-option-description-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_color]" value="<?php echo esc_attr($description_color) ?>">
8437 </div>
8438 </div> <!-- Chart description color -->
8439 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8440 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8441 <label for="ays-chart-option-description-font-size" class="form-label">
8442 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
8443 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
8444 <i class="ays_fa ays_fa_info_circle"></i>
8445 </a>
8446 </label>
8447 </div>
8448 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8449 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-description-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_font_size]" value="<?php echo esc_attr($description_font_size) ?>">
8450 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8451 </div>
8452 </div> <!-- Chart description font size -->
8453 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8454 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8455 <label for="ays-chart-option-description-bold" class="form-label">
8456 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
8457 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
8458 <i class="ays_fa ays_fa_info_circle"></i>
8459 </a>
8460 </label>
8461 </div>
8462 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8463 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8464 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_bold]" value="on" <?php echo esc_attr($description_bold); ?> >
8465 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8466 </label>
8467 </div>
8468 </div> <!-- Description bold -->
8469 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8470 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8471 <label for="ays-chart-option-description-italic" class="form-label">
8472 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
8473 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
8474 <i class="ays_fa ays_fa_info_circle"></i>
8475 </a>
8476 </label>
8477 </div>
8478 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8479 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8480 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_italic]" value="on" <?php echo esc_attr($description_italic); ?> >
8481 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8482 </label>
8483 </div>
8484 </div> <!-- Description italic -->
8485 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8486 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8487 <label for="ays-chart-option-description-position">
8488 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
8489 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
8490 <i class="ays_fa ays_fa_info_circle"></i>
8491 </a>
8492 </label>
8493 </div>
8494 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8495 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_position]">
8496 <?php
8497 foreach ( $title_positions as $option_slug => $option ):
8498 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
8499 ?>
8500 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8501 <?php
8502 endforeach;
8503 ?>
8504 </select>
8505 </div>
8506 </div> <!-- Description position -->
8507 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8508 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8509 <label for="ays-chart-option-description-text-transform">
8510 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
8511 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
8512 <i class="ays_fa ays_fa_info_circle"></i>
8513 </a>
8514 </label>
8515 </div>
8516 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8517 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-text-transform" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_transform]">
8518 <?php
8519 foreach ( $text_transforms as $option_slug => $option ):
8520 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
8521 ?>
8522 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8523 <?php
8524 endforeach;
8525 ?>
8526 </select>
8527 </div>
8528 </div> <!-- description text transform -->
8529 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8530 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8531 <label for="ays-chart-option-description-letter-spacing" class="form-label">
8532 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
8533 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
8534 <i class="ays_fa ays_fa_info_circle"></i>
8535 </a>
8536 </label>
8537 </div>
8538 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8539 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-description-letter-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_letter_spacing]" value="<?php echo esc_attr($description_letter_spacing) ?>">
8540 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8541 </div>
8542 </div> <!-- Chart description letter spacing -->
8543 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8544 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8545 <label for="ays-chart-option-description-text-decoration">
8546 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
8547 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
8548 <i class="ays_fa ays_fa_info_circle"></i>
8549 </a>
8550 </label>
8551 </div>
8552 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8553 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-text-decoration" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_decoration]">
8554 <?php
8555 foreach ( $text_decorations as $option_slug => $option ):
8556 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
8557 ?>
8558 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8559 <?php
8560 endforeach;
8561 ?>
8562 </select>
8563 </div>
8564 </div> <!-- description text decoration -->
8565 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8566 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8567 <label for="ays-chart-option-description-text-shadow" class="form-label">
8568 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
8569 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add a text shadow to chart description.","chart-builder") ); ?>">
8570 <i class="ays_fa ays_fa_info_circle"></i>
8571 </a>
8572 </label>
8573 </div>
8574 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8575 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8576 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-text-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_shadow]" value="on" <?php echo esc_attr($description_text_shadow); ?> >
8577 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8578 </label>
8579 </div>
8580 </div> <!-- description bold -->
8581 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8582 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8583 <label for="ays-chart-option-description-shadow-color">
8584 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
8585 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","chart-builder") ); ?>">
8586 <i class="ays_fa ays_fa_info_circle"></i>
8587 </a>
8588 </label>
8589 </div>
8590 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8591 <input id="ays-chart-option-description-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_shadow_color]" value="<?php echo esc_attr($description_shadow_color) ?>">
8592 </div>
8593 </div> <!-- Chart title color -->
8594 </div>
8595 </div>
8596 <?php
8597 $content = ob_get_clean();
8598
8599 $title = __( 'Description', "chart-builder" );
8600
8601 $sources['description'] = array(
8602 'content' => $content,
8603 'title' => $title
8604 );
8605
8606 return $sources;
8607 }
8608
8609 public function settings_contents_description_styles_settings_chartjs( $sources, $args ){
8610 $html_class_prefix = $args['html_class_prefix'];
8611 $html_name_prefix = $args['html_name_prefix'];
8612 $settings = $args['settings'];
8613
8614 $description_color = $settings['description_color'];
8615 $description_font_size = $settings['description_font_size'];
8616 $title_positions = $settings['title_positions'];
8617 $description_position = $settings['description_position'];
8618 $description_bold = $settings['description_bold'];
8619 $description_text_shadow = $settings['description_text_shadow'];
8620 $description_shadow_color = $settings['description_shadow_color'];
8621 $description_italic = $settings['description_italic'];
8622 $text_transforms = $settings['text_transforms'];
8623 $text_decorations = $settings['text_decorations'];
8624 $description_text_transform = $settings['description_text_transform'];
8625 $description_text_decoration = $settings['description_text_decoration'];
8626 $description_letter_spacing = $settings['description_letter_spacing'];
8627
8628 ob_start();
8629 ?>
8630 <div class="ays-accordion-data-main-wrap">
8631 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
8632 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8633 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8634 <label for="ays-chart-option-description-color">
8635 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
8636 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
8637 <i class="ays_fa ays_fa_info_circle"></i>
8638 </a>
8639 </label>
8640 </div>
8641 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8642 <input id="ays-chart-option-description-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_color]" value="<?php echo esc_attr($description_color) ?>">
8643 </div>
8644 </div> <!-- Chart description color -->
8645 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8646 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8647 <label for="ays-chart-option-description-font-size" class="form-label">
8648 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
8649 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
8650 <i class="ays_fa ays_fa_info_circle"></i>
8651 </a>
8652 </label>
8653 </div>
8654 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8655 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-description-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_font_size]" value="<?php echo esc_attr($description_font_size) ?>">
8656 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8657 </div>
8658 </div> <!-- Chart description font size -->
8659 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8660 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8661 <label for="ays-chart-option-description-bold" class="form-label">
8662 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
8663 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
8664 <i class="ays_fa ays_fa_info_circle"></i>
8665 </a>
8666 </label>
8667 </div>
8668 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8669 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8670 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_bold]" value="on" <?php echo esc_attr($description_bold); ?> >
8671 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8672 </label>
8673 </div>
8674 </div> <!-- Description bold -->
8675 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8676 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8677 <label for="ays-chart-option-description-italic" class="form-label">
8678 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
8679 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
8680 <i class="ays_fa ays_fa_info_circle"></i>
8681 </a>
8682 </label>
8683 </div>
8684 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8685 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8686 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_italic]" value="on" <?php echo esc_attr($description_italic); ?> >
8687 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8688 </label>
8689 </div>
8690 </div> <!-- Description italic -->
8691 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8692 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8693 <label for="ays-chart-option-description-position">
8694 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
8695 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
8696 <i class="ays_fa ays_fa_info_circle"></i>
8697 </a>
8698 </label>
8699 </div>
8700 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8701 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_position]">
8702 <?php
8703 foreach ( $title_positions as $option_slug => $option ):
8704 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
8705 ?>
8706 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8707 <?php
8708 endforeach;
8709 ?>
8710 </select>
8711 </div>
8712 </div> <!-- Description position -->
8713 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8714 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8715 <label for="ays-chart-option-description-text-transform">
8716 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
8717 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
8718 <i class="ays_fa ays_fa_info_circle"></i>
8719 </a>
8720 </label>
8721 </div>
8722 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8723 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-text-transform" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_transform]">
8724 <?php
8725 foreach ( $text_transforms as $option_slug => $option ):
8726 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
8727 ?>
8728 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8729 <?php
8730 endforeach;
8731 ?>
8732 </select>
8733 </div>
8734 </div> <!-- description text transform -->
8735 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8736 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8737 <label for="ays-chart-option-description-letter-spacing" class="form-label">
8738 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
8739 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
8740 <i class="ays_fa ays_fa_info_circle"></i>
8741 </a>
8742 </label>
8743 </div>
8744 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8745 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-description-letter-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_letter_spacing]" value="<?php echo esc_attr($description_letter_spacing) ?>">
8746 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
8747 </div>
8748 </div> <!-- Chart description letter spacing -->
8749 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8750 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8751 <label for="ays-chart-option-description-text-decoration">
8752 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
8753 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
8754 <i class="ays_fa ays_fa_info_circle"></i>
8755 </a>
8756 </label>
8757 </div>
8758 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8759 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-text-decoration" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_decoration]">
8760 <?php
8761 foreach ( $text_decorations as $option_slug => $option ):
8762 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
8763 ?>
8764 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8765 <?php
8766 endforeach;
8767 ?>
8768 </select>
8769 </div>
8770 </div> <!-- description text decoration -->
8771 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8772 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8773 <label for="ays-chart-option-description-text-shadow" class="form-label">
8774 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
8775 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add a text shadow to chart description.","chart-builder") ); ?>">
8776 <i class="ays_fa ays_fa_info_circle"></i>
8777 </a>
8778 </label>
8779 </div>
8780 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8781 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8782 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-text-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_shadow]" value="on" <?php echo esc_attr($description_text_shadow); ?> >
8783 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8784 </label>
8785 </div>
8786 </div> <!-- description bold -->
8787 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8788 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8789 <label for="ays-chart-option-description-shadow-color">
8790 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
8791 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","chart-builder") ); ?>">
8792 <i class="ays_fa ays_fa_info_circle"></i>
8793 </a>
8794 </label>
8795 </div>
8796 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8797 <input id="ays-chart-option-description-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_shadow_color]" value="<?php echo esc_attr($description_shadow_color) ?>">
8798 </div>
8799 </div> <!-- Chart title color -->
8800 </div>
8801 </div>
8802 <?php
8803 $content = ob_get_clean();
8804
8805 $title = __( 'Description', "chart-builder" );
8806
8807 $sources['description'] = array(
8808 'content' => $content,
8809 'title' => $title
8810 );
8811
8812 return $sources;
8813 }
8814
8815 /**
8816 * Chart page settings contents
8817 * @param $args
8818 */
8819 public function ays_chart_page_advanced_settings_contents( $args ){
8820 $chart_source_type = $args['chart_source_type'];
8821
8822 if ($chart_source_type === 'chart-js') {
8823 if ($args['source_chart_type'] !== 'pie_chart') {return;}
8824 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', array(), $args );
8825 } else {
8826 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings', array(), $args );
8827 }
8828
8829 $sources = array();
8830 foreach ( $sources_contents as $key => $sources_content ) {
8831 $collapsed = $key == 'advanced_settings' ? 'false' : 'true';
8832
8833 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
8834 if(isset($sources_content['title'])){
8835 $content .= '<legend class="ays-accordion-options-header">';
8836 $content .= '<svg class="ays-accordion-arrow '. ( $key == 'advanced_settings' ? 'ays-accordion-arrow-down' : 'ays-accordion-arrow-right' ) .'" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
8837 <g>
8838 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: '. ( $key == 'advanced_settings' ? '#008cff' : '#c4c4c4' ) .';" vector-effect="non-scaling-stroke" />
8839 </g>
8840 </svg>';
8841
8842 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
8843 }
8844
8845 $content .= '<div class="ays-accordion-options-content">';
8846 $content .= $sources_content['content'];
8847 $content .= '</div>';
8848
8849 $content .= '</fieldset>';
8850
8851 $sources[] = $content;
8852 }
8853 $content_for_escape = implode('' , $sources );
8854 echo html_entity_decode( esc_html($content_for_escape) );
8855 }
8856
8857 public function settings_contents_advanced_settings( $sources, $args ){
8858 $html_class_prefix = $args['html_class_prefix'];
8859 $html_name_prefix = $args['html_name_prefix'];
8860 $settings = $args['settings'];
8861 $tab_title = $args['tab_name'];
8862
8863 $rotation_degree = $settings['rotation_degree'];
8864 $reverse_categories = $settings['reverse_categories'];
8865 $slice_border_color = $settings['slice_border_color'];
8866 $slice_texts = $settings['slice_texts'];
8867 $slice_text = $settings['slice_text'];
8868 $tooltip_text_options = $settings['tooltip_text_options'];
8869 $tooltip_text = $settings['tooltip_text'];
8870 $is_stacked = $settings['is_stacked'];
8871 $focus_target_options = $settings['focus_target_options'];
8872 $focus_target = $settings['focus_target'];
8873 $multiple_data_format_options = $settings['multiple_data_format_options'];
8874 $multiple_data_format = $settings['multiple_data_format'];
8875 $opacity = $settings['opacity'];
8876 $group_width = $settings['group_width'];
8877 $group_width_format = $settings['group_width_format'];
8878 $group_width_format_options = $settings['group_width_format_options'];
8879 $line_width = $settings['line_width'];
8880 $data_grouping_limit = $settings['data_grouping_limit'];
8881 $data_grouping_label = $settings['data_grouping_label'];
8882 $data_grouping_color = $settings['data_grouping_color'];
8883 $multiple_selection = $settings['multiple_selection'];
8884 $point_shape_options = $settings['point_shape_options'];
8885 $point_shape = $settings['point_shape'];
8886 $crosshair_trigger_options = $settings['crosshair_trigger_options'];
8887 $crosshair_trigger = $settings['crosshair_trigger'];
8888 $crosshair_orientation_options = $settings['crosshair_orientation_options'];
8889 $crosshair_orientation = $settings['crosshair_orientation'];
8890 $crosshair_opacity = $settings['crosshair_opacity'];
8891 $dash_style = $settings['dash_style'];
8892 $point_size = $settings['point_size'];
8893 $donut_hole_size = $settings['donut_hole_size'];
8894 $orientation = $settings['orientation'];
8895 $fill_nulls = $settings['fill_nulls'];
8896 $allow_collapse = $settings['allow_collapse'];
8897 $org_classname = $settings['org_classname'];
8898 $org_node_background_color = $settings['org_node_background_color'];
8899 $org_node_padding = $settings['org_node_padding'];
8900 $org_node_border_radius = $settings['org_node_border_radius'];
8901 $org_node_border_width = $settings['org_node_border_width'];
8902 $org_node_border_color = $settings['org_node_border_color'];
8903 $org_node_text_color = $settings['org_node_text_color'];
8904 $org_node_text_font_size = $settings['org_node_text_font_size'];
8905 $org_node_description_font_color = $settings['org_node_description_font_color'];
8906 $org_node_description_font_size = $settings['org_node_description_font_size'];
8907 $org_selected_classname = $settings['org_selected_classname'];
8908 $org_selected_node_background_color = $settings['org_selected_node_background_color'];
8909 $org_selected_node_text_color = $settings['org_selected_node_text_color'];
8910
8911 ob_start();
8912 ?>
8913 <div class="ays-accordion-data-main-wrap">
8914 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
8915 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
8916 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8917 <label for="ays-chart-option-rotation-degree" class="form-label">
8918 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
8919 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The angle, in degrees, to rotate the chart by. The default of 0 will orient the leftmost edge of the first slice directly up.","chart-builder") ); ?>">
8920 <i class="ays_fa ays_fa_info_circle"></i>
8921 </a>
8922 </label>
8923 </div>
8924 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8925 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-rotation-degree" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[rotation_degree]" value="<?php echo esc_attr($rotation_degree) ?>">
8926 </div>
8927 </div> <!-- Rotation degree -->
8928 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
8929 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8930 <label for="ays-chart-option-reverse-categories">
8931 <?php echo esc_html(__( "Reverse Categories", "chart-builder" )); ?>
8932 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If this option is enabled, the pie slices will be drawn counterclockwise.","chart-builder") ); ?>">
8933 <i class="ays_fa ays_fa_info_circle"></i>
8934 </a>
8935 </label>
8936 </div>
8937 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8938 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8939 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-reverse-categories" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[reverse_categories]" value="on" <?php echo esc_attr($reverse_categories); ?> >
8940 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8941 </label>
8942 </div>
8943 </div> <!-- Reverse Categories -->
8944 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
8945 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8946 <label for="ays-chart-option-slice-border-color">
8947 <?php echo esc_html(__( "Slice Border Color", "chart-builder" )); ?>
8948 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
8949 <i class="ays_fa ays_fa_info_circle"></i>
8950 </a>
8951 </label>
8952 </div>
8953 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8954 <input id="ays-chart-option-slice-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_border_color]" value="<?php echo esc_attr($slice_border_color) ?>">
8955 </div>
8956 </div> <!-- Slice border color -->
8957 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
8958 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8959 <label for="ays-chart-option-slice-text">
8960 <?php echo esc_html(__( "Slice text", "chart-builder" )); ?>
8961 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose the content of the text to be displayed on the pie slice.","chart-builder") ); ?>">
8962 <i class="ays_fa ays_fa_info_circle"></i>
8963 </a>
8964 </label>
8965 </div>
8966 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8967 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-slice-text" name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text]">
8968 <?php
8969 foreach ( $slice_texts as $option_slug => $option ):
8970 $selected = ( $slice_text == $option_slug ) ? 'selected' : '';
8971 ?>
8972 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8973 <?php
8974 endforeach;
8975 ?>
8976 </select>
8977 </div>
8978 </div> <!-- Slice text -->
8979 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
8980 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8981 <label for="ays-chart-option-tooltip-text">
8982 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
8983 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose how to display the text in the chart tooltip.","chart-builder") ); ?>">
8984 <i class="ays_fa ays_fa_info_circle"></i>
8985 </a>
8986 </label>
8987 </div>
8988 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
8989 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-tooltip-text" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_text]">
8990 <?php
8991 foreach ( $tooltip_text_options as $option_slug => $option ):
8992 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
8993 ?>
8994 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8995 <?php
8996 endforeach;
8997 ?>
8998 </select>
8999 </div>
9000 </div> <!-- Slice tooltip Text -->
9001 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
9002 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9003 <label for="ays-chart-option-data-grouping-limit" class="form-label">
9004 <?php echo esc_html(__( "Chart Data Grouping Limit", "chart-builder" )); ?>
9005 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The percentage value of the pie, below which a slice will not show individually. All slices that have not passed this value will be combined to a single 'Other' slice, whose size is the sum of all their sizes. Default is not to show individually any slice which is smaller than half a degree.","chart-builder") ); ?>">
9006 <i class="ays_fa ays_fa_info_circle"></i>
9007 </a>
9008 </label>
9009 </div>
9010 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9011 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-data-grouping-limit" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[data_grouping_limit]" value="<?php echo esc_attr($data_grouping_limit) ?>" step=".1" min="0" max="360">
9012 </div>
9013 </div> <!-- Data Grouping Limit -->
9014 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
9015 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9016 <label for="ays-chart-option-data-grouping-label" class="form-label">
9017 <?php echo esc_html(__( "Chart Data Grouping Label", "chart-builder" )); ?>
9018 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("A label for the combination slice that holds all slices below chart data grouping limit.","chart-builder") ); ?>">
9019 <i class="ays_fa ays_fa_info_circle"></i>
9020 </a>
9021 </label>
9022 </div>
9023 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9024 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-data-grouping-label" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[data_grouping_label]" value="<?php echo esc_attr($data_grouping_label) ?>">
9025 </div>
9026 </div> <!-- Data Grouping Label -->
9027 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
9028 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9029 <label for="ays-chart-option-data-grouping-color">
9030 <?php echo esc_html(__( "Chart Data Grouping Color", "chart-builder" )); ?>
9031 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Color for the combination slice that holds all slices below chart data grouping limit.","chart-builder") ); ?>">
9032 <i class="ays_fa ays_fa_info_circle"></i>
9033 </a>
9034 </label>
9035 </div>
9036 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9037 <input id="ays-chart-option-data-grouping-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[data_grouping_color]" value="<?php echo esc_attr($data_grouping_color) ?>">
9038 </div>
9039 </div> <!-- Data Grouping Color -->
9040 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt display_none">
9041 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9042 <label for="ays-chart-option-is-stacked">
9043 <?php echo esc_html(__( "Is stacked", "chart-builder" )); ?>
9044 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Is stacked: If this option is enabled, the chart will be displayed in the proportional contribution of individual data points in comparison to a total.","chart-builder") ); ?>">
9045 <i class="ays_fa ays_fa_info_circle"></i>
9046 </a>
9047 </label>
9048 </div>
9049 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9050 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
9051 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-is-stacked" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[is_stacked]" value="on" <?php echo esc_attr($is_stacked); ?> >
9052 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
9053 </label>
9054 </div>
9055 </div> <!-- Is stacked -->
9056 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt cb-bar_chart-opt cb-column_chart-opt display_none">
9057 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9058 <label for="ays-chart-option-focus-target">
9059 <?php echo esc_html(__( "Focus target", "chart-builder" )); ?>
9060 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
9061 echo esc_html( sprintf(
9062 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9063 "<p>" . __('There are two ways to focus the data table elements.', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
9064 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9065 __('%1$sSingle data:%2$s If you choose the Single Data option, the focus will be on the single data point. By this, the particular cell of the data table will be focused.', "chart-builder") . "</li><li>" .
9066 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9067 __('%1$sGroup data:%2$s If you choose the Group Data option, the focus will be on the grouped data points. By this, a row of the data table will be focused.', "chart-builder") . "</li></ul>",
9068 '<em>', '</em>',
9069 '<em>', '</em>'
9070 ));
9071 ?>">
9072 <i class="ays_fa ays_fa_info_circle"></i>
9073 </a>
9074 </label>
9075 </div>
9076 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9077 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-focus-target" name="<?php echo esc_attr($html_name_prefix); ?>settings[focus_target]">
9078 <?php
9079 foreach ( $focus_target_options as $option_slug => $option ):
9080 $selected = ( $focus_target == $option_slug ) ? 'selected' : '';
9081 ?>
9082 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
9083 <?php
9084 endforeach;
9085 ?>
9086 </select>
9087 </div>
9088 </div> <!-- Focus target -->
9089 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt cb-bar_chart-opt cb-column_chart-opt display_none">
9090 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9091 <label for="ays-chart-option-opacity" class="form-label">
9092 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
9093 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent. In bar and column charts, this refers to the visible data: rectangles. In charts where selecting data creates a dot, such as the line chart, this refers to the circles that appear upon hover or selection.","chart-builder") ); ?>">
9094 <i class="ays_fa ays_fa_info_circle"></i>
9095 </a>
9096 </label>
9097 </div>
9098 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9099 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-opacity" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[opacity]" value="<?php echo esc_attr($opacity) ?>" step=".1" min="0" max="1">
9100 </div>
9101 </div> <!-- Data opacity -->
9102 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt display_none">
9103 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9104 <label for="ays-chart-option-group-width">
9105 <?php echo esc_html(__( "Bar width", "chart-builder" )); ?>
9106 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
9107 echo esc_html( sprintf(
9108 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9109 "<p>" . __('The width of the bars, specified in either of these formats:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
9110 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9111 __('%1$sPixels:%2$s Set the width of the bars in pixels.', "chart-builder") . "</li><li>" .
9112 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9113 __('%1$sPercentage:%2$s Set the width of the bars in percentage.', "chart-builder") . "</li></ul>",
9114 '<em>', '</em>',
9115 '<em>', '</em>'
9116 ));
9117 ?>">
9118 <i class="ays_fa ays_fa_info_circle"></i>
9119 </a>
9120 </label>
9121 </div>
9122 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9123 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-group-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[group_width]" min="0" step=".1" value="<?php echo esc_attr($group_width) ?>">
9124 <select class="<?php echo esc_attr($html_class_prefix) ?>option-width-format-change <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-group-width-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[group_width_format]">
9125 <?php
9126 foreach ( $group_width_format_options as $option_slug => $option ):
9127 $selected = ( $group_width_format == $option_slug ) ? 'selected' : '';
9128 ?>
9129 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
9130 <?php
9131 endforeach;
9132 ?>
9133 </select>
9134 </div>
9135 </div> <!-- Bars width -->
9136 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9137 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9138 <label for="ays-chart-option-line-width" class="form-label">
9139 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
9140 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Data line width in pixels. Set 0 for hiding all the lines and show only the point. Note: If a line width is specified for series, it will override this setting.","chart-builder") ); ?>">
9141 <i class="ays_fa ays_fa_info_circle"></i>
9142 </a>
9143 </label>
9144 </div>
9145 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9146 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-line-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[line_width]" value="<?php echo esc_attr($line_width) ?>">
9147 </div>
9148 </div> <!-- Line width -->
9149 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9150 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9151 <label for="ays-chart-option-multiple-selection">
9152 <?php echo esc_html(__( "Multiple data selection", "chart-builder" )); ?>
9153 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("When enabled, you may select multiple data points at once. To remove a data point from selection, click on it again. Note: This option works only when 'Tooltip trigger' option is set to 'When selected'.","chart-builder") ); ?>">
9154 <i class="ays_fa ays_fa_info_circle"></i>
9155 </a>
9156 </label>
9157 </div>
9158 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9159 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
9160 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-multiple-selection" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[multiple_selection]" value="on" <?php echo esc_attr($multiple_selection); ?> >
9161 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
9162 </label>
9163 </div>
9164 </div> <!-- Multiple data selection -->
9165 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9166 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9167 <label for="ays-chart-option-multiple-data-format">
9168 <?php echo esc_html(__( "Multiple data format", "chart-builder" )); ?>
9169 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
9170 echo esc_html( sprintf(
9171 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9172 "<p>" . __('How multiple data selections are rolled up into tooltips:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
9173 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9174 __('%1$sCategory:%2$s Group selected data by row titles.', "chart-builder") . "</li><li>" .
9175 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9176 __('%1$sSeries:%2$s Group selected data by column titles.', "chart-builder") . "</li><li>" .
9177 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9178 __('%1$sAuto:%2$s Group selected data by row titles, if they have the same titles or by column titles', "chart-builder") . "</li><li>" .
9179 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
9180 __('%1$sNone:%2$s Show only one tooltip per selection.', "chart-builder") . "</li></ul>",
9181 '<em>', '</em>',
9182 '<em>', '</em>',
9183 '<em>', '</em>',
9184 '<em>', '</em>'
9185 ));
9186 ?>">
9187 <i class="ays_fa ays_fa_info_circle"></i>
9188 </a>
9189 </label>
9190 </div>
9191 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9192 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-multiple-data-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[multiple_data_format]">
9193 <?php
9194 foreach ( $multiple_data_format_options as $option_slug => $option ):
9195 $selected = ( $multiple_data_format == $option_slug ) ? 'selected' : '';
9196 ?>
9197 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
9198 <?php
9199 endforeach;
9200 ?>
9201 </select>
9202 </div>
9203 </div> <!-- Multiple data format -->
9204 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9205 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9206 <label for="ays-chart-option-point-shape">
9207 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
9208 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The shape of individual data elements: 'Circle', 'Triangle', 'Square', 'Diamond', 'Star', or 'Polygon'.","chart-builder") ); ?>">
9209 <i class="ays_fa ays_fa_info_circle"></i>
9210 </a>
9211 </label>
9212 </div>
9213 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9214 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-point-shape" name="<?php echo esc_attr($html_name_prefix); ?>settings[point_shape]">
9215 <?php
9216 foreach ( $point_shape_options as $option_slug => $option ):
9217 $selected = ( $point_shape == $option_slug ) ? 'selected' : '';
9218 ?>
9219 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
9220 <?php
9221 endforeach;
9222 ?>
9223 </select>
9224 </div>
9225 </div> <!-- Point shape -->
9226 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9227 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9228 <label for="ays-chart-option-point-size" class="form-label">
9229 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
9230 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Diameter of displayed points in pixels. Use zero to hide all points.","chart-builder") ); ?>">
9231 <i class="ays_fa ays_fa_info_circle"></i>
9232 </a>
9233 </label>
9234 </div>
9235 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9236 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-point-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[point_size]" value="<?php echo esc_attr($point_size) ?>">
9237 </div>
9238 </div> <!-- Point size -->
9239 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9240 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9241 <label for="ays-chart-option-orientation">
9242 <?php echo esc_html(__( "Rotate Vertical", "chart-builder" )); ?>
9243 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the option, if you want to change the direction of the chart from horizontal to vertical.","chart-builder") ); ?>">
9244 <i class="ays_fa ays_fa_info_circle"></i>
9245 </a>
9246 </label>
9247 </div>
9248 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9249 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
9250 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-orientation" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[orientation]" value="on" <?php echo esc_attr($orientation); ?> >
9251 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
9252 </label>
9253 </div>
9254 </div> <!-- Orientation -->
9255 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9256 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9257 <label for="ays-chart-option-fill-nulls">
9258 <?php echo esc_html(__( "Autofill nulls", "chart-builder" )); ?>
9259 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Whether to guess and autofill the value of missing points when something goes wrong with the chart data. If checked, the chart will automatically fill the value of any missing data based on neighboring points. Else, it will leave a break in the line at the unknown point.","chart-builder") ); ?>">
9260 <i class="ays_fa ays_fa_info_circle"></i>
9261 </a>
9262 </label>
9263 </div>
9264 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9265 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
9266 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-fill-nulls" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[fill_nulls]" value="on" <?php echo esc_attr($fill_nulls); ?> >
9267 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
9268 </label>
9269 </div>
9270 </div> <!-- Autofill nulls -->
9271 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9272 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9273 <label for="ays-chart-option-crosshair-trigger">
9274 <?php echo esc_html(__( "Crosshair trigger", "chart-builder" )); ?>
9275 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose when to display crosshairs. Crosshairs are thin vertical and horizontal lines centered on a data point in a chart.","chart-builder") ); ?>">
9276 <i class="ays_fa ays_fa_info_circle"></i>
9277 </a>
9278 </label>
9279 </div>
9280 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9281 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-crosshair-trigger" name="<?php echo esc_attr($html_name_prefix); ?>settings[crosshair_trigger]">
9282 <?php
9283 foreach ( $crosshair_trigger_options as $option_slug => $option ):
9284 $selected = ( $crosshair_trigger == $option_slug ) ? 'selected' : '';
9285 ?>
9286 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
9287 <?php
9288 endforeach;
9289 ?>
9290 </select>
9291 </div>
9292 </div> <!-- Crosshair trigger -->
9293 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9294 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9295 <label for="ays-chart-option-crosshair-orientation">
9296 <?php echo esc_html(__( "Crosshair orientation", "chart-builder" )); ?>
9297 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The crosshair orientation, which can be 'vertical' for vertical hairs only, 'horizontal' for horizontal hairs only, or 'both' for traditional crosshairs.","chart-builder") ); ?>">
9298 <i class="ays_fa ays_fa_info_circle"></i>
9299 </a>
9300 </label>
9301 </div>
9302 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9303 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-crosshair-orientation" name="<?php echo esc_attr($html_name_prefix); ?>settings[crosshair_orientation]">
9304 <?php
9305 foreach ( $crosshair_orientation_options as $option_slug => $option ):
9306 $selected = ( $crosshair_orientation == $option_slug ) ? 'selected' : '';
9307 ?>
9308 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
9309 <?php
9310 endforeach;
9311 ?>
9312 </select>
9313 </div>
9314 </div> <!-- Crosshair orientation -->
9315 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9316 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9317 <label for="ays-chart-option-crosshair-opacity" class="form-label">
9318 <?php echo esc_html(__( "Crosshair opacity", "chart-builder" )); ?>
9319 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The crosshair opacity, with 0.0 being fully transparent and 1.0 fully opaque.","chart-builder") ); ?>">
9320 <i class="ays_fa ays_fa_info_circle"></i>
9321 </a>
9322 </label>
9323 </div>
9324 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9325 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-crosshair-opacity" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[crosshair_opacity]" value="<?php echo esc_attr($crosshair_opacity) ?>" step=".1" min="0" max="1">
9326 </div>
9327 </div> <!-- Crosshair opacity -->
9328 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
9329 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9330 <label for="ays-chart-option-dash-style" class="form-label">
9331 <?php echo esc_html(__( "Dash Pattern", "chart-builder" )); ?>
9332 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enter a sequence of numbers separated by commas to define the dash pattern. The first number specifies the length of the first dash, the second number specifies the length of the gap after it, and so on. For example, '4,4' will create a pattern of 4-length dashes followed by 4-length gaps, and '5,1,3' will create a pattern of a 5-length dash, a 1-length gap, a 3-length dash, a 5-length gap, and so on.","chart-builder") ); ?>">
9333 <i class="ays_fa ays_fa_info_circle"></i>
9334 </a>
9335 </label>
9336 </div>
9337 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9338 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-dash-style" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[dash_style]" value="<?php echo esc_attr($dash_style) ?>">
9339 </div>
9340 </div> <!-- Line dash pattern -->
9341 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-donut_chart-opt display_none">
9342 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9343 <label for="ays-chart-option-donut-hole-size">
9344 <?php echo esc_html(__( "Hole size", 'chart-builder' )); ?>
9345 </label>
9346 </div>
9347 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right <?php echo esc_attr($html_class_prefix) ?>option-input">
9348 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-donut-hole-size" type="number" min="0" max="1" step=".1" name="<?php echo esc_attr($html_name_prefix); ?>settings[donut_hole_size]" value="<?php echo esc_attr($donut_hole_size) ?>">
9349 </div>
9350 </div> <!-- Donut hole size -->
9351 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none ays-pro-features-v2-main-box">
9352 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
9353 <div class="ays-pro-features-v2-video-button"></div>
9354 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
9355 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
9356 <div class="ays-pro-features-v2-upgrade-text">
9357 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
9358 </div>
9359 </a>
9360 </div>
9361 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix )?>option-title">
9362 <label for="ays-chart-option-curve-type">
9363 <?php echo esc_html(__( "Line curve type", "chart-builder" )); ?>
9364 </label>
9365 </div>
9366 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9367 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-line-curve-type" name="<?php echo esc_attr($html_name_prefix); ?>settings[line_curve_type]">
9368 <option><?php echo esc_html(__( "Straight", "chart-builder" )); ?></option>
9369 </select>
9370 </div>
9371 </div> <!-- Line curve type -->
9372 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9373 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9374 <label for="ays-chart-option-allow-collapse">
9375 <?php echo esc_html(__( "Allow collapse", "chart-builder" )); ?>
9376 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, double click on the node will collapse a node. Note: If the node has an Url option set in the source tab, this option will not work.","chart-builder") ); ?>">
9377 <i class="ays_fa ays_fa_info_circle"></i>
9378 </a>
9379 </label>
9380 </div>
9381 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9382 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
9383 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-allow-collapse" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[allow_collapse]" value="on" <?php echo esc_attr($allow_collapse); ?> >
9384 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
9385 </label>
9386 </div>
9387 </div> <!-- Allow collapse -->
9388 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9389 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9390 <label for="ays-chart-option-org-node-description-font-color">
9391 <?php echo esc_html(__( "Description color", "chart-builder" )); ?>
9392 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description text color of the node.","chart-builder") ); ?>">
9393 <i class="ays_fa ays_fa_info_circle"></i>
9394 </a>
9395 </label>
9396 </div>
9397 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9398 <input id="ays-chart-option-org-node-description-font-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_description_font_color]" value="<?php echo esc_attr($org_node_description_font_color) ?>">
9399 </div>
9400 </div> <!-- Org Node Description color -->
9401 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9402 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9403 <label for="ays-chart-option-org-node-description-font-size" class="form-label">
9404 <?php echo esc_html(__( "Description font size", "chart-builder" )); ?>
9405 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description font size of the node.","chart-builder") ); ?>">
9406 <i class="ays_fa ays_fa_info_circle"></i>
9407 </a>
9408 </label>
9409 </div>
9410 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9411 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-description-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_description_font_size]" value="<?php echo esc_attr($org_node_description_font_size) ?>">
9412 </div>
9413 </div> <!-- Org Node Description font size -->
9414 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9415 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9416 <label for="ays-chart-option-org-classname" class="form-label">
9417 <?php echo esc_html(__( "Custom CSS class", "chart-builder" )); ?>
9418 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("A class name to assign to node elements to specify styles for the chart elements.","chart-builder") ); ?>">
9419 <i class="ays_fa ays_fa_info_circle"></i>
9420 </a>
9421 </label>
9422 </div>
9423 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9424 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-classname" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_classname]" placeholder="chart-builder-org-chart-tree-node" value="<?php echo esc_attr($org_classname) ?>">
9425 </div>
9426 </div> <!-- Org custom class -->
9427 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
9428 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none" style="background:transparent;box-shadow:unset;padding:10px 0">
9429 <br>
9430 <blockquote>
9431 <?php echo sprintf(
9432 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
9433 esc_html(__( '%1$sNote:%2$s Custom CSS class must be set for the options below to take effect.', 'chart-builder' )), '<strong>', '</strong>'); ?>
9434 </blockquote>
9435 <br>
9436 </div>
9437 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9438 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9439 <label for="ays-chart-option-org-node-background-color">
9440 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
9441 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Background color of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
9442 <i class="ays_fa ays_fa_info_circle"></i>
9443 </a>
9444 </label>
9445 </div>
9446 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9447 <input id="ays-chart-option-org-node-background-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_background_color]" value="<?php echo esc_attr($org_node_background_color) ?>">
9448 </div>
9449 </div> <!-- Org Node Background color -->
9450 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9451 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9452 <label for="ays-chart-option-org-node-padding" class="form-label">
9453 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
9454 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Padding of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
9455 <i class="ays_fa ays_fa_info_circle"></i>
9456 </a>
9457 </label>
9458 </div>
9459 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9460 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-padding" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_padding]" value="<?php echo esc_attr($org_node_padding) ?>">
9461 </div>
9462 </div> <!-- Org Node Padding -->
9463 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9464 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9465 <label for="ays-chart-option-org-node-border-radius" class="form-label">
9466 <?php echo esc_html(__( "Border radius", "chart-builder" )); ?>
9467 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Border radius of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
9468 <i class="ays_fa ays_fa_info_circle"></i>
9469 </a>
9470 </label>
9471 </div>
9472 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9473 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-border-radius" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_border_radius]" value="<?php echo esc_attr($org_node_border_radius) ?>">
9474 </div>
9475 </div> <!-- Org Node Border radius -->
9476 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9477 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9478 <label for="ays-chart-option-org-node-border-width" class="form-label">
9479 <?php echo esc_html(__( "Border width", "chart-builder" )); ?>
9480 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Border width of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
9481 <i class="ays_fa ays_fa_info_circle"></i>
9482 </a>
9483 </label>
9484 </div>
9485 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9486 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_border_width]" value="<?php echo esc_attr($org_node_border_width) ?>">
9487 </div>
9488 </div> <!-- Org Node Border width -->
9489 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9490 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9491 <label for="ays-chart-option-org-node-border-color">
9492 <?php echo esc_html(__( "Border color", "chart-builder" )); ?>
9493 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Border color of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
9494 <i class="ays_fa ays_fa_info_circle"></i>
9495 </a>
9496 </label>
9497 </div>
9498 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9499 <input id="ays-chart-option-org-node-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_border_color]" value="<?php echo esc_attr($org_node_border_color) ?>">
9500 </div>
9501 </div> <!-- Org Node Background color -->
9502 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9503 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9504 <label for="ays-chart-option-org-node-text-color">
9505 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
9506 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Text color of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
9507 <i class="ays_fa ays_fa_info_circle"></i>
9508 </a>
9509 </label>
9510 </div>
9511 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9512 <input id="ays-chart-option-org-node-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_text_color]" value="<?php echo esc_attr($org_node_text_color) ?>">
9513 </div>
9514 </div> <!-- Org Node Text color -->
9515 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9516 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9517 <label for="ays-chart-option-org-node-text-font-size" class="form-label">
9518 <?php echo esc_html(__( "Text font size", "chart-builder" )); ?>
9519 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Font size of the text of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
9520 <i class="ays_fa ays_fa_info_circle"></i>
9521 </a>
9522 </label>
9523 </div>
9524 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9525 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-text-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_text_font_size]" value="<?php echo esc_attr($org_node_text_font_size) ?>">
9526 </div>
9527 </div> <!-- Org Node Text font size -->
9528 </div> <!-- Org custom class options -->
9529 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9530 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9531 <label for="ays-chart-option-org-selected-classname" class="form-label">
9532 <?php echo esc_html(__( "Selected node custom CSS class", "chart-builder" )); ?>
9533 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("A class name to assign to node elements to specify styles for the selected chart elements.","chart-builder") ); ?>">
9534 <i class="ays_fa ays_fa_info_circle"></i>
9535 </a>
9536 </label>
9537 </div>
9538 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9539 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-selected-classname" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_selected_classname]" placeholder="chart-builder-org-chart-tree-node-selected" value="<?php echo esc_attr($org_selected_classname) ?>">
9540 </div>
9541 </div> <!-- Org custom selected class -->
9542 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
9543 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none" style="background:transparent;box-shadow:unset;padding:10px 0">
9544 <br>
9545 <blockquote>
9546 <?php echo sprintf(
9547 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
9548 esc_html(__( '%1$sNote:%2$s Selected node custom CSS class must be set for the options below to take effect. Add the Custom CSS Class so that the Selected node custom CSS class can operate correctly for you.', 'chart-builder' )),
9549 '<strong>',
9550 '</strong>'
9551 ); ?>
9552 </blockquote>
9553 <br>
9554 </div>
9555 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9556 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9557 <label for="ays-chart-option-org-selected-node-background-color">
9558 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
9559 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Background color of the selected node. Note: You need to set a Selected node custom CSS class for this option to work.","chart-builder") ); ?>">
9560 <i class="ays_fa ays_fa_info_circle"></i>
9561 </a>
9562 </label>
9563 </div>
9564 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9565 <input id="ays-chart-option-org-selected-node-background-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_selected_node_background_color]" value="<?php echo esc_attr($org_selected_node_background_color) ?>">
9566 </div>
9567 </div> <!-- Org selected Node Background color -->
9568 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
9569 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9570 <label for="ays-chart-option-org-selected-node-text-color">
9571 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
9572 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Text color of the selected node. Note: You need to set a Selected node custom CSS class for this option to work.","chart-builder") ); ?>">
9573 <i class="ays_fa ays_fa_info_circle"></i>
9574 </a>
9575 </label>
9576 </div>
9577 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9578 <input id="ays-chart-option-org-selected-node-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_selected_node_text_color]" value="<?php echo esc_attr($org_selected_node_text_color) ?>">
9579 </div>
9580 </div> <!-- Org selected Node text color -->
9581 </div> <!-- Org custom selected class options -->
9582 </div>
9583 </div>
9584 <?php
9585 $content = ob_get_clean();
9586
9587 $sources['advanced_settings'] = array(
9588 'content' => $content,
9589 'title' => $tab_title
9590 );
9591
9592 return $sources;
9593 }
9594
9595 public function settings_contents_advanced_settings_chartjs( $sources, $args ){
9596 $html_class_prefix = $args['html_class_prefix'];
9597 $html_name_prefix = $args['html_name_prefix'];
9598 $settings = $args['settings'];
9599 $tab_title = $args['tab_name'];
9600
9601 $outer_radius = $settings['outer_radius'];
9602 $slice_spacing = $settings['slice_spacing'];
9603 $circumference = $settings['circumference'];
9604 $start_angle = $settings['start_angle'];
9605 $rotation_degree = $settings['rotation_degree'];
9606 $slice_border_color = $settings['slice_border_color'];
9607 $slice_border_width = $settings['slice_border_width'];
9608 $tooltip_text_options = $settings['tooltip_text_options'];
9609 $tooltip_text = $settings['tooltip_text'];
9610 // $index_axis = $settings['index_axis'];
9611
9612 ob_start();
9613 ?>
9614 <div class="ays-accordion-data-main-wrap">
9615 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
9616 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt display_none">
9617 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9618 <label for="ays-chart-option-outer-radius" class="form-label">
9619 <?php echo esc_html(__( "Outer Radius", "chart-builder" )); ?>
9620 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The outer radius of the chart.","chart-builder") ); ?>">
9621 <i class="ays_fa ays_fa_info_circle"></i>
9622 </a>
9623 </label>
9624 </div>
9625 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9626 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-outer-radius" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[outer_radius]" value="<?php echo esc_attr($outer_radius) ?>">
9627 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
9628 </div>
9629 </div> <!-- Outer Radius -->
9630 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt display_none">
9631 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9632 <label for="ays-chart-option-slice-spacing" class="form-label">
9633 <?php echo esc_html(__( "Slices Spacing", "chart-builder" )); ?>
9634 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Fixed arc offset (in pixels).","chart-builder") ); ?>">
9635 <i class="ays_fa ays_fa_info_circle"></i>
9636 </a>
9637 </label>
9638 </div>
9639 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9640 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-slice-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_spacing]" value="<?php echo esc_attr($slice_spacing) ?>">
9641 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
9642 </div>
9643 </div> <!-- Slice Spacing -->
9644 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt display_none">
9645 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9646 <label for="ays-chart-option-circumference" class="form-label">
9647 <?php echo esc_html(__( "Arc Coverage", "chart-builder" )); ?>
9648 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Adjust the sweep angle to define the arc's coverage area along the circumference.","chart-builder") ); ?>">
9649 <i class="ays_fa ays_fa_info_circle"></i>
9650 </a>
9651 </label>
9652 </div>
9653 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9654 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-circumference" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[circumference]" value="<?php echo esc_attr($circumference) ?>">
9655 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
9656 </div>
9657 </div> <!-- Arc Coverage -->
9658 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt display_none">
9659 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9660 <label for="ays-chart-option-start-angle" class="form-label">
9661 <?php echo esc_html(__( "Start Angle", "chart-builder" )); ?>
9662 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Starting angle to draw arcs from.","chart-builder") ); ?>">
9663 <i class="ays_fa ays_fa_info_circle"></i>
9664 </a>
9665 </label>
9666 </div>
9667 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9668 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-start-angle" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[start_angle]" value="<?php echo esc_attr($start_angle) ?>">
9669 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
9670 </div>
9671 </div> <!-- Start Angle -->
9672 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt display_none">
9673 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9674 <label for="ays-chart-option-rotation-degree" class="form-label">
9675 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
9676 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The angle, in degrees, to rotate the chart by. The default of 0 will orient the leftmost edge of the first slice directly up.","chart-builder") ); ?>">
9677 <i class="ays_fa ays_fa_info_circle"></i>
9678 </a>
9679 </label>
9680 </div>
9681 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9682 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-rotation-degree" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[rotation_degree]" value="<?php echo esc_attr($rotation_degree) ?>">
9683 </div>
9684 </div> <!-- Rotation degree -->
9685 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt ">
9686 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9687 <label for="ays-chart-option-slice-border-width">
9688 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
9689 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the slice borders.","chart-builder") ); ?>">
9690 <i class="ays_fa ays_fa_info_circle"></i>
9691 </a>
9692 </label>
9693 </div>
9694 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9695 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-slice-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_border_width]" value="<?php echo esc_attr($slice_border_width) ?>">
9696 </div>
9697 </div> <!-- Border Width -->
9698 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt ">
9699 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9700 <label for="ays-chart-option-slice-border-color">
9701 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
9702 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
9703 <i class="ays_fa ays_fa_info_circle"></i>
9704 </a>
9705 </label>
9706 </div>
9707 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9708 <input id="ays-chart-option-slice-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_border_color]" value="<?php echo esc_attr($slice_border_color) ?>">
9709 </div>
9710 </div> <!-- Slice border color -->
9711 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt">
9712 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9713 <label for="ays-chart-option-tooltip-text">
9714 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
9715 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose how to display the text in the chart tooltip.","chart-builder") ); ?>">
9716 <i class="ays_fa ays_fa_info_circle"></i>
9717 </a>
9718 </label>
9719 </div>
9720 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
9721 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-tooltip-text" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_text]">
9722 <?php
9723 foreach ( $tooltip_text_options as $option_slug => $option ):
9724 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
9725 ?>
9726 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
9727 <?php
9728 endforeach;
9729 ?>
9730 </select>
9731 </div>
9732 </div> <!-- Slice tooltip Text -->
9733 <!-- <div class="form-group row mb-2 <?php // echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
9734 <div class="col-sm-5 d-flex align-items-center <?php // echo esc_attr($html_class_prefix) ?>option-title">
9735 <label for="ays-chart-option-index-axis">
9736 <?php // echo esc_html(__( "Horizontal ", "chart-builder" )); ?>
9737 <a class="ays_help" data-bs-toggle="tooltip" title="<?php // echo esc_attr( __("If this option is enabled, the pie slices will be drawn counterclockwise.","chart-builder") ); ?>">
9738 <i class="ays_fa ays_fa_info_circle"></i>
9739 </a>
9740 </label>
9741 </div>
9742 <div class="col-sm-7 py-1 <?php // echo esc_attr($html_class_prefix) ?>input-align-right">
9743 <label class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
9744 <input class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-index-axis" type="checkbox" name="<?php // echo esc_attr($html_name_prefix); ?>settings[index_axis]" value="on" <?php // echo esc_attr($index_axis); ?> >
9745 <span class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php // echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
9746 </label>
9747 </div>
9748 </div> Reverse Categories -->
9749 </div>
9750 </div>
9751 <?php
9752 $content = ob_get_clean();
9753
9754 $sources['advanced_settings'] = array(
9755 'content' => $content,
9756 'title' => $tab_title
9757 );
9758
9759 return $sources;
9760 }
9761
9762 public function settings_contents_slices_settings( $sources, $args ){
9763 $html_class_prefix = $args['html_class_prefix'];
9764 $html_name_prefix = $args['html_name_prefix'];
9765 $settings = $args['settings'];
9766 $source = $args['source'];
9767 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
9768 $source_chart_type = $args['source_chart_type'];
9769 $settings = $args['settings'];
9770 $title_row = array_shift($source);
9771
9772 if (isset($source) && !empty($source)) {
9773 if ( !isset( $source[0] ) ) {
9774 if (count($source[1]) > 2) {
9775 $titles = array();
9776 for ($i = 0; $i < count($source[1]); $i++) {
9777 array_push($titles, __("Title", 'chart-builder').$i);
9778 }
9779 $source[0] = $titles;
9780 } else {
9781 $source[0] = array(
9782 __("Country", 'chart-builder'),
9783 __("Population", 'chart-builder'),
9784 );
9785 }
9786
9787 ksort($source);
9788 }
9789 }
9790
9791 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
9792 foreach ($source as $key => $row) {
9793 $source[$key] = array_slice($row, 0, 2);
9794 }
9795 }
9796
9797 ob_start();
9798 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
9799 $slice_color = $settings['slice_color'];
9800 $slice_colors_default = $settings['slice_colors_default'];
9801 $slice_offset = $settings['slice_offset'];
9802 $slice_text_color = $settings['slice_text_color'];
9803
9804 ?>
9805 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-slices-settings-tab cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab">
9806 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
9807 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
9808 <?php
9809 foreach ( $source as $key => $val ):
9810 ?>
9811 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
9812 <legend class="ays-slices-accordion-options-header">
9813 <svg class="ays-slices-accordion-arrow ays-slices-accordion-arrow-right" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
9814 <g>
9815 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: #c4c4c4;" vector-effect="non-scaling-stroke" />
9816 </g>
9817 </svg>
9818 <span><?php echo esc_html($val[0]); ?></span>
9819 </legend>
9820 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
9821 <div class="ays-slices-accordion-data-main-wrap">
9822 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
9823 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
9824 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9825 <label for="ays-chart-option-slice-color">
9826 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
9827 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for this slice.","chart-builder") ); ?>">
9828 <i class="ays_fa ays_fa_info_circle"></i>
9829 </a>
9830 </label>
9831 </div>
9832 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9833 <input type="color"
9834 id="ays-chart-option-slice-color-<?php echo esc_attr($key); ?>"
9835 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
9836 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo esc_attr($key); ?>]"
9837 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : esc_attr($slice_colors_default[$key]); ?>"
9838 data-slice-id="<?php echo esc_attr($key); ?>">
9839 </div>
9840 </div> <!-- Slice color -->
9841 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
9842 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9843 <label for="ays-chart-option-slice-offset" class="form-label">
9844 <?php echo esc_html(__( "Offset", "chart-builder" )); ?>
9845 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the chart's radius).","chart-builder") ); ?>">
9846 <i class="ays_fa ays_fa_info_circle"></i>
9847 </a>
9848 </label>
9849 </div>
9850 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9851 <input type="number"
9852 id="ays-chart-option-slice-offset-<?php echo esc_attr($key); ?>"
9853 class="ays-chart-option-slice-offset ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
9854 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_offset][<?php echo esc_attr($key); ?>]"
9855 value="<?php echo isset($slice_offset[$key]) ? esc_attr($slice_offset[$key]) : 0 ; ?>"
9856 data-slice-id="<?php echo esc_attr($key); ?>"
9857 step=".01" min="0.0" max="1.0">
9858 </div>
9859 </div> <!-- Slice offset -->
9860 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
9861 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9862 <label for="ays-chart-option-slice-text-color">
9863 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
9864 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for the text of this slice.","chart-builder") ); ?>">
9865 <i class="ays_fa ays_fa_info_circle"></i>
9866 </a>
9867 </label>
9868 </div>
9869 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9870 <input type="color"
9871 id="ays-chart-option-slice-text-color-<?php echo esc_attr($key); ?>"
9872 class="ays-chart-option-slice-text-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
9873 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text_color][<?php echo esc_attr($key); ?>]"
9874 value="<?php echo isset($slice_text_color[$key]) ? esc_attr($slice_text_color[$key]) : '#ffffff'; ?>"
9875 data-slice-id="<?php echo esc_attr($key); ?>">
9876 </div>
9877 </div> <!-- Slice color -->
9878 </div>
9879 </div>
9880 </div>
9881 </fieldset>
9882 <?php
9883 endforeach;
9884 ?>
9885 </div>
9886 </div>
9887 <br>
9888 <blockquote>
9889 <?php echo esc_html(__( "Save the chart to update the data.", "chart-builder" )); ?>
9890 </blockquote>
9891 </div>
9892 <?php
9893
9894 } else {
9895 ?>
9896 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-slices-settings-tab cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab"></div>
9897 <?php
9898 }
9899
9900 $content = ob_get_clean();
9901
9902 $title = esc_html(__( 'Slices settings', 'chart-builder' ));
9903
9904 $sources['slices_settings'] = array(
9905 'content' => $content,
9906 'title' => $title
9907 );
9908
9909 return $sources;
9910 }
9911
9912 public function settings_contents_slices_settings_chartjs( $sources, $args ){
9913 $html_class_prefix = $args['html_class_prefix'];
9914 $html_name_prefix = $args['html_name_prefix'];
9915 $settings = $args['settings'];
9916 $source = $args['source'];
9917 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
9918 $source_chart_type = $args['source_chart_type'];
9919 $settings = $args['settings'];
9920 $title_row = array_shift($source);
9921
9922 if (isset($source) && !empty($source)) {
9923 if ( !isset( $source[0] ) ) {
9924 if (count($source[1]) > 2) {
9925 $titles = array();
9926 for ($i = 0; $i < count($source[1]); $i++) {
9927 array_push($titles, __("Title", 'chart-builder').$i);
9928 }
9929 $source[0] = $titles;
9930 } else {
9931 $source[0] = array(
9932 __("Country", 'chart-builder'),
9933 __("Population", 'chart-builder'),
9934 );
9935 }
9936
9937 ksort($source);
9938 }
9939 }
9940
9941 if ($source_chart_type == 'pie_chart') {
9942 foreach ($source as $key => $row) {
9943 $source[$key] = array_slice($row, 0, 2);
9944 }
9945 }
9946
9947 ob_start();
9948 if ($source_chart_type == 'pie_chart') {
9949 $slice_color = $settings['slice_color'];
9950 $slices_border_color = $settings['slices_border_color'];
9951 $slice_colors_default = $settings['slice_colors_default'];
9952
9953 ?>
9954 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-slices-settings-tab cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab">
9955 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
9956 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
9957 <?php
9958 foreach ( $source as $key => $val ):
9959 ?>
9960 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
9961 <legend class="ays-slices-accordion-options-header">
9962 <svg class="ays-slices-accordion-arrow ays-slices-accordion-arrow-right" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
9963 <g>
9964 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: #c4c4c4;" vector-effect="non-scaling-stroke" />
9965 </g>
9966 </svg>
9967 <span><?php echo esc_html($val[0]); ?></span>
9968 </legend>
9969 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
9970 <div class="ays-slices-accordion-data-main-wrap">
9971 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
9972 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
9973 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9974 <label for="ays-chart-option-slice-color">
9975 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
9976 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for this slice.","chart-builder") ); ?>">
9977 <i class="ays_fa ays_fa_info_circle"></i>
9978 </a>
9979 </label>
9980 </div>
9981 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
9982 <input type="color"
9983 id="ays-chart-option-slice-color-<?php echo esc_attr($key); ?>"
9984 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
9985 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo esc_attr($key); ?>]"
9986 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : esc_attr($slice_colors_default[$key]); ?>"
9987 data-slice-id="<?php echo esc_attr($key); ?>">
9988 </div>
9989 </div> <!-- Slice color -->
9990 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
9991 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
9992 <label for="ays-chart-option-slice-border-color">
9993 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
9994 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for this slice border.","chart-builder") ); ?>">
9995 <i class="ays_fa ays_fa_info_circle"></i>
9996 </a>
9997 </label>
9998 </div>
9999 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10000 <input type="color"
10001 id="ays-chart-option-slice-border-color-<?php echo esc_attr($key); ?>"
10002 class="ays-chart-option-slice-border-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
10003 name="<?php echo esc_attr($html_name_prefix); ?>settings[slices_border_color][<?php echo esc_attr($key); ?>]"
10004 value="<?php echo isset($slices_border_color[$key]) ? esc_attr($slices_border_color[$key]) : esc_attr($settings['slice_border_color']); ?>"
10005 data-slice-id="<?php echo esc_attr($key); ?>">
10006 </div>
10007 </div> <!-- Slice border color -->
10008 </div>
10009 </div>
10010 </div>
10011 </fieldset>
10012 <?php
10013 endforeach;
10014 ?>
10015 </div>
10016 </div>
10017 <br>
10018 <blockquote>
10019 <?php echo esc_html(__( "Save the chart to update the data.", "chart-builder" )); ?>
10020 </blockquote>
10021 </div>
10022 <?php
10023
10024 } else {
10025 ?>
10026 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-slices-settings-tab cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab"></div>
10027 <?php
10028 }
10029
10030 $content = ob_get_clean();
10031
10032 $title = esc_html(__( 'Slices settings', 'chart-builder' ));
10033
10034 $sources['slices_settings'] = array(
10035 'content' => $content,
10036 'title' => $title
10037 );
10038
10039 return $sources;
10040 }
10041
10042 public function settings_contents_series_settings( $sources, $args ){
10043 $html_class_prefix = $args['html_class_prefix'];
10044 $html_name_prefix = $args['html_name_prefix'];
10045 $settings = $args['settings'];
10046 $source = $args['source'];
10047 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
10048 $source_chart_type = $args['source_chart_type'];
10049
10050 $line_width = $settings['line_width'];
10051 $point_size = $settings['point_size'];
10052 $point_shape_options = $settings['point_shape_options'];
10053 $point_shape = $settings['point_shape'];
10054
10055 if (isset($source) && !empty($source)) {
10056 if ( !isset( $source[0] ) ) {
10057 if (count($source[1]) > 2) {
10058 $titles = array();
10059 for ($i = 0; $i < count($source[1]); $i++) {
10060 array_push($titles, __("Title", "chart-builder").$i);
10061 }
10062 $source[0] = $titles;
10063 } else {
10064 $source[0] = array(
10065 __("Country", "chart-builder"),
10066 __("Population", "chart-builder"),
10067 );
10068 }
10069
10070 ksort($source);
10071 }
10072 }
10073
10074 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
10075 foreach ($source as $key => $row) {
10076 $source[$key] = array_slice($row, 0, 2);
10077 }
10078 }
10079
10080 ob_start();
10081 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'line_chart' || $source_chart_type == 'bar_chart' || $source_chart_type == 'column_chart') {
10082 $series_row = array_shift($source);
10083 $title = array_shift($series_row);
10084 $series_color = $settings['series_color'];
10085 $series_colors_default = $settings['series_colors_default'];
10086 $series_format = $settings['series_format'];
10087 $series_visible_in_legend = $settings['series_visible_in_legend'];
10088 $series_line_width = $settings['series_line_width'];
10089 $series_point_size = $settings['series_point_size'];
10090 $series_point_shape = $settings['series_point_shape'];
10091
10092 ?>
10093 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-series-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
10094 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
10095 <div class="<?php echo esc_attr($html_class_prefix) ?>series-settings">
10096 <?php
10097 foreach ( $series_row as $key => $val ):
10098 ?>
10099 <fieldset class="ays-series-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-series-<?php echo esc_attr($key); ?>" data-collapsed="true">
10100 <legend class="ays-series-accordion-options-header">
10101 <svg class="ays-series-accordion-arrow ays-series-accordion-arrow-right" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
10102 <g>
10103 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: #c4c4c4;" vector-effect="non-scaling-stroke" />
10104 </g>
10105 </svg>
10106 <span><?php echo esc_attr($val); ?></span>
10107 </legend>
10108 <div class="ays-series-accordion-options-content ays-series-accordion-options-content">
10109 <div class="ays-series-accordion-data-main-wrap">
10110 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
10111 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
10112 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
10113 <label for="ays-chart-option-series-color">
10114 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
10115 </label>
10116 </div>
10117 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10118 <input type="color"
10119 id="ays-chart-option-series-color-<?php echo esc_attr($key); ?>"
10120 class="ays-chart-option-series-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
10121 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_color][<?php echo esc_attr($key); ?>]"
10122 value="<?php echo isset($series_color[$key]) ? esc_attr($series_color[$key]) : esc_attr($series_colors_default[$key]); ?>"
10123 data-series-id="<?php echo esc_attr($key); ?>">
10124 </div>
10125 </div> <!-- series color -->
10126 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
10127 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
10128 <label for="ays-chart-option-series-visible-in-legend">
10129 <?php echo esc_html(__( "Visible in legend", "chart-builder" )); ?>
10130 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to have the series shown in the legend, otherwise it won`t be shown. If the chart has only one column, disabling this option will not work. If you don't want any of the labels to be shown in the legend, change the 'Legend position' option to 'Hide' to entirely hide the legend .","chart-builder") ); ?>">
10131 <i class="ays_fa ays_fa_info_circle"></i>
10132 </a>
10133 </label>
10134 </div>
10135 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10136 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
10137 <input type="checkbox"
10138 id="ays-chart-option-series-visible-in-legend-<?php echo esc_attr($key); ?>"
10139 class="ays-chart-option-series-visible-in-legend <?php echo esc_attr($html_class_prefix) ?>toggle-switch"
10140 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_visible_in_legend][<?php echo esc_attr($key); ?>]"
10141 value="on"
10142 data-series-id="<?php echo esc_attr($key); ?>"
10143 <?php echo isset($series_visible_in_legend[$key]) && $series_visible_in_legend[$key] == 'on' ? 'checked' : (!isset($series_color[$key]) ? 'checked' : ''); ?> >
10144 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
10145 </label>
10146 </div>
10147 </div> <!-- Series visible in legend -->
10148 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
10149 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
10150 <label for="ays-chart-option-series-color">
10151 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
10152 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The format of series data. The format string is a subset of the ICU pattern set . For instance, '#,###%' will result in output values '1,000%', '750%', and '50%' for values 10, 7.5, and 0.5. Note: This option won't work if the axes 'Remove Extra Zeros' option is enabled.","chart-builder") ); ?>">
10153 <i class="ays_fa ays_fa_info_circle"></i>
10154 </a>
10155 </label>
10156 </div>
10157 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10158 <input type="text"
10159 id="ays-chart-option-series-format-<?php echo $key; ?>"
10160 class="ays-chart-option-series-format ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
10161 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_format][<?php echo $key; ?>]"
10162 value="<?php echo isset($series_format[$key]) && '' !== $series_format[$key] ? esc_attr($series_format[$key]) : ''; ?>"
10163 data-series-id="<?php echo $key; ?>">
10164 </div>
10165 </div> <!-- Format -->
10166 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
10167 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
10168 <label for="ays-chart-option-series-line-width">
10169 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
10170 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Line width in pixels. Set 0 for hiding all the lines and show only the point.","chart-builder") ); ?>">
10171 <i class="ays_fa ays_fa_info_circle"></i>
10172 </a>
10173 </label>
10174 </div>
10175 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10176 <input type="number"
10177 id="ays-chart-option-series-line-width-<?php echo esc_attr($key); ?>"
10178 class="ays-chart-option-series-line-width ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
10179 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_line_width][<?php echo esc_attr($key); ?>]"
10180 value="<?php echo isset($series_line_width[$key]) ? esc_attr($series_line_width[$key]) : esc_attr($line_width); ?>"
10181 data-series-id="<?php echo esc_attr($key); ?>">
10182 </div>
10183 </div> <!-- Line width -->
10184 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
10185 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
10186 <label for="ays-chart-option-series-point-size">
10187 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
10188 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Point size in pixels. Set 0 for hiding all points.","chart-builder") ); ?>">
10189 <i class="ays_fa ays_fa_info_circle"></i>
10190 </a>
10191 </label>
10192 </div>
10193 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10194 <input type="number"
10195 id="ays-chart-option-series-point-size-<?php echo esc_attr($key); ?>"
10196 class="ays-chart-option-series-point-size ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
10197 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_size][<?php echo esc_attr($key); ?>]"
10198 value="<?php echo isset($series_point_size[$key]) ? esc_attr($series_point_size[$key]) : esc_attr($point_size); ?>"
10199 data-series-id="<?php echo esc_attr($key); ?>">
10200 </div>
10201 </div> <!-- Point size -->
10202 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
10203 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
10204 <label for="ays-chart-option-series-point-shape">
10205 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
10206 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The shape of individual data elements: 'Circle', 'Triangle', 'Square', 'Diamond', 'Star', or 'Polygon'.","chart-builder") ); ?>">
10207 <i class="ays_fa ays_fa_info_circle"></i>
10208 </a>
10209 </label>
10210 </div>
10211 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10212 <select
10213 id="ays-chart-option-series-point-shape-<?php echo esc_attr($key); ?>"
10214 class="ays-chart-option-series-point-shape <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select"
10215 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_shape][<?php echo esc_attr($key); ?>]"
10216 data-series-id="<?php echo esc_attr($key); ?>">
10217 >
10218 <?php
10219 $value = isset($series_point_shape[$key]) ? esc_attr($series_point_shape[$key]) : $point_shape;
10220 foreach ( $point_shape_options as $option_slug => $option ):
10221 $selected = ( $value === $option_slug ) ? 'selected' : '';
10222 ?>
10223 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
10224 <?php
10225 endforeach;
10226 ?>
10227 </select>
10228 </div>
10229 </div> <!-- Point shape -->
10230 </div>
10231 </div>
10232 </div>
10233 </fieldset>
10234 <?php
10235 endforeach;
10236 ?>
10237 </div>
10238 </div>
10239 <br>
10240 <blockquote>
10241 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
10242 <br>
10243 <?php echo sprintf(
10244 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
10245 esc_html(__( '%1$sNote:%2$s If you are not able to set the options, disable the row settings feature.', 'chart-builder' )),
10246 '<strong>',
10247 '</strong>'
10248 ); ?>
10249 </blockquote>
10250 </div>
10251 <?php
10252
10253 } else {
10254 ?>
10255 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-series-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab"></div>
10256 <?php
10257 }
10258
10259 $content = ob_get_clean();
10260
10261 $title = __( 'Series settings', "chart-builder" );
10262
10263 $sources['series_settings'] = array(
10264 'content' => $content,
10265 'title' => $title
10266 );
10267
10268 return $sources;
10269 }
10270
10271 public function settings_contents_row_settings( $sources, $args ){
10272 $html_class_prefix = $args['html_class_prefix'];
10273 $html_name_prefix = $args['html_name_prefix'];
10274 $settings = $args['settings'];
10275 $source = $args['source'];
10276 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
10277 $source_chart_type = $args['source_chart_type'];
10278
10279 if (isset($source) && !empty($source)) {
10280 if ( !isset( $source[0] ) ) {
10281 if (count($source[1]) > 2) {
10282 $titles = array();
10283 for ($i = 0; $i < count($source[1]); $i++) {
10284 array_push($titles, __("Title", 'chart-builder').$i);
10285 }
10286 $source[0] = $titles;
10287 } else {
10288 $source[0] = array(
10289 __("Country", 'chart-builder'),
10290 __("Population", 'chart-builder'),
10291 );
10292 }
10293
10294 ksort($source);
10295 }
10296 }
10297
10298 array_shift($source);
10299 $rows = array_column($source, 0);
10300
10301 $enable_row_settings = $settings['enable_row_settings'];
10302 $series_color = $settings['series_color'][0] ?? '#3366cc';
10303 $rows_color = $settings['rows_color'];
10304 $rows_opacity = $settings['rows_opacity'];
10305
10306 ob_start();
10307 ?>
10308 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-row-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
10309 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
10310 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
10311 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
10312 <label for="ays-chart-option-enable-row-settings">
10313 <?php echo esc_html(__( "Enable row settings", "chart-builder" )); ?>
10314 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to be able to choose the row settings. If this option is disabled, you will be able to set the general color form the series settings.","chart-builder") ); ?>">
10315 <i class="ays_fa ays_fa_info_circle"></i>
10316 </a>
10317 </label>
10318 </div>
10319 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10320 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
10321 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch <?php echo esc_attr($html_class_prefix) ?>toggle-hidden-option" id="ays-chart-option-enable-row-settings" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_row_settings]" value="on" <?php echo esc_attr($enable_row_settings); ?> >
10322 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
10323 </label>
10324 </div>
10325 </div> <!-- Enable row settings -->
10326 <div class="<?php echo esc_attr($html_class_prefix) ?>rows-settings <?php echo esc_attr($html_class_prefix) ?>hidden-options-section <?php echo $enable_row_settings === 'checked' ? '' : 'display_none'; ?>">
10327 <br>
10328 <?php
10329 foreach ( $rows as $key => $val ):
10330 ?>
10331 <fieldset class="ays-rows-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-rows-<?php echo esc_attr($key); ?>" data-collapsed="true">
10332 <legend class="ays-rows-accordion-options-header">
10333 <svg class="ays-rows-accordion-arrow ays-rows-accordion-arrow-right" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
10334 <g>
10335 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: #c4c4c4;" vector-effect="non-scaling-stroke" />
10336 </g>
10337 </svg>
10338 <span><?php echo esc_html($val); ?></span>
10339 </legend>
10340 <div class="ays-rows-accordion-options-content ays-rows-accordion-options-content">
10341 <div class="ays-rows-accordion-data-main-wrap">
10342 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
10343 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
10344 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
10345 <label for="ays-chart-option-rows-color">
10346 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
10347 </label>
10348 </div>
10349 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10350 <input type="color"
10351 id="ays-chart-option-rows-color-<?php echo esc_attr($key); ?>"
10352 class="ays-chart-option-rows-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
10353 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_color][<?php echo esc_attr($key); ?>]"
10354 value="<?php echo isset($rows_color[$key]) && '' !== $rows_color[$key] ? esc_attr($rows_color[$key]) : esc_attr($series_color); ?>"
10355 data-rows-id="<?php echo esc_attr($key); ?>">
10356 </div>
10357 </div> <!-- color -->
10358 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
10359 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
10360 <label for="ays-chart-option-rows-color">
10361 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
10362 </label>
10363 </div>
10364 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
10365 <input type="number"
10366 id="ays-chart-option-rows-opacity-<?php echo esc_attr($key); ?>"
10367 class="ays-chart-option-rows-opacity ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
10368 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_opacity][<?php echo esc_attr($key); ?>]"
10369 value="<?php echo isset($rows_opacity[$key]) && '' !== $rows_opacity[$key] ? esc_attr($rows_opacity[$key]) : 1.0; ?>"
10370 data-rows-id="<?php echo esc_attr($key); ?>"
10371 step=".1" min="0" max="1">
10372 </div>
10373 </div> <!-- opacity -->
10374 </div>
10375 </div>
10376 </div>
10377 </fieldset>
10378 <?php
10379 endforeach;
10380 ?>
10381 <br>
10382 <blockquote>
10383 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
10384 <br>
10385 <?php echo sprintf(
10386 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
10387 esc_html(__( '%1$sNote:%2$s The applied styles will work only if the chart has one column.', 'chart-builder' )),
10388 '<strong>',
10389 '</strong>'
10390 ); ?>
10391 </blockquote>
10392 </div>
10393 <div class="<?php echo esc_attr($html_class_prefix) ?>not-hidden-options-section <?php echo $enable_row_settings === 'checked' ? 'display_none' : ''; ?>">
10394 <br>
10395 <blockquote>
10396 <?php echo sprintf(
10397 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
10398 esc_html(__( '%1$sNote:%2$s If this option is disabled, the general options will be set from the series settings.', 'chart-builder' )),
10399 '<strong>',
10400 '</strong>'
10401 ); ?>
10402 </blockquote>
10403 </div>
10404 </div>
10405 </div>
10406 <?php
10407 $content = ob_get_clean();
10408
10409 $title = __( 'Row settings', "chart-builder" );
10410
10411 $sources['row_settings'] = array(
10412 'content' => $content,
10413 'title' => $title
10414 );
10415
10416 return $sources;
10417 }
10418
10419 public function ays_chart_disable_all_notice_from_plugin() {
10420 if (!function_exists('get_current_screen')) {
10421 return;
10422 }
10423
10424 $screen = get_current_screen();
10425
10426 if (empty($screen) || strpos($screen->id, $this->plugin_name) === false) {
10427 return;
10428 }
10429
10430 global $wp_filter;
10431
10432 // Keep plugin-specific notices
10433 $our_plugin_notices = array();
10434
10435 $exclude_functions = [
10436 'chart_builder_general_admin_notice',
10437 ];
10438
10439 if (!empty($wp_filter['admin_notices'])) {
10440 foreach ($wp_filter['admin_notices']->callbacks as $priority => $callbacks) {
10441 foreach ($callbacks as $key => $callback) {
10442 // For class-based methods
10443 if (
10444 is_array($callback['function']) &&
10445 is_object($callback['function'][0]) &&
10446 get_class($callback['function'][0]) === __CLASS__
10447 ) {
10448 $our_plugin_notices[$priority][$key] = $callback;
10449 }
10450 // For standalone functions
10451 elseif (
10452 is_string($callback['function']) &&
10453 in_array($callback['function'], $exclude_functions)
10454 ) {
10455 $our_plugin_notices[$priority][$key] = $callback;
10456 }
10457 }
10458 }
10459 }
10460
10461 // Remove all notices
10462 remove_all_actions('admin_notices');
10463 remove_all_actions('all_admin_notices');
10464
10465 // Re-add only your plugin's notices
10466 foreach ($our_plugin_notices as $priority => $callbacks) {
10467 foreach ($callbacks as $callback) {
10468 add_action('admin_notices', $callback['function'], $priority);
10469 }
10470 }
10471 }
10472
10473 }
10474